Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

curveOnSurface( string , [append=boolean], [degree=float], [knot=float], [periodic=boolean], [positionUV=[float, float]], [replace=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

curveOnSurface is undoable, NOT queryable, and NOT editable.

The curve-on-surface command creates a new curve-on-surface from a list of control vertices (CVs). A string is returned containing the pathname to the newly created curve-on-surface. You can replace an existing curve by using the "-r/replace" flag. You can append points to an existing curve-on-surface by using the "-a/append" flag. See also the curve command, which describes how to query curve attributes.

Return value

string- name of new curve-on-surface

Related

curve

Flags

append, degree, knot, periodic, positionUV, replace
Long name (short name) Argument types Properties
degree(d) float create
The degree of the new curve. Default is 3. Note that you need degree+1 curve points to create a visible curve span, eg. you must place 4 points for a degree 3 curve.
replace(r) boolean create
Replaces an entire existing curve. If you use this flag, you must specify the name of the curve to replace, at the end of the command. (See examples below.)
append(a) boolean create
Appends point(s) to the end of an existing curve. If you use this flag, you must specify the name of the curve to append to, at the end of the command. (See examples below.)
positionUV(uv) [float, float] createmultiuse
The uv position of a point.
knot(k) float createmultiuse
A knot value in a knot vector. One flag per knot value. There must be (numberOfPoints + degree - 1) knots and the knot vector must be non-decreasing.
periodic(per) boolean create
If on, creates a curve that is periodic. Default is off.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

cmds.curveOnSurface( 'surface1', d=3, uv=((0, 0),(0.3, 0.5), (0.5, 0.6), (0.9, 1.0)) )
# This command creates a curve-on-surface of degree three with
# four control vertices on surface1.

cmds.curveOnSurface( 'surface1', uv=((0, 0), (0.3, 0.5), (0.5, 0.6), (0.7, 0.8), (1.0, 1.0)), k=(0, 0, 0, 1, 2, 2, 2) )
# This command creates a curve-on-surface with five CVs
# and a knot vector, on surface1. Notice that there must be
# (number of CVs + degree - 1) knots and that the knot
# vector must be non-decreasing.

cmds.curveOnSurface( 'surface1', degree=3, per=True, uv=((0, 0), (0.2, 0.6), (0.4, 0.7), (0.9, 0.9), (0.0, 0.0), (0.2, 0.6), (0.4, 0.7)), k=(-2, -1, 0, 1, 2, 3, 4, 5, 6) )
# This command creates a closed (or "periodic") curve-on-surface with
# four distinct CVs. You must specify a knot vector when the
# "-per" flag is on. Notice that the first "degree" points
# are the same as the last "degree" points (ie. the first three
# points are the same as the last three points). Notice also
# that the knot spacing between the first "degree" knots must
# be the same as the spacing between the last "degree" knots
# (ie. the space between the 1st and 2nd knots is the same as
# the space between the 7th and 8th knots, and the space between
# the 2nd and 3rd knots is the same as the space between the
# 8th and 9th knots). There must be space between the first
# "degree" knots, unlike the previous example, where the first
# "degree" knots are the same.

cmds.curveOnSurface( 'surface1->curve1', append=True, uv=(1.0, 1.0) )
# This command appends a point to an existing curve-on-surface.
# Notice that the curve-on-surface is specified, not just the surface.

cmds.curveOnSurface( 'surface1->curve1', replace=True, d=1, uv=((1.0, 1.0), (2.0, 2.0)) )
# This command replaces an existing curve, surface1->curve1, with a
# new curve of degree 1 having the given points. Do not use this
# flag on a curve that is a result of a construction history operation.