I’ve been wrestling with this for over a week now and I’m at my wits end. I am creating Breps manually using code, for example using snippets like this:
//right bottom fillet
arcPlane.Origin = plane.PointAt(halfTenonWidth - radius, radius);
c = new Circle(arcPlane, radius);
a = new Arc(c, new Interval(Math.PI * 1.5, 2 * Math.PI));
outCurves.Add(a.ToNurbsCurve());
and then combining NurbsCurve array outCurves like this:
Curve joined = Curve.JoinCurves(outCurves, Config.Tolerance, false)[0];
joined.Domain = new Interval(0, 1);
Then later, I create a Brep like this:
Surface tSurf = Surface.CreateExtrusion(tShape, ext); //tShape being the joined curves
Brep tBrep = tSurf.ToBrep();
tBrep = tBrep.CapPlanarHoles(Config.Tolerance);
if (tBrep.SolidOrientation != BrepSolidOrientation.Outward)
{
tBrep.Flip();
}
When I check the results here by sending the curve, the surface, the brep or the brep with the capped holes into my RhinoDoc, they all appear totally normal. In fact, I can send my final Breps in to the RhinoDoc and using boolean operations, and they always work fine!
But no matter what I try, SOME of my breps will fail any boolean operation in my C# code. Oddly, some of them work perfectly fine.
I have confirmed that the Breps are outward facing, manifold, solid and valid. I have also tried various tolerance settings in the boolean operations, including the active rhinodoc tolerance. I’m convinced this has something to do with how I’m creating the Breps in my code.
When I tried to recreate the problem in a simple code snippet to post online, of course the boolean worked perfectly. Please let me know if anything comes to mind. Even if I could somehow recreate the process Rhino uses when adding a Brep to the document - since somehow that is “cleaning” my breps and I can then use Boolean op’s in Rhino’s UI.
Thanks!