Grasshopper

algorithmic modeling for Rhino

I have a curve as a boundary, many circles will be generated inside it.

 I am looking for a method to detect if any circle intersect with the curve. Also If one circle outside of boundary, it need to be trimmed.

What two methods I can call?

Views: 2311

Replies to This Discussion

Hi cmrhm,

I think you're on the right track here. OnCurve merely collects the properties and methods that all types of curves must adhere to.

In your list you're missing OnArcCurve and OnPolyCurve. Brep edges and trims will eventually also derive from OnCurve.

The way to think about OnCurve is to treat it as the common denominator of all curves. Lines and Circles on the other hand have very well defined shapes which makes intersection algorithms (for example) much easier. Oftentimes, exact mathematical solutions can be computed for cases involving lines and arcs, which is not possible for 'freeform' or 'unpredictable' curves.

But it is very important to realize that OnLine, OnArc, OnCircle, OnEllipse and OnPolyline do not derive from OnCurve. You need to convert these objects into OnLineCurve, OnArcCurve etc. if you want to use them in functions that operate on OnCurves.

This 'split' still exists in the new RhinoCommon SDK, but at least we've managed to get rid of all the IOnLineCurve, IOnArc, IOnNurbsCurve types (phew).

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thx David. The explanation really helps! I am happy.

Could u take a minute looking my code? The problem I mentioned might have sth to do with passing value or refrence.

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