Skip to content

Real-world slicer exports fail on inheritance resolution and sentinel values #54

@maziggy

Description

@maziggy

Hi — first of all, thanks for this project. Nice clean wrapper and the containerization is a great touch.

I wanted to flag two distinct failure modes I hit when testing against real-world exports from the OrcaSlicer and BambuStudio GUIs, with
orca-slicer-api built from current main, OrcaSlicer 2.3.1 AppImage, on Linux x86_64. Both the upstream test fixtures in tests/files/input/ slice cleanly, so the setup is otherwise healthy.

## 1. Delta profiles with inherits: fail to parse

When I pass profiles that users exported from their slicer GUI ("Export preset to file"), the API returns:

500 — Slicing failed with error from slicer: The input preset file is invalid and can not be parsed.

Diffing the failing profiles against tests/files/input/{printer,process,filament}.json:

tests/files/input User export
Top-level keys 79 / 116 / 69 12 / 11 / 9
inherits: target fdm_bbl_3dp_001_common (low-level internal template) Bambu Lab X1 Carbon 0.4 nozzle (user-visible system preset)
filament no inherits at all (fully flattened) delta on Bambu PLA Basic @BBL X1C

It looks like the OrcaSlicer CLI can resolve inherits: against its bundled low-level fdm_* templates in resources/profiles/BBL.json, but
not against user-visible system presets living in resources/profiles/BBL/{machine,process,filament}/. The GUI resolves both. Your reference fixtures sidestep this by either inheriting from the low-level base or being fully flattened, which is why e2e passes but real exports don't.

Would you be open to having the API walk the inherits: chain against the AppImage's bundled profiles (they're right there in /app/squashfs-root/resources/profiles/BBL/) and hand a flattened JSON to the CLI? That would make the "upload your exported profile, slice a cube"
workflow actually work end-to-end for typical users. Happy to contribute a PR if that's a direction you'd accept.

## 2. 3MF slicing fails on sentinel -1 values

When I instead pass a 3MF file exported from the slicer GUI (with profile embedded, no explicit profile params on the request), the API returns:

500 — Slicing failed with error from slicer: Invalid parameter value(s) included in the 3mf file.

This happens with 3MFs exported from both OrcaSlicer and BambuStudio. The upstream tests/files/input/Cube.3mf slices fine in the same container.

Unzipping a failing 3MF and inspecting Metadata/project_settings.config (609 fields total, printer = Bambu Lab H2D, 13-slot filament config) surfaces these suspects:

prime_tower_brim_width = '-1'
filament_tower_interface_print_temp = ['-1', ..., '-1'] # 13 slots
internal_bridge_fan_speed = ['-1', ..., '-1']
ironing_fan_speed = ['-1', ..., '-1']
support_material_interface_fan_speed = ['-1', ..., '-1']

These are "-1 = auto / unset" sentinels. The GUI accepts them and interprets them at slice time; the CLI's strict validator rejects the
whole file.

This may be out of scope for the wrapper and actually a bug (or under-documented contract) on the OrcaSlicer CLI side. But it's worth
documenting in the README or flagging as a known limitation so others hitting this same wall can find it. A --sanitize-3mf option in the API
that strips/replaces known sentinel fields before invoking the CLI would be hugely valuable, even if it's best-effort.

## Reproduction

Both failures are reproducible in minutes against upstream main:

# 1. Boot the container
docker build --build-arg ORCASLICER_VERSION=2.3.0 --build-arg TARGETARCH=amd64 -t orca-slicer-api .
docker run -d -p 3000:3000 --name orca-slicer-api orca-slicer-api

# 2. Export any printer/process/filament preset from OrcaSlicer GUI as JSON
#    (you'll get delta files with inherits: pointing at user-visible presets)

# 3. Try to slice a cube with them — reproduces failure mode #1
curl -X POST http://localhost:3000/slice \
  -F "file=@cube.stl;type=model/stl" \
  -F "printerProfile=@exported-printer.json;type=application/json" \
  -F "presetProfile=@exported-process.json;type=application/json" \
  -F "filamentProfile=@exported-filament.json;type=application/json" \
  -F "exportType=3mf"

# 4. Export a 3MF from OrcaSlicer GUI (File → Save as 3MF) and slice it
#    with no profile params — reproduces failure mode #2
curl -X POST http://localhost:3000/slice \
  -F "file=@real-export.3mf;type=model/3mf" \
  -F "exportType=3mf"

Environment

- orca-slicer-api: main built from source
- OrcaSlicer: 2.3.1 AppImage (the one your Dockerfile downloads)
- Docker: recent, Linux x86_64, Debian host
- Slicer exports: OrcaSlicer 2.3.x and BambuStudio recent release

Let me know if either of these is something you'd like a PR on, or if they're already being tracked in #12 / #16. Thanks again for the project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions