pyffi :: utils :: tristrip :: OrientedStrip :: Class OrientedStrip
[hide private]
[frames] | no frames]

Class OrientedStrip

source code

An oriented strip, with stitching support.
Instance Methods [hide private]
 
__init__(self, strip)
Construct oriented strip from regular strip (i.e.
source code
 
compactify(self)
Remove degenerate faces from front and back.
source code
 
reverse(self)
Reverse vertices.
source code
 
__len__(self) source code
 
__iter__(self) source code
 
__str__(self)
String representation.
source code
 
__repr__(self) source code
 
get_num_stitches(self, other)
Get number of stitches required to glue the vertices of self to other.
source code
 
__add__(self, other)
Combine two strips, using minimal number of stitches.
source code
Method Details [hide private]

__init__(self, strip)
(Constructor)

source code 

Construct oriented strip from regular strip (i.e. a list).

Constructors

>>> ostrip = OrientedStrip([0,1,2,3])
>>> ostrip.vertices
[0, 1, 2, 3]
>>> ostrip.reversed
False
>>> ostrip = OrientedStrip([0,0,1,2,3])
>>> ostrip.vertices
[0, 1, 2, 3]
>>> ostrip.reversed
True
>>> ostrip2 = OrientedStrip(ostrip)
>>> ostrip2.vertices
[0, 1, 2, 3]
>>> ostrip2.reversed
True
>>> ostrip = OrientedStrip(None) # doctest: +ELLIPSIS
Traceback (most recent call last):
    ...
TypeError: ...

Compactify

>>> ostrip = OrientedStrip([0,0,0,1,2,3])
>>> ostrip.vertices
[0, 1, 2, 3]
>>> ostrip.reversed
False
>>> ostrip = OrientedStrip([0,0,0,0,1,2,3])
>>> ostrip.vertices
[0, 1, 2, 3]
>>> ostrip.reversed
True
>>> ostrip = OrientedStrip([0,0,0,1,2,3,3,3,3])
>>> ostrip.vertices
[0, 1, 2, 3]
>>> ostrip.reversed
False
>>> ostrip = OrientedStrip([0,0,0,0,1,2,3,3,3,3])
>>> ostrip.vertices
[0, 1, 2, 3]
>>> ostrip.reversed
True