Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Google deepmind Mujoco User Mesh

From Leeroopedia
Revision as of 12:47, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Google_deepmind_Mujoco_User_Mesh.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Physics Simulation, Mesh Processing, Computational Geometry
Last Updated 2026-02-15 04:00 GMT

Overview

Implements mesh loading, processing, convex hull computation, and signed distance field generation for MuJoCo geometric assets.

Description

user_mesh.cc is a large (4671 lines) module responsible for all mesh-related operations in MuJoCo. It loads meshes via tinyobjloader, computes convex hulls using qhull, generates signed distance fields via TriangleMeshDistance, and creates marching cubes isosurfaces using the MC library. The file handles OBJ file parsing, vertex/face processing, normal computation, texture coordinate management, and the conversion of mesh data into MuJoCo-compatible internal formats. It also supports asset caching for performance optimization.

Usage

Used during model compilation whenever mesh assets (OBJ files, STL files, or procedural meshes) are referenced in the model specification, handling the full pipeline from file loading to compiled mesh data.

Code Reference

Source Location

Key Functions

// Key classes and external library usage
// Uses tinyobjloader for OBJ loading
// Uses qhull (qhull_ra.h) for convex hull computation
// Uses TriangleMeshDistance for SDF computation
// Uses MC.h for marching cubes isosurface extraction

Import

#include <mujoco/mjspec.h>
#include "user/user_api.h"
#include "user/user_cache.h"
#include "user/user_model.h"
#include "user/user_objects.h"

I/O Contract

Inputs

Name Type Required Description
resource mjResource* Yes Resource handle for loading mesh file data
model mjCModel* Yes Model context for compilation settings and asset cache
vfs const mjVFS* No Virtual file system for resource lookups

Outputs

Name Type Description
vertices float[] Processed vertex positions
faces int[] Triangle face indices
normals float[] Computed vertex or face normals
texcoords float[] Texture coordinates

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment