Skip to content

Commit 6c84650

Browse files
feat: get rig of angleAssociationThreshold parameter that is now unused
1 parent 9fef73c commit 6c84650

5 files changed

Lines changed: 1 addition & 26 deletions

File tree

src/diffCheck/segmentation/DFSegmentation.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ namespace diffCheck::segmentation
102102
std::vector<std::shared_ptr<geometry::DFPointCloud>> &clusters,
103103
double angleThreshold,
104104
double associationThreshold,
105-
double angleAssociationThreshold,
106105
double maximumFaceSegmentDistance)
107106
{
108107
std::vector<std::shared_ptr<geometry::DFPointCloud>> faceSegments = std::vector<std::shared_ptr<geometry::DFPointCloud>>();
@@ -362,7 +361,6 @@ namespace diffCheck::segmentation
362361
std::vector<std::vector<std::shared_ptr<geometry::DFMesh>>> meshes,
363362
double angleThreshold,
364363
double associationThreshold,
365-
double angleAssociationThreshold,
366364
double maximumFaceSegmentDistance)
367365
{
368366
if (unassociatedClusters.size() == 0)
@@ -471,7 +469,7 @@ namespace diffCheck::segmentation
471469

472470
double currentDistance = (clusterCenter - faceCenter).norm() * std::abs(std::cos(clusterNormalToJunctionLineAngle))
473471
/ std::min(std::abs(clusterNormal.dot(faceNormal)), 0.05) ;
474-
if (std::abs(sin(acos(faceNormal.dot(clusterNormal)))) < angleThreshold && currentDistance < maximumFaceSegmentDistance && currentDistance * (angleAssociationThreshold + std::abs(faceNormal.dot((faceCenter - clusterCenter) / (faceCenter - clusterCenter).norm()))) < distance)
472+
if (std::abs(sin(acos(faceNormal.dot(clusterNormal)))) < angleThreshold && currentDistance < maximumFaceSegmentDistance && currentDistance * (std::abs(faceNormal.dot((faceCenter - clusterCenter) / (faceCenter - clusterCenter).norm()))) < distance)
475473
{
476474
goodMeshIndex = meshIndex;
477475
goodFaceIndex = faceIndex;

src/diffCheck/segmentation/DFSegmentation.hh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ namespace diffCheck::segmentation
3333
* @param clusters the vector of clusters from cilantro to associate with the mesh faces of the reference mesh
3434
* @param angleThreshold the threshold to consider the a cluster as potential candidate for association. the value passed is the minimum sine of the angles. A value of 0 requires perfect alignment (angle = 0), while a value of 0.1 allows an angle of 5.7 degrees.
3535
* @param associationThreshold the threshold to consider the points of a segment and a mesh face as associable. It is the ratio between the surface of the closest mesh triangle and the sum of the areas of the three triangles that form the rest of the pyramid described by the mesh triangle and the point we want to associate or not. The lower the number, the more strict the association will be and some poinnts on the mesh face might be wrongfully excluded.
36-
* @param angleAssociationThreshold a number to indicate how much distance in the plane of the face should be favored, compared to distance orthogonal to the face normal. If set to 0, any face in the same plane as the face will be considered as having a distance of 0. If set to a high value (e.g. 1000000), no difference will be made between distance in the plane of the face and orthogonal to it. Default is 0.5
3736
* @param maximumFaceSegmentDistance the maximum distance a segment's center of mass can be perpendicularly to a mesh face
3837
* @return std::shared_ptr<geometry::DFPointCloud> The unified segments
3938
*/
@@ -44,7 +43,6 @@ namespace diffCheck::segmentation
4443
std::vector<std::shared_ptr<geometry::DFPointCloud>> &clusters,
4544
double angleThreshold = 0.1,
4645
double associationThreshold = 0.1,
47-
double angleAssociationThreshold = 0.5,
4846
double maximumFaceSegmentDistance = 0.05);
4947

5048
/** @brief Iterated through clusters and finds the corresponding mesh face. It then associates the points of the cluster that are on the mesh face to the segment already associated with the mesh face.
@@ -55,7 +53,6 @@ namespace diffCheck::segmentation
5553
* @param meshes the mesh faces for all the model. This is used to associate the clusters to the mesh faces.
5654
* @param angleThreshold the threshold to consider the a cluster as potential candidate for association. the value passed is the minimum sine of the angles. A value of 0 requires perfect alignment (angle = 0), while a value of 0.1 allows an angle of 5.7 degrees.
5755
* @param associationThreshold the threshold to consider the points of a segment and a mesh face as associable. It is the ratio between the surface of the closest mesh triangle and the sum of the areas of the three triangles that form the rest of the pyramid described by the mesh triangle and the point we want to associate or not. The lower the number, the more strict the association will be and some poinnts on the mesh face might be wrongfully excluded.
58-
* @param angleAssociationThreshold a number to indicate how much distance in the plane of the face should be favored, compared to distance orthogonal to the face normal. If set to 0, any face in the same plane as the face will be considered as having a distance of 0. If set to a high value (e.g. 1000000), no difference will be made between distance in the plane of the face and orthogonal to it. Default is 0.5
5956
* @param maximumFaceSegmentDistance the maximum distance a segment's center of mass can be perpendicularly to a mesh face
6057
* @return void
6158
*/
@@ -67,7 +64,6 @@ namespace diffCheck::segmentation
6764
std::vector<std::vector<std::shared_ptr<geometry::DFMesh>>> meshes,
6865
double angleThreshold = 0.1,
6966
double associationThreshold = 0.1,
70-
double angleAssociationThreshold = 0.5,
7167
double maximumFaceSegmentDistance = 0.05);
7268
};
7369
} // namespace diffCheck::segmentation

