GLTFMesh
- class compas.files.GLTFMesh(primitive_data_list, context, mesh_name=None, weights=None, extras=None, extensions=None)[source]
Bases:
objectObject containing mesh data in a format compatible with the glTF standard.
- Attributes
mesh_name (str) – String of the name of the mesh.
weights (list) – List containing the weights to be applied to morph targets.
primitive_data_list (list) – List of objects defining the geometry and material of the mesh.
extras (object)
extensions (object)
context (GLTFContent) – GLTF context in which the mesh exists.
key (int) – Key of the mesh used in
compas.files.GLTFMesh.context.meshes.vertices (list) – List of xyz-tuples representing the points of the mesh.
faces (list) – List of tuples referencing the indices of
compas.files.GLTFMesh.verticesrepresenting faces of the mesh.
Methods
Creates a
GLTFMeshfrom a glTF node dictionary and inserts it in the provided context.Construct a
GLTFMeshobject from a compas mesh.Construct a
GLTFMeshobject from lists of vertices and faces.Returns a list of the elements of
indicesgrouped into tuples of sizegroup_size.Given a list of indices, returns a list of indices, all shifted by
shift.Returns a JSONable dictionary object in accordance with glTF specifications.
Raises an exception if not all faces in
facesare defining either all triangles, lines or points.Raise an exception if there are either too many vertices, or the vertices do not represent points in 3-space.