Commandline use#
Introduction#
Installation and preparation#
To be able to use CloudCompare and its command line mode, you first need to install it. It can be done directly from precompiled sources or build from source.
Precompiled sources#
Installers can be found under CC - Installers.
Compilation from source#
Download source code from CC - Master branch
Download CCCoreLib from CC - CoreLib.
Copy CCoreLib into
CC_master/libs/qCC_db/extern/CCCoreLib/
Open Cmake-Gui
Click
Configure project
-> Set builder (tested with VisualStudio2019)Configuration may fail with
Qt5 not found
-> add entryCMAKE_PREFIX_PATH
and make it point toQt/5.*/builder
(builder can be msvc2019 for example or setQt5_Dir
variable toQt/5.*/builder/lib/cmake/Qt5
(optional) Modify
CMAKE_INSTALL_PREFIX
to a folder not needing admin rightsConfigure, then generate if no further error
Open project and set compilation type to
build
Compile all, there will be an error after compilation
Compile
INSTALL
After compilation is successfull, go to compilation properties (need to be done for each build type) -> debug -> command -> point to
CMAKE_INSTALL_PREFIX/CloudCompare(_debug)/CloudCompare.exe
You can then launch the program through VisualStudio
Commandline usage#
Prepare for use (Windows)#
CloudCompare
and point to CMAKE_INSTALL_PREFIX/CloudCompare(_debug)/CloudCompare.exe
, then restart your computer.Explanations#
-SILENT
-LOG_FILE filename
.CloudCompare -AUTO_SAVE OFF
to disable auto-save. Then, to save when you want, use -SAVE_CLOUDS
or -SAVE_MESHES
following what has been loaded.Examples#
First example load two clouds, then apply ICP till a difference of 1e-10 between both clouds. It then save a merge into a new file.
1:: Get two clouds and align them thanks to ICP
2@echo off
3:: Remove modified files and get fresh ones from dflt folder
4echo Get fresh models
5del *.bin
6del *.txt
7for /R %cd%\dflt %%f in (c*.bin) do copy "%%f" %cd%
8:: Command CC to do things
9echo Launch CloudCompare
10CloudCompare -SILENT -LOG_FILE log.txt -O c1.bin -O c2.bin -AUTO_SAVE OFF -REMOVE_RGB -NO_TIMESTAMP -ICP -MIN_ERROR_DIFF 1e-10 -ADJUST_SCALE -MERGE_CLOUDS -SAVE_CLOUDS
11:: CC / no console / log in log.txt / open c1 / open c2 / no auto save btw steps / remove unused texture data / no timestamp on save / align clouds with ICP/ merge c1-c2 / save
Second example show the alignment followed by the creation of a heatmap representing the differences between two clouds (absolute values only). It can then be opened in CloudCompare.
1:: Get two clouds, align them, create a heatmap
2@echo off
3:: Remove modified files and get fresh ones from dflt folder
4echo Get fresh models
5del *.bin
6del *.txt
7for /R %cd%\dflt %%f in (tunn*.bin) do copy "%%f" %cd%
8:: Command CC to do things
9echo Launch CloudCompare
10CloudCompare -SILENT -LOG_FILE log.txt -AUTO_SAVE OFF -O tunn2.bin -O tunn1.bin -SS SPATIAL 0.4 -REMOVE_RGB -NO_TIMESTAMP -SAVE_CLOUDS -ICP -MIN_ERROR_DIFF 1e-8 -C2C_DIST -SAVE_CLOUDS
11:: CC / no console / log in log.txt / no auto save btw steps / open scans / subsample / no timestamp on save / align clouds/ dist o1-o2 (heatmap) / save
12echo Done with computation