There was an error while loading. Please reload this page.
2 parents b379924 + c4c395a commit 69ca054Copy full SHA for 69ca054
2 files changed
tests/integration_tests/pybinds_tests/test_pybind_units.py
@@ -75,6 +75,18 @@ def test_DFPointCloud_properties(create_DFPointCloudSampleRoof):
75
assert pc.has_colors() == False, "has_colors() should return False"
76
assert pc.has_normals() == False, "has_normals() should return False"
77
78
+def test_DFPointCloud_add_points():
79
+ point_pc_1 = [(0, 0, 0)]
80
+ point_pc_2 = [(1, 1, 1)]
81
+ normal_pc_1 = [(0, 0, 1)]
82
+ normal_pc_2 = [(1, 0, 0)]
83
+ color_pc_1 = [(255, 0, 0)]
84
+ color_pc_2 = [(0, 255, 0)]
85
+ pc_1 = dfb.dfb_geometry.DFPointCloud(point_pc_1, normal_pc_1, color_pc_1)
86
+ pc_2 = dfb.dfb_geometry.DFPointCloud(point_pc_2, normal_pc_2, color_pc_2)
87
+ pc_1.add_points(pc_2)
88
+ assert pc_1.points.__len__() == 2, "two pointclouds of 1 pt combined into one should have 2 pts"
89
+
90
def test_DFPointCloud_apply_color(create_DFPointCloudSampleRoof):
91
pc = create_DFPointCloudSampleRoof
92
pc.apply_color(255, 0, 0)
tests/unit_tests/DFPointCloudTest.cc
@@ -117,6 +117,13 @@ TEST_F(DFPointCloudTestFixture, ComputeDistance) {
117
EXPECT_EQ(distances.size(), 7379);
118
}
119
120
+TEST_F(DFPointCloudTestFixture, AddPoints) {
121
+ std::shared_ptr<diffCheck::geometry::DFPointCloud> dfPointCloud2 = std::make_shared<diffCheck::geometry::DFPointCloud>();
122
+ dfPointCloud2->LoadFromPLY(diffCheck::io::GetRoofQuarterPlyPath());
123
+ dfPointCloud.AddPoints(*dfPointCloud2);
124
+ EXPECT_EQ(dfPointCloud.GetNumPoints(), 7379 * 2);
125
+}
126
127
TEST_F(DFPointCloudTestFixture, ComputeAABB) {
128
std::vector<Eigen::Vector3d> bbox = dfPointCloud.ComputeBoundingBox();
129
EXPECT_EQ(bbox.size(), 2);
0 commit comments