# Brep Faster Holes? using AddTrimCurve?

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

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);
``````

did you see those infos / samples ?

1 Like

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.

Just for interest this is what I’m testing on - nested gaskets ready for laser cutting.

The DisplayConduit takes 600ms to load - 200ms for our containment test routine & 400ms to create the Breps & bounding box.

Would love to make it faster

just guessing:

track the transformations of same parts.
create a single brep.
create a quite rough mesh
copy and transform the mesh

maybe a hatch is faster then a brep ?

You might trying add each planar curve as a planar face loop.

test_planar_loops.py (2.0 KB)

– Dale

Thanks @dale

Yeah that worked nicely - 14000ms to 400ms,

@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!