collada.triangleset.TriangleSet¶
- class collada.triangleset.TriangleSet(sources, material, index, xmlnode=None)¶
Class containing the data COLLADA puts in a <triangles> tag, a collection of triangles.
The TriangleSet object is read-only. To modify a TriangleSet, create a new instance using
collada.geometry.Geometry.createTriangleSet().If
Tis an instance ofcollada.triangleset.TriangleSet, thenlen(T)returns the number of triangles in the set.T[i]returns the ith triangle in the set.
- __init__(sources, material, index, xmlnode=None)¶
A TriangleSet should not be created manually. Instead, call the
collada.geometry.Geometry.createTriangleSet()method after creating a geometry instance.
Methods
__init__(sources, material, index[, xmlnode])A TriangleSet should not be created manually.
bind(matrix, materialnodebysymbol)Create a bound triangle set from this triangle set, transform and material mapping
generateNormals()If
normalsis None or you wish for normals to be recomputed, call this method to recompute them.generateTexTangentsAndBinormals()If there are no texture tangents, this method will compute them.
getInputList()Gets a
collada.source.InputListrepresenting the inputs from a primitiveload(collada, localscope, node)Load and return a class instance from an XML node.
save()Put all the data to the internal xml node (xmlnode) so it can be serialized.
Attributes
normalRead-only numpy.array of size Nx3 where N is the number of normal values in the primitive's normal source array.
normal_indexRead-only numpy.array of size Nx3 where N is the number of vertices in the primitive.
texbinormal_indexsetRead-only tuple of texture binormal index arrays.
texbinormalsetRead-only tuple of texture binormal arrays.
texcoord_indexsetRead-only tuple of texture coordinate index arrays.
texcoordsetRead-only tuple of texture coordinate arrays.
textangent_indexsetRead-only tuple of texture tangent index arrays.
textangentsetRead-only tuple of texture tangent arrays.
vertexRead-only numpy.array of size Nx3 where N is the number of vertex points in the primitive's vertex source array.
vertex_indexRead-only numpy.array of size Nx3 where N is the number of vertices in the primitive.
xmlnodeElementTree representation of the data.