I have a set of closed co-planar curves. One is the “outside” and the reset are “holes” & I know which.
I need to make a Brep in order to render them.
I have been using Brep.CreatePlanarBreps(crvs, 0.001);
However this is too slow for use in our DisplayConduit (where i have hundreds of such sets of curves).
Since I know which is the outer and which are the inner i thought it might be faster if I could construct the Brep more manually using Brep.CreateTrimmedPlane & then adding the holes manually using Brep.AddTrimCurve method (rhino3d.com)
however no hole is created
What is the correct way to use this method?
Is there a faster approach?
var outer = (new Circle(Plane.WorldXY, Point3d.Origin, 50)).ToNurbsCurve();
var inner = (new Circle(Plane.WorldXY, Point3d.Origin, 25)).ToNurbsCurve();
var brep = Brep.CreateTrimmedPlane(Plane.WorldXY, outer);
brep.AddTrimCurve(inner);
Thanks @Tom_P yeah I’d seen those samples - was hoping to find a mechamism without having to dig into the minutia - that sample takes 600 lines to build a brep
The last post in that thread was handy, this approach does indeed make the hole
var outer = (new Circle(Plane.WorldXY, Point3d.Origin, 50)).ToNurbsCurve();
var inner = (new Circle(Plane.WorldXY, Point3d.Origin, 25)).ToNurbsCurve();
var brep = Brep.CreateTrimmedPlane(Plane.WorldXY, outer);
brep.Loops.AddPlanarFaceLoop(0, BrepLoopType.Inner, new[] { inner });
That approach takes my Display Conduit from 14000ms to 373ms to build the Breps so quite an improvement. This is on 1000 curves.
@Tom_P Good idea i’ll have to see if hatches are faster
For now I parallelized the Brep creation and dropped my test case from 400ms to 75ms, probably good enough for now - two orders of magnitude improvement is enough for one days work!