Lattice Structures
Corkscrew
{
sphere -n ("sphereA_" + $y) -p 3 $y 3;
sphere -n ("sphereB_" + $y) -p -3 $y 3;
sphere -n ("sphereC_" + $y) -p 3 $y -3;
sphere -n ("sphereD_" + $y) -p -3 $y -3;
cylinder -n ("cylA_" + $y) -hr 17 -r 0.25
-p 0 $y 3;
cylinder -n ("cylB_" + $y) -hr 17 -r 0.25 -p 0 $y -3;
cylinder -n ("cylC_" + $y) -hr 17 -r 0.25 -p 3 $y 0 -ax
0 0 1;
cylinder -n ("cylD_" + $y) -hr 17 -r 0.25 -p -3 $y 0 -ax
0 0 1;
select -r ("sphereA_" + $y) ("sphereB_"
+ $y) ("sphereC_" + $y) ("sphereD_" + $y) ("cylA_"
+ $y) ("cylB_" + $y) ("cylC_" + $y) ("cylD_"
+ $y);
group -n ("group_" + $y);
}
for($i = 0; $i <50; $i++)
{
shorty($i);
rotate -r -os 0 ($i*10) 0;
}
Random Twist
{
sphere -n ("sphereA_" + $y) -p 3 $y 3;
sphere -n ("sphereB_" + $y) -p -3 $y 3;
sphere -n ("sphereC_" + $y) -p 3 $y -3;
sphere -n ("sphereD_" + $y) -p -3 $y -3;
cylinder -n ("cylA_" + $y) -hr 17 -r 0.25
-p 0 $y 3;
cylinder -n ("cylB_" + $y) -hr 17 -r 0.25 -p 0 $y -3;
cylinder -n ("cylC_" + $y) -hr 17 -r 0.25 -p 3 $y 0 -ax
0 0 1;
cylinder -n ("cylD_" + $y) -hr 17 -r 0.25 -p -3 $y 0 -ax
0 0 1;
select -r ("sphereA_" + $y) ("sphereB_"
+ $y) ("sphereC_" + $y) ("sphereD_" + $y) ("cylA_"
+ $y) ("cylB_" + $y) ("cylC_" + $y) ("cylD_"
+ $y);
group -n ("group_" + $y);
}
for($i = 0; $i <30; $i++)
{
float $random = rand(10);
shorty($i*3);
rotate -r -os 0 ($i*$random) 0;
}
Random Snake Lattice
proc shorty(float $y)
{
sphere -n ("sphereA_" + $y) -p 3 $y 3;
sphere -n ("sphereB_" + $y) -p -3 $y 3;
sphere -n ("sphereC_" + $y) -p 3 $y -3;
sphere -n ("sphereD_" + $y) -p -3 $y -3;
cylinder -n ("cylA_" + $y)
-hr 17 -r 0.25 -p 0 $y 3;
cylinder -n ("cylB_" + $y) -hr 17 -r 0.25 -p 0 $y -3;
cylinder -n ("cylC_" + $y) -hr 17 -r 0.25 -p 3 $y 0 -ax
0 0 1;
cylinder -n ("cylD_" + $y) -hr 17 -r 0.25 -p -3 $y 0 -ax
0 0 1;
select -r ("sphereA_" +
$y) ("sphereB_" + $y) ("sphereC_" + $y) ("sphereD_"
+ $y) ("cylA_" + $y) ("cylB_" + $y) ("cylC_"
+ $y) ("cylD_" + $y);
group -n ("group_" + $y);
}
shorty(1);
for($i = 0; $i <90; $i++)
{
float $random_x = rand(-10,10);
float $random_y = rand(-10,10);
float $random_z = rand(-10,10);
duplicate;
rotate -r -os ($i+$random_x) ($i+$random_y) ($i+$random_z);
move -r -os ($i+$random_x) 1 ($i+$random_z);
}
Random Snake Lattice Interface
//Create Singular Component of Lattice Snake
proc shorty(float $y)
{
sphere -n ("sphereA_" + $y) -p 3 $y 3;
sphere -n ("sphereB_" + $y) -p -3 $y 3;
sphere -n ("sphereC_" + $y) -p 3 $y -3;
sphere -n ("sphereD_" + $y) -p -3 $y -3;
cylinder -n ("cylA_" + $y) -hr 17 -r
0.25 -p 0 $y 3;
cylinder -n ("cylB_" + $y) -hr 17 -r 0.25 -p 0 $y -3;
cylinder -n ("cylC_" + $y) -hr 17 -r 0.25 -p 3 $y 0 -ax
0 0 1;
cylinder -n ("cylD_" + $y) -hr 17 -r 0.25 -p -3 $y 0 -ax
0 0 1;
select -r ("sphereA_" + $y) ("sphereB_"
+ $y) ("sphereC_" + $y) ("sphereD_" + $y) ("cylA_"
+ $y) ("cylB_" + $y) ("cylC_" + $y) ("cylD_"
+ $y);
group -n ("group_" + $y);
}
//Create Lattice Snake
proc runShorty(){
shorty(1);
for($i = 0; $i <90; $i++)
{
float $random_x = rand(-10,10);
float $random_y = rand(-10,10);
float $random_z = rand(-10,10);
duplicate;
rotate -r -os ($i+$random_x) ($i+$random_y) ($i+$random_z);
move -r -os ($i+$random_x) 1 ($i+$random_z);
}
}
//Create Interface to Make Lattice Snake and Clear
Window
window -title "runShorty";
columnLayout;
button
-label "Make Snake"
-command "runShorty()"
-bgc 0.8 0.8 1.0
-w 100;
button
-label "Clear All"
-command "select -all; delete"
-bgc 1.0 0.2 0.2
-w 100;
showWindow;
|