collada.polygons.Polygons¶
- class collada.polygons.Polygons(sources, material, polygons, xmlnode=None)¶
Class containing the data COLLADA puts in a <polygons> tag, a collection of polygons that can have holes.
The Polygons object is read-only. To modify a Polygons, create a new instance using
collada.geometry.Geometry.createPolygons().Polygons with holes are not currently supported, so for right now, this class is essentially the same as a
collada.polylist.Polylist. Use a polylist instead if your polygons don’t have holes.
- __init__(sources, material, polygons, xmlnode=None)¶
A Polygons should not be created manually. Instead, call the
collada.geometry.Geometry.createPolygons()method after creating a geometry instance.
Methods
__init__(sources, material, polygons[, xmlnode])A Polygons should not be created manually.
bind(matrix, materialnodebysymbol)Create a bound polygons from this polygons, transform and material mapping
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.
triangleset()This performs a simple triangulation of the polylist using the fanning method.
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 line set.