DFCloudSizeDownsample component

Contents

_images/icon7.png

DFCloudSizeDownsample component#

Downsample a point cloud by giving the target size of the downsampled cloud.

Inputs:

i_cloud (pointcloud ,item)

The point cloud to reduce the size.

i_size (int ,item)

The size of the wished downsampled cloud.

Outputs:

o_cloud

The downsampled cloud.

Code:

#! python3


import Rhino
from ghpythonlib.componentbase import executingcomponent as component


from diffCheck import df_cvt_bindings

class DFCloudSizeDownsample(component):
    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)

        return [o_cloud]