I have been playing with using PythonSCAD and OpenSCAD to design laser cut parts, but I always found fiddling with the different line colors in LaserGRBL and LightBurn's interfaces to be annoying and somewhat error-prone. To solve that, I developed a machine config, that allows me to set and save persistent information (like kerf, and material specific cut and engrave settings). In addition, I incorporated a colormap modeled after LightBurn's full color table.
Guenther Sohler also added the ability to trigger the export directly in the code, with a call to model.export(filename). With that I have been able to generate the gcode for a project that uses two different materials, and wildly different laser parameters, but still be able to view the parts in the preview window.
Enjoy, and please reach out if you find any bugs or suggestions.
EBo --