class counterpart of mel function curve
The curve command creates a new curve from a list of control vertices (CVs). A string is returned containing the pathname to the newly created curve. You can create a curve from points either in world space or object (local) space, either with weights or without. You can replace an existing curve by using the “-r/replace” flag. You can append a point to an existing curve by using the “-a/append” flag. To create a curve-on-surface, use the curveOnSurface command. To change the degree of a curve, use the rebuildCurve command. To change the of parameter range curve, use the rebuildCurve command.
This method returns the area bounded by this curve. The curve must be closed and planar.
Parameters : |
|
---|---|
Return type: | float |
Derived from api method maya.OpenMaya.MFnNurbsCurve.area
This method determines the closest point on the curve to the given point.
Parameters : |
|
---|---|
Return type: | Point |
Derived from api method maya.OpenMaya.MSpace.closestPoint
This method creates a copy of a nurbs curve.
Parameters : |
|
---|---|
Return type: | PyNode |
Derived from api method maya.OpenMaya.MFnNurbsCurve.copy
This method creates a nurbs curve from the given edit points and sets this function set to operate on the new curve.
Parameters : |
|
---|---|
Return type: | PyNode |
Derived from api method maya.OpenMaya.MFnNurbsCurve.createWithEditPoints
This method is used to directly access a contiguous group of CVs. The returned group can be accessed via the MItCurveCV class. Any modifications to these CVs will affect this curve. updateCurve should be called to cause the curve to redraw itself.
Parameters : |
|
---|---|
Return type: | PyNode |
Derived from api method maya.OpenMaya.MFnNurbsCurve.cvs
Return the degree of this curve. If the degree cannot be determined then 0 is returned.
Return type: | int |
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.degree
This method determines the distance from the given point to closest point on the curve.
Parameters : |
|
---|---|
Return type: | float |
Derived from api method maya.OpenMaya.MSpace.distanceToPoint
Given the length along the curve, find the parameter value that corresponds to it. If the parameter value cannot be found for the given length then ReturnStatus is set to kInvalidParameter and the parameter for the end point of the curve is returned.
Parameters : |
|
---|---|
Return type: | float |
Derived from api method maya.OpenMaya.MFnNurbsCurve.findParamFromLength
This method returns the form of the curve. The curve can be open, closed, or periodic.
Return type: | BezierCurve.Form |
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.form
Get the CV at the given index.
Parameters : |
|
---|---|
Return type: | Point |
Derived from api method maya.OpenMaya.MSpace.getCV
Get the positions of the CVs of this curve. The returned group can be accessed via the MPointArray class. Any modifications to these CVs will not affect this curve. setCVs should be called to modify the original curve. updateCurve should be called to cause the curve to redraw itself.
Parameters : |
|
---|---|
Return type: | Point list |
Derived from api method maya.OpenMaya.MSpace.getCVs
Evaluate the surface at the given parameter returning the position, first derivative and optionally the seecond derivative. Derivatives are not normalized.
Parameters : |
|
---|---|
Return type: | (Point, Vector, Vector) |
Derived from api method maya.OpenMaya.MSpace.getDerivativesAtParm
Get the parameter value of the specified knot for this curve. Knot indices range from 0 to numKnots() - 1
Parameters : |
|
---|---|
Return type: | float |
Derived from api method maya.OpenMaya.MFnNurbsCurve.knot
Return the range corresponding to the maximum and minimum parameter values for this curve.
Return type: | (float, float) |
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.getKnotDomain
This method retrieves a copy of the knot array for this curve.
Return type: | float list |
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.getKnots
This method retrieves the parameter value corresponding to the given point on the curve.
Parameters : |
|
---|---|
Return type: | float |
Derived from api method maya.OpenMaya.MSpace.getParamAtPoint
Returns the point in space that is at the given parameter value of the curve. If the parameter value does not give a valid point on the curve, then MS::kInvalidParameter is returned.
Parameters : |
|
---|---|
Return type: | Point |
Derived from api method maya.OpenMaya.MSpace.getPointAtParam
This method determines if the shape was created with history.
Return type: | bool |
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.hasHistoryOnCreate
Determines whether the specified parameter value is within the bounds of the knot vector of this curve
Parameters : |
|
---|---|
Return type: | bool |
Derived from api method maya.OpenMaya.MFnNurbsCurve.isParamOnCurve
This method determines if this curve is a planar curve. If planeNormal is non-NULL then the normal to the plane containing this curve is returned in this location.
Parameters : |
|
---|---|
Return type: | bool |
Derived from api method maya.OpenMaya.MFnNurbsCurve.isPlanar
Determines whether the given point is on this curve.
Parameters : |
|
---|---|
Return type: | bool |
Derived from api method maya.OpenMaya.MSpace.isPointOnCurve
Return the arc length of this curve or 0.0 if it cannot be computed.
Parameters : |
|
---|---|
Return type: | float |
Derived from api method maya.OpenMaya.MFnNurbsCurve.length
This method gives end knots full multiplicity. This ensures the end points of the curve interpolate the first and last CVs. It can also be used to convert a periodic curve to a closed curve. Derived from api method maya.OpenMaya.MFnNurbsCurve.makeMultipleEndKnots
Undo is not currently supported for this method
This method 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 param.
Parameters : |
|
---|---|
Return type: | Vector |
Derived from api method maya.OpenMaya.MSpace.normal
Returns the number of CVs.
Parameters : |
---|
If editableOnly evaluates to True (default), then this will return the number of cvs that can be actually edited (and also the highest index that may be used for cv’s - ie, if
myCurve.numCVs(editableOnly=True) == 4
If editablyOnly is False, then this will return the underlying number of cvs used to define the mathematical curve - degree + numSpans.
These will only differ if the form is ‘periodic’, in which case the editable number will be numSpans (as the last ‘degree’ cv’s are ‘locked’ to be the same as the first ‘degree’ cvs). In all other cases, the number of cvs will be degree + numSpans.
Examples : | >>> from pymel.core import *
>>> # a periodic curve
>>> myCurve = curve(name='periodicCurve1', d=3, periodic=True, k=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), pw=[(4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (0, 5.5, 0, 1), (-4, 4, 0, 1), (-5.5, 0, 0, 1), (-4, -4, 0, 1), (0, -5.5, 0, 1), (4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1)] )
>>> myCurve.cv
NurbsCurveCV(u'periodicCurveShape1.cv[0:7]')
>>> myCurve.numCVs()
8
>>> myCurve.numCVs(editableOnly=False)
11
>>>
>>> # an open curve
>>> myCurve = curve(name='openCurve1', d=3, periodic=False, k=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), pw=[(4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (0, 5.5, 0, 1), (-4, 4, 0, 1), (-5.5, 0, 0, 1), (-4, -4, 0, 1), (0, -5.5, 0, 1), (4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1)] )
>>> myCurve.cv
NurbsCurveCV(u'openCurveShape1.cv[0:10]')
>>> myCurve.numCVs()
11
>>> myCurve.numCVs(editableOnly=False)
11
|
---|---|
Return type: | int |
Returns the number of EPs.
Examples : | >>> from pymel.core import *
>>> # a periodic curve
>>> myCurve = curve(name='periodicCurve2', d=3, periodic=True, k=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), pw=[(4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (0, 5.5, 0, 1), (-4, 4, 0, 1), (-5.5, 0, 0, 1), (-4, -4, 0, 1), (0, -5.5, 0, 1), (4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1)] )
>>> myCurve.ep
NurbsCurveEP(u'periodicCurveShape2.ep[0:7]')
>>> myCurve.numEPs()
8
>>>
>>> # an open curve
>>> myCurve = curve(name='openCurve2', d=3, periodic=False, k=(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), pw=[(4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1), (0, 5.5, 0, 1), (-4, 4, 0, 1), (-5.5, 0, 0, 1), (-4, -4, 0, 1), (0, -5.5, 0, 1), (4, -4, 0, 1), (5.5, 0, 0, 1), (4, 4, 0, 1)] )
>>> myCurve.ep
NurbsCurveEP(u'openCurveShape2.ep[0:8]')
>>> myCurve.numEPs()
9
|
---|---|
Return type: | int |
Return the number of knots for this curve. If the number of knots cannot be determined then 0 is returned.
Return type: | int |
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.numKnots
Return the number of spans for this curve. If the number of spans cannot be determined then 0 is returned.
Return type: | int |
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.numSpans
Remove knot(s) from this curve. If removeAll is true then all of the knots except for the knot at the given parameter value will be removed. If removeAll is false then only the knot at the given parameter value will be removed.
Parameters : |
|
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.removeKnot
Undo is not currently supported for this method
This method reverse the curve direction.
Parameters : |
|
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.reverse
Undo is not currently supported for this method
Set the CV at the given index to the given point. The method updateCurve should be called to trigger changes in the curve.
Parameters : |
|
---|
Derived from api method maya.OpenMaya.MSpace.setCV
Set the CVs for this curve to the given points.
Parameters : |
|
---|
Derived from api method maya.OpenMaya.MSpace.setCVs
Set the given knot’s parameter value. Knot indices range from 0 to numKnots() - 1 .
Parameters : |
|
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.setKnot
This method is used to set the values of a contiguous group of knots of the curve. The range of knots to set is specified using the start and end index. The knots of index startIndex to endIndex inclusive will be set using the value in the double array.
Parameters : |
|
---|
Derived from api method maya.OpenMaya.MFnNurbsCurve.setKnots
This method returns the tangent at the given parameter value on the curve. The resulting tangent vector is normalized.
Parameters : |
|
---|---|
Return type: | Vector |
Derived from api method maya.OpenMaya.MSpace.tangent
This method signals that this curve has changed and needs to be recalculated. Derived from api method maya.OpenMaya.MFnNurbsCurve.updateCurve
Undo is not currently supported for this method