Grasshopper

generative modeling for Rhino

# Conic function (similar to graph mapper)

I'm looking for a function that can reproduce the graphical results of the conic graph mapper in GH. At x=-1, i'd have an arc, at x=0 a line, and at x=1 the inverse of the first arc. If necessary, i can use 2 functions for x>0 and x<0. Anyone have an idea?

Views: 175

### Replies to This Discussion

A conic doesn't consists of lines and arcs at all. I fear there is some confusion somewhere, can you elaborate, in case it's on my end?

--

David Rutten

david@mcneel.com

Sorry, it's probably my fault for not explaining well. I'm looking for a mathematical function where i can interpolate from one arc (x=1) through a line (x=0) to a mirror of the first arc (x=-1), similar to the picture. The values -1->1 and the orientation of the arc are arbitrary, I'm just looking to be able to interpolate from one arc to its mirror, so i can use it as a distribution gradient in a component. Thanks!

Attachments:

Ah I see, interpolate that way. Although the conic can indeed represent a line and an arc, most often it is neither. In the attached file, if you set the middle slider to 0, you get a line. If you set it to 0.5 * SquareRoot of 2.0, you get an arc. Other values result in hyperbolas and/or parabolas, I'm not 100% sure which without doing a bunch more research first.

There is no mathematical function of the form y = f(x) that allows the evaluation of a specific x value. I use curve intersections to find the values in the GraphMapper (same for Bezier curve, it also uses curve intersections, all the others do have f(x) functions for quick evaluation).

--

David Rutten

david@mcneel.com

Attachments:

Maybe I'm looking at it the wrong way. My goal is to be able to transition from one gradient distribution to the next, like in the 'circles' image, with a slider. Normally I'd use a graph mapper, but for the current application I cannot.

Attachments:

What if you use 2 Graphmappers and then blend between the two values using a slider and the [Interpolate] component?

--

David Rutten

david@mcneel.com

Problem is I'm translating a def into javascript, so i don't have access to a graph mapper. Thanks again though.

However, now that I think of it, I can probably get away with interpolating between two functions (based on sqrt(1-x^2)) in the same way the interpolate component does. Wont be too performant, but it should work. Thanks!

by 雷锋

by 雷锋

by 雷锋

• View All