From ea9fad5bbeb25a0fb31180b7dd028594ec5180a1 Mon Sep 17 00:00:00 2001 From: tetrapod00 <145553014+tetrapod00@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:08:03 -0800 Subject: [PATCH] Add technical definition for manifoldness --- tutorials/3d/csg_tools.rst | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/tutorials/3d/csg_tools.rst b/tutorials/3d/csg_tools.rst index 2fdb6ec2785..3133c4147ff 100644 --- a/tutorials/3d/csg_tools.rst +++ b/tutorials/3d/csg_tools.rst @@ -91,14 +91,31 @@ The :ref:`CSGPolygon3D ` node extrude along a Polygon drawn Custom meshes ~~~~~~~~~~~~~ -Any mesh can be used for :ref:`CSGMesh3D `; the mesh can be -modeled in other software and imported into Godot. Multiple materials are -supported. There are some restrictions for geometry: - -- it must be closed, -- it must not self-intersect, -- it must not contain internal faces, -- every edge must connect to only two other faces. +Custom meshes can be used for :ref:`CSGMesh3D ` as long as the +mesh is *manifold*. The mesh can be modeled in other software and imported into +Godot. Multiple materials are supported. + +For a mesh to be used as a CSG mesh, it is required to: + +- be closed +- have each edge connect to only two faces +- have volume + +And it is recommended to avoid: + +- negative volume +- self-intersection +- interior faces + +Godot uses the `manifold `__ library to +implement CSG meshes. The technical definition of "manifold" used by Godot is +the following, adapted from that library's `definition of "manifold" +`__: + + Every edge of every triangle must contain the same two vertices (by index) as + exactly one other triangle edge, and the start and end vertices must switch + places between these two edges. The triangle vertices must appear in clockwise + order when viewed from the outside of the Godot Engine manifold mesh. .. image:: img/csg_custom_mesh.png