Rhino 4, circle mutates into nurbs!

Hello list,

when moving a circle sometimes I see from the property window that the geometric primitive changes from “circle” to “nurbs”. Some other times to “circle nurbs” but most times it is still a circle. If you open the attached file and try to move the entire right object somewhere you will probably reproduce the problem.

Since this behavior crashes my plug-in I’d like to know if it is a bug, or I miss something to understand if I have to write a work around.

Thanks. L

FORI_TESTCIM.3dm (82.6 KB)

Bug or not, you’ll probably be safest writing a workaround, as they’re not going to change or fix Rhino 4…

–Mitch

On the other hand, it would be good to check that it hasn’t migrated it’s way into Rhino 5, or if it has and it’s a feature instead of a bug an explanation of what’s going on might be useful to the OP.

Mitch,

thanks for your reply. After several tests I’ve never been able to reproduce this problem under Rhino 5. I’ll write a workaround.

Bye. L

Have you tried giving it a higher tolerance? Rhino essentially doesn’t support “Circles” as such. They are all just NURBS curves approximating a circle. I don’t know if Rhino somewhere remembers the curve to be created with the circle tool, but I’d guess at some point it just determines that the curve does sufficiently looks like a circle.

You can check activating the control points. Move points a reproducible distance -> “Closed NURBS Curve”. Move it back into position “Circle” again.

That is not actually correct. Rhino does have a circle object which is a mathematical definition of a circle (center and radius), not a NURBS curve (since Rhino 4). Of course, when the circle is modified in a way that can no longer be described by an arc, it then gets converted into a NURBS curve. Once that happens, it will not automatically convert back to a circle even if restored to its original condition, you need to run SimplifyCrv to see if it’s “close enough”, if it is, Rhino replaces the curve with a new circle object.

–Mitch

Edit:

1 Like

Sure there is a Circle Object that provides data as you’d expect for a circle. It just stores a Plane and a radius and has some methods to access this special data. But the question is how this Circle really is stored and handled within Rhino. e.g. RhinoCommon moves and rotates a circle by modifying the base plane. But I cannot see what’s going on inside Rhino on the other side of Interop.

Since I cannot look inside Rhino, I can only test the behavior. Above is how I tested in Rhino only. Once you move the control points, the result is clearly a NURBS curve with special weights. If you move the CPs back to the original curve, Rhino will show a circle again.

I made a few more tests with Grasshopper: created a Circle, exploded the NURBS curve, constructed a new one, baked to Rhino. Grasshopper said its a “circular curve”. The result shows up as “Circle” in Rhino. The curve can be slightly modified in the weight factors and/or CP positions and still will show up as a Circle in Rhino.

Question remains: does Rhino check and convert NURBS curves back and forth everytime you modify a CP or does it check and create a Circle structure if you ask for circle properties. Maybe Grasshopper does some checks when baking. I don’t know… but when I’d have to code Rhino internals, I’d just keep it all NURBS and check for special cases like line, polyline or circle when needed.

I’d venture as far as claiming, you could draw a NURBS curve by hand with grid snaps and modifying the weights to get a Circle. But Rhino Weights Command seems to truncate the input and grasshopper says the weights need do be exact up to the tenth decimal.

Circle curves are stored and handled as their data structure describes.

You can - if you limit yourself to one arc quadrant. You will get what Rhino calls an “elliptical arc” - probably because there is still some floating point fuzz in the weight… As a Rhino NURBS circle is really 4 joined arc spans with fully multiple knots (kinks) in between, you cannot directly create the circle starting with a degree 2 curve and weighting the points.

But all this is really an academic discussion - the main thing here is that depending on the process used, you cannot be 100% sure if your object is going to end up as a pure circle object or a “circle-like” NURBS curve. So if you need one or the other for a downstream process/function, you should always check and try to convert in your code before proceeding.

–Mitch

1 Like

You are right, deforming the control points of a circle in Rhino behaves like 4 separeate arc quadrants. I did in fact observe the distorted Grasshopper result turn out to be an elliptical curve before it deteriorated to a planar NURBS curve.
On the other hand, you can create a circular curve in Grasshopper from a continuous set of points and weights. The result is a single NURBS span as long as it resides in GH and a Circle, once baked to Rhino. There should be a way to modify the weights in RhinoScript with sufficient precision… still all academic since it’s highly unlikely that an arbitrary curve suddenly turns into a circle.

