Skip to main content

mesh-to-sim-asset

PyPI version License: MIT CI

mesh-to-sim-asset converts 3D mesh files (OBJ, PLY, FBX, GLTF, USD, etc.) into simulation-ready assets for Drake. It automatically estimates physical properties (mass, friction, material) using vision-language models and generates collision geometries, producing complete SDF assets that are ready to drop into a simulation.

Installation

This repository uses uv for dependency management.

  1. Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Install the dependencies into .venv:
uv sync
  1. Activate the virtual env:
source .venv/bin/activate
  1. Install wine:
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine
  1. Install the pre-commit hooks:
pre-commit install
  1. Install git-lfs:
git-lfs install
git-lfs pull
  1. Install blender:
sudo snap install blender --classic
  1. 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 for installation instructions.

Installation via pip

We are hosting a pip wheel on PyPi. Please install using pip install mesh-to-sim-asset.

Note that this will only install the python package (replacing repo cloning + uv sync). You will still need to install the remaining dependencies manually:

Feature External dependency Required?
Mesh rendering / VLM analysis Blender Yes
VLM property estimation OPENAI_API_KEY env var Yes
VTK collision mesh simplification Wine + RoLoPoly (source repo only) Optional — only for VTK collision mode
USD input conversion usd2sdf Optional — only for USD inputs

The pip wheel does not include the RoLoPoly binary or the validation scripts (scripts/). To use VTK-based collision mesh simplification, clone the repository and follow the full installation instructions above.

After installing the pip wheel, the scripts can be run using python -m create_drake_asset_from_geometry and python -m make_asset_drake_compatible.

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:

python create_drake_asset_from_geometry.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.

Development

Build a new wheel and publish it to PyPi

Build the wheel:

uv build

Publish it:

uv publish --token $PYPI_TOKEN

where PYPI_TOKEN refers to the PyPi API token.

Metadata

Release files for mesh-to-sim-asset 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mesh-to-sim-asset 0.1.6
File Size Uploaded
mesh_to_sim_asset-0.1.6.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for mesh-to-sim-asset 0.1.6
File Interpreter ABI Platform
mesh_to_sim_asset-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / mesh_to_sim_asset-0.1.6.tar.gz

Download URL mesh_to_sim_asset-0.1.6.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
953f06491fd90c2d732b2709a0c0b2b672eab79b7741f17e22cfec772f8dc1da
BLAKE2b-256 checksum
How to use checksums
18d46efe6e5fe9ccad0deb5af608095cd1e949b76cf9f791481279c782ca6806
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mesh_to_sim_asset-0.1.6-py3-none-any.whl

Download URL mesh_to_sim_asset-0.1.6-py3-none-any.whl
Size 76.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca3671fe50944598964fc210c9a3e56106af08e6699d6234dc3b578c2e32e9ab
BLAKE2b-256 checksum
How to use checksums
2b1fbdf2ef18e93f3942c0372a70f92c1988f0568032f463a916a23e665cef47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page