If you try and convert the curve to a circle directly in GH you fail. But if you deconstruct the Nurbs Curve to get the Control Points, Weights and Knots and then rebuild it you get a clean conversion.
1.) The curve is a closed arc curve.
2.) The NURBS curve “looks” like a circle based on the document tolerance.
Other circle detection tools use a much higher tolerance when determining if a NURBS curve looks like a circle. I can tighten RhinoScript’s tolerance. But the last time I did, I got beat up pretty bad on the old newgroup (my Mitch if I recall correctly).
No, it would have been the opposite, I think. I am in general for a stricter definition of stuff for Rhinoscript methods. Actually I would like to have Rhino.IsCircle only return True if it really is a “Circle” object, not just potentially simplify into one. The reason for this is that some downstream machining programs only “like” real circle objects for determining things like drill points and arc radius centers… “Close enough” isn’t an option… And if we are trying to find near-circle objects, then run SimplifyCrv with the desired tolerance on them and then IsCircle… Or, I guess there could be switches in IsCircle, but that’s perhaps complicating things too much.
The one thing that is important to me is consistency here. Having one scripting method return a looser definition of a “circle” than another is not a great thing, IMO, as it makes predicting behavior difficult and knowledge of how one system works may induce mistakes when using the other. And if Rhino’s native commands have yet a third way of looking things, well, then everyone’s confused…
I have a scenario where I extract the edges of holes imported from Solidworks, and this results in 2 arcs. I then join them and the Python IsCircle method doesn’t recognize them as circles. In Rhinoscript they did, and that worked for me. For my needs, I have to be able to see “circles” created this way as circles.
As I said, although I would like a stricter definition, what I mostly want is consistency. And that means if Rhino.IsCircle says it’s a circle, that rs.IsCircle also does AND that the Rhino’s SimplifyCrv command will in fact turn the object into a circle… At least that way we can predict what it will do.
To further explain the dilemma post above with GH this was David’s response:
The problem seems to be that the original curve is a PolyCurve. They don’t know how to convert themselves to arcs evidently. This is -in my opinion- a bug in the Rhino SDK. I’ve fixed it in Grasshopper for the time being.
Attached is another set of circles that should simplify but don’t - at least on the first application of SimplifyCrv - a second application does the trick though - just in case this helps for testing “the fix”…