Grasshopper

algorithmic modeling for Rhino

Hi I'm kinda new to c#. This question maybe simple but I'm not be able to get it done.

I want to convert line in grasshopper to Polyline in c# so I can use command CenterPoint later.

Anyone has any idea how to do it?

Thanks in advance!

Views: 2131

Replies to This Discussion

Well, a line would be an open polyline with a single segment, it doesn't have a center point. You want to convert curves to polylines? If so, are the curves curved? If so, what metrics and tolerances do you want to use for the approximating polyline?

--

David Rutten

david@mcneel.com

Thanks for your reply David Rutten! I think I got confused between using Line and Curve in grasshopper so C# take in curve as objects instead of recognizing it as curves. Sorry for the trouble. I will try to figure out on my own as much as possible next time. Again Im kinda new to C# and grasshopper.

Thanks,

Chau

The Curve class has a ToPolyline method on it which you can use to create a polyline approximation of the curve. This method has all sorts of settings so you can control both angular and distance tolerances.

--

David Rutten

david@mcneel.com

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service