Repository navigation
boolean fail #7112
Replies: 5 comments 2 replies
|
Thank you for your prompt reply. Currently, when I sequentially subtract 4_0.stl, 4_1.stl, 6_0.stl, 6_1.stl, 7_0.stl, 7_1.stl, 8_0.stl, and 8_1.stl from body.stl, an error occurs. The error message reads: "Bad contour on 2 mesh B faces, probably mesh A has self-intersections on contours lying on these faces." Could you please offer some suggestions on how to perform the Boolean operation successfully? |
|
The attachment didn't upload. Your comment only shows the In the meantime, here's what that error usually means. On some step, the mesh you are cutting (the result of the previous subtractions) and the next cutter meet in a degenerate way. Usually two cutters share a face or touch along an edge, for example
With the files I can tell you exactly which step fails and why. |
|
Thanks for the files. This time all meshes are fine: each is closed, oriented outward, and has no self-intersections. I reproduced the error: the subtractions of The reason is that the six small cutters The fix is to unite the six small cutters first. Unions of these simple meshes don't produce degenerate triangles. Then subtract the united tool from the body: MR.Mesh Load(string name) => MR.MeshLoad.fromAnySupportedFormat(name + ".stl");
var body = Load("Body");
// the six small cutters meet at one point on the top of the body, so unite them first
var tools = Load("6_0");
foreach (var name in new[] { "6_1", "7_0", "7_1", "8_0", "8_1" })
{
var u = MR.boolean(tools, Load(name), MR.BooleanOperation.Union);
if (!u.valid()) throw new Exception(name + ": " + u.errorString);
tools = u.mesh;
}
foreach (var cutter in new[] { Load("4_0"), Load("4_1"), tools })
{
var res = MR.boolean(body, cutter, MR.BooleanOperation.DifferenceAB);
if (!res.valid()) throw new Exception(res.errorString);
body = res.mesh;
}With MeshLib 3.1.4.297 (the latest NuGet), the result is a closed mesh with 34028 triangles, volume 2.38746, and no self-intersections. Version 3.1.3.429 also succeeds, but its result has 3 small self-intersecting triangles near the body wall, so please update. |



Uh oh!
There was an error while loading. Please reload this page.
21.zip
I failed to perform Boolean operations using MeshLib.SDK (C#) (see attachment: body.stl cut 21.stl)
All reactions