File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
src/gh/components/DF_main_pc_axes Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change 55from diffCheck import df_poses
66
77import Rhino
8+ from Grasshopper .Kernel import GH_RuntimeMessageLevel as RML
89
910from ghpythonlib .componentbase import executingcomponent as component
1011
1112import System
1213
13- def compute_dot_product (v1 , v2 ):
14- """
15- Compute the dot product of two vectors.
16- """
17- return (v1 .X * v2 .X ) + (v1 .Y * v2 .Y ) + (v1 .Z * v2 .Z )
18-
1914class DFMainPCAxes (component ):
2015 def RunScript (self ,
2116 i_clouds : System .Collections .Generic .List [Rhino .Geometry .PointCloud ],
@@ -33,7 +28,8 @@ def RunScript(self,
3328 df_cloud = df_cvt_bindings .cvt_rhcloud_2_dfcloud (cloud )
3429 if df_cloud is None :
3530 return None , None
36- df_cloud .estimate_normals (True , 12 )
31+ if not df_cloud .has_normals ():
32+ ghenv .Component .AddRuntimeMessage (RML .Error , f"Point cloud { i } has no normals. Please compute the normals." ) # noqa: F821
3733
3834 df_points = df_cloud .get_axis_aligned_bounding_box ()
3935 df_point = (df_points [0 ] + df_points [1 ]) / 2
Original file line number Diff line number Diff line change 1717 "name" : " i_clouds" ,
1818 "nickname" : " i_clouds" ,
1919 "description" : " clouds whose main axes are to be calculated" ,
20- "optional" : true ,
20+ "optional" : false ,
2121 "allowTreeAccess" : true ,
2222 "showTypeHints" : true ,
2323 "scriptParamAccess" : " list" ,
You can’t perform that action at this time.
0 commit comments