Do not raise an error for flipped triangles if their area contribution is negligible.

PiperOrigin-RevId: 474552367
Change-Id: I9727a74e50a9bab9b04bb0de0b64e11587ed36f1
This commit is contained in:
Alessio Quaglino
2022-09-15 07:06:22 -07:00
committed by Copybara-Service
parent c8517e63a4
commit 0e05e7ce52
2 changed files with 103 additions and 55 deletions
+22
View File
@@ -288,6 +288,28 @@ TEST_F(MujocoTest, FlippedFaceAllowedInertial) {
mj_deleteModel(model);
}
TEST_F(MujocoTest, FlippedFaceAllowedNegligibleArea) {
static constexpr char xml[] = R"(
<mujoco>
<asset>
<mesh name="example_mesh"
vertex="0 0 0 1 0 0 0 1 0 0 0 1 0 0 1"
face="2 0 3 0 1 3 1 2 3 0 2 1 0 3 4" />
</asset>
<worldbody>
<body>
<geom type="mesh" mesh="example_mesh"/>
</body>
</worldbody>
</mujoco>
)";
std::array<char, 1024> error;
mjModel* model = LoadModelFromString(xml, error.data(), error.size());
EXPECT_THAT(model, testing::NotNull());
CheckTetrahedronWasRescaled(model);
mj_deleteModel(model);
}
TEST_F(MujocoTest, AreaTooSmall) {
static constexpr char xml[] = R"(
<mujoco>