Difference between revisions of "Mesh to NURBS Converter"
From scripting
(Created page with " string $Objs[] = `ls-sl`; //Author Nick Pisca 0001d 2007 int $Objscount = size($Objs); if($Objscount == 0) { warning "Nothing Selected. Select some Polygons and try re-...") |
(No difference)
|
Latest revision as of 07:23, 22 April 2017
string $Objs[] = `ls-sl`; //Author Nick Pisca 0001d 2007 int $Objscount = size($Objs); if($Objscount == 0) { warning "Nothing Selected. Select some Polygons and try re-running."; } else { hide; select -cl; for($i=0;$i<size($Objs);$i++){ string $CurObj = $Objs[$i]; int $CurObjFaceCount[] = `polyEvaluate -f $CurObj`; for ($j=0;$j<$CurObjFaceCount[0];$j++) { string $StrAttr[] = `listAttr ($CurObj+".f["+$j+"]")`; float $Pt1[] = `pointPosition ($CurObj+"."+$StrAttr[0])`; float $Pt2[] = `pointPosition ($CurObj+"."+$StrAttr[4])`; float $Pt3[] = `pointPosition ($CurObj+"."+$StrAttr[8])`; surface -du 1 -dv 1 -ku 0 -ku 1 -kv 0 -kv 1 -p $Pt1[0] $Pt1[1] $Pt1[2] -p $Pt2[0] $Pt2[1] $Pt2[2] -p $Pt3[0] $Pt3[1] $Pt3[2] -p $Pt2[0] $Pt2[1] $Pt2[2] -n NewGeomConv ; currentTime $j; } int $Perc = 100*$i/size($Objs); print ("Percentage Completed. " + $Perc + "%\n"); } } select -r "NewGeomConv*"
More information on NURBS and polygons, read pages 43-49, 109-116 in YSYT.