This is an old program I ran on my mill. I don't use cutter comp on the mill as the cam calculates for the tool offset.
But to try and better understand where and how cutter comp was goofing up I started trying as many programs as I could.
The picture below is an interesting example of how the arc in the profile should have been trimmed to stay within the starting area.
The profile should never cross its self. Although there is times when you may want to cross a profile like in a figure eight it should not be possible to do so using left or right cutter comp.
It should only recreate offset periphery geometries for the first area that can be painted "Flooded" with a brush "Tool" the size of the current active tool.
The specification of the G4* offset word would determine in witch bounds of the area to fill.
A determination of open ended and area type geometries would need to be determined.
Geometry specifying a G4* word and which does not intersect itself would be considered open ended.
Geometry intersecting itself without the G4* word would be a center line tool path no offset needed.
Geometry intersecting itself with the G4* word would need to be "Flooded" like stated above.
If we can get that working in the X Y plane then maybe we can move on two all three.