Learning to layout simple code ?

More
01 Mar 2010 23:16 #2146 by grey1beard
Well, solved that one by paying more attention to the nested brackets :)
However, though AXIS now accepts the lines I've written, the gui shows a pretty weird plot, and not what I was expecting.

The four lines plot the expected parabolic curve, cutting in ccw direction, ramping down.
I then move over to the right, then plot a mirror image back towards the first, cutting cw, last four lines.
This is where it goes wrong.
My code for a clockwise cut produces garbage, so I'd be gratefull for some help again.
John

#1=50 (scale)
#2=[0.05*#1] (sh)
#3=[400] (feed)
#6=0
#7=0.36

g00 x[0] y[0] z#2
g00 x[0] y[0.015*#1]
g01 x[0] y[0.015*#1] z[-0.015*SQRT[3]*#1] F#3

(parabolic cut starts here)
O100 WHILE [#6 LE 0.18]
g01 x[#6*#1] y2.006173*[#6**2]+0.015]*#1] z[-1*SQRT[3]*[[2.006173*[#6**2]+0.015]*#1 F#3
#6=[#6+0.009]
O100 ENDWHILE

(move to cut mirror image)
g00 x[0.18*#1] y[0.08*#1] z#2
g00 x[0.36*#1] y[0.015*#1]
g01 x[0.36*#1] y[0.015*#1] z[-0.015*SQRT[3]*#1] F#3

(goes wrong here on)
O100 WHILE [#7 GE 0.18]
g01 x[#7*#1] y2.006173*[[#7-0.36]**2]+0.015]*#1] z[-1*SQRT[3]*[[2.006173*[[#7-0.36]**2]+0.015]*#1 F#3
#7=[#7-0.009]
O100 ENDWHILE

Please Log in or Create an account to join the conversation.

More
02 Mar 2010 20:57 #2154 by grey1beard
Well, I've managed to get the best of three with AXIS, and now have a parabolic curve meeting its mirror image in the centre :D
So at least the bottom serif is now done, but not quite dusted.

One thing I've noticed, and here's a small bit of code to illustrate the point -
#1=0
O100 WHILE [#1 LE 0.18]
g01 x[#1] y[0.5*#1]
#1=[#1+0.009]
O100 ENDWHILE

Running this in the AXIS gui, the curve only goes from x0 y0 to x0.171 y0.0855 , rather than x0.18 y0.09.

Is this correct ?
I assumed the "less than or equal to" would finish when #1 reached 0.18 but I've found that I need to add a line of code to get the curve to where I expect it to finish.

Any comments ?
John

Please Log in or Create an account to join the conversation.

Time to create page: 0.051 seconds
Powered by Kunena Forum