// This script was created to create a spiral shaped curve. // // Directions // // To create realistic shocks: // - loft around the curve // - do NOT delete history on the lofted surface // - use a lattice to deform the curve // - the lofted surface should deform realisticly // // // sh = spiral height // nl = number of loops // lh = loop height // sr = spiral radius global proc jgSpiralCurve(float $sh, int $nl, float $sr) { float $lh = $sh/$nl; string $curveRoot = "curve -d 3"; int $numCvs = ($nl*8); for($cv = 0; $cv <= ($numCvs); $cv++) { float $rad = `deg_to_rad((45 * $cv))`; float $offset = ($cv*($lh/8)); string $tmp = ("-p " + (`sin($rad)`*$sr) + " " + $offset + " " + (`cos($rad)`*$sr) + " "); $curveRoot = ($curveRoot + $tmp); } eval $curveRoot; } global proc jgSpiral() { if (`window -ex jgSpiralCurveUI`) deleteUI jgSpiralCurveUI; window -t "Jason Gill - Spiral Curve - www.3dgill.com" -wh 400 135 -s false jgSpiralCurveUI; columnLayout -cal "center"; rowColumnLayout -nc 2 -cw 1 20 -cw 2 360; text -l ""; floatSliderGrp -label "Height:" -field true -min 1 -max 100.0 -fmn 0.0001 -fmx 1000 -v 10 -cw3 100 60 120 -ct3 "right" "left" "left" heightSliderGrp; text -l ""; floatSliderGrp -label "Radius:" -field true -min 1 -max 100.0 -fmn 0.0001 -fmx 1000 -v 1 -cw3 100 60 120 -ct3 "right" "left" "left" radiusSliderGrp; text -l ""; intSliderGrp -label "Number of Loops:" -field true -min 1 -max 100 -fmn 1 -fmx 1000 -v 10 -cw3 100 60 120 -ct3 "right" "left" "left" loopSliderGrp; setParent ..; columnLayout -cal "center"; separator -w 400 -h 10; setParent ..; rowLayout -nc 2 -cw2 50 300 -ct2 "both" "both"; text -l ""; button -l "Create Spiral" -w 250 -al "center" -c "jgSpiralCurve `floatSliderGrp -q -v heightSliderGrp` `intSliderGrp -q -v loopSliderGrp` `floatSliderGrp -q -v radiusSliderGrp`"; setParent ..; setParent ..; showWindow; }