3MF Medical Surgical Guides & Implants (.3mf)
@modelscript/three-mf (languages/three-mf) provides native WebAssembly parsing, half-edge 2-manifold watertightness and Euler-Poincaré characteristic (DAEBuilder lowering, and ISO 10303-21 STEP / OpenSCAD projections for ISO/ASTM 52915 3MF Medical patient-specific 3D-printed surgical guides and cranial/orthopedic implants.
Supported Extensions & Standards
| Extension | Format | Description |
|---|---|---|
.3mf | ISO/ASTM 52915 3MF | 3D Manufacturing Format (<model>, <resources>, <mesh>, <vertices>, <triangles>, <build>, and surgical guide/implant metadata) |
Key Capabilities
1. Watertight 2-Manifold Topology & Signed Divergence Volume
- Constructs the mesh half-edge incidence graph to verify that every triangle edge is shared by exactly two oppositely oriented faces (zero boundary holes, zero non-manifold edges, zero degenerate zero-area triangles).
- Computes exact signed divergence volume, surface area, connected shells, genus
, and Euler characteristic .
2. Surgical Cutting Guide & Drill-Sleeve Verification
- Validates patient-specific osteotomy cutting guides and pedicle/dental drill sleeves:
- Enforces minimum structural wall thickness (
for biocompatible PA12 / Formlabs BioMed resins) and positive drill-guide sleeve radial wall thickness ( ). - Verifies unit-normalized osteotomy cutting-plane normals (
) and drill trajectory vectors.
- Enforces minimum structural wall thickness (
3. ISO 10303-21 STEP & OpenSCAD Export
- Exports verified surgical guides and implants to ISO 10303-21 STEP (
threeMfToStep) and OpenSCAD (threeMfToScad).
Pre-Flight Diagnostics
10 rules10 error
| Code | Rule | Severity | Message |
|---|---|---|---|
M9701 | three-mf-non-manifold-edge | error | Mesh in object '<objId>' is not a closed 2-manifold ('<openEdges>' open boundary edges, '<nonManifoldEdges>' non-manifold edges). |
M9702 | three-mf-degenerate-triangle | error | Triangle #<triIndex> (<v1>, <v2>, <v3>) in object '<objId>' is degenerate (duplicate vertex indices or zero area). |
M9703 | three-mf-negative-mesh-volume | error | Mesh in object '<objId>' has non-positive signed volume '<signedVol> mm^3' (inverted outward face normals). |
M9704 | three-mf-unresolved-build-object | error | Build '<item>' references undefined resource '<object id="<objectId>">'. |
M9705 | three-mf-wall-thickness-violation | error | Surgical guide or cannula '<targetName>' has wall thickness '<actualMm> mm' below minimum additive manufacturing threshold '<minMm> mm'. |
M9706 | three-mf-invalid-osteotomy-guide-axis | error | Osteotomy plane or drill sleeve '<guideFeatureId>' on object '<objId>' has a zero-length normal/axis vector. |
M9707 | three-mf-missing-biocompatible-material | error | Medical object '<objId>' lacks an approved ISO 10993 / USP Class VI biocompatible material (found '<matName>'). |
M9708 | three-mf-singular-item-transform | error | Build '<item objectid="<objectId>">' has singular or reflection 4x3 affine transform with determinant '<det>'. |
M9709 | three-mf-out-of-bounds-vertex-index | error | Triangle #<triIndex> (<v1>, <v2>, <v3>) in object '<objId>' references vertex index outside [0, <value>]. |
M9710 | three-mf-duplicate-object-id | error | Duplicate '<object id="<objId>">' declared in '<resources>'. |
Generated from languages/three-mf/src/lints/rules.ts. All languages →
CLI Usage
bash
# Inspect 3MF objects, build items, and surgical guide metadata
msx three-mf inspect MandibleOsteotomyGuide.3mf
# Validate 2-manifold watertightness, wall thickness, and osteotomy planes
msx three-mf validate MandibleOsteotomyGuide.3mf
# Compute mesh topology metrics (Euler characteristic, volume, surface area)
msx three-mf topology MandibleOsteotomyGuide.3mf
# Export surgical guide mesh to ISO 10303-21 STEP or OpenSCAD
msx three-mf to-step MandibleOsteotomyGuide.3mf > MandibleOsteotomyGuide.stp
msx three-mf to-scad MandibleOsteotomyGuide.3mf > MandibleOsteotomyGuide.scad
