simbridge-cad-mujoco 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. simbridge_cad_mujoco-0.3.0/.github/ISSUE_TEMPLATE/bug_report.yml +17 -0
  2. simbridge_cad_mujoco-0.3.0/.github/workflows/ci.yml +28 -0
  3. simbridge_cad_mujoco-0.3.0/CITATION.cff +9 -0
  4. simbridge_cad_mujoco-0.3.0/CONTRIBUTING.md +11 -0
  5. simbridge_cad_mujoco-0.3.0/LICENSE +21 -0
  6. simbridge_cad_mujoco-0.3.0/MANIFEST.in +16 -0
  7. simbridge_cad_mujoco-0.3.0/PKG-INFO +186 -0
  8. simbridge_cad_mujoco-0.3.0/README.md +159 -0
  9. simbridge_cad_mujoco-0.3.0/THIRD_PARTY.md +12 -0
  10. simbridge_cad_mujoco-0.3.0/docs/corridor-research.md +33 -0
  11. simbridge_cad_mujoco-0.3.0/docs/execution-report.md +50 -0
  12. simbridge_cad_mujoco-0.3.0/docs/exporter-audit.md +22 -0
  13. simbridge_cad_mujoco-0.3.0/docs/new-cad-workflow.md +58 -0
  14. simbridge_cad_mujoco-0.3.0/docs/research-setup.md +35 -0
  15. simbridge_cad_mujoco-0.3.0/docs/review-guide.md +13 -0
  16. simbridge_cad_mujoco-0.3.0/docs/robot-ir.schema.json +316 -0
  17. simbridge_cad_mujoco-0.3.0/examples/concentric.step +413 -0
  18. simbridge_cad_mujoco-0.3.0/examples/concentric.yaml +35 -0
  19. simbridge_cad_mujoco-0.3.0/examples/pendulum.step +853 -0
  20. simbridge_cad_mujoco-0.3.0/examples/pendulum.yaml +35 -0
  21. simbridge_cad_mujoco-0.3.0/examples/prismatic.step +853 -0
  22. simbridge_cad_mujoco-0.3.0/examples/prismatic.yaml +35 -0
  23. simbridge_cad_mujoco-0.3.0/examples/repeated.step +597 -0
  24. simbridge_cad_mujoco-0.3.0/examples/repeated.yaml +25 -0
  25. simbridge_cad_mujoco-0.3.0/examples/rigid.step +853 -0
  26. simbridge_cad_mujoco-0.3.0/examples/rigid.yaml +20 -0
  27. simbridge_cad_mujoco-0.3.0/examples/two_link.step +895 -0
  28. simbridge_cad_mujoco-0.3.0/examples/two_link.yaml +55 -0
  29. simbridge_cad_mujoco-0.3.0/paper/README.md +16 -0
  30. simbridge_cad_mujoco-0.3.0/paper/generated/collision-provenance.json +8 -0
  31. simbridge_cad_mujoco-0.3.0/paper/generated/collision-table.tex +10 -0
  32. simbridge_cad_mujoco-0.3.0/paper/generated/collision-tradeoff.pdf +0 -0
  33. simbridge_cad_mujoco-0.3.0/paper/generated/collision-tradeoff.png +0 -0
  34. simbridge_cad_mujoco-0.3.0/paper/generated/external-table.tex +9 -0
  35. simbridge_cad_mujoco-0.3.0/paper/generated/fault-detection.pdf +0 -0
  36. simbridge_cad_mujoco-0.3.0/paper/generated/fault-detection.png +0 -0
  37. simbridge_cad_mujoco-0.3.0/paper/generated/fault-table.tex +9 -0
  38. simbridge_cad_mujoco-0.3.0/paper/generated/kaya-table.tex +11 -0
  39. simbridge_cad_mujoco-0.3.0/paper/generated/provenance.json +5 -0
  40. simbridge_cad_mujoco-0.3.0/paper/main.pdf +0 -0
  41. simbridge_cad_mujoco-0.3.0/paper/main.tex +131 -0
  42. simbridge_cad_mujoco-0.3.0/pyproject.toml +45 -0
  43. simbridge_cad_mujoco-0.3.0/research/PROTOCOL.md +84 -0
  44. simbridge_cad_mujoco-0.3.0/research/cad-sources.json +76 -0
  45. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/README.md +13 -0
  46. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/browser-smoke-v0.3.json +19 -0
  47. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/clearance-study-summary.csv +181 -0
  48. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/clearance-study-summary.json +368 -0
  49. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/external-after-fix.json +68 -0
  50. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/external-before-fix.json +70 -0
  51. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/fresh-design.json +63 -0
  52. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/kaya-comparison.json +1307 -0
  53. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/kaya-corridor.json +94 -0
  54. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/source-hashes.json +32 -0
  55. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/tests.xml +1 -0
  56. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/validator-pilot.json +539 -0
  57. simbridge_cad_mujoco-0.3.0/research/evidence/2026-11-30/validator-probes.csv +40 -0
  58. simbridge_cad_mujoco-0.3.0/research/licenses/NVIDIA-Kaya-LICENSE +21 -0
  59. simbridge_cad_mujoco-0.3.0/research/licenses/SO-ARM100-LICENSE +201 -0
  60. simbridge_cad_mujoco-0.3.0/scripts/augment_bbox_corridor.py +83 -0
  61. simbridge_cad_mujoco-0.3.0/scripts/browser_smoke.py +127 -0
  62. simbridge_cad_mujoco-0.3.0/scripts/build_collision_artifacts.py +96 -0
  63. simbridge_cad_mujoco-0.3.0/scripts/build_paper_artifacts.py +56 -0
  64. simbridge_cad_mujoco-0.3.0/scripts/compare_kaya_baselines.py +161 -0
  65. simbridge_cad_mujoco-0.3.0/scripts/evaluate_external.py +63 -0
  66. simbridge_cad_mujoco-0.3.0/scripts/fetch_cad.py +36 -0
  67. simbridge_cad_mujoco-0.3.0/scripts/fresh_design_demo.py +98 -0
  68. simbridge_cad_mujoco-0.3.0/scripts/make_examples.py +75 -0
  69. simbridge_cad_mujoco-0.3.0/scripts/render_preview.py +29 -0
  70. simbridge_cad_mujoco-0.3.0/scripts/run_acceptance.py +43 -0
  71. simbridge_cad_mujoco-0.3.0/scripts/run_clearance_study.py +208 -0
  72. simbridge_cad_mujoco-0.3.0/scripts/run_kaya_corridor.py +90 -0
  73. simbridge_cad_mujoco-0.3.0/scripts/summarize_clearance_study.py +122 -0
  74. simbridge_cad_mujoco-0.3.0/setup.cfg +4 -0
  75. simbridge_cad_mujoco-0.3.0/src/simbridge/__init__.py +3 -0
  76. simbridge_cad_mujoco-0.3.0/src/simbridge/__main__.py +3 -0
  77. simbridge_cad_mujoco-0.3.0/src/simbridge/articulation/__init__.py +0 -0
  78. simbridge_cad_mujoco-0.3.0/src/simbridge/articulation/infer.py +44 -0
  79. simbridge_cad_mujoco-0.3.0/src/simbridge/benchmark.py +163 -0
  80. simbridge_cad_mujoco-0.3.0/src/simbridge/cli.py +104 -0
  81. simbridge_cad_mujoco-0.3.0/src/simbridge/compile/__init__.py +0 -0
  82. simbridge_cad_mujoco-0.3.0/src/simbridge/compile/mjcf.py +93 -0
  83. simbridge_cad_mujoco-0.3.0/src/simbridge/diagnostics.py +26 -0
  84. simbridge_cad_mujoco-0.3.0/src/simbridge/dynamics/__init__.py +0 -0
  85. simbridge_cad_mujoco-0.3.0/src/simbridge/dynamics/inertia.py +41 -0
  86. simbridge_cad_mujoco-0.3.0/src/simbridge/errors.py +2 -0
  87. simbridge_cad_mujoco-0.3.0/src/simbridge/geometry/__init__.py +0 -0
  88. simbridge_cad_mujoco-0.3.0/src/simbridge/geometry/adaptive.py +231 -0
  89. simbridge_cad_mujoco-0.3.0/src/simbridge/geometry/clearance.py +159 -0
  90. simbridge_cad_mujoco-0.3.0/src/simbridge/geometry/corridor.py +138 -0
  91. simbridge_cad_mujoco-0.3.0/src/simbridge/geometry/meshes.py +84 -0
  92. simbridge_cad_mujoco-0.3.0/src/simbridge/guided.py +112 -0
  93. simbridge_cad_mujoco-0.3.0/src/simbridge/ingest/__init__.py +0 -0
  94. simbridge_cad_mujoco-0.3.0/src/simbridge/ingest/step.py +182 -0
  95. simbridge_cad_mujoco-0.3.0/src/simbridge/ir/__init__.py +0 -0
  96. simbridge_cad_mujoco-0.3.0/src/simbridge/ir/schema.py +198 -0
  97. simbridge_cad_mujoco-0.3.0/src/simbridge/onboarding.py +50 -0
  98. simbridge_cad_mujoco-0.3.0/src/simbridge/pipeline.py +124 -0
  99. simbridge_cad_mujoco-0.3.0/src/simbridge/validate/__init__.py +0 -0
  100. simbridge_cad_mujoco-0.3.0/src/simbridge/validate/physics.py +222 -0
  101. simbridge_cad_mujoco-0.3.0/src/simbridge/web/app.js +29 -0
  102. simbridge_cad_mujoco-0.3.0/src/simbridge/web/index.html +17 -0
  103. simbridge_cad_mujoco-0.3.0/src/simbridge/web/style.css +1 -0
  104. simbridge_cad_mujoco-0.3.0/src/simbridge/webapp.py +250 -0
  105. simbridge_cad_mujoco-0.3.0/src/simbridge_cad_mujoco.egg-info/PKG-INFO +186 -0
  106. simbridge_cad_mujoco-0.3.0/src/simbridge_cad_mujoco.egg-info/SOURCES.txt +116 -0
  107. simbridge_cad_mujoco-0.3.0/src/simbridge_cad_mujoco.egg-info/dependency_links.txt +1 -0
  108. simbridge_cad_mujoco-0.3.0/src/simbridge_cad_mujoco.egg-info/entry_points.txt +2 -0
  109. simbridge_cad_mujoco-0.3.0/src/simbridge_cad_mujoco.egg-info/requires.txt +16 -0
  110. simbridge_cad_mujoco-0.3.0/src/simbridge_cad_mujoco.egg-info/top_level.txt +1 -0
  111. simbridge_cad_mujoco-0.3.0/tests/conftest.py +15 -0
  112. simbridge_cad_mujoco-0.3.0/tests/test_dynamics.py +22 -0
  113. simbridge_cad_mujoco-0.3.0/tests/test_guided_collision.py +74 -0
  114. simbridge_cad_mujoco-0.3.0/tests/test_ingestion.py +66 -0
  115. simbridge_cad_mujoco-0.3.0/tests/test_physics.py +34 -0
  116. simbridge_cad_mujoco-0.3.0/tests/test_pipeline.py +194 -0
  117. simbridge_cad_mujoco-0.3.0/tests/test_research.py +57 -0
  118. simbridge_cad_mujoco-0.3.0/uv.lock +1548 -0
