Skip to content

Commit 5308e44

Browse files
fix: rename MergeCloud to CloudUnion and fix mistakes in metadata
1 parent e7dad06 commit 5308e44

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""Merges point clouds together."""
2+
import diffCheck
3+
from diffCheck.diffcheck_bindings import dfb_geometry as df_geometry
4+
import Rhino
5+
6+
import System
7+
8+
from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML
9+
10+
from ghpythonlib.componentbase import executingcomponent as component
11+
12+
TOL = Rhino.RhinoDoc.ActiveDoc.ModelAbsoluteTolerance
13+
14+
class DFMergeAssemblies(component):
15+
def RunScript(self,
16+
i_clouds: System.Collections.Generic.List[Rhino.Geometry.PointCloud]):
17+
if i_clouds is None or len(i_clouds) == 0:
18+
ghenv.Component.AddRuntimeMessage(RML.Warning, "No point clouds provided. Please connect point clouds to the input.") # noqa: F821
19+
return None
20+
21+
merged_cloud = df_geometry.DFPointCloud()
22+
for cloud in i_clouds:
23+
df_cloud = diffCheck.df_cvt_bindings.cvt_rhcloud_2_dfcloud(cloud)
24+
merged_cloud.add_points(df_cloud)
25+
26+
o_cloud = diffCheck.df_cvt_bindings.cvt_dfcloud_2_rhcloud(merged_cloud)
27+
return [o_cloud]
14.9 KB
Loading
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "DFCloudUnion",
3+
"nickname": "DFCloudUnion",
4+
"category": "diffCheck",
5+
"subcategory": "Cloud",
6+
"description": "This component merges a series of point clouds into a unique point cloud.",
7+
"exposure": 4,
8+
"instanceGuid": "1e5e3ce8-1eb8-4227-9456-016f3cedd235",
9+
"ghpython": {
10+
"hideOutput": true,
11+
"hideInput": true,
12+
"isAdvancedMode": true,
13+
"marshalOutGuids": true,
14+
"iconDisplay": 2,
15+
"inputParameters": [
16+
{
17+
"name": "i_clouds",
18+
"nickname": "i_clouds",
19+
"description": "The point clouds to merge.",
20+
"optional": false,
21+
"allowTreeAccess": true,
22+
"showTypeHints": true,
23+
"scriptParamAccess": "list",
24+
"wireDisplay": "default",
25+
"sourceCount": 0,
26+
"typeHintID": "pointcloud",
27+
"flatten": true
28+
}
29+
],
30+
"outputParameters": [
31+
{
32+
"name": "o_cloud",
33+
"nickname": "o_cloud",
34+
"description": "The merged point clouds.",
35+
"optional": false,
36+
"sourceCount": 0,
37+
"graft": false
38+
}
39+
]
40+
}
41+
}

0 commit comments

Comments
 (0)