Hi guys, I am trying to make a “flow along cuve” tool but I am hitting walls…
The only tool I found was the “Rhino.Geometry.Curve.FlowSpaceMorph()” but I can’t seem to get it right.
Thanks for any help!
(This is a small part of a project curved curve onto geometry and then make a straight line with the length of the projected curve and then flow the projection onto the straight line)
Curve.SetStartPoint and .SetEndPoint are better suited for tweaking the ends of existing valid curves.
Instead, create the linear curve more directly such as
line = Rhino.Geometry.NurbsCurve.Create(
periodic=False,
degree=1,
points=rs.coerce3dpointlist(((0,0,0), (length,0,0))))
Then use FlowSpaceMorph like this
crv_WIP = curve.DuplicateCurve() # Good to do this since curve.IsDocumentControlled == True.
fsm = Rhino.Geometry.Morphs.FlowSpaceMorph(flow, line, False)
fsm.Morph(crv_WIP)
sc.doc.Objects.Replace(crv_id, crv_WIP)
sc.doc.Views.Redraw()
Thanks so much guys!
I had no idea space morph was sat up as a separate “portal” that could be reused, and would probably not have figured it out either. And that is great as now I can set it up once and pass all kinds of stuff through it