Repository navigation
Description
What happened
Splitting a mesh-converted solid at a plane fails when the mesh has sliver facets a few tenths of a micrometre across, as decimated meshes often do. The converted body passes SMLib's full check (--validation each_step), so it's the split that breaks.
The script below writes a 44-triangle closed mesh (a 0.04 × 1.8 × 0.05 mm piece of a knurled knob's decimated mesh; vertex rows 0.4 to 0.6 µm apart in z):
| result | |
|---|---|
mesh.convert, then solid.split_body at XZ |
SMLib's result is not a closed solid |
| the same mesh scaled 10× or 100× | splits into two closed bodies |
On the whole knob (2,000 triangles, edges down to 1.3 µm), the split is refused for "partially Coincident Edges" and "Bad Loop Orient" at every plane tried (XZ, YZ, XY at z −5, y 0.37). A tilted plane through its middle even reports "the tool does not split the body". Infinity Cubes' converted mesh gives the same "Bad Loop Orient" in a cut.
Expected
Two closed halves, as at 10× scale.
Steps to reproduce
python sliver.py, then solidcraft-cli run sliver.json next to it (main 96280b89a, 0.43.0, Windows):
# sliver.py: writes sliver.stl (44 triangles, a 0.04 x 1.8 x 0.05 mm piece of a decimated mesh)
import struct
V = [
(-8.9375, 0.049745112657547, -9.122843742370605),
(-8.9375, 0.09773678332567215, -9.120742797851562),
(-8.9375, -0.07496185600757599, -9.122835159301758),
(-8.9375, 0.8698979616165161, -9.078125),
(-8.9375, -0.8951396346092224, -9.078125),
(-8.9375, -0.12295322865247726, -9.120742797851562),
(-8.9375, -0.7918225526809692, -9.091606140136719),
(-8.9375, -0.04001481086015701, -9.124358177185059),
(-8.9375, -0.02530142292380333, -9.125),
(-8.9375, 0.00016491214046254754, -9.125),
(-8.9375, 0.014793939888477325, -9.124366760253906),
(-8.9375, 0.7665904760360718, -9.091606140136719),
(-8.98046875, 0.08163239061832428, -9.078516960144043),
(-8.98046875, 0.03221558779478073, -9.080679893493652),
(-8.98046875, -0.04084471985697746, -9.08139419555664),
(-8.98046875, -0.05743195489048958, -9.080671310424805),
(-8.98046875, -0.012612542137503624, -9.082625389099121),
(-8.98046875, 0.015624254010617733, -9.081402778625488),
(-8.98046875, -0.10684844851493835, -9.078516960144043),
(-8.98046875, -0.11584273725748062, -9.078125),
(-8.98046875, 0.09062646329402924, -9.078125),
(-8.950942993164062, -0.7929981350898743, -9.078125),
(-8.950942993164062, 0.7677659392356873, -9.078125),
(-8.938054084777832, -0.012612675316631794, -9.125)]
F = [(0,1,2), (3,4,5), (6,5,4), (3,5,1), (5,2,1), (2,7,0), (8,9,7), (9,10,7), (10,0,7), (1,11,3), (1,0,12), (13,12,0), (14,15,13), (16,14,17), (15,18,12), (18,19,20), (20,12,18), (12,13,15), (13,17,14), (0,10,13), (17,13,10), (21,6,4), (20,3,22), (19,3,20), (3,19,4), (21,4,19), (21,5,6), (19,5,21), (18,5,19), (18,2,5), (15,2,18), (15,7,2), (14,7,15), (16,9,23), (17,9,16), (10,9,17), (9,8,23), (23,8,16), (7,14,8), (14,16,8), (11,1,22), (12,20,1), (20,22,1), (22,3,11)]
with open("sliver.stl", "wb") as f:
f.write(b"\0" * 80 + struct.pack("<I", len(F)))
for t in F:
f.write(struct.pack("<3f", 0, 0, 0) + b"".join(struct.pack("<3f", *V[i]) for i in t) + b"\0\0"){"commands": [
{"command": "file.insert_mesh", "params": {"path": "sliver.stl"}},
{"command": "mesh.convert", "params": {"body": "sliver"}},
{"command": "solid.split_body", "params": {"body": "sliver", "plane": "XZ"}}
]}error: step 3 (solid.split_body): SMLib boolean: operation: SMLib's result is not a closed solid
0.40.0-rc.3 refuses this mesh at mesh.convert (not a constant-section prism), so I couldn't compare.
Related: #18259 (there the converted body already fails the check; here it passes, and the boolean breaks), #18211 (split time on converted meshes).
🤖 Generated with Claude Code
Activity
Mqrius commentedon Nov 17, 2026
A second case from another decimated mesh, in a boolean this time: a tube (r 2.25 to 7.5) joined to a mesh-converted spline shaft whose faceted wall has a vertex exactly on the tube's r 7.5 cylinder. The full shaft gives "no radial edge use classifies the face's edge use"; after an STL round trip, the error below. Cropped to a 0.01 mm piece (22 triangles, mesh vertices 0.7 µm apart near the one on the cylinder), it still fails:
So it relates the piece's edge on the cylinder to an intersection edge about 2e-6 mm from it, split once more at z 20.99986. The piece is closed and measures 1.169e-6 mm³ on its own, and the tube builds as a new body (5949.98 mm³). A plain box with the same corners joins the tube fine; so do converted prisms inscribed in r 7.5 (they convert to a true cylinder).
python piece.py, thensolidcraft-cli run piece.json(main96280b89a):{"commands": [ {"command": "file.insert_mesh", "params": {"path": "piece.stl"}}, {"command": "mesh.convert", "params": {"body": "piece"}}, {"command": "sketch.create", "params": {"plane": "XY", "name": "Tube"}}, {"command": "sketch.circle.center", "params": {"center": [0, 0], "radius": 7.5}}, {"command": "sketch.circle.center", "params": {"center": [0, 0], "radius": 2.25}}, {"command": "sketch.finish", "params": {}}, {"command": "solid.extrude", "params": {"sketch": "Tube", "profiles": [0], "operation": "join", "targets": ["piece"], "distance": "37 mm", "direction": "positive"}} ]}🤖 Generated with Claude Code
dudedagger42 commentedon Nov 17, 2026
Triage by dudedagger42: Reproduced on 0.41.0: your sliver.py mesh converts, then solid.split_body at XZ stops with "SMLib's result is not a closed solid". rc: 1. The same mesh scaled 10x splits into a body on 0.41.0. rc.3 and 0.30.1 refuse earlier, at mesh.convert ("not a supported constant-section prism"), at both scales.
Boundary: the 10x scale splits.
Root cause (unknown): I did not read the split code; the failing step is kernel work (Solidcore).
MarkusReichart commentedon Nov 19, 2026
Triage: the split fails because the XZ plane crosses two sliver triangles near one vertex along cut segments shorter than the kernel's zone tolerance (1e-5 mm). It depends on where the plane passes that vertex, not on the scale as such.
Measured with
solidcraft-cli run(release build of main at 78d06f4), usingsliver.stl:mesh.converttolerance makes no difference: 0.00005 to 0.5 mm all refuse at 1x and all split at 10x.{"origin": [0, c, 0], "normal": [0, 1, 0]}, c = 0, 1e-5 and 1e-4 are refused. c = 2e-4 to 0.3 and -0.001 to -0.5 (11 values) split into two closed bodies.For c of 2e-4 and up, the plane passes above vertex 9 and the shortest cut is 1.4e-4.
Every refused plane leaves a cut of 7.2e-6 or less, and every plane that splits leaves 1.0e-5 or more. That bracket fits
ZONE_TOL_3D = 1e-5(solidcore/crates/solidcore/src/geom/tol.rs:200).Read only, not run: the absolute
COPLANAR = 1e-7incrates/kernel/src/mesh_convert.rs:23fuses triangles 19+20 and 31+32 at 1x only, which explains 24 against 26 kernel faces. The y = 0 plane crosses none of those four triangles. The fix could go in three places:solidcore/docs/booleans.mdshows this is a deliberate choice);mesh.convertgrows the vertex's tolerance;mesh.convertrefuses such slivers with a reason.Not run: the C++ reference, and 476a0e6, which adds #19498 and #19590 in the kernel.
The second case in the thread (the piece joined to the tube) builds on 78d06f4: one closed body, 5949.98 mm³. That is right, because the piece lies at most 3.4e-7 mm outside r 7.5.
Not claiming. We'd take it once the place for the fix is settled.
Written with Claude Code (AI) on behalf of @MarkusReichart.