Page 1 of 1

Running CC from python terminal

Posted: Thu Apr 16, 2020 5:54 pm
by kalliopikout
Good afternoon,


I am trying to run c2m distance algorithm using python, with the following command:

C2M=subprocess.Popen(["C:\Program Files\CloudCompare\CloudCompare.exe","-O",input_PC,"-O",input_Mesh,"-c2m_dist","-AUTO_SAVE","OFF","-SAVE_CLOUDS","FILE", "RESULT.LAS"])

My aim is to save the output in a file named RESULT.LAS, but no matter that the process runs correctly and I get back "RESULT.LAS file saved successfully on the CC console that appears, the file is not being created. Only the default file "cloud1_C2M_DIST_YYYY-MM-DD_HHhMM.bin".

Is it something wrong on my command? If I add the full path then I get an error on the CC console.

I would like to ask also if there is a command for running poison surface reconstruction algorithm via your plugin.


Thanks in advance,
Kalliopi

Re: Running CC from python terminal

Posted: Thu Apr 16, 2020 8:16 pm
by daniel
I think you need to use the 'C_EXPORT_FMT' options to explicitly set 'LAS' as the output format.

Re: Running CC from python terminal

Posted: Fri Apr 17, 2020 8:32 am
by kalliopikout
Hi,


Thanks for your reply!

It seems that it doesn't work. And the "AUTO SAVE OFF" option does not make any difference in the output.
All the following options give the same results:

C2M=subprocess.Popen(["C:\Program Files\CloudCompare\CloudCompare.exe","-O",input_PC,"-O",input_Mesh,"-c2m_dist","-AUTO_SAVE","OFF","-C_EXPORT_FMT","LAS","-SAVE_CLOUDS","FILE", "RESULT.LAS","-C_EXPORT_FMT","LAS"])

C2M=subprocess.Popen(["C:\Program Files\CloudCompare\CloudCompare.exe","-O",input_PC,"-O",input_Mesh,"-c2m_dist","-SAVE_CLOUDS","FILE", "RESULT.LAS","-C_EXPORT_FMT","LAS"])

Thanks in advance for any additional help,
Kalliopi

Re: Running CC from python terminal

Posted: Fri Apr 17, 2020 4:18 pm
by WargodHernandez
The order of the commands matters, you are specifying to turn off auto save after the auto save has already occurred. You are also specifying The output format after the save file

Re: Running CC from python terminal

Posted: Tue Apr 21, 2020 8:24 am
by kalliopikout
Hi,



Thanks for your info.
I am running it as following, and everything works fine except for giving to the new file the name I want ''RESULTS''. I have placed this command in different positions but never works:

C2M=subprocess.Popen(["C:\Program Files\CloudCompare\CloudCompare.exe","-O",input_PC,"-O",input_Mesh,"-C_EXPORT_FMT","LAS","-AUTO_SAVE","OFF","-c2m_dist","-SAVE_CLOUDS" ,"FILE","RESULTS"],universal_newlines=True,stdout=subprocess.PIPE)

Thanks,
Kalliopi

Re: Running CC from python terminal

Posted: Wed Apr 22, 2020 1:51 am
by WargodHernandez
Do you have a log of Cloudcompare output when you run the command you posted?

Re: Running CC from python terminal

Posted: Wed Apr 22, 2020 8:03 am
by kalliopikout
Yes. Here it is what the CC command line shows me:

command line.png
command line.png (18.11 KiB) Viewed 11772 times

And the RESULT.las file is nowhere..

Re: Running CC from python terminal

Posted: Wed Apr 22, 2020 4:35 pm
by WargodHernandez
What is the result if you specify the full path for RESULT?

Re: Running CC from python terminal

Posted: Wed May 13, 2020 12:16 am
by md2030
was this solved? I'm trying to subsampling several point clouds from different meshes, then merge them and save them at once. however, once I turn off the autosave, nothing will be saved afterward. Please help!

Re: Running CC from python terminal

Posted: Wed May 13, 2020 10:33 am
by daniel
You have to use the 'SAVE_CLOUDS' option explicitly (probably at the end of the command line)