Can I have a boolean operarion for STLs directly?

Operating system:
Slicer version:
Expected behavior:
Actual behavior:
I have established two cubes by points with the same axis.After changed into segments , this cubes can be boolean operation but there are many losed informations. I don’t know there are any way maybe some codes to bool-operate just stay in stl file?

Boolean operations directly on meshes is one of the most complicated problems in computer graphics and in Slicer we opted to have a solution that is very robust and quite fast. The method includes a step where the mesh is rasterized into a binary labelmap, therefore you have to make sure the binary labelmap representation of the segmentation has sufficiently small spacing so that all relevant details are preserved. You can use the Crop volume module to create a volume with sufficiently small spacing and use the resulting volume as master volume in the segmentation.

1 Like

There are two ways you can do this easily in Slicer:

  • Segment Morphology module in SlicerRT extension (a good choice if you want to script it and not as part of a segmentation workflow)
  • Logical operators effect in Segment Editor (I recommend this if you want to do this while segmenting, or if you want to script without relying on an extension)