Grasshopper

algorithmic modeling for Rhino

Hello,

There has been a lot of discussion about trimming surfaces and Breps with curves, but anyone what method to use to trim a curve with a Brep or surface?

I can't find one in the SDK, but searching the SDK is still a mystery for me.

I know there is a GH trim curve with brep component. It's perfect, giving outputs of curves inside and outside the brep, but when I use that my data structure gets flattened. I send in 95 paths of 5 and get out 475 paths of 1. That wont work for me downstream. I had the same problem with intersection of curves and surfaces, and when I scripted the intersection in VB the data structure was preserved (as long as didn't set the inputs as lists).

I hope someone can help.

thanks,

Guy

Views: 4103

Replies to This Discussion

Hi Guy,

I use the Brep Curve intersector to find all the parameters on the curve where it intersect with the brep. Then I sort those parameters to make sure they are ascending, then I 'shatter' the curve at all these locations, giving me shards of curve. Finally, I test the midpoint of each shard to see if it's inside or outside of the cutting brep.

There is no trim function that does this out of the box.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
David,

Thank you. I tried that approach but I created interval and a subcurve, it had problems. Your way is better. Also, thanks for creating grasshopper. The world is a better place.

- Guy

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service