pymel.core.modeling.roundConstantRadius¶
- roundConstantRadius(*args, **kwargs)¶
This command generates constant radius NURBS fillets and NURBS corner surfaces for matching edge pairs on NURBS surfaces. An edge pair is a matching pair of surface isoparms or trim edges. This command can handle more than one edge pair at a time. This command can also handle compoundedges, which is where an edge pair is composed of more than two surfaces. Use the -saand -sbflags in this case. The results from this command are three surface var groups plus the name of the new roundConstantRadius dependency node, if history was on. The 1st var group contains trimmed copies of the original surfaces. The 2nd var group contains the new NURBS fillet surfaces. The 3rd var group contains the new NURBS corners (if any). A simple example of an edge pair is an edge of a NURBS cube, where two faces of the cube meet. This command generates a NURBS fillet at the edge and trims back the faces. Another example is a NURBS cylinder with a planar trim surface cap. This command will create a NURBS fillet where the cap meets the the cylinder and will trim back the cap and the cylinder. Another example involves all 12 edges of a NURBS cube. NURBS fillets are created where any face meets another face. NURBS corners are created whenever 3 edges meet at a corner.
Flags:
Long Name / Short Name Argument Types Properties append / a bool If true, then an edge pair is being added to an existing round dependency node. Default is false. When this flag is true, an existing round dependency node must be specified. See example below. caching / cch bool constructionHistory / ch bool Turn the construction history on or off. frozen / fzn bool name / n unicode Sets the name of the newly-created node. If it contains namespace path, the new node will be created under the specified namespace; if the namespace does not exist, it will be created. nodeState / nds int object / o bool Create the result, or just the dependency node. radius / r float radiuss / rad float Use this flag to specify radius. This overrides the r/radiusflag. If only one radflag is used, then it is applied to all edge pairs. If more than one radflag is used, then the number of -radflags must equal the number of edge pairs. For example, for four edge pairs, zero, one or four radflags must be specified. side / s unicode, int Use this flag for compound edges. It replaces the sidea/sideb flags and is compatible with Python. The first argument must be either aor b. The same number of avalues as bvalues must be specified. If no sides are specified with the sideflag (or sidea/sideb flags), then the edges are assumed to be in pairs. See also examples below. For example, two faces of a cube meet at an edge pair. Suppose one of the faces is then split in two pieces at the middle of the edge, so that there is one face on side A, and two pieces on side B. In this case the flag combination: -side a1 -side b2 would be used. The edges must be specified in the corresponding order: // MEL roundConstantRadius -side a1 -side b2 isoA isoB1 isoB2; # Python maya.cmds.roundConstantRadius( ‘isoA’, ‘isoB1’, ‘isoB2’, side=[(a,1), (b,2)] ) sidea / sa int Use this flag for compound edges in conjunction with the following -sbflag. This flag is not intended for use from Python. Please see sideflag instead. The same number of -saflags as -sbflags must be specified. If no -sanor -sbflags are specified, then the edges are assumed to be in pairs. See also examples below. For example, two faces of a cube meet at an edge pair. Suppose one of the faces is then split in two pieces at the middle of the edge, so that there is one face on side A, and two pieces on side B. In this case, the flag combination: -sidea 1 -sideb 2 would be used. The edges must be specified in the corresponding order: roundConstantRadius -sidea 1 -sideb 2 isoA isoB1 isoB2; sideb / sb int Use this flag for compound edges in conjunction with the -saflag. See description for the -saflag. This flag is not intended for use from Python. Please see sideflag instead. Flag can have multiple arguments, passed either as a tuple or a list. tolerance / tol float Derived from mel command maya.cmds.roundConstantRadius
Example:
import pymel.core as pm # This rounds four edges of a cube with radius 0.9. Because a single # radius is specified, it is used for all edges. The edges must # be specified in matching pairs if no "sidea" or "sideb" flags # are used. # cube = pm.nurbsCube(w=5, lr=1, hr=1, d=3, ch=0) sides = pm.listRelatives( cube[0], c=True ) rnd = pm.roundConstantRadius( (sides[0] + ".v[0]"), (sides[2] + ".v[1]"), (sides[0] + ".u[1]"), (sides[4] + ".v[1]"), (sides[0] + ".v[1]"), (sides[3] + ".u[1]"), (sides[0] + ".u[0]"), (sides[5] + ".u[1]"), rad=0.9 ) # This adds a pair of isoparms to an existing round operation, # named $rnd[3] (from previous example) # pm.roundConstantRadius( (sides[3] + '.v[0]'), (sides[5] + '.v[1]'), rnd[3], append=True, rad=0.8 ) # This rounds 6 edges of a cube with different radius values. # The first four edges have radius 0.9 and the others have radius 1.1. # In this case the edges are specified in matching pairs # since no "sidea" or "sideb" flags are used. # cube = pm.nurbsCube( w=5, lr=1, hr=1, d=3, ch=0 ) sides = pm.listRelatives( cube[0], c=True ) pm.roundConstantRadius( (sides[0]+".v[0]"), (sides[2]+".v[1]"), (sides[0]+".u[1]"), (sides[4]+".v[1]"), (sides[0]+".v[1]"), (sides[3]+".u[1]"), (sides[0]+".u[0]"), (sides[5]+".u[1]"), (sides[3]+".v[0]"), (sides[5]+".v[1]"), (sides[2]+".u[1]"), (sides[4]+".u[0]"), rad=[0.9, 0.9, 0.9, 0.9, 1.1, 1.1] ) # This rounds a 2-to-1 compound edge. The sidea flag indicates # that there two edges on side A, and one on side B. # The edges must be specified in the corresponding order. # pln1 = pm.nurbsPlane(w=5, ch=0, ax=(0, 1, 0)) pln2 = pm.nurbsPlane( p=(2.5, 2.5, 1.25), ax=(1, 0, 0), w=2.5, lr=2, d=3, u=1, v=1, ch=0 ) pln3 = pm.nurbsPlane( p=(2.5, 2.5, -1.25), ax=(1, 0, 0), w=2.5, lr=2, d=3, u=1, v=1, ch=0 ) pln4 = pm.nurbsPlane( p=(0, 2.5, -2.5), ax=(0, 0, 1), w=5, lr=1, d=3, u=1, v=1, ch=0 ) pm.roundConstantRadius( (pln2[0]+'.v[0]'), (pln3[0]+'.v[0]'), (pln1[0]+'.u[1]'), (pln3[0]+'.u[1]'), (pln4[0]+'.u[1]'), rad=0.9, side=[('a',2), ('b', 1), ('a', 1), ('b', 1)] )