Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- o105 sub
- (makes torpedo oval slot from X1,Y1 to X2,Y2)
- (parameters)
- (#1 = X1)
- (#2 = Y1)
- (#3 = X2)
- (#4 = Y2)
- (#5 = slot width)
- (#6 = start depth)
- (#7 = end depth)
- (#8 = depth of cut)
- (globals used)
- (#33 = tool diameter - until this is adapted for proper g41 TC)
- (#35 = safety height)
- #10 = [#3-#1] (x2-x1)
- #11 = [#4-#2] (y2-y1)
- (normalise vector)
- #12 = SQRT[[#10*#10]+[#11*#11]]
- #10 = [#10/#12]
- #11 = [#11/#12]
- (scale vector to slot width)
- #13 = [[#5 - #33]/2] (slot radius - tool radius)
- #10 = [#10*#13]
- #11 = [#11*#13]
- g17 (set XY plane for arcs)
- g40 (turn off TC for now - TODO fix for g41)
- (start at X1,Y1 + right vector {yd,-xd})
- g0 X[#1+#11] Y[#2-#10] Z#35
- #20 = #6 (current depth)
- o115 while [#20 gt #7]
- g2 x[#1-#11] y[#2+#10] i[0-#11] j[0+#10] z#20
- g1 x[#3-#11] y[#4+#10]
- g2 x[#3+#11] y[#4-#10] i[0+#11] j[0-#10]
- g1 x[#1+#11] y[#2-#10]
- #20 = [#20 - #8]
- o115 endwhile
- (last circuit at end depth)
- g2 x[#1-#11] y[#2+#10] i[0-#11] j[0+#10] z#7
- g1 x[#3-#11] y[#4+#10]
- g2 x[#3+#11] y[#4-#10] i[0+#11] j[0-#10]
- g1 x[#1+#11] y[#2-#10]
- g2 x[#1-#11] y[#2+#10] i[0-#11] j[0+#10]
- g0 x#1 y#2 (move clear for extraction)
- g0 z#35 (extract to safety height)
- o105 endsub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement