myoassist.terrains
Modular procedural terrain generator for MuJoCo, designed to be used by MyoAssist and other musculoskeletal-simulation projects within MyoSuite.
myoassist_terrains turns a small JSON description of a grid layout into a
ready-to-include MuJoCo MJCF fragment containing tiles, connectors, materials
and (optionally) heightfield assets. It supports explicit per-cell placement,
weighted-random sampling per cell, parametric variation of every tile type,
and a single shared texture for uniform-palette terrains.
┌──────────────────────────────────────────────────────────────────┐
│ JSON config ──► build_terrain() ──► MjSpec ──► XML include│
│ (Python API) (compose) (CLI) │
└──────────────────────────────────────────────────────────────────┘
Getting started
Installation
The package is published as a normal Python package and is utilized via
pip install -e . (editable) or pip install . for a frozen build.
git clone https://github.com/neumovelab/myoassist.terrains.git
cd myoassist.terrains
pip install -e .
# Optional extras
pip install -e ".[render]" # adds mediapy for ensemble renders
pip install -e ".[dev]" # adds pytest for unit tests
Requires Python >=3.10 and mujoco>=3.3.3.
Quick start
Author a config:
{
"terrain_name": "first_terrain",
"grid": { "rows": 2, "cols": 2, "tile_size": [10.0, 10.0] },
"border": { "width": 0.5, "match_mode": "min" },
"palette_preset": "diverse",
"tiles": [
{ "row": 0, "col": 0, "type": "flat", "params": { "height": 0.0 } },
{ "row": 0, "col": 1, "type": "stairs", "params": { "n_steps": 6, "step_height": 0.18 } },
{ "row": 1, "col": 0, "type": "slope", "params": { "angle_deg": 18.0 } },
{ "row": 1, "col": 1, "type": "rough", "params": { "seed": 42, "vertical_relief": 0.8 } }
]
}
Build it from a project that contains a terrain_config.xml pointer:
cd my_user_project # contains terrain_config.xml + terrain_style.xml
myoassist-terrains build path/to/first_terrain.json --activate
The CLI writes terrain/first_terrain.xml into the project directory and (with
--activate) updates the <include file="terrain/first_terrain.xml"/> line in
terrain_config.xml. Any user model that includes terrain_config.xml
now sees the new terrain.
Preview it without a user model:
myoassist-terrains preview first_terrain
python -m mujoco.viewer --mjcf=terrain/first_terrain_preview.xml
Contents
Detailed documentation lives under docs/:
- Concepts — grid, tiles, connectors, boundary contract, palette, texture, randomisation.
- Tile catalog — all nine tile types with parameter tables.
- Configuration schema — the full JSON config reference.
- CLI reference — the
myoassist-terrainscommands. - Python API — the stable public surface + examples.
- Velocity maps — sampling and rendering 3D target-velocity fields over a terrain.
- Project layout for users — expected project structure and include chaining.
- Utilities and example configs — bundled configs, style templates, and render tooling.
- Extending: adding a custom tile type — registering new tile types.
- Development — running the test suite.
License
Apache 2.0. See LICENSE.
Metadata
Release files for myoassist-terrains 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| myoassist_terrains-0.1.0.tar.gz | 60.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| myoassist_terrains-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 125.5 kB
Release files / myoassist_terrains-0.1.0.tar.gz
| Download URL | myoassist_terrains-0.1.0.tar.gz |
|---|---|
| Size | 60.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac8bed3dbbb2180361f78733cfb40529889863b3ec9c70af6a8cc88856925cd9
|
|
BLAKE2b-256 checksum How to use checksums |
7de71fb3f7f7098f59b308bd3bdafa68ca6ccffaaa152021d8a3228484ab5e27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.
Transparency logRelease files / myoassist_terrains-0.1.0-py3-none-any.whl
| Download URL | myoassist_terrains-0.1.0-py3-none-any.whl |
|---|---|
| Size | 65.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e03c9b1b1067442d74b033d7e5ace5531f4825defddfe38ea1c795f5190de749
|
|
BLAKE2b-256 checksum How to use checksums |
64fa4fa53bea8f5acb61f943eb5a95cc13a00fde1b430d10116711c0633f7dfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.
Transparency log