Clean-up flex assumptions.

Do not allow a mix of `elastic2d != none` with `dof = trilinear` since the latter assumes 3d elasticity.

Also, do not assume that `flex_interp > 0` in the engine. This will enable to use, e.g., `flex_interp = -1` to mean a linear surface finite element instead of a 3d finite element which is currently identified with `flex_interp = 1`.

PiperOrigin-RevId: 903852035
Change-Id: Ia6290b4a05e9e510ffb7f36d141cd525b40d3110
This commit is contained in:
Alessio Quaglino
2026-04-22 08:00:42 -07:00
committed by Copybara-Service
parent 863a084d7f
commit a891782553
14 changed files with 84 additions and 10 deletions
+1 -1
View File
@@ -31,7 +31,7 @@
</body>
<flexcomp type="mesh" file="bunny.obj" pos="0 0 .1" dim="2" euler="90 0 0"
radius=".001" rgba="0 .7 .7 1" mass=".05" name="softbody" dof="trilinear">
<elasticity young="1e3" poisson="0.1" damping="0.001" elastic2d="stretch"/>
<elasticity young="1e3" poisson="0.1" damping="0.001" elastic2d="none"/>
<contact selfcollide="none" internal="false"/>
</flexcomp>
</worldbody>
+1 -1
View File
@@ -31,7 +31,7 @@
</body>
<flexcomp type="mesh" file="bunny.obj" pos="0 0 0" dim="2" euler="90 0 0" cellcount="3 3 3"
radius=".001" rgba="0 .7 .7 1" mass=".05" name="softbody" dof="trilinear">
<elasticity young="1e3" poisson="0.1" damping="0.01" elastic2d="stretch"/>
<elasticity young="1e3" poisson="0.1" damping="0.01" elastic2d="none"/>
<contact selfcollide="none" internal="false"/>
</flexcomp>
</worldbody>
+1 -1
View File
@@ -31,7 +31,7 @@
</body>
<flexcomp type="mesh" file="bunny.obj" pos="0 0 -.01" dim="2" euler="90 0 0"
radius=".002" rgba="0 .7 .7 1" mass=".05" name="softbody" dof="quadratic">
<elasticity young="1e3" poisson="0.1" damping="0.0001" elastic2d="stretch"/>
<elasticity young="1e3" poisson="0.1" damping="0.0001" elastic2d="none"/>
<contact selfcollide="none" internal="false"/>
</flexcomp>
</worldbody>
+1 -1
View File
@@ -37,7 +37,7 @@
</body>
<flexcomp type="mesh" file="bunny_with_uv.obj" pos="0 0 .1" dim="2" euler="90 0 0"
radius=".001" material="matsponge" mass=".05" name="softbody" dof="trilinear">
<elasticity young="1e3" poisson="0.1" damping="0.001" elastic2d="stretch"/>
<elasticity young="1e3" poisson="0.1" damping="0.001" elastic2d="none"/>
<contact selfcollide="none" internal="false"/>
</flexcomp>
</worldbody>