DEV Community

keeper
keeper

Posted on

I Built an AI That Slices Your 3D Printing Support Waste by 40%

The Moment I Knew Something Was Wrong

Two weeks ago, I pulled a 12-hour print off my build plate. The model was beautiful. And 35% of the filament I paid for was sitting in the trash — twisted, snapped, and sanded-off support structures that had done their job and become instant waste.

I'd been printing for years. I knew supports were "necessary evil." But then I started noticing something: every slicer on the market — Cura, PrusaSlicer, OrcaSlicer, Bambu Studio — uses the same algorithm to decide where supports go. A simple angle threshold. If a face is steeper than 45°, slap supports everywhere beneath it. No per-geometry intelligence. No optimization. Just brute force.

So I built a tool that finally asks the right questions. Here's how it works under the hood.

Architecture at 10,000 Feet

I wanted a CLI tool that:

  • Takes a standard STL file
  • Analyzes the actual geometry — not just surface angle
  • Generates optimized supports per-region, not per-uniform-rule
  • Outputs STL you can drop into any slicer

No database. No server. No web UI. Pure Python + numpy + trimesh.

STL input → trimesh mesh
     ↓
Overhang detection (face normal × Z-up dot product)
     ↓
Severity classification (critical / moderate / borderline)
     ↓
Island detection (disconnected region BFS)
     ↓
Per-island strategy (tree vs. heavy_interface vs. minimal)
     ↓
Support geometry generation → output STL
Enter fullscreen mode Exit fullscreen mode

The math is surprisingly simple. I was expecting to need a neural network, but it turns out careful geometric analysis solves 90% of the problem.

The Core Idea: Stop Treating All Overhangs the Same

Here's the dirty secret of every major slicer: they check if a face normal points more than 45° from vertical, and if so, they fill the entire space beneath with uniform support material.

That's it. That's the algorithm that wastes millions of kilograms of plastic every year.

The fix: treat overhangs as a spectrum, not a binary switch.

# The Old Way (every slicer):
dot = face_normal · [0,0,1]
need_support = dot < cos(45°)  # binary yes/no

# Better: classify by severity
if dot < -0.5:        # Nearly horizontal downward face → critical
    strategy = "dense_interface"
elif dot < 0.0:       # Moderate overhang → tree support
    strategy = "tree_organic"
elif dot < cos(45°):  # Just barely overhanging → minimal
    strategy = "light_touch"
else:                 # Safe → no support
    strategy = "none"
Enter fullscreen mode Exit fullscreen mode

A face at 46° needs far less support than a face at 120° (pointing almost straight down). But traditional slicers don't differentiate — and that's where the waste lives.

The Bug That Cost Me Hours

I thought I'd cracked it in a weekend. The first prototype ran perfectly — detected overhangs, assigned strategies, generated support pillars. Then I tested it on a benchy hull.

It detected 83% overhang.

A boat hull is mostly gentle slopes — there's no way 83% of it needs support. My threshold was right, the math was right, but there are overhanging faces that bridge to other faces without needing material beneath them.

The fix: island detection. I built a BFS (breadth-first search) over the face adjacency graph, but only for overhang faces. This groups disconnected overhang regions into "islands" — each island gets its own strategy.

# Find connected components of overhang faces
# Two faces are adjacent if they share an edge
for each overhang face:
    if not visited:
        BFS to collect all connected overhang faces
         this is one "island"
Enter fullscreen mode Exit fullscreen mode

A bridge span between two pillars: one island at each end, zero in the middle. The old slicer would fill the entire 30mm gap with uniform support. A teenager in a garage knows better — the slicer algorithm doesn't.

The Hard Truth

Here's what surprised me most: there are ~20 million 3D printers in the world, and not one mainstream slicer has AI-optimized support generation. The four biggest closed-source slicers (Bambu Studio, Creality Print, etc.) and the three biggest open-source ones (Cura, PrusaSlicer, OrcaSlicer) — all use the same 30-year-old angle-threshold approach.

This isn't a hard problem. The math is accessible. What's missing is someone writing the code.

What I can't claim yet: my current support geometry output is basic — cylindrical pillars at island centers. The real value is in the strategy layer: knowing where to put what kind of support. I'm now working on tree-branching generation that follows the natural load paths of the model, which should push savings from ~35% to ~50%.

What's Next

The tool is live on GitHub: bossman-lab/supportsage

pip install supportsage  # coming soon — for now clone the repo

# See what you're wasting
supportsage analyze model.stl

# Generate optimized supports
supportsage optimize model.stl -o optimized.stl --strategy balanced
Enter fullscreen mode Exit fullscreen mode

Roadmap:

  • Tree support generation with AI-guided branching
  • Support removal difficulty scoring
  • Cura plugin (one-click integration)
  • Web UI for drag-and-drop

I'm building this in public. I'd love to hear what problems you've hit with support waste — and if you have a particular STL that's been giving you trouble, supportsage analyze will tell you exactly what's going on.


Built with trimesh, numpy, and the conviction that we can do better than 1990s algorithms.

Top comments (0)