CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Static Public Attributes
svgfig.Poly Class Reference

Public Member Functions

def __init__
 
def __repr__
 
def Path
 
def SVG
 

Public Attributes

 attr
 
 d
 
 loop
 
 mode
 

Static Public Attributes

dictionary defaults = {}
 

Detailed Description

Draws a curve specified by a sequence of points. The curve may be
piecewise linear, like a polygon, or a Bezier curve.

Poly(d, mode, loop, attribute=value)

d                       required        list of tuples representing points
                                        and possibly control points
mode                    default="L"   "lines", "bezier", "velocity",
                                        "foreback", "smooth", or an abbreviation
loop                    default=False   if True, connect the first and last
                                        point, closing the loop
attribute=value pairs   keyword list    SVG attributes

The format of the tuples in d depends on the mode.

"lines"/"L"         d=[(x,y), (x,y), ...]
                                        piecewise-linear segments joining the (x,y) points
"bezier"/"B"        d=[(x, y, c1x, c1y, c2x, c2y), ...]
                                        Bezier curve with two control points (control points
                                        preceed (x,y), as in SVG paths). If (c1x,c1y) and
                                        (c2x,c2y) both equal (x,y), you get a linear
                                        interpolation ("lines")
"velocity"/"V"      d=[(x, y, vx, vy), ...]
                                        curve that passes through (x,y) with velocity (vx,vy)
                                        (one unit of arclength per unit time); in other words,
                                        (vx,vy) is the tangent vector at (x,y). If (vx,vy) is
                                        (0,0), you get a linear interpolation ("lines").
"foreback"/"F"      d=[(x, y, bx, by, fx, fy), ...]
                                        like "velocity" except that there is a left derivative
                                        (bx,by) and a right derivative (fx,fy). If (bx,by)
                                        equals (fx,fy) (with no minus sign), you get a
                                        "velocity" curve
"smooth"/"S"        d=[(x,y), (x,y), ...]
                                        a "velocity" interpolation with (vx,vy)[i] equal to
                                        ((x,y)[i+1] - (x,y)[i-1])/2: the minimal derivative

Definition at line 1679 of file svgfig.py.

Constructor & Destructor Documentation

def svgfig.Poly.__init__ (   self,
  d = [],
  mode = "L",
  loop = False,
  attr 
)

Definition at line 1721 of file svgfig.py.

Member Function Documentation

def svgfig.Poly.__repr__ (   self)

Definition at line 1718 of file svgfig.py.

def svgfig.Poly.Path (   self,
  trans = None,
  local = False 
)
Apply the transformation "trans" and return a Path object in
global coordinates.  If local=True, return a Path in local coordinates
(which must be transformed again).

Definition at line 1733 of file svgfig.py.

def svgfig.Poly.SVG (   self,
  trans = None 
)
Apply the transformation "trans" and return an SVG object.

Definition at line 1729 of file svgfig.py.

Member Data Documentation

svgfig.Poly.attr

Definition at line 1726 of file svgfig.py.

svgfig.Poly.d

Definition at line 1722 of file svgfig.py.

dictionary svgfig.Poly.defaults = {}
static

Definition at line 1716 of file svgfig.py.

svgfig.Poly.loop

Definition at line 1724 of file svgfig.py.

svgfig.Poly.mode

Definition at line 1723 of file svgfig.py.