Trim curves within a box

Hi

i’m curious about if there is an C++ function which finds all curves within a box (not necessarily an existing brep or mesh)?
In general something like this tool in grasshopper “Trim with brep” which returns all “inside” curves.

image

Hi @dsw,

The component you references calculates the intersection points between the curves and the Brep. The curves are then split at those intersection locations. Finally, the mid point of each split piece is use as input to Brep.IsPointInside, ‘RhinoIsPointInBrep’ in C++. If true, the segment goes into the “in” bucket.

Does this help?

– Dale

Hi @dale,

thanks for the insights, that’s what i already feared. :wink:

Thanks for your quick reply

@dsw, you need help?

– Dale

1 Like

Thanks @dale for asking, but i found the function RhinoCurveSplit which does the main work, i guess? After that i only have to iterate through all curves to find all inside curves.

Hi @dsw,

The attached is basically what the GH componet is doing.

cmdTestWolfgang.cpp (3.7 KB)

– Dale

1 Like