How brinter-am-technologies-oy/3mf-bio works
Purpose and Entry Points
This repository defines the pre-1.0 3MF Bio Extension: an XML schema and reference toolchain for recording biofabrication geometry, biological materials, process, evidence, calibration, maturation, and results inside a 3MF package. Primary user entry points are package validation (verify.py, spec/validate_bio.py), package generation from mesh plus questionnaire answers (tools/integrate.py), and local package inspection (tools/viewer.html).
Canonical Format Layer
The normative format is the Bio XML Schema and Schematron rules, extending a 3MF model’s <resources> section under the Bio namespace. It defines typed resources for evidence, substances, cell populations, bioinks, process, printheads, calibration, regulatory determination, open items, maturation, characterization, protocols, results, and volumetric field bindings.
• spec/bio.xsd
• spec/bio.sch
• spec/3MF Bio Extension.md
The key semantic boundary is that schema validity establishes structural and declared-rule conformance, not truth of scientific or regulatory claims.
Validation Pipeline
Validation is intentionally split by capability. XSD validation checks document structure; Schematron checks portable intra-document constraints; Python performs package-aware checks that need ZIP/OPC relationships, external-part existence, bibliography keys, full index bounds, strict/release policy, and cross-part logic.
• spec/validate_schema.py
• spec/validate_bio.py
• spec/bio.libxml.xsd
validate_bio.py accepts either an unpacked package directory or .3mf ZIP. --strict escalates warnings; --release rejects any estimated value. bio.libxml.xsd is a generated compatibility variant for libxml2/lxml.
Provenance, Unknowns, and Release Semantics
The central data-policy model requires numeric values to declare provenance. Estimated values are allowed but must be represented honestly and tied to tracked open items describing ownership and closure actions. This allows the integrator to emit incomplete packages rather than force fabricated inputs; release validation becomes the enforcement boundary.
• spec/bio.xsd
• spec/validate_bio.py
• dossier/Parameter-Dossier.md
Derived process claims additionally require their declared inputs, particularly for extrusion/shear relationships. Acceptance criteria are recorded per laboratory rather than prescribed by the format.
Package Authoring and Consumption
The authoring flow is: select a machine profile, generate/fill a questionnaire response, combine it with STL/OBJ geometry, then emit a validating 3MF package. The browser-only viewer reads a local package and prioritizes an operational run sheet, constraints, open items, dossiers, maturation, and geometry; it has no server or upload dependency.
• tools/questionnaire.py
• tools/integrate.py
• tools/viewer.html
Machine-specific capability input is currently represented as JSON profiles, beginning with Brinter.
• tools/machine_profiles/brinter.json
Reference Packages and Conformance
Two package directories are executable reference data: a volumetric tomographic build and a multi-head extrusion/deposition build with toolpath, biological records, protocols, certificates, and results. They exercise the 3MF OPC structure as well as Bio resources.
• examples/
• examples-extrusion/
• examples-extrusion/bio/toolpath/extrusion.gcode
Conformance testing injects faults through both rule engines; additional round-trip, corpus-generation, red-team, and tool integration checks protect format behavior.
• spec/conformance_tests.py
• spec/roundtrip_test.py
• verify.py
Evidence, Review, and Publication Infrastructure
Dossiers hold parameter sources, calibration references, regulatory mapping, bibliography, and fact-check outcomes that support schema vocabulary rather than runtime execution. External review is explicitly scoped to factual/regulatory assessment and collecting a real dataset.
• dossier/
• review/REGULATORY-REVIEW.md
• review/DATASET-SHEET.md
A static documentation/namespace site is generated from repository Markdown and deployed via GitHub Pages. CI validates the repository and publishes the site.
• site/build_site.py
• .github/workflows/validate.yml
• .github/workflows/pages.yml
Main entry points: validate_bio.py Package Validator · bio.xsd Bio XML Schema · integrate.py 3MF Integrator · verify.py Repository Verification
Components 21
Canonical Format
- Bio XML Schema · Defines typed Bio resources in 3MF resources.
spec/bio.xsd - Bio Schematron · Portable intra-document semantic constraints.
spec/bio.sch - Extension Specification
spec/3MF Bio Extension.md
Validation
- libxml Compatibility Schema · libxml2/lxml-compatible XSD variant.
spec/bio.libxml.xsd - Schema Validator · Checks XML structure and declared schema rules.
spec/validate_schema.py - Package Validator · Checks OPC relationships, cross-part policy, bibliography, and bounds.
spec/validate_bio.py - Repository Verification · Runs repository-level verification and conformance checks.
verify.py
Authoring & Inspection
- Questionnaire Generator · Generates or fills package input responses.
tools/questionnaire.py - Brinter Machine Profile
tools/machine_profiles/brinter.json - 3MF Integrator · Combines geometry, profile, and questionnaire answers into a validating package.
tools/integrate.py - Local Package Viewer · Browser-only inspection of run sheets, constraints, records, and geometry.
tools/viewer.html
Reference Packages
- Tomographic Reference Package · Executable volumetric-build reference data.
- Extrusion Reference Package · Multi-head deposition package with biological and operational records.
- Extrusion Toolpath
examples-extrusion/bio/toolpath/extrusion.gcode
Evidence & Review
- Parameter Dossier · Documents sources, calibration, unknowns, and release semantics.
dossier/Parameter-Dossier.md - Evidence Dossiers · Holds sources, regulatory mapping, bibliography, and fact checks.
- Regulatory Review
review/REGULATORY-REVIEW.md - Dataset Sheet
review/DATASET-SHEET.md
Publication
- Static Site Builder · Builds documentation and namespace site from Markdown.
site/build_site.py - Validation CI
.github/workflows/validate.yml - Pages Deployment CI
.github/workflows/pages.yml
Connections 25
- Extension Specification → Bio XML Schema: specifies
- Extension Specification → Bio Schematron: specifies
- Bio XML Schema → libxml Compatibility Schema: generates compatibility variant
- libxml Compatibility Schema → Schema Validator: used for XSD checks
- Bio Schematron → Package Validator: applies rules
- Bio XML Schema → Package Validator: validates Bio resources
- Parameter Dossier → Package Validator: informs provenance and release policy
- Schema Validator → Repository Verification: runs within
- Package Validator → Repository Verification: runs within
- Brinter Machine Profile → Questionnaire Generator: selects capabilities
- Questionnaire Generator → 3MF Integrator: supplies answers
- Brinter Machine Profile → 3MF Integrator: supplies profile
- 3MF Integrator → Bio XML Schema: emits conforming resources
- 3MF Integrator → Package Validator: validates output
- Tomographic Reference Package → Package Validator: validated as reference
- Extrusion Reference Package → Package Validator: validated as reference
- Extrusion Toolpath → Extrusion Reference Package: contained in
- Tomographic Reference Package → Local Package Viewer: inspects locally
- Extrusion Reference Package → Local Package Viewer: inspects locally
- Evidence Dossiers → Parameter Dossier: contains supporting records
- Regulatory Review → Evidence Dossiers: reviews factual mapping
- Dataset Sheet → Evidence Dossiers: scopes dataset collection
- Repository Verification → Validation CI: executed by
- Static Site Builder → Pages Deployment CI: builds before deployment
- Validation CI → Pages Deployment CI: quality gate