MFnNurbsCurve¶
-
class
MFnNurbsCurve
(*args, **kargs)¶ Bases:
OpenMaya.MFnNurbsCurve
Override of the Maya API class of the same name to make the data within the class ‘picklable’
Methods Summary
closestPoint
(test_pnt[, guess, tolerance, space])Returns a tuple containing the point on the curve which is closest to ‘testPoint’, and the parameter value at which that point occurs. cvPosition
(index[, space])Returns the position of a single control vertex. cvPositions
([space])Returns the positions of all of the curve’s control vertices. getDerivativesAtParam
(param[, space])Evaluates the curve at the given parameter value, returning a tuple containing the position and first derivative at that value. getPointAtParam
(param[, space])Returns the point on the curve at the given parameter value. normal
(param[, space])Returns the normal at the given parameter value on the curve. tangent
(param[, space])Returns the normalized tangent vector at the given parameter value on the curve. Methods Documentation
-
closestPoint
(test_pnt, guess=None, tolerance=0.001, space=2)¶ Returns a tuple containing the point on the curve which is closest to ‘testPoint’, and the parameter value at which that point occurs.
- testPoint (MPoint) - point to get closest to
- guess (float) - a guess as to roughly where on the curve the
- closest point will be. If the guess is in the correct span than it can significantly speed up the search. If not then it may slow down the search a bit. If no guess is supplied then the search will begin at the start of the curve.
- tolerance (float) - maximum allowed distance between the curve
- and the returned point.
- space (MSpace constant) - coordinate space to use for the points
-
cvPosition
(index, space=kObject) → MPoint¶ Returns the position of a single control vertex.
- index (int) - index of the CV to return
- space (int) - an MSpace constant giving the coordinate space in
- which the point is given
-
cvPositions
(space=kObject) → MPointArray¶ Returns the positions of all of the curve’s control vertices.
- space (int) - an MSpace constant giving the coordinate space in
- which the point is given
-
getDerivativesAtParam
(param, space=kObject) -> (MPoint, MVector[, MVector])¶ Evaluates the curve at the given parameter value, returning a tuple containing the position and first derivative at that value. If ‘dUU’ is True then the returned tuple will include the second derivative as well as its third element.
- param (float) - parameter value at which to do the evaluation
- space (int) - an MSpace constant giving the coordinate space in
- which the point is given
- dUU (bool) - if True include the second derivative in the result.
-
getPointAtParam
(param, space=kObject) → MPoint¶ Returns the point on the curve at the given parameter value.
- param (float) - parameter value at which to find the point
- space (int) - an MSpace constant giving the coordinate space in
- which the point should be returned
-
normal
(param, space=kObject) → MVector¶ Returns the normal at the given parameter value on the curve. For degree 1 curves the normal is the vector at right angles to the curve that lies in the average plane of the curve. For higher degrees the normal is defined by the local curvature at the parameter.
- param (float) - parameter value at which to find the normal
- space (int) - an MSpace constant giving the coordinate space in
- which the normal should be returned
-
tangent
(param, space=kObject) → MVector¶ Returns the normalized tangent vector at the given parameter value on the curve.
- param (float) - parameter value at which to find the tangent
- space (int) - an MSpace constant giving the coordinate space in
- which the tangent should be returned
-