DEV Community

keeper
keeper

Posted on

I Turned Three 3D Printing Tools Into One — CLI & Web, Both Work

I'd written three separate 3D printing tools, each with its own niche:

  • SupportSage — AI-optimized support structure generation (tree + pillar)
  • FilamentDB — open-source filament parameter database (nozzle/bed temps, etc.)
  • Printsight — print quality inspection from a photo (stringing, layer issues, warping)

Each tool worked fine on its own. But you had to remember three commands, three install methods, and three completely different output formats. The fragmentation was loud.

Someone asked: "Could you integrate them? And make it work in the web UI too?"

The Minimal Integration Approach

I wanted to keep the three repos independent — no hard dependencies between them. So I added two optional flags as "soft links":

--filament: Auto-lookup print parameters during analysis

# Analyze + show Bambu Lab PLA Basic recommendations
supportsage analyze model.stl --filament "Bambu Lab PLA Basic"

# Generate supports + filament context
supportsage tree model.stl -o optimized.stl --filament "eSun PLA+"
Enter fullscreen mode Exit fullscreen mode

Output becomes:

🌳 Tree Support Generator
  Strategy: balanced

  🌟 Supports generated: optimized.stl

  💡 Filament: Bambu Lab PLA Basic
     🔥 Nozzle: 220°C (range 200-230°C)
     🔥 Bed:    55°C (range 50-60°C)
     ⚡ Max volumetric: 12 mm³/s
     ↩  Retraction: 0.8mm @ 30mm/s
     🌬️ Fan: 100%
     🛏️ Adhesion: brim
Enter fullscreen mode Exit fullscreen mode

--inspect: Post-print quality check

# All in one command: generate supports → lookup filament → inspect print
supportsage tree model.stl -o out.stl --filament "PLA+" --inspect after_print.jpg
Enter fullscreen mode Exit fullscreen mode

Web GUI got the same upgrades

The web UI (supportsage-gui --open → browser) now has three panels:

  1. STL upload + analysis/generation (existing)
  2. Filament search panel — type a name, search FilamentDB, see matching params
  3. Print inspection panel — upload a photo, get quality score + defect breakdown

New API endpoints: /api/filament-search, /api/filament-recommend, /api/print-inspect.

How It Works

Lazy imports (the key decision)

Both FilamentDB and Printsight are optional dependencies. If you only install SupportSage, everything still works:

def _print_filament_info(filament_arg):
    try:
        from filamentdb.database import recommend
    except ImportError:
        print("  ⚠️ filamentdb not installed — skipping filament lookup")
        return
    # ... look up and print
Enter fullscreen mode Exit fullscreen mode

No breakage. The new features are pure bonus on top.

Web backend: pure stdlib

The web GUI uses Python's built-in http.server — no Flask, no Django, no npm. New endpoints use the same lazy import pattern:

def _handle_filament_search(self, data):
    try:
        from filamentdb.database import search
        results = search(data.get("query", ""))
        self._send_json({"results": results})
    except ImportError:
        self._send_json({"error": "FilamentDB not installed"}, 500)
Enter fullscreen mode Exit fullscreen mode

Frontend is vanilla JS + CSS (~32KB single page), zero toolchain required.

Installation

Before: three separate pip install commands, remembering three different wheel URLs.

Now:

bash <(curl -sL https://raw.githubusercontent.com/bossman-lab/supportsage/main/scripts/install_3d_tools.sh)
Enter fullscreen mode Exit fullscreen mode

One command installs all three, with version verification baked in.

Structural Takeaways

This integration work clarified a few things for me:

  1. CLI and Web are fundamentally different interaction models. CLI is pipeline-friendly (chaining --filament--inspect in a single command). Web is browse-friendly (searching filament params alongside inspection results in parallel panels). Don't try to force one pattern onto the other.

  2. "Integration" doesn't mean merging repos. One parent command + two optional flags beats hardcoded imports every time. Loose coupling lets users choose their depth — basic SupportSage only, or the full suite.

  3. Installation UX is the first impression. The psychological gap between three pip install commands and one bash <(curl ...) is bigger than you'd think. The toolchain experience should start from the install.

Project Links


If you're building 3D printing tools or thinking about CLI + Web dual-mode toolchain design, I'd love to hear your approach.

Top comments (0)