Looks like he is using 3 tools, Normal Sized cutter a 1/2 cutter and a 1/8 cutter (at least from what I can figure)
#1 ; #3 ; #4 all look like toold offsets for them to begin at EG DX-RailWidth (Tool Dimension Included)
Personally I'd code it Like this in Zilog
L Tooldiam1 = 10
L Tooldiam2 = 8
L Tooldiam3 = 4
L BorderWidth = 50
then when I am calling the G0
G0 X= DX-BorderWidth+Tooldiam1
(Now thats easier for a layman to understand, if your language doesn't allow words as variables you could use # numbers)
I agree with the Loops (As I am not familiar with the language you are using, I'll just say what I would do for something like this, more like an algorithm)
Now there really is an easier way to do this than using a NCommand (I'd Use a G1)
L Loopvalue = BorderWidth+(ToolDiam1/2)
.StartLoop
L LoopValue = LoopValue + ToolDiam1/2 (I divide by 2 as it gives a cleaner cut takes longer though)
G0 X= BorderWidth + (Tooldiam1/2) Y=LoopValue Z = Depth T = 101?
G1 X= DX-(Tooldiam1/2)
If LoopValue>= DY-ToolDiam1 then Goto endloop
Goto StartLoop
.EndLoop
//The fiddly bit would be to clean up that final liune with a routing after the program is done
G0 X=BorderWidth+(ToolDiam1/2) Y=DY-BorderWidth-(Tooldiam1/2)
G1 X=BorderWidth - (Tooldiam1/2)
That would be the start of the program at least I would think so...
Then if you are wanting to be really fancy you'd run another router down the line to make Tongue&Grooves within the cleaned area as well (Thats slightly more complicated because you have to allow the T&G tolerance adjustment within the looping frame so you have to first calculate the differences and then run them with an adjustment field to allow it to fit in any size door (EG I want my T&G to be 80mm apart but I'll Accept the value you can fit in the area, when I did that I found the T+G was never more than 1/8 difference between actual and desired and always fitted square.) |