Grasshopper

algorithmic modeling for Rhino

We all are told we can't create an OnCurve object, but why we can pass OnCurve object as an argument?

Further to this question, it seems the hint for a component is limited, what if I want to pass an OnPlane or OnSphere?

Views: 135

Replies to This Discussion

Just because you can't create an OnCurve doesn't mean it can't exist. What a method is basically saying when it wants an OnCurve is that it can accept any class that derives from OnCurve, and therefore supports common methods for accessing it.

You can pass an OnPlane. OnSphere's are pretty worthless to actually use, since you'd have to convert them to a OnSurface or OnBrep to really do anything with them. If you're really interested in having a sphere in your scripting component, you can pass in the center point and radius, since that's all the real information you'd be able to get out of an OnSphere anyway.

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