Rewriting gcodepreview with Python

In the re-writing, the template/sample file was re-made:

but it is so prosaically simple and naïve, that the matching DXF:

when imported into a typical CAM tool:

cannot be readily assigned toolpaths to make the diagonal/sloping cut.

A reasonable approximation could be made by deciding how many segments one would be willing to cut/assign toolpaths for, reducing the line by that number:

Done

and duplicating and aligning and assigning toolpaths to cut each copy to the desired depth:

and then assign each line segment after the first with a suitable toolpath:

incrementing as we go along:

until we arrive at:

which once cut may be easily cleaned up with a suitable tool.