@@ -91,14 +91,31 @@ The :ref:`CSGPolygon3D <class_CSGPolygon3D>` node extrude along a Polygon drawn
91
91
Custom meshes
92
92
~~~~~~~~~~~~~
93
93
94
- Any mesh can be used for :ref: `CSGMesh3D <class_CSGMesh3D >`; the mesh can be
95
- modeled in other software and imported into Godot. Multiple materials are
96
- supported. There are some restrictions for geometry:
97
-
98
- - it must be closed,
99
- - it must not self-intersect,
100
- - it must not contain internal faces,
101
- - every edge must connect to only two other faces.
94
+ Custom meshes can be used for :ref: `CSGMesh3D <class_CSGMesh3D >` as long as the
95
+ mesh is *manifold *. The mesh can be modeled in other software and imported into
96
+ Godot. Multiple materials are supported.
97
+
98
+ For a mesh to be used as a CSG mesh, it is required to:
99
+
100
+ - be closed
101
+ - have each edge connect to only two faces
102
+ - have volume
103
+
104
+ And it is recommended to avoid:
105
+
106
+ - negative volume
107
+ - self-intersection
108
+ - interior faces
109
+
110
+ Godot uses the `manifold <https://github.com/elalish/manifold >`__ library to
111
+ implement CSG meshes. The technical definition of "manifold" used by Godot is
112
+ the following, adapted from that library's `definition of "manifold"
113
+ <https://github.com/elalish/manifold/wiki/Manifold-Library#manifoldness-definition> `__:
114
+
115
+ Every edge of every triangle must contain the same two vertices (by index) as
116
+ exactly one other triangle edge, and the start and end vertices must switch
117
+ places between these two edges. The triangle vertices must appear in clockwise
118
+ order when viewed from the outside of the Godot Engine manifold mesh.
102
119
103
120
.. image :: img/csg_custom_mesh.png
104
121
0 commit comments