@@ -0,0 +1,17 @@
1
+ name: Conversion or validation issue
2
+ description: Report an input, conversion, or physics diagnostic problem
3
+ body:
4
+ - type: textarea
5
+ attributes:
6
+ label: Reproduction and expected behavior
7
+ description: Include the exact command, expected result, and actual diagnostics.
8
+ validations:
9
+ required: true
10
+ - type: textarea
11
+ attributes:
12
+ label: Environment
13
+ description: Paste simbridge doctor output. Remove private paths if needed.
14
+ - type: textarea
15
+ attributes:
16
+ label: CAD source and configuration
17
+ description: Provide a minimal public reproducer, license and source revision. Do not share proprietary files or secrets.
@@ -0,0 +1,28 @@
1
+ name: tests-and-package
2
+ on: [push, pull_request]
3
+ permissions:
4
+ contents: read
5
+ jobs:
6
+ test:
7
+ strategy:
8
+ fail-fast: false
9
+ matrix:
10
+ os: [ubuntu-latest, macos-14]
11
+ python: ['3.12']
12
+ runs-on: ${{ matrix.os }}
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: astral-sh/setup-uv@v6
16
+ - run: uv sync --frozen --extra dev --python ${{ matrix.python }}
17
+ - run: uv run --frozen --extra dev pytest -q --junitxml=build/junit.xml
18
+ - run: uv run --frozen python scripts/run_acceptance.py --out build/acceptance-ci
19
+ - run: uv build
20
+ - uses: actions/upload-artifact@v4
21
+ if: always()
22
+ with:
23
+ name: results-${{ matrix.os }}
24
+ path: |
25
+ build/junit.xml
26
+ build/acceptance-ci/summary.json
27
+ build/acceptance-ci/**/report.json
28
+ dist/*
@@ -0,0 +1,9 @@
1
+ cff-version: 1.2.0
2
+ message: "Please cite the released version of SimBridge used in your work. This project has no publication DOI yet."
3
+ title: "SimBridge: CAD-Checked Clearance Corridors for STEP-to-MuJoCo Collision Models"
4
+ type: software
5
+ version: 0.3.0
6
+ date-released: 2026-11-30
7
+ license: MIT
8
+ authors:
9
+ - name: "SimBridge contributors"
@@ -0,0 +1,11 @@
1
+ # Contributing
2
+
3
+ SimBridge is experimental research software. Bug reports, independently sourced CAD cases, documentation fixes and evaluations are useful contributions. By contributing code, you agree to license it under this project's MIT license; do not change the licenses of third-party CAD.
4
+
5
+ Set up with `uv sync --frozen --extra dev --python 3.12`. Run `uv run pytest -q` and `uv run python scripts/run_acceptance.py --out build/<new-directory>` before proposing a code change. Run `uv build` for packaging changes. The checked-in CI workflow covers Linux and macOS/Python 3.12 once the repository is hosted; those CI runs have not happened locally.
6
+
7
+ Report the command, `simbridge doctor` output, config, expected behavior and actual report/diagnostics. Attach the smallest permissible reproducer or a public source URL with its license and pinned revision. Include all failures in evaluations; do not turn unsupported cases into successful conversions by dropping parts or hiding contacts. Never submit proprietary CAD or credentials.
8
+
9
+ Research changes should name the question and test against an independently specified reference where possible. Record source hashes, seeds, solver/timestep settings, manual configuration effort and exclusions. Distinguish software consistency from measured physical fidelity. Do not edit generated result files to improve outcomes; rerun the experiment into a new directory.
10
+
11
+ Please disclose material AI assistance in pull requests, and review/test generated code and citations. Contributors remain responsible for correctness. Proposed paper authorship and contributions require human agreement; repository contributions do not automatically settle authorship.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SimBridge contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,16 @@
1
+ include LICENSE README.md uv.lock
2
+ include CONTRIBUTING.md CITATION.cff THIRD_PARTY.md
3
+ recursive-include .github *.yml
4
+ recursive-include examples *.step *.yaml
5
+ recursive-include docs *.md *.json
6
+ recursive-include scripts *.py
7
+ recursive-include tests *.py
8
+ include research/cad-sources.json
9
+ include research/PROTOCOL.md
10
+ recursive-include paper *.tex *.md
11
+ include paper/main.pdf
12
+ recursive-include paper/generated *.pdf *.png *.json
13
+ recursive-include research/evidence *.json *.csv *.xml *.md
14
+ recursive-include research/licenses *
15
+ prune research/data
16
+ prune research/results
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.4
2
+ Name: simbridge-cad-mujoco
3
+ Version: 0.3.0
4
+ Summary: Compile STEP assemblies and explicit articulation into validated MuJoCo models
5
+ License-Expression: MIT
6
+ Classifier: Development Status :: 3 - Alpha
7
+ Classifier: Intended Audience :: Science/Research
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Topic :: Scientific/Engineering
10
+ Requires-Python: <3.14,>=3.11
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: cadquery==2.6.1
14
+ Requires-Dist: mujoco==3.3.7
15
+ Requires-Dist: numpy==2.2.6
16
+ Requires-Dist: scipy==1.15.3
17
+ Requires-Dist: pydantic==2.12.5
18
+ Requires-Dist: PyYAML==6.0.3
19
+ Requires-Dist: trimesh==4.10.1
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest==9.0.1; extra == "dev"
22
+ Provides-Extra: research
23
+ Requires-Dist: coacd==1.0.14; extra == "research"
24
+ Provides-Extra: browser
25
+ Requires-Dist: playwright==1.65.2; extra == "browser"
26
+ Dynamic: license-file
27
+
28
+ # SimBridge
29
+
30
+ A local Python app and library that compiles STEP assemblies plus explicit joint/material metadata into portable MuJoCo models. It uses OpenCASCADE to retain assembly instances, tessellate local geometry and compute solid mass properties, then executes MuJoCo to validate the result. **Experimental v0.3.0, MIT licensed.**
31
+
32
+ The original failing CAD assembly, application/version and error logs were not provided. This implementation is verified against synthetic fixtures; the original failure remains unverified.
33
+
34
+ Start with the quickstart below. The [research setup](docs/research-setup.md) links the working paper, external CAD evaluation and protocol. The [initial MVP run](docs/execution-report.md) records the earlier synthetic results. Generated builds are local artifacts, not bundled model claims.
35
+
36
+ The target is [newly created CAD to a working MuJoCo mechanism](docs/new-cad-workflow.md), with missing mechanics reviewed explicitly. For a fresh generated design, run `python scripts/fresh_design_demo.py --out build/<new-directory> --seed 20261130`. The browser app supplies a local drag-and-drop review workflow; it does not infer authoritative joint mechanics from geometry.
37
+
38
+ ## Install from PyPI
39
+
40
+ Install the published package and start its local CAD review app with:
41
+
42
+ ```sh
43
+ python -m pip install simbridge-cad-mujoco
44
+ simbridge serve
45
+ ```
46
+
47
+ The direct `cad-to-urdf` comparison requires its documented Linux environment and is not part of this initial release. We will update the research results after that comparison is run on Linux.
48
+
49
+ ## Run from the source tree
50
+
51
+ Python 3.12 is recommended. Tested here on macOS arm64 with Python 3.12.12, CadQuery 2.6.1 / OCCT 7.8.1 and MuJoCo 3.3.7. Direct dependencies are pinned in `pyproject.toml`; `uv.lock` pins transitive dependencies and hashes.
52
+
53
+ ```sh
54
+ cd SimBridge
55
+ # First-time setup; uv downloads the locked packages.
56
+ UV_CACHE_DIR="$PWD/.uv-cache" uv sync --frozen --extra dev --python python3.12
57
+ source .venv/bin/activate
58
+
59
+ simbridge inspect examples/two_link.step --out build/inspection.json
60
+ simbridge configure examples/two_link.step --out build/robot.draft.yaml
61
+ # The draft leaves mechanics/materials unresolved. For this demo, use the
62
+ # complete example config below; for your own CAD, review and fill the draft.
63
+ simbridge convert examples/two_link.step --config examples/two_link.yaml --out build/my_arm
64
+ simbridge validate build/my_arm/model.xml --out build/my_arm/recheck.json
65
+
66
+ # Local drag-and-drop CAD review. The service listens on loopback only.
67
+ simbridge serve
68
+
69
+ # macOS viewer: mjpython supplies the required GUI main-thread launcher.
70
+ mjpython -m simbridge preview build/my_arm/model.xml
71
+ # Other platforms:
72
+ # simbridge preview build/my_arm/model.xml
73
+
74
+ # Optional PNG from the actual MuJoCo renderer (graphics session required):
75
+ python scripts/render_preview.py build/my_arm/model.xml --out build/my_arm/preview.png
76
+ ```
77
+
78
+ Conversion requires an empty/new output directory and preserves earlier builds. Exit codes: `0` success, `1` physics validation failure, `2` invalid input/setup. Failed physics still writes the model, IR and report for diagnosis. You can edit a config and convert into a new directory to review a correction.
79
+
80
+ The viewer shows visual geometry in group 2. Toggle group 3 for collision proxies and use the control sliders for motor commands. No floor, free root or controller is inserted. `--duration 5` opens an advancing, automatically closing viewer for a smoke test; on macOS use `mjpython` for this too.
81
+
82
+ `simbridge doctor --out build/environment.json` records dependency/platform versions for bug reports. Validation reports include stable diagnostic categories and suggested repairs alongside the original error text. `configure` never overwrites an existing file and never supplies missing physical semantics.
83
+
84
+ `simbridge serve` opens a local browser workflow for STEP uploads up to 100 MiB. It reviews part placement and volume, collects rigid/articulated intent, material density, parent/joint details, collision choices and optional swept-sphere clearances, then builds and downloads a ZIP with the MJCF, assets, source hashes and validation report. The service binds only to `127.0.0.1`; files and review sessions are stored under `build/review/`. A user-selected cylindrical candidate fills a joint axis and origin for review. It never decides that the parts are actually connected or moving. This release expects valid closed-solid STEP geometry, one rooted tree, and an explicit uniform density.
85
+
86
+ For a CAD-verified corridor, choose **Verified clearance corridor** and supply a JSON list such as:
87
+
88
+ ```json
89
+ [{"center":[0,0,-0.02],"end":[0,0,0.02],"radius":0.003}]
90
+ ```
91
+
92
+ Coordinates are metres in the selected component's local CAD frame. The endpoint line plus radius defines a swept sphere. SimBridge checks the complete corridor against that component with OpenCASCADE, then removes it from an outer box and exports the remaining convex pieces. This encodes a declared path. It does not establish clearance from other links, moving obstacles, or unrelated contacts. A denied CAD check, insufficient mesh budget, or blocked post-repair path is retained in the report.
93
+
94
+ For a research pilot:
95
+
96
+ ```sh
97
+ simbridge benchmark examples/two_link.step --config examples/two_link.yaml \
98
+ --out research/results/my-pilot --repeats 3 --seeds 0 1 2
99
+ python scripts/fetch_cad.py
100
+ python scripts/evaluate_external.py --out research/results/my-external-run
101
+ ```
102
+
103
+ The benchmark compares validator policies on selected output mutations and records a correlated-input blind spot. It is not a competing-exporter comparison or a general accuracy estimate. External tests currently cover geometric ingestion and static integration only. See the [protocol](research/PROTOCOL.md), [source manifest](research/cad-sources.json), and compact [pilot evidence](research/evidence/2026-11-30/README.md).
104
+
105
+ ## Inputs and conventions
106
+
107
+ `inspect` lists occurrence IDs, display names, original definition IDs, hierarchy, placements, bounding boxes and solid mass properties in SI. Select each instance by exact ID in the config, or by display name when unique. IDs are scoped to one STEP export; regenerate/review the config after changing the source CAD assembly.
108
+
109
+ ```yaml
110
+ schema_version: '1.0'
111
+ name: arm
112
+ defaults:
113
+ density: 2700 # explicit user-chosen kg/m³, never assumed
114
+ timestep: 0.002
115
+ gravity: [0, 0, -9.81]
116
+ links:
117
+ - name: base
118
+ part: base # exact occurrence ID or unique display name
119
+ parent: null # exactly one root, anchored to world
120
+ joint: {type: fixed}
121
+ - name: upper
122
+ part: upper
123
+ parent: base
124
+ collision: box # box, convex_hull, adaptive, or corridor
125
+ joint:
126
+ type: revolute # fixed, revolute, prismatic
127
+ axis: [0, 0, 1] # CHILD CAD part frame; normalized on input
128
+ position: [0, 0, 0] # CHILD CAD part frame, metres
129
+ limits: [-1.2, 1.2] # radians, or metres for prismatic
130
+ damping: 0.05
131
+ actuator: {force_limit: 0.5, gear: 1}
132
+ ```
133
+
134
+ Every STEP leaf instance must appear exactly once. A leaf may contain multiple solids treated as one explicitly configured rigid link. Fixed links remain distinct nested bodies; there is no automatic rigid merge. The graph must be one rooted tree. Closed loops, unsupported joint types, duplicate link names, ambiguous part names and unconfigured instances fail clearly.
135
+
136
+ The CAD world frame and handedness are preserved, with default gravity along -Z. OpenCASCADE reads file-declared units and normalizes to millimetres; the pipeline converts geometry, placement, volume and inertia to SI using the appropriate length powers. Config lengths are always metres and angles radians, independent of file units. The STEP pose is `q=0` and must lie within each joint's explicit limits. Body frames are the local CAD definition frames, not the centers of mass. Joint positions and axes are expressed in the child frame. Body nesting uses relative transforms derived from the original world placements.
137
+
138
+ Each link needs a positive `density` or `mass`, or an explicit `defaults.density`. A per-link `mass` overrides the defaults and scales the exact solid inertia assuming uniform density. No material, joint axis, limit or motor strength is silently inferred. Density estimates are only as good as the selected material and solid geometry. Invalid solids, nonpositive mass, nonsymmetric/nonphysical inertia and mirrored transforms are rejected.
139
+
140
+ Motor `force_limit` bounds both control and actuator force **before gear multiplication**. With gear 1, revolute commands are torque in N m and prismatic commands are force in N. The generalized force limit is `force_limit * gear`. Damping defaults to MuJoCo's zero; motors are added only when explicitly configured.
141
+
142
+ Visual meshes are local-frame STL in metres. Collision can use a native box, convex hull, CAD-intersection-refined boxes, or an explicit CAD-checked clearance corridor. Adaptive-box resource limits and unresolved tolerance appear in the report. Corridor mode subtracts only a user-supplied swept sphere from a bounding-box proxy after numerical CAD Boolean and distance checks; it keeps the rest of that coarse proxy and can still misrepresent unrelated contacts. It is not a general collision decomposition or a formal certificate. CoACD can be installed as an optional research baseline, but SimBridge does not use it as an implicit conversion step.
143
+
144
+ `inspect` ranks coaxial cylindrical-surface hints as low-confidence candidates requiring confirmation. The local browser review can apply a selected hint to a moving-joint axis and origin after the user confirms its parent, joint type and limits. Geometry hints do not establish engagement, motion type, limits or actuation. The user still supplies joint semantics.
145
+
146
+ ## Outputs and checks
147
+
148
+ Each build contains `model.xml`, `assets/`, `robot.ir.json`, `config.yaml`, `report.json` and a generated `README.md`. Assets use relative paths, and builds can be moved without the input STEP. The versioned IR includes source SHA-256 hashes, instance/definition IDs, metadata provenance, transforms, dynamics, joints and asset paths. Its JSON Schema is in `docs/robot-ir.schema.json`.
149
+
150
+ Validation compiles with MuJoCo, checks asset resolution and positive/physical inertias, cross-checks the IR against compiled counts, parents, reference world transforms, masses, centers of mass, inertia tensors, joint types/axes/origins/limits/damping, and actuator targets/gears/bounds. It reports initial penetration beyond 10 µm for contacts admitted by MuJoCo's contact filtering. Parent/child and fixed-body contacts can be filtered, so this is not a complete CAD interference check.
151
+
152
+ It then applies bounded positive/negative motor pulses with gravity disabled to check motion direction, and runs at least 1,000 seeded simulation steps at the configured timestep. The run uses random motor commands at 1% of configured limits, refreshed every 25 steps. Finite states, advancing time, numerical warnings and joint-limit excursions are checked. MuJoCo limits are soft: tolerated overshoot is 0.005 rad for hinges and 0.001 m for slides; actual maxima are reported. Falling under gravity is allowed. Passing demonstrates basic consistency, not real-world fidelity or controller stability.
153
+
154
+ ```sh
155
+ pytest -q
156
+ python scripts/run_acceptance.py --out build/acceptance
157
+ # Optional browser/research tools: uv sync --frozen --extra browser --extra research
158
+ # Recreate the synthetic CAD files, if needed:
159
+ python scripts/make_examples.py
160
+ ```
161
+
162
+ The tests independently compare box/cylinder mass properties, rotated/combined inertia using the parallel-axis theorem, nested/repeated STEP instances, file unit normalization, nonzero two-link kinematics, relocated assets, deterministic simulation, signed actuator responses, metadata errors, closed loops and deliberately corrupted exports. The v0.3.0 working tree passes 46 tests; the earlier v0.2.0 snapshot passed 42. The remaining warnings are upstream CadQuery/pyparsing deprecations. The browser smoke separately exercises rigid, articulated and corridor exports. Corridor-mode evidence remains exploratory and is not a complete collision-fidelity result.
163
+
164
+ Five supported fixtures exercise a rigid assembly, a two-link revolute arm with repeated beam definitions, a rotated prismatic mechanism, repeated cylindrical parts, and a pendulum moving under gravity. A sixth fixture, `concentric`, intentionally diagnoses a limitation: the single box proxy fills a bore's hole and intersects its shaft. Its physics report must fail with an initial-penetration error; accurate annular collision needs multiple proxies or decomposition. Its cylindrical surfaces still produce review-only axis candidates.
165
+
166
+ The densities (2700/7850 kg/m³), joint limits, damping and motor strengths are explicit synthetic choices. Benchmark results are written to `summary.json` with separate actual/expected physics results, conversion times, warnings and intervention counts. The script succeeds when all five supported fixtures pass and the annular collision diagnostic is detected. Zero interventions during a run excludes preparation of its config. These small synthetic assemblies do not establish a real import-success rate or the product's proposed performance targets.
167
+
168
+ ## Scope and implementation
169
+
170
+ ```
171
+ src/simbridge/
172
+ ingest/step.py XCAF references, hierarchy, placements, SI conversion
173
+ ir/schema.py strict config and versioned IR
174
+ geometry/meshes.py visual tessellation, box/hull proxies
175
+ dynamics/inertia.py tensor validation, rotation and rigid combination
176
+ articulation/infer.py review-only candidate axes
177
+ compile/mjcf.py deterministic MJCF
178
+ validate/physics.py compilation, cross-checks and actual simulation
179
+ pipeline.py, cli.py artifact pipeline and CLI/viewer
180
+ ```
181
+
182
+ CPU only; no training or GPU requirement. Native CAD mate/material adapters, closed chains, free roots, flexible parts, nonuniform materials, automatic RL tasks and large-assembly resource isolation are outside this experimental release. The current reader records surface-only/invalid leaves in inspection and refuses conversion until the CAD is repaired. Treat external CAD files as trusted local inputs.
183
+
184
+ See `docs/exporter-audit.md` for the checked source capabilities, licenses and implementation decision. No exporter code was copied. Runtime tools are installed only in the project `.venv`.
185
+
186
+ The package builds with `uv build`; the source archive includes example CAD and the wheel installs the CLI. Source checkout users can run the examples directly. CI is configured for Linux/macOS with Python 3.12; hosted CI has not run yet. See [CONTRIBUTING.md](CONTRIBUTING.md), [CITATION.cff](CITATION.cff), [LICENSE](LICENSE), and [third-party notices](THIRD_PARTY.md). No PyPI release, archive DOI or public repository has been created yet.
@@ -0,0 +1,159 @@
1
+ # SimBridge
2
+
3
+ A local Python app and library that compiles STEP assemblies plus explicit joint/material metadata into portable MuJoCo models. It uses OpenCASCADE to retain assembly instances, tessellate local geometry and compute solid mass properties, then executes MuJoCo to validate the result. **Experimental v0.3.0, MIT licensed.**
4
+
5
+ The original failing CAD assembly, application/version and error logs were not provided. This implementation is verified against synthetic fixtures; the original failure remains unverified.
6
+
7
+ Start with the quickstart below. The [research setup](docs/research-setup.md) links the working paper, external CAD evaluation and protocol. The [initial MVP run](docs/execution-report.md) records the earlier synthetic results. Generated builds are local artifacts, not bundled model claims.
8
+
9
+ The target is [newly created CAD to a working MuJoCo mechanism](docs/new-cad-workflow.md), with missing mechanics reviewed explicitly. For a fresh generated design, run `python scripts/fresh_design_demo.py --out build/<new-directory> --seed 20261130`. The browser app supplies a local drag-and-drop review workflow; it does not infer authoritative joint mechanics from geometry.
10
+
11
+ ## Install from PyPI
12
+
13
+ Install the published package and start its local CAD review app with:
14
+
15
+ ```sh
16
+ python -m pip install simbridge-cad-mujoco
17
+ simbridge serve
18
+ ```
19
+
20
+ The direct `cad-to-urdf` comparison requires its documented Linux environment and is not part of this initial release. We will update the research results after that comparison is run on Linux.
21
+
22
+ ## Run from the source tree
23
+
24
+ Python 3.12 is recommended. Tested here on macOS arm64 with Python 3.12.12, CadQuery 2.6.1 / OCCT 7.8.1 and MuJoCo 3.3.7. Direct dependencies are pinned in `pyproject.toml`; `uv.lock` pins transitive dependencies and hashes.
25
+
26
+ ```sh
27
+ cd SimBridge
28
+ # First-time setup; uv downloads the locked packages.
29
+ UV_CACHE_DIR="$PWD/.uv-cache" uv sync --frozen --extra dev --python python3.12
30
+ source .venv/bin/activate
31
+
32
+ simbridge inspect examples/two_link.step --out build/inspection.json
33
+ simbridge configure examples/two_link.step --out build/robot.draft.yaml
34
+ # The draft leaves mechanics/materials unresolved. For this demo, use the
35
+ # complete example config below; for your own CAD, review and fill the draft.
36
+ simbridge convert examples/two_link.step --config examples/two_link.yaml --out build/my_arm
37
+ simbridge validate build/my_arm/model.xml --out build/my_arm/recheck.json
38
+
39
+ # Local drag-and-drop CAD review. The service listens on loopback only.
40
+ simbridge serve
41
+
42
+ # macOS viewer: mjpython supplies the required GUI main-thread launcher.
43
+ mjpython -m simbridge preview build/my_arm/model.xml
44
+ # Other platforms:
45
+ # simbridge preview build/my_arm/model.xml
46
+
47
+ # Optional PNG from the actual MuJoCo renderer (graphics session required):
48
+ python scripts/render_preview.py build/my_arm/model.xml --out build/my_arm/preview.png
49
+ ```
50
+
51
+ Conversion requires an empty/new output directory and preserves earlier builds. Exit codes: `0` success, `1` physics validation failure, `2` invalid input/setup. Failed physics still writes the model, IR and report for diagnosis. You can edit a config and convert into a new directory to review a correction.
52
+
53
+ The viewer shows visual geometry in group 2. Toggle group 3 for collision proxies and use the control sliders for motor commands. No floor, free root or controller is inserted. `--duration 5` opens an advancing, automatically closing viewer for a smoke test; on macOS use `mjpython` for this too.
54
+
55
+ `simbridge doctor --out build/environment.json` records dependency/platform versions for bug reports. Validation reports include stable diagnostic categories and suggested repairs alongside the original error text. `configure` never overwrites an existing file and never supplies missing physical semantics.
56
+
57
+ `simbridge serve` opens a local browser workflow for STEP uploads up to 100 MiB. It reviews part placement and volume, collects rigid/articulated intent, material density, parent/joint details, collision choices and optional swept-sphere clearances, then builds and downloads a ZIP with the MJCF, assets, source hashes and validation report. The service binds only to `127.0.0.1`; files and review sessions are stored under `build/review/`. A user-selected cylindrical candidate fills a joint axis and origin for review. It never decides that the parts are actually connected or moving. This release expects valid closed-solid STEP geometry, one rooted tree, and an explicit uniform density.
58
+
59
+ For a CAD-verified corridor, choose **Verified clearance corridor** and supply a JSON list such as:
60
+
61
+ ```json
62
+ [{"center":[0,0,-0.02],"end":[0,0,0.02],"radius":0.003}]
63
+ ```
64
+
65
+ Coordinates are metres in the selected component's local CAD frame. The endpoint line plus radius defines a swept sphere. SimBridge checks the complete corridor against that component with OpenCASCADE, then removes it from an outer box and exports the remaining convex pieces. This encodes a declared path. It does not establish clearance from other links, moving obstacles, or unrelated contacts. A denied CAD check, insufficient mesh budget, or blocked post-repair path is retained in the report.
66
+
67
+ For a research pilot:
68
+
69
+ ```sh
70
+ simbridge benchmark examples/two_link.step --config examples/two_link.yaml \
71
+ --out research/results/my-pilot --repeats 3 --seeds 0 1 2
72
+ python scripts/fetch_cad.py
73
+ python scripts/evaluate_external.py --out research/results/my-external-run
74
+ ```
75
+
76
+ The benchmark compares validator policies on selected output mutations and records a correlated-input blind spot. It is not a competing-exporter comparison or a general accuracy estimate. External tests currently cover geometric ingestion and static integration only. See the [protocol](research/PROTOCOL.md), [source manifest](research/cad-sources.json), and compact [pilot evidence](research/evidence/2026-11-30/README.md).
77
+
78
+ ## Inputs and conventions
79
+
80
+ `inspect` lists occurrence IDs, display names, original definition IDs, hierarchy, placements, bounding boxes and solid mass properties in SI. Select each instance by exact ID in the config, or by display name when unique. IDs are scoped to one STEP export; regenerate/review the config after changing the source CAD assembly.
81
+
82
+ ```yaml
83
+ schema_version: '1.0'
84
+ name: arm
85
+ defaults:
86
+ density: 2700 # explicit user-chosen kg/m³, never assumed
87
+ timestep: 0.002
88
+ gravity: [0, 0, -9.81]
89
+ links:
90
+ - name: base
91
+ part: base # exact occurrence ID or unique display name
92
+ parent: null # exactly one root, anchored to world
93
+ joint: {type: fixed}
94
+ - name: upper
95
+ part: upper
96
+ parent: base
97
+ collision: box # box, convex_hull, adaptive, or corridor
98
+ joint:
99
+ type: revolute # fixed, revolute, prismatic
100
+ axis: [0, 0, 1] # CHILD CAD part frame; normalized on input
101
+ position: [0, 0, 0] # CHILD CAD part frame, metres
102
+ limits: [-1.2, 1.2] # radians, or metres for prismatic
103
+ damping: 0.05
104
+ actuator: {force_limit: 0.5, gear: 1}
105
+ ```
106
+
107
+ Every STEP leaf instance must appear exactly once. A leaf may contain multiple solids treated as one explicitly configured rigid link. Fixed links remain distinct nested bodies; there is no automatic rigid merge. The graph must be one rooted tree. Closed loops, unsupported joint types, duplicate link names, ambiguous part names and unconfigured instances fail clearly.
108
+
109
+ The CAD world frame and handedness are preserved, with default gravity along -Z. OpenCASCADE reads file-declared units and normalizes to millimetres; the pipeline converts geometry, placement, volume and inertia to SI using the appropriate length powers. Config lengths are always metres and angles radians, independent of file units. The STEP pose is `q=0` and must lie within each joint's explicit limits. Body frames are the local CAD definition frames, not the centers of mass. Joint positions and axes are expressed in the child frame. Body nesting uses relative transforms derived from the original world placements.
110
+
111
+ Each link needs a positive `density` or `mass`, or an explicit `defaults.density`. A per-link `mass` overrides the defaults and scales the exact solid inertia assuming uniform density. No material, joint axis, limit or motor strength is silently inferred. Density estimates are only as good as the selected material and solid geometry. Invalid solids, nonpositive mass, nonsymmetric/nonphysical inertia and mirrored transforms are rejected.
112
+
113
+ Motor `force_limit` bounds both control and actuator force **before gear multiplication**. With gear 1, revolute commands are torque in N m and prismatic commands are force in N. The generalized force limit is `force_limit * gear`. Damping defaults to MuJoCo's zero; motors are added only when explicitly configured.
114
+
115
+ Visual meshes are local-frame STL in metres. Collision can use a native box, convex hull, CAD-intersection-refined boxes, or an explicit CAD-checked clearance corridor. Adaptive-box resource limits and unresolved tolerance appear in the report. Corridor mode subtracts only a user-supplied swept sphere from a bounding-box proxy after numerical CAD Boolean and distance checks; it keeps the rest of that coarse proxy and can still misrepresent unrelated contacts. It is not a general collision decomposition or a formal certificate. CoACD can be installed as an optional research baseline, but SimBridge does not use it as an implicit conversion step.
116
+
117
+ `inspect` ranks coaxial cylindrical-surface hints as low-confidence candidates requiring confirmation. The local browser review can apply a selected hint to a moving-joint axis and origin after the user confirms its parent, joint type and limits. Geometry hints do not establish engagement, motion type, limits or actuation. The user still supplies joint semantics.
118
+
119
+ ## Outputs and checks
120
+
121
+ Each build contains `model.xml`, `assets/`, `robot.ir.json`, `config.yaml`, `report.json` and a generated `README.md`. Assets use relative paths, and builds can be moved without the input STEP. The versioned IR includes source SHA-256 hashes, instance/definition IDs, metadata provenance, transforms, dynamics, joints and asset paths. Its JSON Schema is in `docs/robot-ir.schema.json`.
122
+
123
+ Validation compiles with MuJoCo, checks asset resolution and positive/physical inertias, cross-checks the IR against compiled counts, parents, reference world transforms, masses, centers of mass, inertia tensors, joint types/axes/origins/limits/damping, and actuator targets/gears/bounds. It reports initial penetration beyond 10 µm for contacts admitted by MuJoCo's contact filtering. Parent/child and fixed-body contacts can be filtered, so this is not a complete CAD interference check.
124
+
125
+ It then applies bounded positive/negative motor pulses with gravity disabled to check motion direction, and runs at least 1,000 seeded simulation steps at the configured timestep. The run uses random motor commands at 1% of configured limits, refreshed every 25 steps. Finite states, advancing time, numerical warnings and joint-limit excursions are checked. MuJoCo limits are soft: tolerated overshoot is 0.005 rad for hinges and 0.001 m for slides; actual maxima are reported. Falling under gravity is allowed. Passing demonstrates basic consistency, not real-world fidelity or controller stability.
126
+
127
+ ```sh
128
+ pytest -q
129
+ python scripts/run_acceptance.py --out build/acceptance
130
+ # Optional browser/research tools: uv sync --frozen --extra browser --extra research
131
+ # Recreate the synthetic CAD files, if needed:
132
+ python scripts/make_examples.py
133
+ ```
134
+
135
+ The tests independently compare box/cylinder mass properties, rotated/combined inertia using the parallel-axis theorem, nested/repeated STEP instances, file unit normalization, nonzero two-link kinematics, relocated assets, deterministic simulation, signed actuator responses, metadata errors, closed loops and deliberately corrupted exports. The v0.3.0 working tree passes 46 tests; the earlier v0.2.0 snapshot passed 42. The remaining warnings are upstream CadQuery/pyparsing deprecations. The browser smoke separately exercises rigid, articulated and corridor exports. Corridor-mode evidence remains exploratory and is not a complete collision-fidelity result.
136
+
137
+ Five supported fixtures exercise a rigid assembly, a two-link revolute arm with repeated beam definitions, a rotated prismatic mechanism, repeated cylindrical parts, and a pendulum moving under gravity. A sixth fixture, `concentric`, intentionally diagnoses a limitation: the single box proxy fills a bore's hole and intersects its shaft. Its physics report must fail with an initial-penetration error; accurate annular collision needs multiple proxies or decomposition. Its cylindrical surfaces still produce review-only axis candidates.
138
+
139
+ The densities (2700/7850 kg/m³), joint limits, damping and motor strengths are explicit synthetic choices. Benchmark results are written to `summary.json` with separate actual/expected physics results, conversion times, warnings and intervention counts. The script succeeds when all five supported fixtures pass and the annular collision diagnostic is detected. Zero interventions during a run excludes preparation of its config. These small synthetic assemblies do not establish a real import-success rate or the product's proposed performance targets.
140
+
141
+ ## Scope and implementation
142
+
143
+ ```
144
+ src/simbridge/
145
+ ingest/step.py XCAF references, hierarchy, placements, SI conversion
146
+ ir/schema.py strict config and versioned IR
147
+ geometry/meshes.py visual tessellation, box/hull proxies
148
+ dynamics/inertia.py tensor validation, rotation and rigid combination
149
+ articulation/infer.py review-only candidate axes
150
+ compile/mjcf.py deterministic MJCF
151
+ validate/physics.py compilation, cross-checks and actual simulation
152
+ pipeline.py, cli.py artifact pipeline and CLI/viewer
153
+ ```
154
+
155
+ CPU only; no training or GPU requirement. Native CAD mate/material adapters, closed chains, free roots, flexible parts, nonuniform materials, automatic RL tasks and large-assembly resource isolation are outside this experimental release. The current reader records surface-only/invalid leaves in inspection and refuses conversion until the CAD is repaired. Treat external CAD files as trusted local inputs.
156
+
157
+ See `docs/exporter-audit.md` for the checked source capabilities, licenses and implementation decision. No exporter code was copied. Runtime tools are installed only in the project `.venv`.
158
+
159
+ The package builds with `uv build`; the source archive includes example CAD and the wheel installs the CLI. Source checkout users can run the examples directly. CI is configured for Linux/macOS with Python 3.12; hosted CI has not run yet. See [CONTRIBUTING.md](CONTRIBUTING.md), [CITATION.cff](CITATION.cff), [LICENSE](LICENSE), and [third-party notices](THIRD_PARTY.md). No PyPI release, archive DOI or public repository has been created yet.
@@ -0,0 +1,12 @@
1
+ # Third-party sources
2
+
3
+ SimBridge's original code and synthetic examples are MIT licensed. Runtime dependencies retain their own licenses in the installed distributions. No exporter source was copied. This notice does not relicense external CAD.
4
+
5
+ External pilot sources are fetched from immutable revisions in [research/cad-sources.json](research/cad-sources.json), with SHA-256 verification and the original license file beside each download. Downloads and generated full model bundles are excluded from Git/source packages. A compact research record contains metadata, reported metrics and a numerical inertia regression from the external test.
6
+
7
+ | Source | Upstream | Terms retained | Local license copy |
8
+ |---|---|---|---|
9
+ | SO-100 follower and SO-101 assembly | [TheRobotStudio/SO-ARM100](https://github.com/TheRobotStudio/SO-ARM100) | Apache-2.0 | [SO-ARM100-LICENSE](research/licenses/SO-ARM100-LICENSE) |
10
+ | Kaya Nano base | [nvidia-isaac/kaya-robot](https://github.com/nvidia-isaac/kaya-robot) | MIT, Copyright (c) 2019 NVIDIA Isaac | [NVIDIA-Kaya-LICENSE](research/licenses/NVIDIA-Kaya-LICENSE) |
11
+
12
+ Source design authors retain credit for their hardware. Their inclusion in an engineering pilot does not imply endorsement or measured mechanical fidelity. Derived models, if distributed later, need the source notices carried with them; the project MIT license does not replace upstream terms.
@@ -0,0 +1,33 @@
1
+ # CAD-checked clearance corridor repair
2
+
3
+ ## Claim under test
4
+
5
+ Given an initial collision proxy (P), a requested swept-sphere path (W), and a convex polyhedral corridor (C), the method checks that (C) is disjoint from the source CAD solid (S), checks that (Wsubseteq C), then partitions (P\setminus C) into convex pieces. The desired outcome is a MuJoCo proxy that admits the declared path while retaining the initial proxy outside that corridor.
6
+
7
+ The geometry argument is conditional: if (S\subseteq P), the corridor contains the whole swept sphere, and the CAD separation check is valid, then removing the corridor cannot remove CAD material and the requested path is clear of the repaired proxy. The current implementation uses floating-point OCCT Booleans/distances and floating-point mesh clipping. It does not prove (S\subseteq P) for arbitrary tessellated hulls, does not establish clearance from other moving bodies, and is not a formal certificate.
8
+
9
+ ## Why the box study changed direction
10
+
11
+ The initial CAD-oracle adaptive box implementation retained uncertain cells conservatively and offered volume, task-region and swept-witness refinement policies. In the first generated bore comparison, CoACD with threshold 0.03 represented the requested path with 21–26 convex pieces. Adaptive boxes needed up to 64 pieces and still blocked nearby free paths. This is evidence against claiming the box method is superior. The full exploratory traces remain under `build/clearance-pilot-v3/`.
12
+
13
+ The corridor repair instead targets a specific failure: a coarse outer proxy can cover a CAD-verified empty passage. The implementation expands an octagonal prism to contain the supplied capsule, verifies its CAD gap, and subtracts its halfspaces from the proxy hull. It can abstain when CAD clearance, capsule containment, solver tolerance or the geometry budget is insufficient. The added pieces may still be more expensive than a successful CoACD model.
14
+
15
+ ## Comparison design
16
+
17
+ The runner generates bores and rectangular slots with distractor openings, random dimensions and aligned/rotated cases. It uses analytic aperture truth, verifies CAD clearance independently, and evaluates whole swept paths continuously. It records the nominal path, nearby feasible paths, paths that should remain blocked, actual geom counts, construction time, and global random-point occupancy errors. CoACD is recorded at its actual geom counts; it is not mislabeled as matched-budget. A CoACD model that already passes is kept unchanged and only measured for verifier overhead.
18
+
19
+ The initial runner still measures free-space MuJoCo step overhead rather than contact-rich task time. The convex distance checker provides independent geometric labels. Near-tangent cases are excluded; solver and CAD failures remain failures. Procedural families and developer-selected external axes do not establish generality or user benefit.
20
+
21
+ ## Observed pilot results
22
+
23
+ On the product's bounding-box starting proxy, all 12 generated training paths passed continuous checking and dynamic insertion, using twelve convex pieces and a median 0.052 s construction time. The repair retained 384/576 held-out CAD-free sweeps (66.7%) and blocked all 192 known collisions. It also covered 3,232/3,802 sampled CAD-free points (85.0%), showing how conservative the remainder stays outside the requested corridor. CoACD at 0.08 used a median twelve pieces, retained 70.5% of free paths and covered 7.1% of sampled free points; at 0.03 it used 20.5 pieces, retained 90.3%, and covered 2.5%.
24
+
25
+ On the independent Kaya base component, the CAD-checked corridor retained 16/30 held-out free sweeps; CoACD retained 27/30 at both thresholds. The corridor used twelve pieces and took 1.13 s; CoACD used 23/71 pieces and took 7.11/8.97 s. The corridor completed dynamic insertion on its selected path. All paths were selected or generated by the implementer, not supplied by robot designers. These results show a speed/size versus global collision-occupancy tradeoff, not an overall advantage.
26
+
27
+ ## Prior art and novelty limits
28
+
29
+ The closest prior art is James Andrews's [Navigation-Driven Approximate Convex Decomposition](https://doi.org/10.1145/3641519.3657479) (SIGGRAPH 2024). It computes and customizes navigable space for an object of a selected size, then generates convex collision pieces that preserve that space; it also evaluates CoACD and directly targets passage through openings. This substantially overlaps the functional goal of leaving a requested free passage open. It is a more general navigation-space/decomposition algorithm than the current single-path repair. SimBridge's narrower distinction is that it accepts an explicit swept sphere in a STEP component's local frame, checks the corridor against the native OpenCASCADE solid, and subtracts it from a conservative bounding-box cover before exporting to MuJoCo. That distinction is a CAD integration and oracle choice, not established algorithmic novelty.
30
+
31
+ Other relevant work includes [CoACD](https://arxiv.org/abs/2205.02961), [Empart](https://arxiv.org/abs/2509.22847), and [Convex Primitive Decomposition](https://arxiv.org/abs/2602.07369), alongside CAD exporters listed in the paper. CoACD reference 2209.08227 previously listed in project notes was incorrect; that identifier is an unrelated plasma-physics paper. This project must not claim novelty for adaptive boxes, convex clipping, decomposition, CAD conversion, task-conditioned passage preservation, or merely prioritizing a user-marked region.
32
+
33
+ A defensible paper claim requires comparison to navigation-driven decomposition on shared CAD-derived inputs and designer-supplied tasks, plus evidence that the native-CAD oracle changes outcomes or reliability in a useful way. It must also measure manual input effort, geometry cost and MuJoCo task behavior across independently authored models. The current generated-family study and one external selected bore are a feasibility study. They do not yet establish a strong or novel paper contribution.
@@ -0,0 +1,50 @@
1
+ # Local execution results
2
+
3
+ Executed on 2026-11-30 in `/Users/jjburrell/SimBridge`, macOS arm64, Python 3.12.12, CadQuery 2.6.1, OCCT 7.8.1 and MuJoCo 3.3.7.
4
+
5
+ The original failing CAD assembly, CAD application/version, desired articulation and failure logs were unavailable. The original failure remains unverified. All geometry here is synthetic.
6
+
7
+ ## Completed
8
+
9
+ - Installed the project CLI in `.venv` and locked all 59 resolved packages in `uv.lock`. `uv sync --frozen --extra dev --offline` succeeded using the downloaded cache, and `uv lock --check --offline` confirmed consistency.
10
+ - Implemented and ran `inspect`, `convert`, `validate`, and the native `preview` command.
11
+ - `pytest -q`: **37 passed**, in 4.34 seconds. The 15 reported warnings are upstream CadQuery/pyparsing deprecations, not MuJoCo numerical warnings.
12
+ - Generated sample STEP assemblies and explicit metadata, plus portable MJCF, local visual/collision assets, versioned IR, source hashes, reports, and per-build instructions.
13
+ - A five-second native MuJoCo preview exited successfully using `mjpython` with access to the local graphics session. Sandbox-restricted GUI execution aborted; the permitted graphics-session run succeeded. The blocking viewer launch subsequently raised a MuJoCo exception; the CLI now consistently uses the verified passive viewer with an advancing simulation loop.
14
+ - Rendered an actual MuJoCo frame and verified its contents visually. The final demo image is `build/demo/two_link/preview.png`.
15
+
16
+ Final benchmark command:
17
+
18
+ ```sh
19
+ .venv/bin/python scripts/run_acceptance.py --out build/demo
20
+ ```
21
+
22
+ | Fixture | Physics result | Bodies / joints / motors | Steps | Conversion seconds |
23
+ |---|---|---|---:|---:|
24
+ | rigid | pass | 2 / 0 / 0 | 1,000 | 0.115 |
25
+ | two_link | pass | 3 / 2 / 2 | 1,000 | 0.149 |
26
+ | prismatic | pass | 2 / 1 / 1 | 1,000 | 0.106 |
27
+ | repeated | pass | 3 / 0 / 0 | 1,000 | 0.123 |
28
+ | pendulum | pass | 2 / 1 / 1 | 1,000 | 0.114 |
29
+ | concentric | expected collision diagnostic | 2 / 1 / 1 | 1,000 | 0.107 |
30
+
31
+ Each run used timestep 0.002 seconds and seed 0, completed two simulated seconds with finite state, and emitted no numerical warnings. Every configured motor passed independent positive/negative direction pulses. The five supported cases had no initial penetrations or joint-limit excursions. Conversion times include ingestion, geometry, export and simulation checks inside the pipeline; they exclude Python/library startup and fixture creation.
32
+
33
+ The sixth case correctly fails physics validation: the bounding-box proxy for an annular bore fills its hole and penetrates its shaft by 0.005 m. This is retained as a regression diagnostic rather than suppressed through contact exclusions. Exact details are in `build/demo/concentric/report.json`; `build/demo/summary.json` explicitly distinguishes actual physics results from expected results. All benchmark expectations were met.
34
+
35
+ No metadata default was chosen during conversion. The fixture configs explicitly supply materials, articulation, limits, damping and motor strengths. Zero manual interventions during runs excludes fixture/config preparation.
36
+
37
+ ## Checks and remaining work
38
+
39
+ Regression coverage includes independent box/cylinder formulas, off-diagonal/rotated tensors and parallel-axis combination, nested/repeated CAD placements, STEP file unit conversion, nonzero planar-arm forward kinematics, relative asset portability, reproducible dynamics, missing metadata, unsupported/closed-loop graphs, corruption of joint axes and actuator targets/gears/bounds, missing assets and initial penetration.
40
+
41
+ The next useful input is the original STEP assembly with intended degrees of freedom and available failure logs. Real-assembly benchmarks, native mate/material adapters, sliding-surface inference and concave collision decomposition remain future work. Synthetic successes do not establish real-world dynamic fidelity, a five-minute conversion guarantee, or a 95% import-success rate.
42
+
43
+ To open the completed model:
44
+
45
+ ```sh
46
+ cd /Users/jjburrell/SimBridge
47
+ .venv/bin/mjpython -m simbridge preview build/demo/two_link/model.xml
48
+ ```
49
+
50
+ Earlier intermediate runs under `build/acceptance` and `build/verified` are preserved. `build/demo` is the final run.
@@ -0,0 +1,22 @@
1
+ # Exporter audit and implementation decision
2
+
3
+ Source review performed 2026-11-30. Capabilities below describe upstream documentation/source, not an execution or endorsement of those tools. None was added as a dependency and no source was copied. Dependencies used by SimBridge have their own bundled licenses; this is not a redistribution license audit.
4
+
5
+ | Candidate | Verified upstream scope | License | Fit for this MVP |
6
+ |---|---|---|---|
7
+ | [Onshape-to-robot](https://github.com/Rhoban/onshape-to-robot) | Onshape API assembly retrieval; URDF, SDF and MuJoCo export | [MIT](https://github.com/Rhoban/onshape-to-robot/blob/master/LICENSE) | Strong candidate for a later native Onshape adapter; requires Onshape data/access rather than a neutral local STEP input. |
8
+ | [Fusion2MuJoCo](https://github.com/jgillick/Fusion2Mujoco) | Fusion add-in; native joints, visual appearance and optional CoACD collision geometry; rigid/revolute/slider motion | [MIT](https://github.com/jgillick/Fusion2Mujoco/blob/main/LICENSE) | Useful native Fusion path. Requires Fusion and native joint metadata. Its documented fallback for unsupported joints is rigid; this MVP instead rejects unsupported input. |
9
+ | [cad-to-urdf](https://github.com/arugoa/cad-to-urdf) | STEP/native CAD routes, YAML corrections, MJCF/URDF/USD and several simulator outputs | [MIT](https://github.com/arugoa/cad-to-urdf/blob/main/LICENSE) | Closest existing neutral exporter. Considered before implementation; see below. |
10
+ | [Onshape Robotics Toolkit](https://github.com/neurobionics/onshape-robotics-toolkit) | Python Onshape REST API workflow and URDF export | [Apache-2.0](https://github.com/neurobionics/onshape-robotics-toolkit/blob/main/LICENSE) | Useful for native metadata extraction; documented prerequisites include Onshape account/API credentials. |
11
+
12
+ The current [cad-to-urdf documentation](https://github.com/arugoa/cad-to-urdf) directly overlaps the neutral-CAD target: it lists STEP inputs, MJCF output, convex collision shapes, and structural, simulator, asset, and same-scenario sim-to-sim checks across multiple targets. Its documented setup targets Linux and uses a [larger dependency stack](https://github.com/arugoa/cad-to-urdf/blob/main/requirements.txt), including build123d, CoACD and multiple simulators with broad version bounds. For future evaluation, its MIT-licensed source was fetched to `/private/tmp` and pinned at `0941c09b8b43e6e3f94a71d00944915afe1faa6c` on 2026-11-30. It was inspected but not installed or run; this machine is macOS arm64, outside the upstream's documented Linux validation environment. A fair performance or usability comparison remains required before claiming a benefit over it.
13
+
14
+ For this small local macOS MVP, extending that pipeline would require changing its canonical identity/frame model and disabling drafting/default policies while accommodating its dependency stack. The chosen implementation instead uses CadQuery's existing OCCT bindings directly with XCAF occurrence references, requires explicit articulation/materials, pins one simulator, and preserves local definition geometry. This is an engineering fit decision, not a claim that cad-to-urdf cannot be adapted or that it fails to work. For broader CAD/simulator coverage, evaluating it on the user's original assembly should precede further duplication.
15
+
16
+ CadQuery's [format documentation](https://cadquery.readthedocs.io/en/latest/importexport.html) establishes STEP/assembly support; behavior was verified against the installed 2.6.1 bindings and generated assemblies. MuJoCo's [Python documentation](https://mujoco.readthedocs.io/en/stable/python.html) describes native compilation, simulation and viewer APIs. SimBridge is deliberately pinned to 3.3.7 and tested against that installed version, rather than assuming current documentation for later versions applies unchanged. macOS passive viewer execution uses `mjpython`.
17
+
18
+ The original CAD application/version, failing assembly and logs remain unavailable. No native exporter compatibility claim can be made for that original case.
19
+
20
+ ## Expanded prior-art check
21
+
22
+ The initial candidate list was incomplete. The [new-CAD workflow review](new-cad-workflow.md) adds the ACDC4Robot research paper and Fusion exporter, plus SR-Platform's generated-asset-to-MuJoCo scene pipeline. In particular, native design-to-simulation, preflight and provenance already have direct prior art. The implementation decisions above are scope/compatibility choices, not novelty evidence.