global proc make_table (float $sides, float $size, float $height, float $thick) { select -all ; delete; // make the table_top _ by using a cylinder the surface is closed and it has thickness. cylinder -p 0 0 0 -ax 0 0 1 -ssw 0 -esw 360 -r $size -hr ($thick/$size) -d 1 -ut 0 -s $sides -nsp 1; nurbsPrimitiveCap 2 0 0; // move the table top so that it is at the correct height for the legs to be inserted undernieth it. move -r 0 0 $height ; // create the first table leg and move it into place. nurbsCube -p 0 0 0 -ax 0 0 1 -w 1 -lr 1 -hr $height -d 1 -u 1 -v 1 -ch 0 -n "table_leg_0"; move -r $size 0 ($height/2) ; // scale it so that it has correct proportions. scale -r $thick $thick 1; // duplicate the legs at each one of the corners. for($counter=1; $counter<$sides; $counter++) { duplicate -rr -n("table_leg_" + $counter); rotate -r 0 0 (360/$sides) -p 0 0 0; }; select -cl; }; //make_table 5 85 40 4;