DFCloudNormalEstimator component

Contents

_images/icon5.png

DFCloudNormalEstimator component#

Evaluate the normals of a point cloud.

Inputs:

i_cloud (pointcloud ,item)

The point cloud to evaluate.

i_knn (int ,item)

The knn search value (by default 100).

i_radius (int ,item)

The radius search. If value is provided the search will be hybrid.

i_bool (bool ,item)

Switch between Open3d (true) or Cilantro (false) library. Default is Open3d.

Outputs:

o_cloud

The cloud with normals computed.

Code:

#! python3

import Rhino
from ghpythonlib.componentbase import executingcomponent as component

from diffCheck import df_cvt_bindings

class DFCloudNormalEstimator(component):
    def RunScript(self,
            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)

        if i_knn is None:
            i_knn = 100

        df_cloud.estimate_normals(
            use_cilantro_evaluator=i_switch_mode,
            knn=i_knn,
            search_radius=i_radius
            )

        o_cloud = df_cvt_bindings.cvt_dfcloud_2_rhcloud(df_cloud)

        return o_cloud