Grasshopper

algorithmic modeling for Rhino

Most commonly, if one has to create a mathematically precise curve/surface in GH/Rhino, one needs to first create a set of points that are derived from the mathematical parametres, and the do an 'interpolation' of sorts, i.e. use the points to then create an interpolated curve/clamped spanning curve/surface from points.

I am guessing that when Rhino is given a set of points to create a surface/interpcrv, it has its routines to interpolate between them, which perhaps is costlier (processing speed wise) than directly generating them from an equation for say, a circle/parabola/hyperbola, or similar mathematical surfaces/curves.

In cases when one knows the precise equation, is there some method in the Rhino SDK to create curves and surfaces directly from equations providing x/y/z values as arraydouble along with the equations?

In the images below, the blue is the native GH circle function, and the red is the one derived from the equation. It obviously takes my equation close to 120 points to get perfect circle, while GH/Rhino natively do it with 8.


Views: 3897

Replies to This Discussion

See this explanation:
http://en.wikipedia.org/wiki/Non-uniform_rational_B-spline#Example:...

You can reproduce a perfect circle using a nurbs curve but it's not as simple as interpolating between points. How rhino does it is the same way as explained in the wikipedia article:
- The control points form a square where you have 3 points in each side.
- The 4 control points on the corners have a weight of 0.707107.
- The 4 control points in the mid sections have a weight of 1.
- The curve is a second degree curve.

You can Change the weight of a control point in rhino using the _weight command. I don't think you can do this using components in grasshopper.
Interpolating through points is exactly the step I want to bypass for reasons of performance. In essence, when an object can be created through 8 control points, why should I have to create 120?

Which is what brings me to the point of creating them through equations when I know the equations - in strictly mathematical realms, not the whimsical. The link you provided is the nurbs's way of creating a circle by altering CV weights, but my discussion is to do with doing it directly through equations, which are not just limited to circles.
A formula will give you a set of points. Rhino has several object types that allow you to specify a series of points in 3d space and it will generate almost any geometric shape for you. These can be a polyline, a nurbs curve, a mesh, a surface or a polysurface.

There are other object types that are a fixed formula and will always generate the same shape like a circle, sphere, etc. I guess it's pretty complicated to create your own object type.

In the end you have to end up with some set of points. Be it pixels in the screen, pixels to print, etc. If you use one of the former object types, rhino cuts out the work for you. Specially if you want to interact with this geometry.
Thanks Vincente,

I get your point. My query was about being able to access the engine that generates the shapes from mathematical equations, and then correspondingly decides CV locations/weights - for creating mathematical curves/surface.

The idea was somewhat to use Rhino+GH like a Graph generator for mathematical equations, only that the resultant curve/surface would then be used to create further geometry which I can't do in MathCAD, etc.

Having to create points first, and a very large number of them to get an accurate representation for a shape as simple as a circle works until a certain decent number of circles, but after a while if you were to do more complex surface operations with it, but then it starts to strangle the memory pipeline simply because of the amount of unnecessary data being processed.

I exchanged a few emails with David about it, and I have my answers now... putting it briefly, the answer is NO, it can't be done unless you are the creator of the Rhino SDK :)
putting it briefly, the answer is NO, it can't be done unless you are the creator of the Rhino SDK :)

That's what i figured. Can you post David response in this thread? I'm sure his response was much better than mine, i'd like to know what it was (and probably more people too).
My response was something along the lines of:

Rhino has a number of classes and functions that are very useful when trying to solve a specific set of curves called Conics (circles, arcs, ellipses, parabolas, hyperbolas). We have some very stable and fast matrix solvers in the SDK which, when used correctly, can give you weights and locations of control-points for conics.

However, in order to use these solvers, one needs a math PhD. It's way beyond me at any rate.

--
David Rutten
david@mcneel.com
Seattle, WA
We have some very stable and fast matrix solvers

Finally, operators can stop reading the code directly.
...that movie was out a decade ago already. I just realized it after reading the latest xkcd.com comic.
WHY did you have to mention that?! Now I feel old...

--
David Rutten
david@mcneel.com
Seattle, WA
It is not the spoon that bends, its only yourself..

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service