Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/integration_tests/pybinds_tests/test_pybind_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ def test_DFPointCloud_properties(create_DFPointCloudSampleRoof):
assert pc.has_colors() == False, "has_colors() should return False"
assert pc.has_normals() == False, "has_normals() should return False"

def test_DFPointCloud_add_points():
point_pc_1 = [(0, 0, 0)]
point_pc_2 = [(1, 1, 1)]
normal_pc_1 = [(0, 0, 1)]
normal_pc_2 = [(1, 0, 0)]
color_pc_1 = [(255, 0, 0)]
color_pc_2 = [(0, 255, 0)]
pc_1 = dfb.dfb_geometry.DFPointCloud(point_pc_1, normal_pc_1, color_pc_1)
pc_2 = dfb.dfb_geometry.DFPointCloud(point_pc_2, normal_pc_2, color_pc_2)
pc_1.add_points(pc_2)
assert pc_1.points.__len__() == 2, "two pointclouds of 1 pt combined into one should have 2 pts"

def test_DFPointCloud_apply_color(create_DFPointCloudSampleRoof):
pc = create_DFPointCloudSampleRoof
pc.apply_color(255, 0, 0)
Expand Down
7 changes: 7 additions & 0 deletions tests/unit_tests/DFPointCloudTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ TEST_F(DFPointCloudTestFixture, ComputeDistance) {
EXPECT_EQ(distances.size(), 7379);
}

TEST_F(DFPointCloudTestFixture, AddPoints) {
std::shared_ptr<diffCheck::geometry::DFPointCloud> dfPointCloud2 = std::make_shared<diffCheck::geometry::DFPointCloud>();
dfPointCloud2->LoadFromPLY(diffCheck::io::GetRoofQuarterPlyPath());
dfPointCloud.AddPoints(*dfPointCloud2);
EXPECT_EQ(dfPointCloud.GetNumPoints(), 7379 * 2);
}

TEST_F(DFPointCloudTestFixture, ComputeAABB) {
std::vector<Eigen::Vector3d> bbox = dfPointCloud.ComputeBoundingBox();
EXPECT_EQ(bbox.size(), 2);
Expand Down