Hi there,
In my plugin, I have a processes that makes two main steps:
- I generate many curves that lay on the (untrimmed) surface of some Brep (e.g. a very fine hatching pattern)
- I trim these curves according to the full Brep (i.e. including all of its trim curves) using
Intersection.CurveBrep(...)
(https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.intersect.intersection/curvebrep#(curve,brep,double,out,out,out))
I notice that #2 is a very expensive operation when the full Brep contains many trim curves (i.e. holes), and I found out a way to reduce this. Namely I perform step #2 in “tiles” on the surface, meaning I operate in local sections on the surface. When I do this I have the opportunity to remove irrelevant trim curves (trim curves that don’t affect the local tile I’m looking at) before doing the many Curve-Brep intersection tests.This greatly increases the speed of the whole trimming process.
However, I’m not sure my method of removing the irrelevant trim curves is very good. What I do is create a bounding box that surrounds my local “tile”, turn it into a Brep, and then do a Brep-Brep intersection test between my tile Brep and my main Brep, taking the interior of it as what I trim my many curves against. The reason I went with this was simply because I wasn’t sure how to interact with the many methods inside BrepTrimList
(https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.collections.breptrimlist).
So I’m curious if there’s a better way to remove these irrelevant/non-local trim curves from the Brep before doing my many Curve-Brep intersection tests.
Any suggestions or guidance would be much appreciated.
Kind regards,
Dustin