Introduce trilinear flex parametrization.

These flexes use only 24 DOFs (3 per vertex of the bounding box), while colliding with the full high resolution mesh.

On an 8x8x8 cube, the performance using DOFs at all vertices is

```
 Simulation time      : 18.74 s
 Steps per second     : 533
 Realtime factor      : 0.53 x
 Time per step        : 1874.4 µs

 Contacts per step    : 114.88
 Constraints per step : 3322.51
 Degrees of freedom   : 1536
```

With the new implementation, it is the following:

```
 Simulation time      : 1.82 s
 Steps per second     : 5507
 Realtime factor      : 5.51 x
 Time per step        : 181.6 µs

 Contacts per step    : 38.84
 Constraints per step : 155.36
 Degrees of freedom   : 24
```

PiperOrigin-RevId: 721008829
Change-Id: I833df027527db578d86667cc4b24295bcf6f7d22
This commit is contained in:
Alessio Quaglino
2025-01-29 09:37:37 -08:00
committed by Copybara-Service
parent 1a4b821b6b
commit 7cdf180641
47 changed files with 8967 additions and 96 deletions
+7 -2
View File
@@ -27,7 +27,7 @@
<geom type="box" size=".02 .1 .15" pos=".18 0 -.2" rgba=".2 .2 .2 1"/>
<flexcomp type="mesh" file="cap.obj" pos=".16 0 -.25" dim="3" euler="0 -90 0"
origin="0 0 0" radius=".001" rgba="0 .7 .7 1" mass=".5" name="left">
<edge equality="true"/>
<edge equality="true" solimp="0.95 0.99 0.001 0.5 2"/>
<contact selfcollide="none" internal="false" contype="2" conaffinity="2"/>
<pin id="0 2 3 4 5 6 7 9 11 13 15 17 19 41 45 46 50 53 57 58 61 176 177 179 180 184 185
187 188 192 193 195 196 200 201 203 204 208 209 211 212 214 215 216 217"/>
@@ -38,13 +38,18 @@
<geom type="box" size=".02 .1 .15" pos="-.18 0 -.2" rgba=".2 .2 .2 1"/>
<flexcomp type="mesh" file="cap.obj" pos="-.16 0 -.25" dim="3" euler="0 90 0"
origin="0 0 0" radius=".001" rgba="0 .7 .7 1" mass=".5" name="right">
<edge equality="true"/>
<edge equality="true" solimp="0.95 0.99 0.001 0.5 2"/>
<contact selfcollide="none" internal="false" contype="2" conaffinity="2"/>
<pin id="0 2 3 4 5 6 7 9 11 13 15 17 19 41 45 46 50 53 57 58 61 176 177 179 180 184 185
187 188 192 193 195 196 200 201 203 204 208 209 211 212 214 215 216 217"/>
</flexcomp>
</body>
</body>
<body>
<freejoint/>
<geom type="box" size=".05 .1 .1" pos="0 0 .1" rgba=".5 .5 0 1" priority="1"
contype="2" condim="6"/>
</body>
</worldbody>
<equality>