Package openalea :: Package plantgl :: Package scenegraph :: Module cspline :: Class CSpline
[frames] | no frames]

Class CSpline

object --+
         |
        CSpline


A CSpline interpolate a set of points.

Instance Methods
 
__init__(self, points, is_closed=False)
Create a CSpline from a set of 2d or 3d points.
 
__len__(self)
 
add_point(self, pt)
 
bezier_cp(self)
Compute bezier control points from the input points.
 
bezier_kv(self, is_linear=False)
Compute a nurbs knot vector from Bezier control points.
 
curve(self, is_linear=False, stride_factor=10)
Return the equivalent PlantGL nurbs curve which interpol the points.
 
derivatives(self)
Compute the derivatives based on the knots and the distance.
 
distances(self)
Compute the distance between the input points.
 
move_point(self, i, pt)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

__init__(self, points, is_closed=False)
(Constructor)

 

Create a CSpline from a set of 2d or 3d points.

Overrides: object.__init__

bezier_kv(self, is_linear=False)

 

Compute a nurbs knot vector from Bezier control points.
bezier_kv(linear=False) -> knot_vector

:param: is_linear indicate if the parametrization is linear or 
pseudo curvilinear abscisse.

curve(self, is_linear=False, stride_factor=10)

 

Return the equivalent PlantGL nurbs curve which interpol the points.
:param: stride_factor is the number of points to draw an arc of the curve.

derivatives(self)

 

Compute the derivatives based on the knots and the distance.
At Pi, the derivative is:
    D_i = P_(i-1)P_i / 4||.|| + P_iP_(i+1) / 4||.||