Circle candidates that don't simplify

In the attached are a bunch of small circles. They are in fact comprised of two joined half-circle arcs.

  1. SimplifyCrv refuses to simplify them.
  2. VB Rhino.IsCircle says “Yes, they are circles”
  3. Python rhinoscriptsyntax rs.IsCircle says “No, they are not!”
  4. The curve deviation between them and a “real” circle object is
    9.13125e-11

So, my friends, can we get some agreement here?? :confounded:

Forgot the attach:
NoSimplify.3dm (260.0 KB)

–Mitch

1 Like

Hi Mitch,

Looking at them in Rhino with the mark one eye ball test they don’t look like circles to me.

This is proven if you explode the joined curves to get the arcs and then convert them into circles you will see the mismatch.

Why VB should be different from RhinoScript is beyond me.

Actually, you’re right - at least partially - I somehow ended up only testing the vertical ones - the ones that are not distorted… Check those out…

–Mitch

NoSimplify2.3dm (235.7 KB)

It is a bit odd I must admit.

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.

RhinoScript’s IsCircle tester return true if:

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…

–Mitch

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.

Seems like an option is necessary.

Dan

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.

–Mitch

Here is what I propose:

1.) Make RhinoScript and RhinoPython work the same by default.

2.) Add options to both so you can provide your own tolerance.

Fair enough?

Hi Dale,

That is just perfect for me and more than fair !!!

While you’re at it, check this recent post by me out as well…

Thanks,

–Mitch

Hi Mitch
You are right often happens to me too. Vthe question should be answered.
Ciao Vittorio

That will work for me too.

Thanks Dale,

Dan

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.

Hi Dale,

Any chance this will make it into SR8?

Thanks,

Dan

Yep.

:smile: Thanks!

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”… :smile:

–Mitch

NotSimpleCircles.3dm (62.4 KB)

Have you tried the the SR8 release candidate?

Got the most recent, I think (5.8.40128.10495, 28-Jan-14)…

Works running Simplify twice in a row…

–Mitch

Ok, my fix was the tune up of RhinoScript’s IsCircle method. Is there something else going on here?