ModelData:getTriangles

Edit

Returns the data for all triangles in the model. There are a few differences between this and the mesh-specific functions like ModelData:getMeshVertex and ModelData:getMeshIndex:

vertices, indices = ModelData:getTriangles()

Arguments

None

Returns

NameTypeDescription
verticestable The triangle vertex positions, returned as a flat (non-nested) table of numbers. The position of each vertex is given as an x, y, and z coordinate.
indicestable A list of numbers representing how to connect the vertices into triangles. Each number is a 1-based index into the vertices table, and every 3 indices form a triangle.

Notes

After this function is called on a ModelData once, the result is cached.

See also