Grasshopper

algorithmic modeling for Rhino

Hi everyone,

I have a Brep with holes in it. I would like to reference the edges of the holes in Grasshopper. The holes are theoretically circular. I am not sure exactly how the holes are made, as they come downstream to me from various sources. I assume they are created through a boolean operation. 

The problem I have is that not all the holes are actually considered Circles in Rhino or Grasshopper. I need Grasshopper to recognise them as Circles so I can work with them as such (i.e. for culling).

In the screen shot below, I have baked a couple of the curves in question from a brep. Grasshopper recognises some as Circular curves and others as Closed Planar Curves. In both cases, the degree is the same. The control point structure is the same. The only difference I can find is that the Closed Planar Curves have a slight variation in their diameter, depending on where I sample them. I understand that by definition, a circle has ONE diameter. So it follows that there is distortion of some sort happening. 

2 questions...

1-Under what conditions would this happen? File tolerance? Anything else?

2-Is there a simple way to force a curve to become a circle? Ideally the fix should happen in GH rather than Rhino since ultimately I would like to work with the edges of Breps rather than modifying extracted curves... but any solution at this stage will be helpful. 

As always, Thanks! 

cbass

Views: 1224

Attachments:

Replies to This Discussion

It's a tolerance issue. Rhino seems to detect circles under Rhino.Math zero tolerance (1.0e-12) which is really close to zero. Attached is a simple c# script which uses rhinocommons Curve.TryGetCircle Method using a tolerance. Using some small tolerance like .001 seems to work. 

Attachments:

Great, Michael. I will try this out. Thanks! 

That did the trick. Thanks!

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