Everything you could possibly want to know (and probably, to be honest, a fair bit more) about Objects.Geometry.Mesh
This table describes in technical terms what Objects.Geometry.Mesh
is and isnt. However, there is a lot of alternate terminology and expectations between industries. so This page hopefully explains this table in a little more detail, aswell as the actual implementation of the Mesh
object model.
Feature | Supported? |
---|---|
Vertices Data | ✅ position (x,y,z) : double, color(argb) : int, texture coordinates(u,v) : double |
Non-Manifold Geo | ✅ Fully supported |
Complex/self intersection | ✅ (supported, but may render/triangulate funny in some apps) |
N-gons | ✅ but since we rely on triangulation, there are performance concerns with large (n > 5000) n-gons |
Edge Loops | ❌ only face loops |
Inner loops | ❌ Inner loops must be split/triangulated (see triangulation) |
Normals & Tangents | ❌ Calculated through CCW indices and shared vertices |
Custom vertex data | ❌ Not supported out of the box |
Multiple render materials | ❌ See #displayValues |
NURBS/BREP/SPLINE/SDF | ❌ Only polygon mesh data |
Number of vertices/faces | 32bit int max value (tho some host applications may be limited to 16) |
vertices
Mesh.vertices
stores a flat list of x,y,z vertices.
What do I mean by a flat list?, I mean the x, y, z components have been flattened into one big long list of double
s!
This means that the length of the list should always be a multiple of 3. It also means that mesh.vertices.Count
gives you a value that is 3 times the number of actual vertices in that mesh. You should use mesh.VerticesCount
for the actual number of vertices.
Note for developers not using .NET or Python SDK: this property is chunked, and you cannot guarantee that the size of a chunk will be a multiple of 3 (in fact, they aren’t by default)
faces
aka indicies/face loops/outer loopsPolygon faces can have an arbitrary number of vertices. The number of vertices we call the cardinality of the face, or simply n
.
For trangles n = 3
, for quads n = 4
, and anything higher we call “n-gons”.
Mesh.faces
stores a flat list of int
s to represent polygon faces.
The first int
in each face represents the cardinality in the face (n
), The next n
int
s are the vertex indices for that face.