Anyway, your point, as well as mine: There might be a lot of obscure conversion going on. So never be sure, you still have a perfect circle. Only sure thing is that every curve object will convert to a NURBS curve.

1 Like

Thanks Mitch and HaLo, I really appreciated your help. I wrote a workaround based on the SimplifyCrv suggestion and it is working as expected.

Merry Christmas and happy new year. L

Yes, it is. I think that plotting splines \not polylines!\ that have a smooth transition between parts with different exactly constant curvature is an opportunity that Rhinoceros dramatically lacks.

Generally, there are no deformable “perfect” circles possible in Rhino, since every edit point of any deformable circle is slightly non-circular. I think this is definitely a challenge for McNeel CAD - maybe not for Rhinoceros, but surely for its probable successors. \This also applies to partially spherical surfaces.\

I guess I don’t understand this statement, as it is possible, and it is done in Rhino, to accurately represent a circle as a NURBS curve.

Ok, then would you show me a sample file where you would plot a both deformable AND perfect circle in Rhinoceros :smile: ? \If it is possible, please write the file in version 4 format…\
Next, for understanding me better, you would try to plot a constant-curvature circle arc that is smoothly blended without a single “explodable” kink to a zero curvature straight line.

I want to see not a finitely accurate circle approximation, but an exactly circular, completely accurate \mathematical\ circle which can be used for safe plotting other figures from it…

Hi Oleg,

The following file contains 2 NURBS curves which are circular: one with 9 control points, and one with 7 control points.

NURBS Circles.3dm (28.7 KB)

Because the two “circles” are deformable (i.e. they are NURBS curves), if you drag a control point, they will no longer be circular. And, dragging a control point will introduce a kink. This is because it is not possible to define a NURBS circle without fully multiple knots.

Which leads to my question: if you require a perfect circle, why do you want it deformable?

Hi Dale,

thank you very much for your attention to my problem!

My question was right about the fact of defining a NURBS circle without fully multiple knots, just as you said above. I am very sad to know that such drawing is completely impossible in OpenNURBS. Maybe there are some non-NURBS ways of representing a smooth shape to the computer \I perfectly understand that the question is silly?
I would like to see a perfect 360° circle deformable and blendable with straight lines just because I suppose it is a beautiful and most intuitive way of plotting any “artistic” curves, in comparison with the “kinked” polyline way. For example, most of the baroque ornamental lines and surfaces are sometimes partially driven with schemas including different radii parts - and it would be quite nice to plot such smooth bendy figures directly with just several “circular CVs” and getting them this way already having constant curvature N°-spans rather than rebuilding any polylines approximating them for getting a final spline.

Thank you especially for the example of a “triangular” circle, it is very amusing for me to see such a specific plots possible in Rhino :relaxed:!

In a few words, my idea originally was: if there is an ancient human habit to get a smooth figure from a free-form tetrangle, whilst getting it perfectly circular when the tetrangle is a perfect square - then why not make a computer program capable of such plots :grinning:? As you remember, the NURBS curve made with four CV’s is smooth, but not circular at all.
\I’m sorry for repeating the reply twice…\

There is. Just run the Circle command and don’t make a deformable circle. This will create a Circle curve (use the What comamnd to verify), which is a non-NURBS curve.

Running the Circle command and creating a deformable circle with Degree=5 and PointCount=24 is about as good as you are going to get. Create one and then run CurveGraph, you will see what I mean.

With that said, with all this talk about perfect circles, deformable, etc., I still fail to see what problem you are trying to solve. Perhaps you can help me understand what it is you are trying to do with Rhino.?

1 Like

It sounds like he is just infatuated by some purist ideology, rather than just practical stuff. Kind of like legislators.

1 Like

The problem in general is to make the work such as this:

look a bit more round :smile: … I know this is not very important, so let’s finish the conversation here - maybe this is way better than writing detailed descriptions of what I am doing with Rhino.

Well… That seems to me more like a troll attack, so I won’t describe any objection ;)… There are always some (also purist, but in opposite way) people who try to focus only on practice, skipping any other issues such as theory, aesthetics, philosophy, sometimes even too complex math, etc… I guess that there is a whole lot of such ideology among coders and other computer engineers - and sometimes such approach is really more efficient in comparison with other states of mind; in fact, this is a prime cause of any computer inventions and any computer usage - and aren’t these computers nice machines? It is always better not to argue with such a lovely utilitarians, but rather just every time give them a task that they completely understand :smile:.