Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/orcaslicer.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The database does not record those values for any filament, so the presets do no

Every preset says this in its own notes field, visible in OrcaSlicer under **Filament Settings → Notes → Filament notes**, together with the API URL it was generated from.

Filaments made of materials OrcaSlicer has no generic profile for — PEEK, PEKK, PPS, PPSU, PVDF, PEI, PVB and similar — are **skipped** rather than published against a wrong-behaving parent.
Filaments made of materials OrcaSlicer has no generic profile for — PEEK, PEKK, PPS, PPSU, PVDF, PEI, PVB, BREAKAWAY and similar — are **skipped** rather than published against a wrong-behaving parent.

---

Expand Down
3 changes: 2 additions & 1 deletion schemas/material_types_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"TPI",
"SBS",
"OBC",
"EVA"
"EVA",
"BREAKAWAY"
]
}
23 changes: 23 additions & 0 deletions tests/test_orca_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,21 @@

import json
import zipfile
from pathlib import Path

from ofd.builder.exporters.orca_exporter import export_orca
from ofd.builder.models import Database
from ofd.builder.orca_mapping import (
ORCA_BASE_BY_MATERIAL,
ORCA_FILAMENT_TYPE_BY_MATERIAL,
ORCA_PRESET_VERSION,
build_profile,
resolve_base_profile,
resolve_filament_id,
resolve_temps,
)

REPO_ROOT = Path(__file__).resolve().parent.parent
BRAND = {"id": "b1", "name": "Acme", "slug": "acme"}
MATERIAL = {"id": "m1", "brand_id": "b1", "material": "PLA", "slug": "PLA"}

Expand Down Expand Up @@ -70,6 +74,25 @@ def test_material_with_no_orca_base_is_unmapped():
assert resolve_base_profile("", "Whatever") is None


def test_breakaway_is_a_material_type_without_an_orca_base():
"""BREAKAWAY (proprietary breakaway support filaments, whose base polymer vendors
often do not name) is a valid material type. OrcaSlicer ships no breakaway generic
profile, so it stays unmapped rather than inheriting another material's behaviour.
The name is upper case like every other material: the WebUI upper-cases material
folder names, so a mixed-case value would not round-trip."""
schema = json.loads((REPO_ROOT / "schemas" / "material_types_schema.json").read_text())
assert "BREAKAWAY" in schema["enum"]
assert resolve_base_profile("BREAKAWAY", "Breakaway-80") is None
assert resolve_base_profile("Breakaway", "Breakaway-80") is None


def test_every_orca_mapped_material_is_a_schema_material():
"""A typo in the mapping tables would otherwise be silently unreachable."""
schema = json.loads((REPO_ROOT / "schemas" / "material_types_schema.json").read_text())
assert set(ORCA_BASE_BY_MATERIAL) <= set(schema["enum"])
assert set(ORCA_FILAMENT_TYPE_BY_MATERIAL) <= set(schema["enum"])


def test_name_refines_the_base():
assert resolve_base_profile("PLA", "Matte PLA") == "Generic PLA Matte @System"
assert resolve_base_profile("PLA", "Silk PLA+") == "Generic PLA Silk @System"
Expand Down
Loading