yuchi233 commited on
Commit
86b57ca
·
verified ·
1 Parent(s): 77db31c

Upload docs/convex_decomposition_spec.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. docs/convex_decomposition_spec.md +50 -2
docs/convex_decomposition_spec.md CHANGED
@@ -24,6 +24,8 @@ assets/robocasa/derived/convex_decompositions/dishwashers/Dishwasher031_vhacd_v1
24
  │ ├── rack0/
25
  │ └── rack1/
26
  ├── mjcf/
 
 
27
  │ └── convex_collision_include.xml
28
  └── logs/
29
  └── decomposition.json
@@ -40,6 +42,8 @@ assets/discoverse/derived/convex_decompositions/objects/cup_vhacd_v1/
40
  │ ├── part_000.obj
41
  │ └── part_001.obj
42
  ├── mjcf/
 
 
43
  │ └── convex_collision_include.xml
44
  └── logs/
45
  └── decomposition.json
@@ -57,6 +61,32 @@ python scripts/scaffold_convex_decomposition.py assets/robocasa/raw/fixtures/dis
57
 
58
  This creates a new directory under `assets/robocasa/derived/convex_decompositions/...` with placeholder metadata, source references, logs, and MJCF include files. Fill in the generated meshes and replace placeholders before adding the asset to `manifest/assets.jsonl`.
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  ### `metadata.yaml`
61
 
62
  Minimum fields:
@@ -129,10 +159,28 @@ Record tool parameters and hashes:
129
  Do not edit raw `model.xml` in place. If MuJoCo collision integration is needed, write a generated include file under:
130
 
131
  ```text
132
- mjcf/convex_collision_include.xml
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  ```
134
 
135
- Downstream projects can include or compile this file when they want convex collision geometry.
136
 
137
  ## Manifest rule
138
 
 
24
  │ ├── rack0/
25
  │ └── rack1/
26
  ├── mjcf/
27
+ │ ├── convex_assets_include.xml
28
+ │ ├── convex_geoms_include.xml
29
  │ └── convex_collision_include.xml
30
  └── logs/
31
  └── decomposition.json
 
42
  │ ├── part_000.obj
43
  │ └── part_001.obj
44
  ├── mjcf/
45
+ │ ├── convex_assets_include.xml
46
+ │ ├── convex_geoms_include.xml
47
  │ └── convex_collision_include.xml
48
  └── logs/
49
  └── decomposition.json
 
61
 
62
  This creates a new directory under `assets/robocasa/derived/convex_decompositions/...` with placeholder metadata, source references, logs, and MJCF include files. Fill in the generated meshes and replace placeholders before adding the asset to `manifest/assets.jsonl`.
63
 
64
+ ### Run CoACD decomposition
65
+
66
+ Use `scripts/run_convex_decomposition.py` when you want to actually generate convex parts and MuJoCo include files:
67
+
68
+ ```bash
69
+ pip install trimesh coacd
70
+
71
+ python scripts/run_convex_decomposition.py \
72
+ assets/robocasa/raw/fixtures/dishwashers/Dishwasher031 \
73
+ --mesh visuals/door.obj \
74
+ --mesh visuals/rack0.obj \
75
+ --variant coacd_v1 \
76
+ --register-manifest
77
+ ```
78
+
79
+ If `--mesh` is omitted, the script searches common mesh locations under the raw asset directory:
80
+
81
+ ```text
82
+ visuals/*.obj
83
+ visuals/*.stl
84
+ meshes/*.obj
85
+ meshes/*.stl
86
+ ```
87
+
88
+ The script writes generated pieces to `meshes/<mesh_name>/part_000.obj`, records hashes and parameters in `logs/decomposition.json`, and creates MJCF include files under `mjcf/`.
89
+
90
  ### `metadata.yaml`
91
 
92
  Minimum fields:
 
159
  Do not edit raw `model.xml` in place. If MuJoCo collision integration is needed, write a generated include file under:
160
 
161
  ```text
162
+ mjcf/
163
+ ```
164
+
165
+ Generated MJCF should be split by include context:
166
+
167
+ ```text
168
+ mjcf/convex_assets_include.xml # include at MJCF root/top level
169
+ mjcf/convex_geoms_include.xml # include inside the target body
170
+ mjcf/convex_collision_include.xml # standalone wrapper for preview/convenience
171
+ ```
172
+
173
+ Recommended integration pattern:
174
+
175
+ ```xml
176
+ <!-- top level -->
177
+ <include file="path/to/mjcf/convex_assets_include.xml"/>
178
+
179
+ <!-- inside the object body that should receive collision geoms -->
180
+ <include file="path/to/mjcf/convex_geoms_include.xml"/>
181
  ```
182
 
183
+ This split avoids mixing root-level `<asset>` declarations with body-level `<geom>` declarations. `convex_collision_include.xml` is provided as a convenience wrapper body and should not be used when replacing collision geometry inside an existing body hierarchy.
184
 
185
  ## Manifest rule
186