Crop2D command line using existing polyline (imported shapefile)

Feel free to ask any question here
Post Reply
adams
Posts: 4
Joined: Tue Nov 24, 2015 7:42 am

Crop2D command line using existing polyline (imported shapefile)

Post 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
daniel
Site Admin
Posts: 7388
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

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

Post by daniel »

Indeed, as the method description seems to indicate, it only works on clouds ;)
Daniel, CloudCompare admin
adams
Posts: 4
Joined: Tue Nov 24, 2015 7:42 am

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

Post 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.
daniel
Site Admin
Posts: 7388
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

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

Post 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).
Daniel, CloudCompare admin
Post Reply