PDA

View Full Version : Helix.ls Crashing in LW8



riki
05-21-2004, 06:58 AM
Art Howe's Helix.ls crashes in Modeler, when you boot Modeler for the first time and run the script in Layer 1. However it doesn't seem to be a problem in Layer 2. Any suggestions on how to fix it?


// Create a Helix Coil curve in a layer #2, and railclone() an object in

// layer #1 along it

// 02.29.96

// Bob Hood

// Updated 06.08.01 Art Howe



@warnings

@version 2.3

@script modeler



main

{

current = lyrfg();

(scratch) = lyrempty();



if(!scratch)

{

error("<br>You must have at least one empty layer to perform this operation.");

return;

}



lyrsetfg(scratch);



editbegin();



l = <.5,0,0>;

p[1] = addpoint(l);



radius = sqrt((l.x * l.x) + (l.z * l.z));

degrees = 30;



for(x = 2;x <= 12;x++)

{

l.y += .1; // 10 cm == .1 meter



l.x = radius * cos(rad(degrees));

l.z = radius * sin(rad(degrees));



p[x] = addpoint(l);



degrees += 30;

}



addcurve(p);



editend();



lyrsetfg(current); // again, assumptions being made about the state

lyrsetbg(scratch); // of layers that probably shouldn't be



railclone(12,KNOTS,"o"); // 12 segments, "o"riented

}