aa_simpleSolid
/*
***************************************************************************
This is a simple utility function that takes a curve and extrudes it, makes
a planar surface and duplicates the planar surface with an offset. All of these
actions combine to make what appears to be a solid. The function also groups
all of the surfaces together in a single node and returns the node name.
aa_simpleSolid(string $spline, float $height, string $axis)
The function takes the name of the spline to create a solid from, the height of
solid and the axis to extrude along.
example:
curve -d 3 -p 0 0 0 -p 10 0 0 -p 0 0 20 -p 0 0 10 -n "testCurve";
closeCurve -ch 1 -ps 1 -rpo 1 -bb 0.5 -bki 0 -p 0.1 "testCurve";
aa_simpleSolid("testCurve",10,"y");
copyright
Cory Clarke cory@nthd.org
***************************************************************************
*/
global proc string aa_slab(string $spline, float $height, string $axis){
//close the curve to make sure it is ok
//closeCurve -ch 1 -ps 1 -rpo 1 -bb 0.5 -bki 0 -p 0.1 "curve1";
//create primary node
$group = `group -em`;
//make a planar surface
$bottom = `planarSrf -ch 0 -d 3 -ko 0 -tol 0.01 -rn 0 -po 0 $spline`;
//group planar surface with main node
parent $bottom[0] $group;
//determine extrusion direction and height
switch($axis){
case "x":
$x = 1;
$y = 0;
$z = 0;
$movex = $height;
$movey = 0;
$movez = 0;
break;
case "y":
$y = 1;
$x = 0;
$z = 0;
$movex = 0;
$movey = $height;
$movez = 0;
break;
case "z":
$z = 1;
$y = 0;
$x = 0;
$movex = 0;
$movey = 0;
$movez = $height;
break;
}
//extrude
$extrude = `extrude -ch false -rn false -po 0 -et 0 -upn 0 -d $x $y $z -length $height -rotation 0 -scale 1 -dl 3 $spline`;
//group extrusion with main node
parent $extrude[0] $group;
//duplication bottom to create top
$top = `duplicate $bottom[0]`;
//move it
move -r $movex $movey $movez $top[0];
select $group;
return $group;
}
print("aa_simplesolid....loaded\n");
There are no threads for this page.
Be the first to start a new thread.