type to search

How to Create Geometry on Nurbs Surface Isoparms in Maya

Asked by

I want to write a tool in MEL that creates a predefined piece of geometry (polygon) along the isoparms of a nurb? (think thorns on a branch. thorns are polygons, and branch is nurbs).

I've been looking at the MEL documentation about Nurbs and like most other parts of it, it is pretty cryptic to get the data you want and how to use it. I can see the data it stores such as the attributes for the isoparms (eg: nurbs1.v[1] or nurbs1.u[2]) but I cannot figure out how to utilize the data.

Any help would be great.

or Cancel

1 answer


mr grumpy [ Editor ]

The pointOnSurface command will give you position/normal/tangent vectors, given a parameter on the surface. e.g.

    string $node = "nurbsSphereShape1";
    float $min = `getAttr ($node+".minValueU")`;
    float $max = `getAttr ($node+".maxValueU")`;
    int $i, $num = 50;
    for ($i=0; $i<$num; $i++) {
        float $u = ((float)$i)/($num-1);
        $u = $min+$u*($max-$min);
        float $p[] = `pointOnSurface -p -u $u -v 0 $node`;
        spaceLocator -p $p[0] $p[1] $p[2];
or Cancel

Your answer

You need to join VFX Overflow to complete this action, click here to do so.