Optional: Length NumTri, contains an ID of the source face this triangle comes from. When auto-generated, this ID will be a triangle index into the original mesh. All neighboring coplanar triangles from that input mesh will refer to a single triangle of that group as the faceID. When supplying faceIDs, ensure that triangles with the same ID are in fact coplanar and have consistent properties (within some tolerance) or the output will be surprising.
Optional: The X-Y-Z-W weighted tangent vectors for smooth Refine(). If non-empty, must be exactly four times as long as Mesh.triVerts. Indexed as 4 * (3 * tri + i) + j, i < 3, j < 4, representing the tangent value Mesh.triVerts[tri][i] along the CCW edge. If empty, mesh is faceted.
Optional: A list of only the vertex indicies that need to be merged to reconstruct the manifold.
Optional: The same length as mergeFromVert, and the corresponding value contains the vertex to merge with. It will have an identical position, but the other properties may differ.
Number of properties per vertex, always >= 3.
Optional: Indicates runs of triangles that correspond to a particular input mesh instance. The runs encompass all of triVerts and are sorted by runOriginalID. Run i begins at triVerts[runIndex[i]] and ends at triVerts[runIndex[i+1]]. All runIndex values are divisible by 3. Returned runIndex will always be 1 longer than runOriginalID, but same length is also allowed as input: triVerts.size() will be automatically appended in this case.
Optional: The OriginalID of the mesh this triangle run came from. This ID is ideal for reapplying materials to the output mesh. Multiple runs may have the same ID, e.g. representing different copies of the same input mesh. If you create an input MeshGL that you want to be able to reference as one or more originals, be sure to set unique values from ReserveIDs().
Optional: For each run, a 3x4 transform is stored representing how the corresponding original mesh was transformed to create this triangle run. This matrix is stored in column-major order and the length of the overall vector is 12 * runOriginalID.size().
The vertex indices of the three triangle corners in CCW (from the outside) order, for each triangle.
Flat, GL-style interleaved list of all vertex properties: propVal = vertProperties[vert * numProp + propIdx]. The first three properties are always the position x, y, z.
Number of triangle runs. Each triangle run is a set of consecutive triangles that all come from the same instance of the same input mesh.
Number of triangles
Number of property vertices
Updates the mergeFromVert and mergeToVert vectors in order to create a manifold solid. If the MeshGL is already manifold, no change will occur and the function will return false. Otherwise, this will merge verts along open edges within tolerance (the maximum of the MeshGL tolerance and the baseline bounding-box tolerance), keeping any from the existing merge vectors.
There is no guarantee the result will be manifold - this is a best-effort helper function designed primarily to aid in the case where a manifold multi-material MeshGL was produced, but its merge vectors were lost due to a round-trip through a file format. Constructing a Manifold from the result will report a Status if it is not manifold.
Gets the x, y, z position of this vertex.
vertex index.
Gets the tangent vector starting at verts(tri)[j] pointing to the next Bezier point along the CCW edge. The fourth value is its weight.
halfedge index: 3 * tri + j, where j is 0, 1, or 2.
Gets the three vertex indices of this triangle in CCW order.
triangle index.
An alternative to Mesh for output suitable for pushing into graphics libraries directly. This may not be manifold since the verts are duplicated along property boundaries that do not match. The additional merge vectors store this missing information, allowing the manifold to be reconstructed.