ger21:
Thanks for that. I see it's a lot more complicated than I thought and that a lot of planning went into your code. This perplexes me quite a bit because, being that I'm just learning, I'm reading a lot of different books, and so far, I gathered that the tool compensation is something that is used to quickly make changes to a program to accommodate, for, say the fact that you may only have a 3/8 cutter instead of a 1/4 cutter or maybe something as small as a worn tool. I imply from this that cutter compensation should work (with obvious limits) on almost anything. Far cry from the tedious planning you have applied in making a complete program around tool compensation.
I can see that the compensation works on your program but what of the real life situation such as mine where I take an otherwise properly functioning program and add cutter compensation for a perfectly good reason i.e. to add some roughing cuts to the path??
This is why I am more interested in figuring what is wrong with my simple program rather than generating something new that actually works.
BTW
Using your ideas and to see what could be done with my code, I added some simple code to take the tool on a little tour well outside the part and back again. I added only .020 compensation to tool #1 and I can see that it goes around the touring lines with the offset visible just fine. SO there is something in your "rule" about moving more than the cutter diameter. Lesson learned there.
BUT the path is still screwed up in the bottom left corner where it does not seem to go far enough in -X to clear the original path. This screwup is far remote from any of the lead in/out code. I can't figure out why it messes that up.
Still perplexed about the usability of the cutter compensation function for what (I thought) it was intended.
I've attached the modified file. Try it with 0.0 and then .020 tool #1 compensation. Look in the bottom left corner, left side and top left corner.
I'm sure I'm getting poor old Mach confused somehow. I'd like to know where.
(not sure how to attach a screen shot).
Thanks for you help in getting me to understand this.
Sage