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.Source objects or a dictionary mapping source ids to the actual objects

  • primitives (list) – List of primitive objects contained within the geometry. Do not set this argument manually. Instead, create a collada.geometry.Geometry first and then append to primitives with 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 xmlnode

Attributes

xmlnode

ElementTree representation of the geometry.

collada

The collada.Collada object this geometry belongs to

id

The unique string identifier for the geometry

name

The text string naming the geometry

double_sided

A boolean indicating whether or not the geometry should be rendered double sided

sourceById

A dictionary containing collada.source.Source objects indexed by their id.

primitives

List of primitives (base type collada.primitive.Primitive) inside this geometry.