Metadata-Version: 2.4
Name: mesh-to-sim-asset
Version: 0.1.0
Summary: Pipeline for converting mesh files into simulation assets
Requires-Python: >=3.10
Requires-Dist: black==25.1.0
Requires-Dist: bpy>=4.0.0
Requires-Dist: coacd>=1.0.7
Requires-Dist: datasets>=4.0.0
Requires-Dist: drake>=1.43.0
Requires-Dist: ipython>=8.37.0
Requires-Dist: isort==5.12.0
Requires-Dist: lxml>=5.4.0
Requires-Dist: manipulation>=2025.5.18
Requires-Dist: numpy>=2.2.6
Requires-Dist: objaverse>=0.1.7
Requires-Dist: openai>=1.12.0
Requires-Dist: pandas>=2.3.1
Requires-Dist: pillow>=10.2.0
Requires-Dist: pycollada>=0.9.2
Requires-Dist: pyvista>=0.45.2
Requires-Dist: scipy>=1.15.3
Requires-Dist: tetgen>=0.6.5
Requires-Dist: tqdm>=4.67.1
Requires-Dist: trimesh>=4.6.10
Requires-Dist: vhacdx>=0.0.8.post2
Description-Content-Type: text/markdown

# mesh-to-sim-asset
Pipeline for converting mesh files into simulation assets

## Installation

This repository uses [uv](https://docs.astral.sh/uv) for dependency management.

1. Install uv:
```sh
curl -LsSf https://astral.sh/uv/install.sh | sh
```

2. Install the dependencies into `.venv`:
```sh
uv sync
```

3. Activate the virtual env:
```sh
source .venv/bin/activate
```

4. Install wine:
```sh
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine
```

5. Install the pre-commit hocks:
```sh
pre-commit install
```

6. Install `git-lfs`:
```sh
git-lfs install
git-lfs pull
```

7. Install blender:
```sh
sudo snap install blender --classic
```

8. Ensure that the `OPENAI_API_KEY` environment variable is set to your OpenAI key.

### [Optional] Install `usd2sdf`

Only required for running `make_asset_drake_compatible.py` with USD inputs.

See [here](https://github.com/gazebosim/gz-usd) for installation instructions.

## Usage

### Geometry/ Mesh to Drake SDF Simulation Asset

Pipeline for converting geometry mesh files into Drake simulation assets with visual
geometries, collision geometries, and physical properties. Non-specified properties
are estimated with a VLM.

The pipeline entrypoint is `create_drake_asset_from_geometry.py`.
Please see that script for argument documentation.

Example:
```sh
python main.py \
    input_dir_path \
    -o output_dir_path \
    -mck
```

### Simulation Asset (USD, URDF, SDF, MJX) to Drake SDF Simulation Asset

Pipeline for converting existing simulation assets (e.g., articulated objects) into
Drake simulation assets with visual geometries, collision geometries, and physical
properties. Non-specified properties are estimated with a VLM.

The pipeline entrypoint is `make_asset_drake_compatible.py`.
Please see that script for argument documentation.

## Validate Static Equilibrium

Simulation assets should at least be statically stable. We can validate this by placing
them onto a flat floor:
```
python scripts/test_mesh_sim.py \
    asset_name.sdf \
    --position "0, 0, 0.1" \
    --rotation "0, 0, 0"
```

Use the `--use_ramp` argument to test rolling down a ramp. We recommend
`--position "0, 0, 0.3"` for the ramp setting.
