Share

construct_mesh

Creates a mesh geometry with only the properties that are required for a valid mesh structure.

Inputs

point_position

An array of float3 values consisting of the positions of the mesh's vertices.

face_offset

An array of uint values, where the nth element is the index at which the face vertices (polygon corners) of the nth polygon start to be listed in the face_vertex array. The last value in the array must be the size of the face_vertex array (as an unsigned integer), which means that the size of the face_offset array is equal to the total number of faces plus one.

face_vertex

An array of uint values containing the indices in the point_position array corresponding to the face vertices of each face in order. The first face vertex of the first polygon is at the index given by element 0 in the face_offset array, the second vertex of the first polygon is at the next index, and so on. The face vertices of the second polygon begin at the index given by element 1 in face_offset, and so on until the face vertices of the last polygon begin at the index given by the second-to-last element of face_offset and continue to the end of the face_vertex array.

This is sometimes called the "winding order" of the polygons. The front of each polygon is the side from which the face vertices appear in the counter-clockwise direction.

Outputs

mesh

The resulting mesh.

Was this information helpful?