Module Curve :: Class CurNurb
[frames | no frames]

Class CurNurb


The CurNurb Object

This object provides access to the control points of the curves that make up a Blender Curve.

The CurNurb supports the python iterator protocol which means you can use a python for statement to access the points in a curve.

The CurNurb also supports the sequence protocol which means you can access the control points of a CurNurb using the [] operator.
Method Summary
BezTriple (Bezier Curve) or List of 5 floats [x, y, z, w, t] for Poly or Nurbs __getitem__(n)
Get the Nth element in the curve.
PyNone __setitem__(n, point)
Replace the Nth point in the curve.
PyNone append(new_point)
Appends a new point to a curve.
integer getFlagU()
Get the CurNurb knot flag U.
integer getFlagV()
Get the CurNurb knot flag V.
integer getMatIndex()
Returns the Material index for this CurNurb.
PyNone getType(value)
Set the type of the curve and converts the curve to its new type if needed
boolean isCyclic()
Boolean method checks whether a CurNurb is cyclic (a closed curve) or not.
boolean isNurb()
Boolean method used to determine whether a CurNurb is of type Bezier or of type Nurb.
PyNone setFlagU(flag)
Set the entire CurNurb knot flag U (knots are recalculated automatically).
PyNone setFlagV(value)
Set the CurNurb knot flag V (knots are recalculated automatically).
PyNone setMatIndex(index)
Sets the Material index for this CurNurb.

Instance Variable Summary
int flagU: The CurNurb knot flag U.
int flagV: The CurNurb knot flag V.
int type: The type of the curve (Poly: 0, Bezier: 1, NURBS: 4)

Method Details

__getitem__(n)
(Indexing operator)

Get the Nth element in the curve. For Bezier curves, that element is a BezTriple. For the rest (Poly and Nurbs), it is a list of 5 floats: x, y, z, weight, tilt (in radians). NOTE 1: This element element is independant on the curve, modifying it will not affect the curve. NOTE 2: Each successive call returns a new object.
Parameters:
n - the index of the element to return
           (type=integer)
Returns:
The Nth element in the curve
           (type=BezTriple (Bezier Curve) or List of 5 floats [x, y, z, w, t] for Poly or Nurbs)

__setitem__(n, point)
(Index assignment operator)

Replace the Nth point in the curve. The type of the argument must match the type of the curve. List of 4 floats (optional 5th float is the tilt value in radians) for Nurbs or BezTriple for Bezier.
Parameters:
n - the index of the element to replace
           (type=integer)
point - the point that will replace the one in the curve. The point can be either a BezTriple type or a list of 4 floats in x,y,z,w (optionally tilt in radians as 5th value) format for a Nurb curve.
           (type=BezTriple or list of 4 floats (optional 5th float is the tilt value in radians))
Returns:
PyNone
           (type=PyNone)

append(new_point)

Appends a new point to a curve. This method appends points to both Bezier and Nurb curves. The type of the argument must match the type of the curve. List of 4 floats (optional 5th float is the tilt value in radians) for Nurbs or BezTriple for Bezier.
Parameters:
new_point - the new point to be appended to the curve. The new point can be either a BezTriple type or a list of 4 floats in x,y,z,w (optionally tilt in radians as 5th value) format for a Nurb curve.
           (type=BezTriple or list of 4 floats (optional 5th float is the tilt value in radians))
Returns:
PyNone
           (type=PyNone)

getFlagU()

Get the CurNurb knot flag U.
Returns:
See setFlagU for description of return value.
           (type=integer)

getFlagV()

Get the CurNurb knot flag V.
Returns:
See setFlagU for description of return value.
           (type=integer)

getMatIndex()

Returns the Material index for this CurNurb.
Returns:
integer
           (type=integer)

getType(value)

Set the type of the curve and converts the curve to its new type if needed
Parameters:
value - CurNurb type flag (0 - Poly, 1 - Bezier, 4 - NURBS)
           (type=integer)
Returns:
PyNone
           (type=PyNone)

isCyclic()

Boolean method checks whether a CurNurb is cyclic (a closed curve) or not.
Returns:
True or False
           (type=boolean)

isNurb()

Boolean method used to determine whether a CurNurb is of type Bezier or of type Nurb.
Returns:
True or False
           (type=boolean)

setFlagU(flag)

Set the entire CurNurb knot flag U (knots are recalculated automatically). The flag can be one of six values:
  • 0 or 1: uniform knots
  • 2 or 3: endpoints knots
  • 4 or 5: bezier knots
Bit 0 controls whether or not the curve is cyclic (1 = cyclic).
Parameters:
flag - CurNurb knot flag
           (type=integer)
Returns:
PyNone
           (type=PyNone)

setFlagV(value)

Set the CurNurb knot flag V (knots are recalculated automatically).
Parameters:
value - See setFlagU for description of return.
           (type=integer)
Returns:
PyNone
           (type=PyNone)

setMatIndex(index)

Sets the Material index for this CurNurb.
Parameters:
index - the new value for the Material number of this CurNurb. No range checking is done.
           (type=integer)
Returns:
PyNone
           (type=PyNone)

Instance Variable Details

flagU

The CurNurb knot flag U. See setFlagU for description.
Type:
int

flagV

The CurNurb knot flag V. See setFlagU for description.
Type:
int

type

The type of the curve (Poly: 0, Bezier: 1, NURBS: 4)
Type:
int

Generated by Epydoc 2.1 on Thu Dec 22 22:38:12 2005 http://epydoc.sf.net