Previous topic

collada.polylist.BoundPolylist

Next topic

collada.polylist.Polylist

This Page

collada.polylist.Polygon

class collada.polylist.Polygon(indices, vertices, normals, texcoords, material)

Bases: object

Single polygon representation. Represents a polygon of N points.

__init__(indices, vertices, normals, texcoords, material)

A Polygon should not be created manually.

Methods

__init__(indices, vertices, normals, ...) A Polygon should not be created manually.
triangles() This triangulates the polygon using a simple fanning method.
vertices

A (N, 3) float array containing the points in the polygon.

normals

A (N, 3) float array with the normals for points in the polygon. Can be None.

texcoords

A tuple where entries are numpy float arrays of size (N, 2) containing the texture coordinates for the points in the polygon for each texture coordinate set. Can be length 0 if there are no texture coordinates.

material

If coming from an unbound collada.polylist.Polylist, contains a string with the material symbol. If coming from a bound collada.polylist.BoundPolylist, contains the actual collada.material.Effect the line is bound to.

triangles()

This triangulates the polygon using a simple fanning method.

Return type:generator of collada.polylist.Polygon