Grasshoper PY3 Script for Generating Laser Cuts

I vibe-coded this Py3 script which automatically turns your geometry into flat 2D curves for which to laser cut.

Lasercut Script Generator.gh (16.9 KB)

Hi Hannes

Great job putting this together. Vibe-coding a full Python 3 script for automation and your logic for coercing different geometry types and setting up the initial shelf-packing algorithm is clever for a first pass.

There are just a couple of fundamental bottlenecks to keep in mind as you develop this further. First, relying purely on bounding boxes for your shelf-packing means irregular shapes (like “L” or “C” profiles) won’t interlock, which can waste material compared to true-shape nesting. Second, iterating through every single face for area calculations and running the 5-degree rotation loop 18 times per part becomes incredibly computationally taxing if you feed it dense meshes or hundreds of parts.

Finally, assuming the largest face is always the cut profile can sometimes backfire on thick, deep objects where the side walls actually have more surface area than the top.

Issue Risk Fix
In-place geometry mutation Silent corruption Store rotation flag, apply at output
5° sweep resolution more material use Two-pass coarse + fine
Shelf picks first fit, not best Sheet count inflation Min-waste selection loop
Mixed coordinate spaces in curve extraction Latent / fallback only Use flat_brep_3d for both methods
GetBoundingBox(xform) rewrite Performance only Keep it

That being said, this is a working foundation for ordinary sheets,

Keep experimenting you are definitely on the right track!

Thanks, yeah definitely a work in progress. Will have to look into these issues deeper.