new feature release: laser cutter colormaps, persistent machine configuration, and direct gcode export

11 views
Skip to first unread message

John David

unread,
Feb 28, 2026, 8:21:55 AMFeb 28
to PythonSCAD
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.

The attached example shows a simple engraved and cut tag.  The full code for this is in the repositories examples <https://github.com/pythonscad/pythonscad/blob/master/examples/GCode/colormap_gcode_colormapped.py>

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 --

Screenshot_colormap_gcode.png

William Adams

unread,
Mar 3, 2026, 7:50:17 AMMar 3
to PythonSCAD
Nice!

I've been working on this sort of thing as a module which one can load at:


see:


It would be nice to coordinate the colour usages at least --- the last time I asked after this:


William

John David

unread,
Mar 3, 2026, 12:29:08 PMMar 3
to William Adams, PythonSCAD
While I modeled LightBurn's color table initially, we can set up any table you might want. You can also attach the individual power/feeds to each.  I am not sure how it would work for extractive (mill/router) processes.  We could kick some ideas around, but the ExportGCode polygons/paths need to have colors to process.  I guess you would want to (pre)view the part, but also the tool-paths (which can have the required tool/colors).  I can see modeling the shape of each tool, and sweeping its paths. The export GCode would take the paths, not the machined part.

BTW, I LOL'ed reading Ray Kholodovsky's reply that started by referencing XKCD's Standards comic (927 ;-)

  EBo --

--
You received this message because you are subscribed to the Google Groups "PythonSCAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonscad+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pythonscad/258ec323-ce3b-489e-876d-9bea65da4860n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Adams

unread,
Mar 7, 2026, 10:23:25 AMMar 7
to PythonSCAD
I hope that it's okay that I take this conversation to direct/personal e-mail and tag in Guenther --- if there's someone else who should be included, let me know there.

William

John David

unread,
Mar 7, 2026, 12:16:02 PMMar 7
to William Adams, PythonSCAD
I am good with direct emails.  I prefer them actually -- until it is appropriate to make public announcements.

Reply all
Reply to author
Forward
0 new messages