Grasshopper

algorithmic modeling for Rhino

I've been referring to the sdk and rhino common to understand the way in which one would test a curve for it being open or closed without luck as the references that I've found are a little too abstract for me to implement successfully.

Would someone be kind enough to post a c# example of testing for a closed curve?

Your help will be welcomed.

Views: 655

Replies to This Discussion

 private void RunScript(Curve x, ref object A)
  {
    A = x.IsClosed; // Boolean Return
  }

Michael,

Many thanks. I feel silly for asking but I'm still having trouble with the SDK so some further clarification would be great if you can bear with me. Just say I have an array of curves, duplicated from a Brep after the Brep was successfully brought in through the x input. 

// For example

Brep [] geom = new Brep();

geom = x;

Curves[] ca = geom.DuplicateEdgeCurves(true);

// The naked edge curves are then joined here

Curves[] neca = Curve.JoinCurves(ca);

// I want to test for closed edge curves here.

bool[] b = neca.IsClosed;

// End of example.

Why doesn't this work? I'm clearly missing a lot of something...

Problem solved: I've noticed that the issue rests in the Curve Array vs the normal Curve. 

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