%
(Program to cut a ellipse pattern )
(parameter #100 is the major axis and #101 is minor axis)
(we'l be approximating an ellipse using g1 commands, make)
(parameter #103 larger and we'll get a closer approx)
(zero the cutter at the center of major axis, x is major axis)
g17 g20 g40 g49 g54 g80 g90 g94
g10 l2 p1 x0 y0 z0 (make axis set 1 be absolute)
t1 m6 (tellit we're using a tool, recommend 1/4 inche endmill)
f100
g0 x0 y0 z0
#100 = 2.00 (major axis)
#101 = .60 (minor axis)
#102 = 3 (the number of passes each .010 inches deep)
#103 = 80
#104 = 0
g0 z +1.000
g0 x -[#100] (travel to minus the major axis)
o100 while [#104 lt #102] (count the depth)
#104 = [#104 + 1]
g1 f50 z - [#104 * 0.080] (start with a plunge cut here)
#105 = [- #100]
#106 = 0
o102 while [#105 lt 0] (do positive y negative x)
#106 = [#106 + 1]
#105 = [-#100 + #106 * [#100 / #103]]
x [#105] y [[#101 / #100] * sqrt [[#100 * #100] - [#105 * #105]]]
o102 endwhile
#105 = 0
#106 = 0
o103 while [#105 lt #100] (do positive y positive x)
#106 = [#106 + 1]
#105 = [[#100 / #103 ] * #106]
x [#105] y [[#101 / #100] * sqrt [[#100 * #100] - [#105 * #105]]]
o103 endwhile
#106 = 0
o104 while [#105 gt 0] (do negative y positive x)
#106 = [#106 + 1]
#105 = [#100 - [#100 / #103 ] * #106]
x [#105] y - [[#101 / #100] * sqrt [[#100 * #100] - [#105 * #105]]]
o104 endwhile
#106 = 0
o105 while [#105 gt [-#100]] (do negative y negative x)
#106 = [#106 + 1]
#105 = -[[#100 / #103 ] * #106]
x [#105] y - [[#101 / #100] * sqrt [[#100 * #100] - [#105 * #105]]]
o105 endwhile
o100 endwhile
g1 z +1.00
g0 x0 y0
g0 z0
m2
%