Page 1 of 1

Crop2D command line using existing polyline (imported shapefile)

Posted: Tue May 29, 2018 1:57 pm
by adams
Hello,

I would like to Crop2D loaded mesh by existing shapefile (imported earlier), using command line mode. Is it possible to choose existing polyline instead of number and coordinates of vertices?

Code: Select all

import os, subprocess

CCPath = r"C:\Program Files\CloudCompare"

filePath = r"E:\AS\Agi_skrypt\mesh_cc.ply"
shpPath = r"E:\AS\Agi_skrypt\obszar_cc.shp"

os.chdir(CCPath)
openFile=os.system("CloudCompare -AUTO_SAVE OFF -O " + filePath " + "-CROP2D Z " + shpPath)

Update: I have vertices coordinates from shapefile, but when i try to launch this function this error appears:
"No point cloud availabe...". Does it mean that this function works only on pointclouds? :( i cropped meshes in this way using GUI version of CC.

Best regards,
Adam

Re: Crop2D command line using existing polyline (imported shapefile)

Posted: Tue May 29, 2018 5:28 pm
by daniel
Indeed, as the method description seems to indicate, it only works on clouds ;)

Re: Crop2D command line using existing polyline (imported shapefile)

Posted: Tue Jun 05, 2018 2:24 pm
by adams
I found out a solution for my problem. I generate point cloud from my mesh :)

I have an another problem... namely i can't specify filename of resulted mesh.

Code: Select all

openFile=os.system("CloudCompare -AUTO_SAVE OFF -O " + filePath +" " + "-SAMPLE_MESH POINTS 100000 -CROP2D Z " + coordinates + "-CLEAR_MESHES -DELAUNAY -AUTO_SAVE OFF -CLEAR_CLOUDS -M_EXPORT_FMT PLY -SAVE_MESHES FILE mask.ply")
I'm using CC in version 2.10alpha and according to http://www.cloudcompare.org/doc/wiki/in ... _line_mode it is possible to spefify exported mesh/meshes.

Re: Crop2D command line using existing polyline (imported shapefile)

Posted: Tue Jun 05, 2018 9:16 pm
by daniel
That's a bit strange. Do you have some warning messages in the console maybe?

Just as a remark, I don't think you need to add the "-AUTO_SAVE OFF" statement two times. Same thing for the "-CLEAR_CLOUDS" (not sure it's necessary here).