Plotting a Spiral in .mel
This script creates a spiral. Play with the settings to get a bunch of different effects.
global proc makeOpenSpiral()
{
//tweakables
int $points = 180;
float $startRadius = 0;
float $endRadius = 2;
float $xOrigin = 0;
float $zOrigin = 0;
float $yOrigin = 0;
float $degrees = 1800;
//
float $increment = ($degrees/$points);
float $radiusIncrement = (($endRadius-$startRadius)/$points);
float $step;
float $radialStep;
string $cmd = “curve -d 3 “;
for ($i = 0; ($points+1) > $i; ++$i)
{
$step = $increment * $i;
$step = `deg_to_rad $step`;
$radialStep = ($startRadius + ($radiusIncrement * $i));
float $xPos = ($xOrigin + ($radialStep * `cos $step`));
float $zPos = ($zOrigin + ($radialStep * `sin $step`));
// float $yPos = `sin $i`;
// float $yPos = ($points / ($i+1));
// float $yPos = (($i+.01)*.01);
float $yPos = $yOrigin;
$cmd = ($cmd + ” -p ” + $xPos + ” ” + $yPos + ” ” + $zPos);
}
eval $cmd;
}
