Grasshopper

algorithmic modeling for Rhino

Hi,

I am pretty new to Python. I would like to reparameterize a curve in python. I have looked at this solution, but when I implement it, I cannot do a other actions, e.g. move the curve.

import rhinoscriptsyntax as rs
import Rhino as rc


a = rs.AddEllipse(rs.WorldXYPlane(), 35, 75)

a_ = rs.coercecurve(a)
a_.Domain = rc.Geometry.Interval(0,1)

rs.MoveObject(a_, (45,0,0))

The last line does not work and I get the following error: Runtime error (TypeErrorException): iteration over non-sequence of type NurbsCurve

Is there another way to set the domain to (0,1)?

Views: 1313

Replies to This Discussion

Hi Dimitar

You need new_a = sc.doc.Objects.AddCurve(a_) convert nurbscurve type to GUID,Check the attached file. I hope this helps "

Attachments:

Thanks you! This helps. I am curious, is there another way to set the interval of a curve to (0,1).

Hi Dimitar

Check the attached file. I hope this helps "

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service