### Navigation

- index
- modules |
- next |
- previous |
- pycollada 0.4 documentation »
- API Reference »

# collada.polylist.Polylist

class `collada.polylist.``Polylist`(sources, material, index, vcounts, xmlnode=None)

  Bases: `collada.primitive.Primitive`

  Class containing the data COLLADA puts in a <polylist> tag, a collection of polygons. The Polylist object is read-only. To modify a Polylist, create a new instance using `collada.geometry.Geometry.createPolylist()`.

  - If `P` is an instance of `collada.polylist.Polylist`, then `len(P)` returns the number of polygons in the set. `P[i]` returns the ith polygon in the set.

  digraph inheritanced10274bdba { rankdir=LR; size="8.0, 12.0"; "DaeObject" [style="setlinewidth(0.5)",URL="collada.common.DaeObject.html#collada.common.DaeObject",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="This class is the abstract interface to all collada objects.",height=0.25,shape=box,fontsize=10]; "Polylist" [style="setlinewidth(0.5)",URL="#collada.polylist.Polylist",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Class containing the data COLLADA puts in a <polylist> tag, a collection of",height=0.25,shape=box,fontsize=10]; "Primitive" -> "Polylist" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LineSet" [style="setlinewidth(0.5)",URL="collada.lineset.LineSet.html#collada.lineset.LineSet",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Class containing the data COLLADA puts in a <lines> tag, a collection of",height=0.25,shape=box,fontsize=10]; "Primitive" -> "LineSet" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Primitive" [style="setlinewidth(0.5)",URL="collada.primitive.Primitive.html#collada.primitive.Primitive",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Base class for all primitive sets like TriangleSet, LineSet, Polylist, etc.",height=0.25,shape=box,fontsize=10]; "DaeObject" -> "Primitive" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TriangleSet" [style="setlinewidth(0.5)",URL="collada.triangleset.TriangleSet.html#collada.triangleset.TriangleSet",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Class containing the data COLLADA puts in a <triangles> tag, a collection of",height=0.25,shape=box,fontsize=10]; "Primitive" -> "TriangleSet" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Polygons" [style="setlinewidth(0.5)",URL="collada.polygons.Polygons.html#collada.polygons.Polygons",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="Class containing the data COLLADA puts in a <polygons> tag, a collection of",height=0.25,shape=box,fontsize=10]; "Polylist" -> "Polygons" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

  `__init__`(sources, material, index, vcounts, xmlnode=None)

    A Polylist should not be created manually. Instead, call the `collada.geometry.Geometry.createPolylist()` method after creating a geometry instance.

  Methods

  `__init__`(sources, material, index, vcounts) | A Polylist should not be created manually. Instead, call the
  `bind`(matrix, materialnodebysymbol) | Create a bound polylist from this polylist, transform and material mapping
  `load`(collada, localscope, node) |
  `save`() |
  `triangleset`() | This performs a simple triangulation of the polylist using the fanning method.

  Attributes

  `normal` | Read-only numpy.array of size Nx3 where N is the number of normal values in the
  `normal_index` | Read-only numpy.array of size Nx3 where N is the number of vertices in the primitive.
  `texcoord_indexset` | Read-only tuple of texture coordinate index arrays.
  `texcoordset` | Read-only tuple of texture coordinate arrays.
  `vertex` | Read-only numpy.array of size Nx3 where N is the number of vertex points in the
  `vertex_index` | Read-only numpy.array of size Nx3 where N is the number of vertices in the primitive.

  `xmlnode` = None

    ElementTree representation of the line set.

  `triangleset`()

    This performs a simple triangulation of the polylist using the fanning method.

    Return type: | `collada.triangleset.TriangleSet`

  `bind`(matrix, materialnodebysymbol)

    Create a bound polylist from this polylist, transform and material mapping

  `getInputList`()

    Gets a `collada.source.InputList` representing the inputs from a primitive

  `normal`

    Read-only numpy.array of size Nx3 where N is the number of normal values in the primitive’s normal source array.

  `normal_index`

    Read-only numpy.array of size Nx3 where N is the number of vertices in the primitive. To get the actual normal values, one can use this array to select into the normals array, e.g. `normal[normal_index]`.

  `texbinormal_indexset`

    Read-only tuple of texture binormal index arrays. Each value is a numpy.array of size Nx3 where N is the number of vertices in the primitive. To get the actual texture binormals, one can use the array to select into the texbinormalset array, e.g. `texbinormalset[0][texbinormal_indexset[0]]` would select the first set of texture binormals.

  `texbinormalset`

    Read-only tuple of texture binormal arrays. Each value is a numpy.array of size Nx3 where N is the number of texture binormals in the primitive’s source array.

  `texcoord_indexset`

    Read-only tuple of texture coordinate index arrays. Each value is a numpy.array of size Nx2 where N is the number of vertices in the primitive. To get the actual texture coordinates, one can use the array to select into the texcoordset array, e.g. `texcoordset[0][texcoord_indexset[0]]` would select the first set of texture coordinates.

  `texcoordset`

    Read-only tuple of texture coordinate arrays. Each value is a numpy.array of size Nx2 where N is the number of texture coordinates in the primitive’s source array.

  `textangent_indexset`

    Read-only tuple of texture tangent index arrays. Each value is a numpy.array of size Nx3 where N is the number of vertices in the primitive. To get the actual texture tangents, one can use the array to select into the textangentset array, e.g. `textangentset[0][textangent_indexset[0]]` would select the first set of texture tangents.

  `textangentset`

    Read-only tuple of texture tangent arrays. Each value is a numpy.array of size Nx3 where N is the number of texture tangents in the primitive’s source array.

  `vertex`

    Read-only numpy.array of size Nx3 where N is the number of vertex points in the primitive’s vertex source array.

  `vertex_index`

    Read-only numpy.array of size Nx3 where N is the number of vertices in the primitive. To get the actual vertex points, one can use this array to select into the vertex array, e.g. `vertex[vertex_index]`.

### Navigation

- index
- modules |
- next |
- previous |
- pycollada 0.4 documentation »
- API Reference »