Skip to content

Commit 732a289

Browse files
committed
CAP-FIX: now normals are checked for registration components
1 parent 0f7cf8c commit 732a289

File tree

3 files changed

+9
-0
lines changed
  • src/gh/components

3 files changed

+9
-0
lines changed

src/gh/components/DF_fast_global_registration/code.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ def RunScript(self,
2222
i_iteration_number: int,
2323
i_max_tuple_count: int
2424
) -> rg.Transform:
25+
# preliminary checks
2526
if i_cloud_source is None or i_cloud_target is None:
2627
ghenv.Component.AddRuntimeMessage(RML.Warning, "Please provide both objects of type point clouds to align") # noqa: F821
2728
return None
29+
if not i_cloud_source.ContainsNormals or not i_cloud_target.ContainsNormals:
30+
ghenv.Component.AddRuntimeMessage(RML.Error, "Please compute cloud's normals with a component before") # noqa: F821
2831

2932
# set default values
3033
if i_radius_kd_search is None:

src/gh/components/DF_icp_registration/code.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ def RunScript(self,
2525
is_t_estimate_pt2pt: bool, # valid only for 03dicp
2626
i_use_point_to_plane: bool # valid only for 03dicp
2727
) -> rg.Transform:
28+
# preliminary checks
2829
if i_cloud_source is None or i_cloud_target is None:
2930
ghenv.Component.AddRuntimeMessage(RML.Warning, "Please provide both objects of type point clouds to align") # noqa: F821
3031
return None
32+
if not i_cloud_source.ContainsNormals or not i_cloud_target.ContainsNormals:
33+
ghenv.Component.AddRuntimeMessage(RML.Error, "Please compute cloud's normals with a component before") # noqa: F821
3134

3235
# set default values
3336
if i_use_generalized_icp is None:

src/gh/components/DF_ransac_global_registration/code.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ def RunScript(self,
2525
i_max_iterations: int,
2626
i_confidence_threshold: float
2727
) -> rg.Transform:
28+
# preliminary checks
2829
if i_cloud_source is None or i_cloud_target is None:
2930
ghenv.Component.AddRuntimeMessage(RML.Warning, "Please provide both objects of type point clouds to align") # noqa: F821
3031
return None
32+
if not i_cloud_source.ContainsNormals or not i_cloud_target.ContainsNormals:
33+
ghenv.Component.AddRuntimeMessage(RML.Error, "Please compute cloud's normals with a component before") # noqa: F821
3134

3235
# set default values
3336
if i_radius_kd_search is None:

0 commit comments

Comments
 (0)