Skip to content
Beta.3mf@modelscript/three-mf 10 diagnostic rules
Parser WASM GLR
Diagnostics 10 rules
DAE Arena Lowering
Simulation Co-sim / Export
Projections STEP, OpenSCAD
Live ExamplePatientMandibleGuide.3mf

3MF Patient-Specific Ti-6Al-4V Surgical Cutting Guide

Additive manufacturing package defining a watertight 2-manifold mesh with Euler-Poincare chi = 2 topology verification.

Playground
Source (25 lines)
1<?xml version="1.0" encoding="UTF-8"?>
2<model unit="millimeter" xml:lang="en-US" xmlns="http://schemas.microsoft.com/3dmanufacturing/core/2015/02">
3  <resources>
4    <basematerials id="1">
5      <base name="Ti-6Al-4V ELI (ASTM F136)" displaycolor="#94A3B8"/>
6    </basematerials>
7    <object id="2" name="MandibularCuttingGuide" type="model" pid="1" pindex="0">
8      <mesh>
9        <vertices>
10          <vertex x="0.0"  y="0.0"  z="0.0"/>
11          <vertex x="24.0" y="0.0"  z="0.0"/>
12          <vertex x="12.0" y="20.0" z="0.0"/>
13          <vertex x="12.0" y="8.0"  z="16.0"/>
14        </vertices>
15        <triangles>
16          <triangle v1="0" v2="2" v3="1"/>
17          <triangle v1="0" v2="1" v3="3"/>
18          <triangle v1="1" v2="2" v3="3"/>
19          <triangle v1="2" v2="0" v3="3"/>
20        </triangles>
21      </mesh>
22    </object>
23  </resources>
24  <build><item objectid="2"/></build>
25</model>
3MF Watertight Manifold Mesh & Build Tray
assigns material slices build «astm f136 material» Ti-6Al-4V ELI «parameters» id = 1 surgical grade alloy «2-manifold object» CuttingGuide Mesh «model» V = 4, E = 6, F = 4 Euler chi = 2 «3mf build item» Build Tray «verification» watertight = true zero non-manifold edges
Drag to pan · Click % to reset

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 (χ=V−E+F) verification, surgical guide minimum wall-thickness and drill-sleeve K-wire clearance auditing, osteotomy cutting-plane normal validation, 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 ​

ExtensionFormatDescription
.3mfISO/ASTM 52915 3MF3D 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 g, and Euler characteristic χ=V−E+F=2(1−g).

2. Surgical Cutting Guide & Drill-Sleeve Verification ​

  • Validates patient-specific osteotomy cutting guides and pedicle/dental drill sleeves:
    • Enforces minimum structural wall thickness (≥1.2 mm for biocompatible PA12 / Formlabs BioMed resins) and positive drill-guide sleeve radial wall thickness (router−rinner≥1.0 mm).
    • Verifies unit-normalized osteotomy cutting-plane normals (∥n∥=1) and drill trajectory vectors.

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

CodeRuleSeverityMessage
M9701three-mf-non-manifold-edgeerrorMesh in object '<objId>' is not a closed 2-manifold ('<openEdges>' open boundary edges, '<nonManifoldEdges>' non-manifold edges).
M9702three-mf-degenerate-triangleerrorTriangle #<triIndex> (<v1>, <v2>, <v3>) in object '<objId>' is degenerate (duplicate vertex indices or zero area).
M9703three-mf-negative-mesh-volumeerrorMesh in object '<objId>' has non-positive signed volume '<signedVol> mm^3' (inverted outward face normals).
M9704three-mf-unresolved-build-objecterrorBuild '<item>' references undefined resource '<object id="<objectId>">'.
M9705three-mf-wall-thickness-violationerrorSurgical guide or cannula '<targetName>' has wall thickness '<actualMm> mm' below minimum additive manufacturing threshold '<minMm> mm'.
M9706three-mf-invalid-osteotomy-guide-axiserrorOsteotomy plane or drill sleeve '<guideFeatureId>' on object '<objId>' has a zero-length normal/axis vector.
M9707three-mf-missing-biocompatible-materialerrorMedical object '<objId>' lacks an approved ISO 10993 / USP Class VI biocompatible material (found '<matName>').
M9708three-mf-singular-item-transformerrorBuild '<item objectid="<objectId>">' has singular or reflection 4x3 affine transform with determinant '<det>'.
M9709three-mf-out-of-bounds-vertex-indexerrorTriangle #<triIndex> (<v1>, <v2>, <v3>) in object '<objId>' references vertex index outside [0, <value>].
M9710three-mf-duplicate-object-iderrorDuplicate '<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

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Pricing • Trademark Policy