# 3D Mesh Boolean (union, difference, intersection) > Combine two closed meshes: add them, cut one out of the other or keep the overlap. Upload two closed STL, OBJ, PLY or GLB meshes and get their union, difference (first minus second) or intersection as a new watertight mesh. Move the second mesh with an offset, then download the result as STL, OBJ, PLY or GLB with a volume report. Part of usefulweb.app (https://usefulweb.app/). Part of [Renderloom](https://renderloom.usefulweb.app/) (ownerApp: renderloom). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://renderloommeshboolean.usefulweb.app/ (interactive tool at https://renderloommeshboolean.usefulweb.app/tool) - JSON API: POST https://renderloommeshboolean.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://renderloommeshboolean.usefulweb.app/api/v1/tool) - OpenAPI: https://renderloommeshboolean.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://renderloommeshboolean.usefulweb.app/mcp - tool `renderloom_mesh_boolean` ## Inputs - fileA (file, required): First mesh (STL, OBJ, PLY or GLB) - A closed mesh with up to 60000 triangles. - fileB (file, required): Second mesh (STL, OBJ, PLY or GLB) - A closed mesh with up to 60000 triangles. For a difference, this is the part that is cut away. - operation (select): Operation - offsetX (number): Move the second mesh along X - offsetY (number): Move the second mesh along Y - offsetZ (number): Move the second mesh along Z - unit (select): Model units - Used for the volume in cm³ and for GLB output (GLB stores metres). Both meshes must use the same units. - output (select): Output format ## Method - Both meshes are welded and checked with the shared analyser: each must be watertight (no open or non-manifold edges, consistent winding, no zero-area triangles). Inside-out shells are turned outward; cavities keep pointing inward. - Decisions are made in normalised coordinates in which the second mesh is offset by a tiny amount along its vertex normals (outward for union and difference, inward for intersection) plus a small fixed translation. Every orientation test is certified with Shewchuk’s floating-point error bound; if a sign is uncertain the run repeats with a larger offset (up to 4 attempts). - Each edge of one mesh is tested against nearby faces of the other (bounding volume hierarchy). A crossing creates one vertex shared by both meshes and by the faces on both sides of the edge, so the cut curves match exactly. - Cut faces are split along the intersection curves and ear-clipped. Connected patches are classified as inside or outside the other mesh from the exact signs at the crossings (local face normals or the generalised winding number where a patch has none). Union keeps both outsides, intersection both insides, difference the outside of the first and the flipped inside of the second. - Edges shorter than the offset that end in an intersection vertex are collapsed, closed parts with zero thickness are removed, and the result is checked again: only watertight results are returned. Output coordinates are the original ones; intersection vertices lie on the original edges. ## Limits - Both meshes must be closed, manifold and free of self-intersections; open or non-manifold meshes are refused, self-intersections are not detected. Intersection points may move by up to about 1e-8 of the model size, and faces that touch exactly are resolved by a tiny symbolic offset (touching parts merge in a union and are cut cleanly in a difference).