Package Pmv :: Module extruder :: Class ExtrudeObject
[hide private]
[frames] | no frames]

Class ExtrudeObject

source code

Known Subclasses:
ExtrudeSSElt

Base class to take a shape and extrude it along a 3D path.

Instance Methods [hide private]
  __init__(self, path3D, matrix, shape, cap1=0, cap2=0, arrow=0, larrow=3, warrow=2)
Constructor: Takes as arguments a path3D, matrix, 2D shape, and optional cap1, cap2, and arrow.
  getextrudeVertices(self)
get the extruded vertices and normals.
  addArrow(self, pts)
Compute the vertices for an arrowhead.
  dist(self, p1, p2)
Calculate distance between two pts.
  getFaces(self)
get the list of faces for the extrusion, and add faces for caps.
  buildFaces(self, faces, start, end, ls, dup)
Method that returns the faces for the points in the path3D between start and end.
  fixNormals(self, faces)
fixes normals on arrow by using glQuadNormals, which calculates normals.
  glQuadNormals(self, vertices, faces)
gets normals for quads by converting a quad face into two triangle faces and calling TriangleNormals.
  setResidueProperties(self, properties, propName, resIndices)
with the given list of pairs of residue indices and corresponding colors, the method sets the color per residue in the self.colors array.
  setStripProperty(self, properties, propName)
set the color array so that each side strip of the structure has one color.

Method Details [hide private]

__init__(self, path3D, matrix, shape, cap1=0, cap2=0, arrow=0, larrow=3, warrow=2)
(Constructor)

source code 
Constructor: Takes as arguments a path3D, matrix, 2D shape, and optional cap1, cap2, and arrow. Calls getextrudeVertices() and getFaces() and stores the return values in self.vertices, self.vnormals , and self.faces.

getextrudeVertices(self)

source code 
get the extruded vertices and normals. If an arrow is specified, extra vertices are added. If caps are specified, the end vertices must be duplicated and used as extra vertices.

addArrow(self, pts)

source code 
Compute the vertices for an arrowhead. self.larrow specifies how far back the arrow goes along the path3D. self.warrow is the width in real units.

dist(self, p1, p2)

source code 
Calculate distance between two pts.

getFaces(self)

source code 
get the list of faces for the extrusion, and add faces for caps.

buildFaces(self, faces, start, end, ls, dup)

source code 
Method that returns the faces for the points in the path3D between start and end. Ls is the length of the shape and dup indicates if the vertices are duplicated.

fixNormals(self, faces)

source code 
fixes normals on arrow by using glQuadNormals, which calculates normals.

glQuadNormals(self, vertices, faces)

source code 
gets normals for quads by converting a quad face into two triangle faces and calling TriangleNormals.

setResidueProperties(self, properties, propName, resIndices)

source code 
with the given list of pairs of residue indices and corresponding colors, the method sets the color per residue in the self.colors array.

setStripProperty(self, properties, propName)

source code 
set the color array so that each side strip of the structure has one color.