Couldn't find the G code producing software I wanted so I decided to write my own :whistling:

I want to draw lines and arcs with AutoCAD, give them thickness and elevation, export it as a dxf, then get an instant 2.5D toolpath that updates the moment I tweak the tool sizes.

I've been on it a week and by Jingo I'm nearly there.

I'm writing it around one part I want to make so it's probably full of bugs, but the code is well commented and lacks cleverness so I shouldn't need much DDT.

I read the part in as lines, arcs and circles. Gcode cuts lines, arcs and circles so that was a no-brainer. I stitch them together end to end forming lumps and pockets. Only entities having the same elevation and thickness will stitch. I can expand/contract lumps and pockets to get tool paths.

Zero thickness items draw but don't cut.
Exceptions to that are a zero thickness lines and arcs with a zero elevation. That is the block outline.
Lumps have positive thickness.
Pockets have negative thickness.

Thinking about imposing draft angles using the layer name, but I've managed to do it without layer names so far. Makes it less complicated to draw

I draw it on screen in either plan or dimetric projection, the space bar toggles between 3 views.

So far toolpath generation takes approx 0.2 seconds from the dxf file data and produces 3 distinct cut planes on my 3 level part. I think the delay is in the bubble sorting when I grid it out.

Just starting on the excess material removal...

I have already identified the excess as an easy to follow map so I can chop it out anyway I like. Thought maybe if I wrote about it here it might clear it in my head. There are so just many possibilities.

I want to cut down hill because my mill cuts much better down hill.

It whittles away an edge sweet as a nut so long as I don't go in beyond the tool radius.

It ploughs through and cuts a slot nicely, but it does like to have tool supporting metal on both sides of the cutter when I do that.

If I whittle it down from the outside, round and round and round I'll be wasting lots of time cutting air if the part is severely off centre.

OTOH, one or two laps is often all you need, especially at the botttom.

Thinking outlines, if I add laps cutting tool radius deep until the stock removal rate per lap drops away significantly, back up one level and start by clearing to that. I don't want to end up cutting a U shaped indent orbitally:nope:

Thinking on it, it's dead easy to get a close approximation on the remaining excess material area so that's my way to go. (See how this writing it down lark sharpens the dulled brain) :heehee:

I also need to identify paths through the block that could separate two islands then whittle them down independantly, that could save a lot of time consuming laps.

Brain unfogged, I'll do some more code tomorrow.

One thing I particularly want to try is a spiral down finishing cut, seems the best bet for a fine finish on my mill. Don't ask me why, just is

Robin