It’s probably something I’m doing wrong, but here it goes anyway:
I have some objects which were created by extracting edgecurves and joining then together. They appear to be circles even though they technically aren’t.
With Rhinoscript, the IsCircle method recognizes these objects as circles, and I can determine a diameter using the CircleRadius method. That’s what I need to do.
In Python, is seems that the IsCircle definition is now stricter, and these objects are not recognized as circles (or even arcs). I need to determine the diameter of these objects, so this is not a good twist.
I will attach a Rhino file and 2 scripts (one Rhinoscript and one Python) for testing. Maybe this change is intentional, and there is a simple workaround?
These are not circles in that they are not curves that are represented by our internal ON_ArcCurve geometry class.
But, Rhino is capable of detecting whether or not a curve looks enough like a circle that we can obtain circle parameters (e.g. origin, plane, radius). The tolerance used by RhinoScript, when asking Rhino to determine this, is pretty loose (i.e. the document’s tolerance) which is why the What command says they are polycurves and RhinoScript reports them as circles.
Python determines whether or not a curve passes this test with the Rhino.Geometry.Curve.IsCircle function. The default tolerance for this function is pretty tight. There is an override for this that allows you to provide your own tolerance, if needed.