Grasshopper

algorithmic modeling for Rhino

So here is a little hang up that I have been experiencing: 

I getting an "invalid Curve" when doing this: 

def toRHPolyCurve(self):
    rhPolyCurve = rc.Geometry.PolyCurve()
    for j in self.curves:
        if type(j) == MSLine:
            rhPolyCurve.Append(j.toRHLineCurve())
        elif type(j) == MSArc:
            rhPolyCurve.Append(j.toRHArc())
        elif type(j) == MSNurbsCurve:
            rhPolyCurve.Append(j.toRHNurbsCurve())
    return rhPolyCurve

This is a definition that returns a PolyCurve() yet Grasshopper tells me its an invalid curve. Ideas? 

Views: 824

Replies to This Discussion

You can use the Polycurve.IsValidWithLog method to see why Rhino might think the curve is invalid.

Now, I got it to where it returns a Curve object, but its not valid to use inside of Grasshopper. 

You can use the Curve.IsValidWithLog method to see why Rhino might think the curve is invalid. I can't tell just by looking from all the way over here.

Yes, IsValidWithLog is pretty good. I think I know what my issue is now. Thanks! 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service