From d1e728e8d9d2e6312de4230b653ee76fb2a4ded9 Mon Sep 17 00:00:00 2001 From: DamienGilliard <127743632+DamienGilliard@users.noreply.github.com> Date: Thu, 19 Sep 2024 20:34:42 +0200 Subject: [PATCH 1/5] FIX: add default values and throw standard warning if no PC or assembly is given --- src/gh/components/DF_CAD_segmentator/code.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gh/components/DF_CAD_segmentator/code.py b/src/gh/components/DF_CAD_segmentator/code.py index 49ab985b..cacb988c 100644 --- a/src/gh/components/DF_CAD_segmentator/code.py +++ b/src/gh/components/DF_CAD_segmentator/code.py @@ -1,13 +1,13 @@ #! python3 -import typing +import System +import Rhino import Rhino.Geometry as rg from ghpythonlib.componentbase import executingcomponent as component +from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML -import diffCheck -import diffCheck.df_geometries from diffCheck.diffcheck_bindings import dfb_segmentation from diffCheck import df_cvt_bindings @@ -16,11 +16,14 @@ class DFCADSegmentator(component): def RunScript(self, - i_clouds : typing.List[rg.PointCloud], - i_assembly : diffCheck.df_geometries.DFAssembly, - i_angle_threshold : float, - i_association_threshold : float - ) -> rg.PointCloud: + i_clouds: System.Collections.Generic.IList[Rhino.Geometry.PointCloud], + i_assembly, + i_angle_threshold: float = 0.1, + i_association_threshold: float = 0.1) -> rg.PointCloud: + + if i_clouds is None or i_assembly is None: + self.AddRuntimeMessage(RML.Warning, "Please provide a cloud and an assembly to segmentate") + return None o_clusters = [] df_clusters = [] # we make a deepcopy of the input clouds From 1df2aa82a56d27c40307e56e6d944cb1d282487c Mon Sep 17 00:00:00 2001 From: DamienGilliard <127743632+DamienGilliard@users.noreply.github.com> Date: Thu, 19 Sep 2024 21:05:40 +0200 Subject: [PATCH 2/5] UPTDATE: better standard values and info added to metadata --- src/gh/components/DF_CAD_segmentator/code.py | 5 +++++ src/gh/components/DF_CAD_segmentator/metadata.json | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gh/components/DF_CAD_segmentator/code.py b/src/gh/components/DF_CAD_segmentator/code.py index cacb988c..2e04a5b0 100644 --- a/src/gh/components/DF_CAD_segmentator/code.py +++ b/src/gh/components/DF_CAD_segmentator/code.py @@ -24,6 +24,11 @@ def RunScript(self, if i_clouds is None or i_assembly is None: self.AddRuntimeMessage(RML.Warning, "Please provide a cloud and an assembly to segmentate") return None + if i_angle_threshold is None: + i_angle_threshold = 0.1 + if i_association_threshold is None: + i_association_threshold = 0.1 + o_clusters = [] df_clusters = [] # we make a deepcopy of the input clouds diff --git a/src/gh/components/DF_CAD_segmentator/metadata.json b/src/gh/components/DF_CAD_segmentator/metadata.json index 51de3ad2..415dc571 100644 --- a/src/gh/components/DF_CAD_segmentator/metadata.json +++ b/src/gh/components/DF_CAD_segmentator/metadata.json @@ -40,7 +40,7 @@ { "name": "i_angle_threshold", "nickname": "i_angle_threshold", - "description": "From 0 to 1, it's the sin value. The closer to 0 the less permissive and viceversa to 1.", + "description": "From 0 to 1, it's the sin value. By default 0.1. The closer to 0 the less permissive and viceversa to 1.", "optional": false, "allowTreeAccess": true, "showTypeHints": true, @@ -52,7 +52,7 @@ { "name": "i_association_threshold", "nickname": "i_association_threshold", - "description": "From 0 to infinite. By default 0.5. The closer to 0 the less permissive your point.", + "description": "From 0 to infinite. By default 0.1. The closer to 0 the less permissive your point.", "optional": false, "allowTreeAccess": true, "showTypeHints": true, From a6bb4a11e1c5cdb62b3c54878dbd0930437fb6a8 Mon Sep 17 00:00:00 2001 From: DamienGilliard <127743632+DamienGilliard@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:16:34 +0200 Subject: [PATCH 3/5] FIX: avoid error created by ghcomponentizer by importing Rhino and System in advance --- .../DF_cloud_cloud_distance/code.py | 8 +++---- .../components/DF_cloud_mesh_distance/code.py | 15 ++++++------ .../DF_cloud_normal_estimator/code.py | 14 +++++------ .../DF_cloud_size_downsample/code.py | 7 ++---- .../DF_cloud_uniform_downsample/code.py | 7 ++---- .../DF_cloud_voxel_downsample/code.py | 7 ++---- .../components/DF_csv_exporter/metadata.json | 2 +- src/gh/components/DF_deconstruct_beam/code.py | 8 ++----- .../DF_fast_global_registration/code.py | 21 ++++++++-------- .../DF_fast_global_registration/metadata.json | 12 ---------- src/gh/components/DF_icp_registration/code.py | 24 ++++++++----------- .../components/DF_joint_segmentator/code.py | 4 ++-- src/gh/components/DF_mesh_to_cloud/code.py | 10 ++++---- .../components/DF_normal_segmentator/code.py | 6 ++--- .../DF_ransac_global_registration/code.py | 12 +++++----- src/gh/components/DF_remove_beam/code.py | 11 +++------ .../DF_visualization_settings/code.py | 6 ++--- 17 files changed, 67 insertions(+), 107 deletions(-) diff --git a/src/gh/components/DF_cloud_cloud_distance/code.py b/src/gh/components/DF_cloud_cloud_distance/code.py index b5f85217..f42cb471 100644 --- a/src/gh/components/DF_cloud_cloud_distance/code.py +++ b/src/gh/components/DF_cloud_cloud_distance/code.py @@ -1,8 +1,8 @@ #! python3 -import typing +import System -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML @@ -14,8 +14,8 @@ class DFCloudCloudDistance(component): def RunScript(self, - i_cloud_source: typing.List[rg.PointCloud], - i_cloud_target: typing.List[rg.PointCloud], + i_cloud_source: System.Collections.Generic.List[Rhino.Geometry.PointCloud], + i_cloud_target: System.Collections.Generic.List[Rhino.Geometry.PointCloud], i_swap: bool): if i_cloud_source is None or i_cloud_target is None: ghenv.Component.AddRuntimeMessage(RML.Warning, "Please provide both objects of type point clouds to compare") # noqa: F821 diff --git a/src/gh/components/DF_cloud_mesh_distance/code.py b/src/gh/components/DF_cloud_mesh_distance/code.py index fbd46531..c466a8ff 100644 --- a/src/gh/components/DF_cloud_mesh_distance/code.py +++ b/src/gh/components/DF_cloud_mesh_distance/code.py @@ -1,24 +1,23 @@ #! python3 -import typing +import System -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML import diffCheck from diffCheck import df_cvt_bindings from diffCheck import df_error_estimation -from diffCheck.df_geometries import DFAssembly class DFCloudMeshDistance(component): def RunScript(self, - i_cloud_source: typing.List[rg.PointCloud], - i_assembly: DFAssembly, - i_signed_flag: bool, - i_swap: bool, - i_analysis_resolution): + i_cloud_source: System.Collections.Generic.List[Rhino.Geometry.PointCloud], + i_assembly, + i_signed_flag: bool, + i_swap: bool, + i_analysis_resolution: float): if i_analysis_resolution is None: scalef = diffCheck.df_util.get_doc_2_meters_unitf() diff --git a/src/gh/components/DF_cloud_normal_estimator/code.py b/src/gh/components/DF_cloud_normal_estimator/code.py index 8c888685..09bf1ea6 100644 --- a/src/gh/components/DF_cloud_normal_estimator/code.py +++ b/src/gh/components/DF_cloud_normal_estimator/code.py @@ -1,19 +1,17 @@ #! python3 - -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component from diffCheck import df_cvt_bindings class DFCloudNormalEstimator(component): def RunScript(self, - i_cloud : rg.PointCloud = None, - i_knn : int = None, - i_radius : float = None, - i_switch_mode : bool = True - ): - o_cloud = rg.PointCloud() + i_cloud: Rhino.Geometry.PointCloud, + i_knn: int, + i_radius: int, + i_switch_mode: bool): + o_cloud = Rhino.Geometry.PointCloud() df_cloud = df_cvt_bindings.cvt_rhcloud_2_dfcloud(i_cloud) diff --git a/src/gh/components/DF_cloud_size_downsample/code.py b/src/gh/components/DF_cloud_size_downsample/code.py index be261d4c..57eabccc 100644 --- a/src/gh/components/DF_cloud_size_downsample/code.py +++ b/src/gh/components/DF_cloud_size_downsample/code.py @@ -1,17 +1,14 @@ #! python3 -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component from diffCheck import df_cvt_bindings class DFCloudSizeDownsample(component): - def RunScript(self, - i_cloud: rg.PointCloud, - i_size: int, - ) -> rg.PointCloud: + def RunScript(self, i_cloud: Rhino.Geometry.PointCloud, i_size: float) -> Rhino.Geometry.PointCloud: df_cloud = df_cvt_bindings.cvt_rhcloud_2_dfcloud(i_cloud) df_cloud.downsample_by_size(i_size) o_cloud = df_cvt_bindings.cvt_dfcloud_2_rhcloud(df_cloud) diff --git a/src/gh/components/DF_cloud_uniform_downsample/code.py b/src/gh/components/DF_cloud_uniform_downsample/code.py index 0b07e5b1..ec0cfdc4 100644 --- a/src/gh/components/DF_cloud_uniform_downsample/code.py +++ b/src/gh/components/DF_cloud_uniform_downsample/code.py @@ -1,17 +1,14 @@ #! python3 -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component from diffCheck import df_cvt_bindings class DFCloudUniformDownsample(component): - def RunScript(self, - i_cloud: rg.PointCloud, - i_every_k_points: int, - ) -> rg.PointCloud: + def RunScript(self, i_cloud: Rhino.Geometry.PointCloud, i_every_k_points: int) -> Rhino.Geometry.PointCloud: df_cloud = df_cvt_bindings.cvt_rhcloud_2_dfcloud(i_cloud) df_cloud.uniform_downsample(i_every_k_points) o_cloud = df_cvt_bindings.cvt_dfcloud_2_rhcloud(df_cloud) diff --git a/src/gh/components/DF_cloud_voxel_downsample/code.py b/src/gh/components/DF_cloud_voxel_downsample/code.py index bd4b04c6..2544ba62 100644 --- a/src/gh/components/DF_cloud_voxel_downsample/code.py +++ b/src/gh/components/DF_cloud_voxel_downsample/code.py @@ -1,17 +1,14 @@ #! python3 -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component from diffCheck import df_cvt_bindings class DFCloudVoxelDownsample(component): - def RunScript(self, - i_cloud: rg.PointCloud, - i_voxel_size: float, - ) -> rg.PointCloud: + def RunScript(self, i_cloud: Rhino.Geometry.PointCloud, i_voxel_size: float) -> Rhino.Geometry.PointCloud: df_cloud = df_cvt_bindings.cvt_rhcloud_2_dfcloud(i_cloud) df_cloud.voxel_downsample(i_voxel_size) o_cloud = df_cvt_bindings.cvt_dfcloud_2_rhcloud(df_cloud) diff --git a/src/gh/components/DF_csv_exporter/metadata.json b/src/gh/components/DF_csv_exporter/metadata.json index cd4fe62c..c3ec7e9d 100644 --- a/src/gh/components/DF_csv_exporter/metadata.json +++ b/src/gh/components/DF_csv_exporter/metadata.json @@ -51,7 +51,7 @@ }, { "name": "i_export_seperate_files", - "nickname": "i_export_seperate_file", + "nickname": "i_export_seperate_files", "description": "Whether to export one single file or seperate files per element.", "optional": true, "allowTreeAccess": true, diff --git a/src/gh/components/DF_deconstruct_beam/code.py b/src/gh/components/DF_deconstruct_beam/code.py index d714dde6..407a2b1b 100644 --- a/src/gh/components/DF_deconstruct_beam/code.py +++ b/src/gh/components/DF_deconstruct_beam/code.py @@ -1,16 +1,12 @@ #! python3 -import typing - +import System from ghpythonlib.componentbase import executingcomponent as component -from diffCheck.df_geometries import DFBeam - class DFDeconstructBeam(component): - def RunScript(self, - i_beams : typing.List[DFBeam]): + def RunScript(self, i_beams: System.Collections.Generic.List[object]): o_side_faces, o_joint_faces, o_joint_ids = [], [], [] for i_b in i_beams: diff --git a/src/gh/components/DF_fast_global_registration/code.py b/src/gh/components/DF_fast_global_registration/code.py index 1012b455..e66eda97 100644 --- a/src/gh/components/DF_fast_global_registration/code.py +++ b/src/gh/components/DF_fast_global_registration/code.py @@ -1,7 +1,7 @@ #! python3 -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML @@ -14,14 +14,13 @@ class DFFastGlobalRegistration(component): def RunScript(self, - i_cloud_source: rg.PointCloud, - i_cloud_target: rg.PointCloud, - i_radius_kd_search: float, - i_neighbours_kd_search: int, - i_max_corrspondence_dist: float, - i_iteration_number: int, - i_max_tuple_count: int - ) -> rg.Transform: + i_cloud_source: Rhino.Geometry.PointCloud, + i_cloud_target: Rhino.Geometry.PointCloud, + i_radius_kd_search: float, + i_neighbours_kd_search: int, + i_max_corrspondence_dist: float, + i_iteration_number: int, + i_max_tuple_count: int) -> Rhino.Geometry.Transform: if i_cloud_source is None or i_cloud_target is None: ghenv.Component.AddRuntimeMessage(RML.Warning, "Please provide both objects of type point clouds to align") # noqa: F821 return None @@ -64,11 +63,11 @@ def RunScript(self, # cvt df xform to rhino xform df_xform_matrix = df_xform.transformation_matrix - rh_form = rg.Transform() + rh_form = Rhino.Geometry.Transform() for i in range(4): for j in range(4): rh_form[i, j] = df_xform_matrix[i, j] - if rh_form == rg.Transform.Identity: + if rh_form == Rhino.Geometry.Transform.Identity: ghenv.Component.AddRuntimeMessage(RML.Warning, "The transformation matrix is identity, no transformation is applied") # noqa: F821 return None diff --git a/src/gh/components/DF_fast_global_registration/metadata.json b/src/gh/components/DF_fast_global_registration/metadata.json index 0f076951..4836d6ff 100644 --- a/src/gh/components/DF_fast_global_registration/metadata.json +++ b/src/gh/components/DF_fast_global_registration/metadata.json @@ -13,18 +13,6 @@ "marshalOutGuids": true, "iconDisplay": 2, "inputParameters": [ - { - "name": "i_recompute", - "nickname": "i_recompute", - "description": "Connect a button to recompute the registration.", - "optional": true, - "allowTreeAccess": true, - "showTypeHints": true, - "scriptParamAccess": "item", - "wireDisplay": "default", - "sourceCount": 0, - "typeHintID": "bool" - }, { "name": "i_cloud_source", "nickname": "i_cloud_source", diff --git a/src/gh/components/DF_icp_registration/code.py b/src/gh/components/DF_icp_registration/code.py index 76ebb887..f7209a1e 100644 --- a/src/gh/components/DF_icp_registration/code.py +++ b/src/gh/components/DF_icp_registration/code.py @@ -1,7 +1,7 @@ #! python3 -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML @@ -14,17 +14,13 @@ class DFICPRegistration(component): def RunScript(self, - i_cloud_source: rg.PointCloud, - i_cloud_target: rg.PointCloud, - - i_use_generalized_icp: bool, - - i_max_corrspondence_dist: float, - i_max_iteration: int, - - is_t_estimate_pt2pt: bool, # valid only for 03dicp - i_use_point_to_plane: bool # valid only for 03dicp - ) -> rg.Transform: + i_use_generalized_icp: bool, + i_cloud_source: Rhino.Geometry.PointCloud, + i_cloud_target: Rhino.Geometry.PointCloud, + i_max_corrspondence_dist: float, + i_max_iteration: int, + is_t_estimate_pt2pt: bool, + i_use_point_to_plane: bool) -> Rhino.Geometry.Transform: if i_cloud_source is None or i_cloud_target is None: ghenv.Component.AddRuntimeMessage(RML.Warning, "Please provide both objects of type point clouds to align") # noqa: F821 return None @@ -78,11 +74,11 @@ def RunScript(self, # cvt df xform to rhino xform df_xform_matrix = df_xform.transformation_matrix - rh_form = rg.Transform() + rh_form = Rhino.Geometry.Transform() for i in range(4): for j in range(4): rh_form[i, j] = df_xform_matrix[i, j] - if rh_form == rg.Transform.Identity: + if rh_form == Rhino.Geometry.Transform.Identity: ghenv.Component.AddRuntimeMessage(RML.Warning, "The transformation matrix is identity, no transformation is applied") # noqa: F821 return None diff --git a/src/gh/components/DF_joint_segmentator/code.py b/src/gh/components/DF_joint_segmentator/code.py index f7baf46a..c981706b 100644 --- a/src/gh/components/DF_joint_segmentator/code.py +++ b/src/gh/components/DF_joint_segmentator/code.py @@ -9,7 +9,7 @@ from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML from ghpythonlib.componentbase import executingcomponent as component -import typing +import System ABSTOL = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance @@ -17,7 +17,7 @@ class DFJointSegmentator(component): def __init__(self): super(DFJointSegmentator, self).__init__() def RunScript(self, - i_clusters: typing.List[Rhino.Geometry.PointCloud], + i_clusters: System.Collections.Generic.List[Rhino.Geometry.PointCloud], i_assembly: diffCheck.df_geometries.DFAssembly, i_angle_threshold: float, i_distance_threshold: float): diff --git a/src/gh/components/DF_mesh_to_cloud/code.py b/src/gh/components/DF_mesh_to_cloud/code.py index ca8112da..4cc696f2 100644 --- a/src/gh/components/DF_mesh_to_cloud/code.py +++ b/src/gh/components/DF_mesh_to_cloud/code.py @@ -1,7 +1,7 @@ #! python3 -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component @@ -11,14 +11,12 @@ class DFMeshToCloud(component): - def RunScript(self, - i_mesh: rg.Mesh, - i_points: int) -> rg.PointCloud: + def RunScript(self, i_mesh: Rhino.Geometry.Mesh, i_points: int) -> Rhino.Geometry.PointCloud: df_mesh = diffCheck.df_cvt_bindings.cvt_rhmesh_2_dfmesh(i_mesh) df_cloud = df_mesh.sample_points_uniformly(i_points) # convert the df_cloud to a rhino cloud - rgpoints = [rg.Point3d(pt[0], pt[1], pt[2]) for pt in df_cloud.points] - rh_cloud = rg.PointCloud(rgpoints) + rgpoints = [Rhino.Geometry.Point3d(pt[0], pt[1], pt[2]) for pt in df_cloud.points] + rh_cloud = Rhino.Geometry.PointCloud(rgpoints) return [rh_cloud] diff --git a/src/gh/components/DF_normal_segmentator/code.py b/src/gh/components/DF_normal_segmentator/code.py index 9c096abf..a63c6dda 100644 --- a/src/gh/components/DF_normal_segmentator/code.py +++ b/src/gh/components/DF_normal_segmentator/code.py @@ -1,7 +1,7 @@ #! python3 -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component @@ -12,13 +12,13 @@ class DFCloudNormalSegmentator(component): def RunScript(self, - i_cloud, + i_cloud: Rhino.Geometry.PointCloud, i_normal_threshold_degree=None, i_min_cluster_size=None, i_use_knn_neighborhood=None, i_knn_neighborhood_size=None, i_radius_neighborhood_size=None - ) -> rg.PointCloud: + ) -> Rhino.Geometry.PointCloud: o_clusters = [] df_cloud = df_cvt_bindings.cvt_rhcloud_2_dfcloud(i_cloud) diff --git a/src/gh/components/DF_ransac_global_registration/code.py b/src/gh/components/DF_ransac_global_registration/code.py index 79a34f4f..e7f1e497 100644 --- a/src/gh/components/DF_ransac_global_registration/code.py +++ b/src/gh/components/DF_ransac_global_registration/code.py @@ -1,7 +1,7 @@ #! python3 -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML @@ -13,8 +13,8 @@ class DFRANSACGlobalRegistration(component): def RunScript(self, - i_cloud_source: rg.PointCloud, - i_cloud_target: rg.PointCloud, + i_cloud_source: Rhino.Geometry.PointCloud, + i_cloud_target: Rhino.Geometry.PointCloud, i_radius_kd_search: float, i_neighbours_kd_search: int, i_max_corrspondence_dist: float, @@ -24,7 +24,7 @@ def RunScript(self, i_similarity_threshold: float, i_max_iterations: int, i_confidence_threshold: float - ) -> rg.Transform: + ) -> Rhino.Geometry.Transform: if i_cloud_source is None or i_cloud_target is None: ghenv.Component.AddRuntimeMessage(RML.Warning, "Please provide both objects of type point clouds to align") # noqa: F821 return None @@ -82,11 +82,11 @@ def RunScript(self, # cvt df xform to rhino xform df_xform_matrix = df_xform.transformation_matrix - rh_form = rg.Transform() + rh_form = Rhino.Geometry.Transform() for i in range(4): for j in range(4): rh_form[i, j] = df_xform_matrix[i, j] - if rh_form == rg.Transform.Identity: + if rh_form == Rhino.Geometry.Transform.Identity: ghenv.Component.AddRuntimeMessage(RML.Warning, "The transformation matrix is identity, no transformation is applied") # noqa: F821 return None diff --git a/src/gh/components/DF_remove_beam/code.py b/src/gh/components/DF_remove_beam/code.py index c95a0418..8f914d5e 100644 --- a/src/gh/components/DF_remove_beam/code.py +++ b/src/gh/components/DF_remove_beam/code.py @@ -1,19 +1,14 @@ #! python3 -import typing +import System from ghpythonlib.componentbase import executingcomponent as component -import diffCheck -import diffCheck.df_geometries -import diffCheck.diffcheck_bindings -import diffCheck.df_util - class DFRemoveBeam(component): def RunScript(self, - i_assembly : diffCheck.df_geometries.DFAssembly=None, - i_idx_2_remove : typing.List[int]=None): + i_assembly, + i_idx_2_remove: System.Collections.Generic.List[int]): if i_assembly is None or i_idx_2_remove is None: return None diff --git a/src/gh/components/DF_visualization_settings/code.py b/src/gh/components/DF_visualization_settings/code.py index c1091ba0..0e375170 100644 --- a/src/gh/components/DF_visualization_settings/code.py +++ b/src/gh/components/DF_visualization_settings/code.py @@ -3,7 +3,7 @@ import System import typing -import Rhino.Geometry as rg +import Rhino from ghpythonlib.componentbase import executingcomponent as component import Grasshopper as gh @@ -181,7 +181,7 @@ def RunScript(self, i_lower_threshold: float, i_legend_height: float, i_legend_width: float, - i_legend_plane: rg.Plane, + i_legend_plane: Rhino.Geometry.Plane, i_histogram_scale_factor: float): """ @@ -216,7 +216,7 @@ def RunScript(self, if i_legend_width is None: i_legend_width = 0.5 if i_legend_plane is None: - i_legend_plane = rg.Plane.WorldXY + i_legend_plane = Rhino.Geometry.Plane.WorldXY if i_histogram_scale_factor is None: i_histogram_scale_factor = 0.01 From b521a80ae173d7b8399d360d7592c9dbc17b62ab Mon Sep 17 00:00:00 2001 From: DamienGilliard <127743632+DamienGilliard@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:20:36 +0200 Subject: [PATCH 4/5] FIX: name of output changed from o_clusters to o_cloud --- src/gh/components/DF_normal_segmentator/metadata.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gh/components/DF_normal_segmentator/metadata.json b/src/gh/components/DF_normal_segmentator/metadata.json index da03f461..900ccf6b 100644 --- a/src/gh/components/DF_normal_segmentator/metadata.json +++ b/src/gh/components/DF_normal_segmentator/metadata.json @@ -88,8 +88,8 @@ ], "outputParameters": [ { - "name": "o_clusters", - "nickname": "o_clusters", + "name": "o_clouds", + "nickname": "o_clouds", "description": "The segmented clouds.", "optional": false, "sourceCount": 0, From 256238270713dfdfb3ef33c45e39172dd1f61f34 Mon Sep 17 00:00:00 2001 From: Andrea Settimi Date: Fri, 20 Sep 2024 17:35:39 +0200 Subject: [PATCH 5/5] FIX: missing rg --- src/gh/components/DF_CAD_segmentator/code.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gh/components/DF_CAD_segmentator/code.py b/src/gh/components/DF_CAD_segmentator/code.py index 2e04a5b0..2e57ca65 100644 --- a/src/gh/components/DF_CAD_segmentator/code.py +++ b/src/gh/components/DF_CAD_segmentator/code.py @@ -3,7 +3,6 @@ import System import Rhino -import Rhino.Geometry as rg from ghpythonlib.componentbase import executingcomponent as component from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML