Running CC from python terminal
-
- Posts: 15
- Joined: Fri Jun 21, 2019 12:34 pm
Running CC from python terminal
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
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
I think you need to use the 'C_EXPORT_FMT' options to explicitly set 'LAS' as the output format.
Daniel, CloudCompare admin
-
- Posts: 15
- Joined: Fri Jun 21, 2019 12:34 pm
Re: Running CC from python terminal
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
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
-
- Posts: 187
- Joined: Tue Mar 05, 2019 3:59 pm
Re: Running CC from python terminal
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
-
- Posts: 15
- Joined: Fri Jun 21, 2019 12:34 pm
Re: Running CC from python terminal
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
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
-
- Posts: 187
- Joined: Tue Mar 05, 2019 3:59 pm
Re: Running CC from python terminal
Do you have a log of Cloudcompare output when you run the command you posted?
-
- Posts: 15
- Joined: Fri Jun 21, 2019 12:34 pm
Re: Running CC from python terminal
Yes. Here it is what the CC command line shows me:
And the RESULT.las file is nowhere..
And the RESULT.las file is nowhere..
-
- Posts: 187
- Joined: Tue Mar 05, 2019 3:59 pm
Re: Running CC from python terminal
What is the result if you specify the full path for RESULT?
Re: Running CC from python terminal
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
You have to use the 'SAVE_CLOUDS' option explicitly (probably at the end of the command line)
Daniel, CloudCompare admin