| |
- list(object)
-
- Polygon
- object
-
- DegeneratePolygon
class DegeneratePolygon(object) |
|
Class encapsulated a degenerate triangle definition
At the moment this is not a particularly useful class,
eventually it might be used for interactive debugging
of the geometry (for instance highlighting the degenerate
polygons with indexed line sets).
Note: an index of -1 indicates a likely tesselation-
generated vertex. |
|
Methods defined here:
- __init__(self, vertices, node=None, reason='')
- Initialize the DegeneratePolygon instance
vertices -- sequence of vertices
node -- optional pointer to the source node
reason -- string description of the condition which
makes this a degenerate polygon definition.
- __repr__(self)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Polygon(list) |
|
Holder for metadata regarding a particular polygon
Often during certain operations (such as tessellation)
is useful to have an object for representing a polygon
which binds together all the metadata regarding that
polygon.
The Polygon class is modeled as a simple list-of-vertices
with a convenience method normalise to make the class
easier to use when dealing with triangle-only systems
such as the array geometry classes. |
|
- Method resolution order:
- Polygon
- list
- object
Methods defined here:
- __init__(self, polyIndex=-1, node=None, points=None, ccw=True)
- Initialize the polygon
polyIndex -- more accurately "polygon ID", an opaque
value used to identify the polygon.
node -- optional reference to the scenegraph node from
which we are derived, used primarily during error
reporting to give feedback regarding which node has
encountered the error.
points -- list of vertices which make up the definition
of the polygon.
- __repr__(self)
- Produce code-like representation of the polygon
- checkVertices(self)
- Check set of triangle vertices for possible degeneracy
At the moment this checks for condition:
* vertices are collinear
Returns only the well formed triangles from the input
triangle vertex set. (Note that this is called by normalise,
which explains the rather strange input and output).
- normalise(self, tessellate=None)
- Normalise this polygon to a set of triangle vertices
tesselate -- callable which can accept a Polygon instance
and return a list of vertices representing a
tesselated polygon triangle-set. (And only a triangle-
set, no triangle-fans or triangle-strips).
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from list:
- __add__(...)
- x.__add__(y) <==> x+y
- __contains__(...)
- x.__contains__(y) <==> y in x
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __delslice__(...)
- x.__delslice__(i, j) <==> del x[i:j]
Use of negative indices is not supported.
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __gt__(...)
- x.__gt__(y) <==> x>y
- __iadd__(...)
- x.__iadd__(y) <==> x+=y
- __imul__(...)
- x.__imul__(y) <==> x*=y
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __reversed__(...)
- L.__reversed__() -- return a reverse iterator over the list
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- __setslice__(...)
- x.__setslice__(i, j, y) <==> x[i:j]=y
Use of negative indices is not supported.
- __sizeof__(...)
- L.__sizeof__() -- size of L in memory, in bytes
- append(...)
- L.append(object) -- append object to end
- count(...)
- L.count(value) -> integer -- return number of occurrences of value
- extend(...)
- L.extend(iterable) -- extend list by appending elements from the iterable
- index(...)
- L.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
- insert(...)
- L.insert(index, object) -- insert object before index
- pop(...)
- L.pop([index]) -> item -- remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- remove(...)
- L.remove(value) -- remove first occurrence of value.
Raises ValueError if the value is not present.
- reverse(...)
- L.reverse() -- reverse *IN PLACE*
- sort(...)
- L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1
Data and other attributes inherited from list:
- __hash__ = None
- __new__ = <built-in method __new__ of type object at 0x8187c0>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
| |