CloudCompare / CloudComPy

Python wrapper for CloudCompare
Other
283 stars 40 forks source link

Accessing individual polyline store in a single SHP file for cropping a point cloud #114

Open giplessis opened 1 year ago

giplessis commented 1 year ago

Hi, all

Is there a way to access to the individual polyline stored in a single SHP file for cropping a point cloud. something like :

c_cropped_list=list()
polys = cc.loadPolyline(filename=myfilepath, mode=cc.CC_SHIFT_MODE.XYZ)
for poly in polys:
    c_cropped_list.append(cloud.crop2D(poly, 2, True))

Context : I've a SHP file containing potentially multiple polygones. I want to load and use them for cropping a point cloud. I work perfectly when my SHP file contains only one polygone but gave me only the first one when it contains multiple polygones.

prascle commented 1 year ago

Hi, A little development is required here. To load multiple entities, the function to use is cc.importFile, but currently it only recognizes clouds and meshes. When used with a shape containing several polygons, we only get the poygon nodes as clouds. I'm going to add the missing entities (polylines, and probably facets and primitives) to the importFile function.

Regards, Paul

giplessis commented 1 year ago

Hi Paul, I understand. Let me know if I could be of help. Best regards, Gilles