src/diffCheckBindings.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ PYBIND11_MODULE(diffcheck_bindings, m) {
231231
py::arg("unassociated_clusters"),
232232
py::arg("angle_threshold") = 0.1,
233233
py::arg("association_threshold") = 0.1,
234-
py::arg("angle_association_threshold") = 0.5,
235234
py::arg("maximum_face_segment_distance") = 0.05)
236235

237236
.def_static("clean_unassociated_clusters", &diffCheck::segmentation::DFSegmentation::CleanUnassociatedClusters,
@@ -242,6 +241,5 @@ PYBIND11_MODULE(diffcheck_bindings, m) {
242241
py::arg("reference_mesh"),
243242
py::arg("angle_threshold") = 0.1,
244243
py::arg("association_threshold") = 0.1,
245-
py::arg("angle_association_threshold") = 0.5,
246244
py::arg("maximum_face_segment_distance") = 0.05);
247245
}

src/gh/components/DF_CAD_segmentator/code.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def RunScript(self,
2121
i_assembly,
2222
i_angle_threshold: float,
2323
i_association_threshold: float,
24-
i_angle_association_threshold: float,
2524
i_maximum_face_segment_distance: float,
2625
i_radius_normal_estimation: float,
2726
i_max_correspondence_distance_icp: float):
@@ -33,8 +32,6 @@ def RunScript(self,
3332
i_angle_threshold = 0.1
3433
if i_association_threshold is None:
3534
i_association_threshold = 0.1
36-
if i_angle_association_threshold is None:
37-
i_angle_association_threshold = 0.5
3835
if i_radius_normal_estimation is None:
3936
i_radius_normal_estimation = 0.01
4037
o_face_clusters = []
@@ -97,7 +94,6 @@ def RunScript(self,
9794
unassociated_clusters=df_clouds,
9895
angle_threshold=i_angle_threshold,
9996
association_threshold=i_association_threshold,
100-
angle_association_threshold=i_angle_association_threshold,
10197
maximum_face_segment_distance=i_maximum_face_segment_distance
10298
)
10399
df_asssociated_cluster_faces_per_beam.append(df_new_asssociated_cluster_faces)
@@ -117,7 +113,6 @@ def RunScript(self,
117113
reference_mesh=[df_b_mesh_faces],
118114
angle_threshold=i_angle_threshold,
119115
association_threshold=i_association_threshold,
120-
angle_association_threshold=i_angle_association_threshold,
121116
maximum_face_segment_distance=i_maximum_face_segment_distance
122117
)
123118

src/gh/components/DF_CAD_segmentator/metadata.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,6 @@
6161
"sourceCount": 0,
6262
"typeHintID": "float"
6363
},
64-
{
65-
"name": "i_angle_association_threshold",
66-
"nickname": "i_angle_association_threshold",
67-
"description": "A number to indicate how much distance in the plane of the face should be favored, compared to distance orthogonal to the face normal. Default is 0.5",
68-
"optional": true,
69-
"allowTreeAccess": true,
70-
"showTypeHints": true,
71-
"scriptParamAccess": "item",
72-
"wireDisplay": "default",
73-
"sourceCount": 0,
74-
"typeHintID": "float"
75-
},
7664
{
7765
"name": "i_radius_normal_estimation",
7866
"nickname": "i_radius_normal_estimation",

0 commit comments

Comments
 (0)