How to change the value of a user-defined scalar field using cloudComPy?

60 Views Asked by At

I have an array of points which I need to convert into a point cloud. I am using the python API of cloud compare; cloudComPy to achieve this. My ultimate goal is to create a point cloud object using these points and add a scalar field named as "lane_id" to this point cloud with a value of 2.

I created an empty point cloud using -

import cloudComPy as cc
import numpy as np

# A small sample for arr_of_points
arr_of_points = np.arange(1,31).reshape(-1, 3)
cloud = cc.ccPointCloud()
cloud.coordsFromNPArray_copy(arr_of_points)

This returns me a point cloud object as expected. Now, I tried to create a new scalar field -

cloud.addScalarField("lane_id")

Now, I cannot find a path to assign a value to this newly created scalar field.

0

There are 0 best solutions below