Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <ichen@openrobotics.org>
  • Loading branch information
iche033 committed Mar 14, 2024
1 parent aca682c commit 9a530b0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions graphics/src/MeshManager_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,15 @@ TEST_F(MeshManager, ConvexDecomposition)
const common::Mesh *boxMesh = mgr->Load(
common::testing::TestFile("data", "box.dae"));

ASSERT_NE(nullptr, boxMesh);
EXPECT_EQ(1u, boxMesh->SubMeshCount());

gzdbg << "Decomposing box " << std::endl;
std::size_t maxConvexHulls = 4;
std::size_t resolution = 1000;
auto decomposed = mgr->ConvexDecomposition(
boxMesh->SubMeshByIndex(0u).lock().get());
boxMesh->SubMeshByIndex(0u).lock().get(), maxConvexHulls, resolution);
gzdbg << "Decomposing box done " << std::endl;

// Decomposing a box should just produce a box
EXPECT_EQ(1u, decomposed.size());
Expand All @@ -310,14 +316,15 @@ TEST_F(MeshManager, ConvexDecomposition)
EXPECT_EQ(8u, boxSubmesh.NormalCount());
EXPECT_EQ(36u, boxSubmesh.IndexCount());

std::size_t maxConvexHulls = 4;
std::size_t resolution = 1000;
const common::Mesh *drillMesh = mgr->Load(
common::testing::TestFile("data", "cordless_drill",
"meshes", "cordless_drill.dae"));
ASSERT_NE(nullptr, drillMesh);
EXPECT_EQ(1u, drillMesh->SubMeshCount());
gzdbg << "Decomposing drill " << std::endl;
decomposed = mgr->ConvexDecomposition(
drillMesh->SubMeshByIndex(0u).lock().get(), maxConvexHulls, resolution);
gzdbg << "Decomposing drill done " << std::endl;

// A drill should be decomposed into multiple submeshes
EXPECT_LT(1u, decomposed.size());
Expand Down

0 comments on commit 9a530b0

Please sign in to comment.