diff --git a/docs/orcaslicer.md b/docs/orcaslicer.md index a63988cbe1..36c3c0bbad 100644 --- a/docs/orcaslicer.md +++ b/docs/orcaslicer.md @@ -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. --- diff --git a/schemas/material_types_schema.json b/schemas/material_types_schema.json index 8b4f0cb38d..d6d9018f80 100644 --- a/schemas/material_types_schema.json +++ b/schemas/material_types_schema.json @@ -44,6 +44,7 @@ "TPI", "SBS", "OBC", - "EVA" + "EVA", + "BREAKAWAY" ] } diff --git a/tests/test_orca_exporter.py b/tests/test_orca_exporter.py index 3335755012..f72fd848c4 100644 --- a/tests/test_orca_exporter.py +++ b/tests/test_orca_exporter.py @@ -8,10 +8,13 @@ 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, @@ -19,6 +22,7 @@ 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"} @@ -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"