Implementation:Google deepmind Mujoco User Flexcomp Header
| Knowledge Sources | |
|---|---|
| Domains | Physics Simulation, Deformable Bodies |
| Last Updated | 2026-02-15 04:00 GMT |
Overview
Declares the mjCFlexcomp class and associated enums for flexible composite object types and degrees of freedom.
Description
user_flexcomp.h defines the mjtFcompType enum (grid, box, cylinder, ellipsoid, square, disc, circle, mesh, GMSH, direct) and mjtDof enum (full, radial, trilinear, quadratic) that control flexcomp generation. The mjCFlexcomp class declares methods for making different flexcomp geometries (MakeGrid, MakeBox, MakeSquare, MakeMesh, MakeGMSH), loading GMSH files in v2.2 and v4.1 formats, and grid/box ID computation helpers. Public properties include name, type, count, spacing, and scale arrays.
Usage
Included by the native MJCF reader and the flexcomp implementation to define the interface for flexible deformable object construction.
Code Reference
Source Location
- Repository: Google_deepmind_Mujoco
- File: src/user/user_flexcomp.h
- Lines: 1-118
Key Functions
typedef enum _mjtFcompType {
mjFCOMPTYPE_GRID, mjFCOMPTYPE_BOX, mjFCOMPTYPE_CYLINDER,
mjFCOMPTYPE_ELLIPSOID, mjFCOMPTYPE_SQUARE, mjFCOMPTYPE_DISC,
mjFCOMPTYPE_CIRCLE, mjFCOMPTYPE_MESH, mjFCOMPTYPE_GMSH,
mjFCOMPTYPE_DIRECT
} mjtFcompType;
class mjCFlexcomp {
public:
mjCFlexcomp(void);
bool Make(mjsBody* body, char* error, int error_sz);
bool MakeGrid(char* error, int error_sz);
bool MakeMesh(mjCModel* model, mjsCompiler* compiler, char* error, int error_sz);
bool MakeGMSH(mjCModel* model, mjsCompiler* compiler, char* error, int error_sz);
};
Import
#include "user/user_flexcomp.h"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| N/A | N/A | N/A | Header declaring the mjCFlexcomp class and associated enums |
Outputs
| Name | Type | Description |
|---|---|---|
| mjCFlexcomp | class | Flexcomp object builder with type, count, spacing, and scale properties |