Grasshopper

algorithmic modeling for Rhino

Hi, I am trying to reverse a curve, but I only get a "True" output once it is completed. I know I have to create a duplicate but how the duplicated curve will adopt the "True" output of the original curve?

If not, then what's the easiest way to flip a curve?

Views: 2490

Replies to This Discussion

Try this:

import Rhino
dup = Rhino.Geometry.Curve.Duplicate(crv)
if Rhino.Geometry.Curve.Reverse(dup) == True: a = dup

Hi Jmn,

you can also use rs.ReverseCurve(), which works similarly.

See this example.

You can also use rs.CopyObject(obj) first. It's not necessary if that is the only operation in your script, as GhPython copies inputs for you.

Thanks,

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service