diff --git a/doc/XMLreference.rst b/doc/XMLreference.rst index a3df8d0e..756adca1 100644 --- a/doc/XMLreference.rst +++ b/doc/XMLreference.rst @@ -4041,7 +4041,7 @@ extensions specific to flexes. .. _flex-contact-internal: -:at:`internal`: :at-val:`[true, false], "true"` +:at:`internal`: :at-val:`[true, false], "false"` Enables or disables internal collisions which prevent flex self-penetration and element inversion. Note that flex elements that have shared vertices cannot collide (or else there will be permanent contacts). In 1D and 2D, internal collision checks rely on predefined vertex-element pairs, where the vertex is treated as a sphere with the same @@ -4049,7 +4049,9 @@ extensions specific to flexes. flex. The pre-defined vertex-element pairs are generated by the model compiler automatically. In 3D, internal collision checks are performed within each tetraheron: each vertex is collided with the plane corresponding to the opposing triangle face (again using the flex radius). The resulting contacts are always created with condim 1, gap 0, - margin 0. + margin 0. Note that internal contacts modify the behavior implied by the :ref:`elasticity + parameters` and is recommended only for flexes where element inversion cannot be prevented. The + default value of this attribute was changed from "true" to "false" in version 3.3.1. .. _flex-contact-selfcollide: diff --git a/doc/changelog.rst b/doc/changelog.rst index c2361990..b4580149 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -5,6 +5,12 @@ Changelog Upcoming version (not yet released) ----------------------------------- +.. admonition:: Breaking API changes + :class: attention + + - The default value of the flag for toggling :ref:`internal flex contacts` was changed from + "true" to "false". This feature has proven to be counterintuitive for users. + Bug fixes ^^^^^^^^^ - :ref:`mj_jacDot` was missing a term that accounts for the motion of the point with respect to diff --git a/src/user/user_init.c b/src/user/user_init.c index 44b3a4fa..76ea52ad 100644 --- a/src/user/user_init.c +++ b/src/user/user_init.c @@ -229,7 +229,7 @@ void mjs_defaultFlex(mjsFlex* flex) { // set other defaults flex->dim = 2; flex->radius = 0.005; - flex->internal = 1; + flex->internal = 0; flex->selfcollide = mjFLEXSELF_AUTO; flex->activelayers = 1; flex->rgba[0] = flex->rgba[1] = flex->rgba[2] = 0.5f; diff --git a/test/testdata/flex.xml b/test/testdata/flex.xml index 45396300..4e243dbf 100644 --- a/test/testdata/flex.xml +++ b/test/testdata/flex.xml @@ -31,24 +31,27 @@ + + + - +