vuer-sim 0.0.1__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.
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ node_modules/
11
+ docs/dist/
12
+ .DS_Store
13
+ *.tmp
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ ## 0.0.1 — 2026-11-22
4
+
5
+ First release.
6
+
7
+ - `PhysicsMaterial` (friction, restitution, density, solref, solimp, condim, priority, margin,
8
+ gap) with MJCF (geom attributes, `<default>` classes, compiled models) and
9
+ USD converters: UsdPhysics plus the `mjcPhysics` names of MuJoCo 4.0.1 (`mjc:solref`,
10
+ `mjc:torsionalfriction`, ... on material and collider prims). Restitution maps to the
11
+ `solref` damping ratio. Sensor materials use `vuersim:` attributes.
12
+ - `infer_physics`: a documented visual-to-physics lookup table with sources and confidence.
13
+ - `SensorMaterial` and `lidar_returns`: dropout, glass, black surfaces, range noise, intensity.
14
+ - `MaterialTable`: `materials.json` in a bundle (stored form), assignment rules, `apply` to
15
+ `MjSpec` or `MjModel`, `sensor_arrays`.
16
+ - `vuer_sim.viewer`: vuer events that load and save the table for the `@vuer-ai/vuer-sim` editor.
17
+ - Dockit docs site and the `vuer-sim` agent skill.
vuer_sim-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ge Yang
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,93 @@
1
+ Metadata-Version: 2.5
2
+ Name: vuer-sim
3
+ Version: 0.0.1
4
+ Summary: Simulation materials for MuJoCo and USD scenes: physics materials, visual-to-physics inference, LiDAR materials, and an editor for vuer.
5
+ Project-URL: Homepage, https://github.com/vuer-ai/vuer-sim
6
+ Project-URL: Documentation, https://vuer-sim.dreamlake.ai
7
+ Project-URL: Repository, https://github.com/vuer-ai/vuer-sim
8
+ Author-email: Ge Yang <ge@fortyfive.ai>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Scientific/Engineering :: Physics
16
+ Requires-Python: >=3.10
17
+ Requires-Dist: numpy>=1.21
18
+ Provides-Extra: all
19
+ Requires-Dist: mujoco>=3.2; extra == 'all'
20
+ Requires-Dist: usd-core>=24.5; extra == 'all'
21
+ Requires-Dist: vuer>=0.1.6; extra == 'all'
22
+ Provides-Extra: mujoco
23
+ Requires-Dist: mujoco>=3.2; extra == 'mujoco'
24
+ Provides-Extra: usd
25
+ Requires-Dist: usd-core>=24.5; extra == 'usd'
26
+ Provides-Extra: viewer
27
+ Requires-Dist: vuer>=0.1.6; extra == 'viewer'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # vuer-sim
31
+
32
+ Simulation materials for MuJoCo and USD scenes.
33
+
34
+ - **`PhysicsMaterial`**: friction (slide, torsion, roll), restitution, density, `solref`,
35
+ `solimp`, `condim`, `priority`, `margin`, with `from_mjcf`/`to_mjcf` (geom attributes and
36
+ `<default>` classes) and `from_usd`/`to_usd` (UsdPhysics plus MuJoCo's `mjcPhysics`
37
+ schema names, pinned at MuJoCo 4.0.1).
38
+ - **Restitution in MuJoCo** through the `solref` damping ratio:
39
+ `z = -ln(e) / sqrt(π² + ln(e)²)`. The [docs](docs/pages/guides/restitution/+Page.mdx)
40
+ give the limits and measured bounce values.
41
+ - **`infer_physics`**: a visual-to-physics lookup table (wood, metal, plastic, rubber,
42
+ glass, fabric, ceramic, ...) with sources and a confidence.
43
+ - **`SensorMaterial`** and **`lidar_returns`**: dropout, glass, black surfaces, range noise
44
+ and intensity for the per-ray geom ids of a ray-cast LiDAR.
45
+ - **`MaterialTable`**: `materials.json` in a scene bundle; `load`, `save`, `apply(model)`.
46
+ - **Editor**: `@vuer-ai/vuer-sim` (TypeScript) edits a table in the browser and saves it
47
+ through vuer events that `vuer_sim.viewer` handles.
48
+
49
+ The core needs only numpy. vuer is optional.
50
+
51
+ ```bash
52
+ pip install vuer-sim # core
53
+ pip install 'vuer-sim[mujoco]' # apply tables to MuJoCo models
54
+ pip install 'vuer-sim[usd]' # USD converters (usd-core)
55
+ pip install 'vuer-sim[viewer]' # editor events (vuer)
56
+ ```
57
+
58
+ ```python
59
+ import mujoco
60
+ from vuer_sim import MaterialTable, infer_physics
61
+
62
+ spec = mujoco.MjSpec.from_file("examples/lab_table/scene.xml")
63
+ table = MaterialTable()
64
+ for m in spec.materials:
65
+ guess = infer_physics({"name": m.name, "base_color": list(m.rgba)}, name=m.name)
66
+ table.add(guess.material)
67
+ table.assign[f"material:{m.name}"] = m.name
68
+ table.save("examples/lab_table") # materials.json
69
+ table.apply(spec)
70
+ model = spec.compile()
71
+ ```
72
+
73
+ See `examples/build_material_table.py` and `examples/edit_materials.py`.
74
+
75
+ ## Docs
76
+
77
+ The docs are a [dockit](https://dockit.dreamlake.ai) site in `docs/` (`pnpm --dir docs dev`).
78
+ The agent skill is generated into `skills/vuer-sim/`.
79
+
80
+ ## Development
81
+
82
+ ```bash
83
+ uv sync --group dev --group heavy
84
+ make check # lint, typecheck, fast tests: what PR CI runs
85
+ ./scripts/local-checks.sh # MuJoCo, USD and vuer tests, and the example
86
+ ```
87
+
88
+ Release: a `Release vX.Y.Z` PR bumps `pyproject.toml` and `CHANGELOG.md`; after the merge,
89
+ `make release` tags `vX.Y.Z` and publishes to PyPI.
90
+
91
+ ## License
92
+
93
+ MIT
@@ -0,0 +1,64 @@
1
+ # vuer-sim
2
+
3
+ Simulation materials for MuJoCo and USD scenes.
4
+
5
+ - **`PhysicsMaterial`**: friction (slide, torsion, roll), restitution, density, `solref`,
6
+ `solimp`, `condim`, `priority`, `margin`, with `from_mjcf`/`to_mjcf` (geom attributes and
7
+ `<default>` classes) and `from_usd`/`to_usd` (UsdPhysics plus MuJoCo's `mjcPhysics`
8
+ schema names, pinned at MuJoCo 4.0.1).
9
+ - **Restitution in MuJoCo** through the `solref` damping ratio:
10
+ `z = -ln(e) / sqrt(π² + ln(e)²)`. The [docs](docs/pages/guides/restitution/+Page.mdx)
11
+ give the limits and measured bounce values.
12
+ - **`infer_physics`**: a visual-to-physics lookup table (wood, metal, plastic, rubber,
13
+ glass, fabric, ceramic, ...) with sources and a confidence.
14
+ - **`SensorMaterial`** and **`lidar_returns`**: dropout, glass, black surfaces, range noise
15
+ and intensity for the per-ray geom ids of a ray-cast LiDAR.
16
+ - **`MaterialTable`**: `materials.json` in a scene bundle; `load`, `save`, `apply(model)`.
17
+ - **Editor**: `@vuer-ai/vuer-sim` (TypeScript) edits a table in the browser and saves it
18
+ through vuer events that `vuer_sim.viewer` handles.
19
+
20
+ The core needs only numpy. vuer is optional.
21
+
22
+ ```bash
23
+ pip install vuer-sim # core
24
+ pip install 'vuer-sim[mujoco]' # apply tables to MuJoCo models
25
+ pip install 'vuer-sim[usd]' # USD converters (usd-core)
26
+ pip install 'vuer-sim[viewer]' # editor events (vuer)
27
+ ```
28
+
29
+ ```python
30
+ import mujoco
31
+ from vuer_sim import MaterialTable, infer_physics
32
+
33
+ spec = mujoco.MjSpec.from_file("examples/lab_table/scene.xml")
34
+ table = MaterialTable()
35
+ for m in spec.materials:
36
+ guess = infer_physics({"name": m.name, "base_color": list(m.rgba)}, name=m.name)
37
+ table.add(guess.material)
38
+ table.assign[f"material:{m.name}"] = m.name
39
+ table.save("examples/lab_table") # materials.json
40
+ table.apply(spec)
41
+ model = spec.compile()
42
+ ```
43
+
44
+ See `examples/build_material_table.py` and `examples/edit_materials.py`.
45
+
46
+ ## Docs
47
+
48
+ The docs are a [dockit](https://dockit.dreamlake.ai) site in `docs/` (`pnpm --dir docs dev`).
49
+ The agent skill is generated into `skills/vuer-sim/`.
50
+
51
+ ## Development
52
+
53
+ ```bash
54
+ uv sync --group dev --group heavy
55
+ make check # lint, typecheck, fast tests: what PR CI runs
56
+ ./scripts/local-checks.sh # MuJoCo, USD and vuer tests, and the example
57
+ ```
58
+
59
+ Release: a `Release vX.Y.Z` PR bumps `pyproject.toml` and `CHANGELOG.md`; after the merge,
60
+ `make release` tags `vX.Y.Z` and publishes to PyPI.
61
+
62
+ ## License
63
+
64
+ MIT
@@ -0,0 +1,67 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "vuer-sim"
7
+ version = "0.0.1"
8
+ description = "Simulation materials for MuJoCo and USD scenes: physics materials, visual-to-physics inference, LiDAR materials, and an editor for vuer."
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [{ name = "Ge Yang", email = "ge@fortyfive.ai" }]
12
+ requires-python = ">=3.10"
13
+ classifiers = [
14
+ "Development Status :: 3 - Alpha",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Topic :: Scientific/Engineering :: Physics",
19
+ ]
20
+ dependencies = ["numpy>=1.21"]
21
+
22
+ [project.optional-dependencies]
23
+ mujoco = ["mujoco>=3.2"]
24
+ usd = ["usd-core>=24.5"]
25
+ viewer = ["vuer>=0.1.6"]
26
+ all = ["vuer-sim[mujoco,usd,viewer]"]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/vuer-ai/vuer-sim"
30
+ Documentation = "https://vuer-sim.dreamlake.ai"
31
+ Repository = "https://github.com/vuer-ai/vuer-sim"
32
+
33
+ [dependency-groups]
34
+ # Fast unit tests and static checks: what PR CI installs.
35
+ dev = ["pytest>=8", "ruff>=0.6", "mypy>=1.11"]
36
+ # Heavy checks that run locally or by manual dispatch (scripts/local-checks.sh).
37
+ heavy = ["mujoco>=3.2", "usd-core>=24.5", "vuer>=0.1.6"]
38
+
39
+ [tool.hatch.build.targets.wheel]
40
+ packages = ["src/vuer_sim"]
41
+
42
+ [tool.hatch.build.targets.sdist]
43
+ include = ["src/vuer_sim", "README.md", "LICENSE", "CHANGELOG.md"]
44
+
45
+ [tool.pytest.ini_options]
46
+ testpaths = ["tests"]
47
+ markers = [
48
+ "mujoco: needs mujoco (heavy; local or manual dispatch)",
49
+ "usd: needs pxr from usd-core (heavy; local or manual dispatch)",
50
+ "viewer: needs vuer (heavy; local or manual dispatch)",
51
+ ]
52
+
53
+ [tool.ruff]
54
+ line-length = 110
55
+ target-version = "py310"
56
+ # Generated or prose-only trees: ruff must not reformat code blocks in the skill markdown.
57
+ extend-exclude = ["docs", "skills"]
58
+
59
+ [tool.ruff.lint]
60
+ select = ["E", "F", "I", "B", "UP"]
61
+ ignore = ["E501", "UP037"]
62
+
63
+ [tool.mypy]
64
+ python_version = "3.10"
65
+ files = ["src/vuer_sim"]
66
+ ignore_missing_imports = true
67
+ check_untyped_defs = true
@@ -0,0 +1,43 @@
1
+ """vuer-sim: simulation materials for MuJoCo and USD scenes.
2
+
3
+ The core needs only numpy. Optional extras: ``[mujoco]`` (apply tables to
4
+ models), ``[usd]`` (``pxr`` converters), ``[viewer]`` (the vuer editor events).
5
+ """
6
+
7
+ from .infer import CATEGORIES, Inferred, infer_physics, lookup_table
8
+ from .physics import (
9
+ PhysicsMaterial,
10
+ dampratio_to_restitution,
11
+ max_stable_timestep,
12
+ mjcf_defaults,
13
+ restitution_to_dampratio,
14
+ solref_restitution,
15
+ )
16
+ from .sensor import LidarReturns, SensorArrays, SensorMaterial, lidar_returns
17
+ from .table import ApplyReport, MaterialTable
18
+
19
+ try:
20
+ from importlib.metadata import version as _version
21
+
22
+ __version__ = _version("vuer-sim")
23
+ except Exception: # pragma: no cover - source tree without an install
24
+ __version__ = "0+unknown"
25
+
26
+ __all__ = [
27
+ "ApplyReport",
28
+ "CATEGORIES",
29
+ "Inferred",
30
+ "LidarReturns",
31
+ "MaterialTable",
32
+ "PhysicsMaterial",
33
+ "SensorArrays",
34
+ "SensorMaterial",
35
+ "dampratio_to_restitution",
36
+ "infer_physics",
37
+ "lidar_returns",
38
+ "lookup_table",
39
+ "max_stable_timestep",
40
+ "mjcf_defaults",
41
+ "restitution_to_dampratio",
42
+ "solref_restitution",
43
+ ]
@@ -0,0 +1,29 @@
1
+ """Number formatting and the stored JSON form shared by every vuer-sim file."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ from collections.abc import Iterable
7
+ from typing import Any
8
+
9
+
10
+ def num(v: float) -> str:
11
+ """Shortest text that parses back to the same float (``1.0`` -> ``"1"``)."""
12
+ v = float(v)
13
+ if v.is_integer() and abs(v) < 1e16:
14
+ return str(int(v))
15
+ return repr(v)
16
+
17
+
18
+ def nums(vs: Iterable[float]) -> str:
19
+ """Space-separated ``num`` values, as MJCF writes vectors."""
20
+ return " ".join(num(v) for v in vs)
21
+
22
+
23
+ def parse_nums(text: str) -> tuple[float, ...]:
24
+ return tuple(float(t) for t in str(text).split())
25
+
26
+
27
+ def dumps(obj: Any) -> str:
28
+ """Stored form of the DreamLake bundle contract: sorted keys, 2-space indent, trailing newline."""
29
+ return json.dumps(obj, sort_keys=True, indent=2, ensure_ascii=False) + "\n"