holder: switch to OpenSCAD Manifold backend (10-50x faster renders)

OpenSCAD 2021.01 (Debian 13 default) is single-threaded CGAL. The Manifold
backend, available in OpenSCAD 2024+, parallelises CSG operations and
gives massive speedups on multi-cell holders.

Bench on this LXC (6 cores), realistic params:
  6x12  (72 cells):  CGAL  3.14s -> Manifold 0.08s   (37x)
  10x20 (200 cells): -                       1.41s
  15x25 (375 cells): -                       1.97s

Installation steps performed on the server (manual, not in this repo):
  wget https://files.openscad.org/snapshots/OpenSCAD-2026.04.26-x86_64.AppImage
  ./AppImage --appimage-extract  (no FUSE required)
  ln -s squashfs-root/AppRun /usr/local/bin/openscad-nightly

Code changes:
- holder.py: new OPENSCAD_BACKEND env var (default "Manifold");
  appends "--backend Manifold" to the openscad call when set.
- deploy/busbar-designer.service: points OPENSCAD_BIN at the
  extracted nightly and sets OPENSCAD_BACKEND=Manifold.

Real-time progress percentage was investigated but not implemented:
OpenSCAD has no headless --progress flag, so live % from the CLI is
not feasible. With Manifold making renders sub-second to a few seconds,
the existing indeterminate progress bar + elapsed timer is sufficient.
This commit is contained in:
wenil
2026-05-25 11:35:20 +03:00
parent af3ed092dc
commit 0aa38809b4
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -23,6 +23,10 @@ Environment=HOST=0.0.0.0
Environment=PORT=5000
Environment=FLASK_DEBUG=0
Environment=PATH=/opt/busbar-designer/.venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
; Use OpenSCAD nightly (extracted AppImage) for the Manifold backend.
; Falls back to system "openscad" (CGAL) if this binary is missing.
Environment=OPENSCAD_BIN=/usr/local/bin/openscad-nightly
Environment=OPENSCAD_BACKEND=Manifold
; HOME points inside the project so ezdxf / matplotlib / build123d can write
; their config + cache while ProtectHome=true still hides the real /home.
Environment=HOME=/opt/busbar-designer/data