File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed
src/gh/components/DF_cloud_union Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 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 ]
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments