collada.geometry.Geometry¶
- class collada.geometry.Geometry(collada, id, name, sourcebyid, primitives=None, xmlnode=None, double_sided=False)¶
A class containing the data coming from a COLLADA <geometry> tag
- __init__(collada, id, name, sourcebyid, primitives=None, xmlnode=None, double_sided=False)¶
Create a geometry instance
- Parameters:
collada (collada.Collada) – The collada object this geometry belongs to
id (str) – A unique string identifier for the geometry
name (str) – A text string naming the geometry
sourcebyid – A list of
collada.source.Sourceobjects or a dictionary mapping source ids to the actual objectsprimitives (list) – List of primitive objects contained within the geometry. Do not set this argument manually. Instead, create a
collada.geometry.Geometryfirst and then append toprimitiveswith the create* functions.xmlnode – When loaded, the xmlnode it comes from.
double_sided (bool) – Whether or not the geometry should be rendered double sided
Methods
__init__(collada, id, name, sourcebyid[, ...])Create a geometry instance
bind(matrix, materialnodebysymbol)Binds this geometry to a transform matrix and material mapping.
createLineSet(indices, inputlist[, materialid])Create a set of lines for use in this geometry instance.
createPolygons(indices, inputlist[, materialid])Create a polygons for use with this geometry instance.
createPolylist(indices, vcounts, inputlist)Create a polylist for use with this geometry instance.
createTriangleSet(indices, inputlist[, ...])Create a set of triangles for use in this geometry instance.
load(collada, localscope, node)Load and return a class instance from an XML node.
save()Saves the geometry back to
xmlnodeAttributes
xmlnodeElementTree representation of the geometry.
colladaThe
collada.Colladaobject this geometry belongs toidThe unique string identifier for the geometry
nameThe text string naming the geometry
double_sidedA boolean indicating whether or not the geometry should be rendered double sided
sourceByIdA dictionary containing
collada.source.Sourceobjects indexed by their id.primitivesList of primitives (base type
collada.primitive.Primitive) inside this geometry.