Convert active scalar field to RGB colors after Cloud-to-Mesh Distance

Feel free to ask any question here
Post Reply
LemonyClone
Posts: 1
Joined: Sun Jan 08, 2023 7:03 pm

Convert active scalar field to RGB colors after Cloud-to-Mesh Distance

Post by LemonyClone »

Just recently I discovered command line mode - and it’s awesome! Thank you very much for this great software!

So I have two files and want to calculate Cloud-to-Mesh Distance. I am only interested in all distances between 0 and 20. With CloudCompare_v2.13.alpha_bin_x64 on Windows 10, following command works fine:

Code: Select all

cloudcompare.exe -SILENT -AUTO_SAVE OFF -M_EXPORT_FMT BIN -EXT bin -O FileCompared.stl -O FileReference.stl -C2M_DIST -MAX_DIST 21 -SAVE_MESHES FILES tempFileCompared.bin tempFileReference.bin
In a second step I want to apply a custom color scale to the calculated file:

Code: Select all

cloudcompare.exe -SILENT -AUTO_SAVE OFF -M_EXPORT_FMT PLY -EXT ply -O tempFileCompared.bin -SF_COLOR_SCALE colorbar.xml -SAVE_MESHES FILES FileComparedWithSF.ply
Now I want to load the calculated file into Paraview. This works when I manually convert the active scalar field to RGB colors, remove all SFs and save the file with extension ply.

To automate this process, I would like to add the command line arguments -SF_CONVERT_TO_RGB FALSE and -REMOVE_ALL_SFS. But the following command does not work:

Code: Select all

cloudcompare.exe -SILENT -AUTO_SAVE OFF -M_EXPORT_FMT PLY -EXT ply -O tempFileCompared.bin -SF_COLOR_SCALE colorbar.xml -SET_ACTIVE_SF 'C2M signed distances[<21]' -SF_CONVERT_TO_RGB FALSE -REMOVE_ALL_SFS  -SAVE_MESHES FILES FileComparedWithSF.ply
Can you help me how to get this command working? Thank you very much in advance!

Here the log output:
[Plugin] Searching: C:/CloudCompare_v2.13.alpha_bin_x64/plugins

Plugin found: Additional I/O (QADDITIONAL_IO_PLUGIN.dll)
Plugin found: Animation (QANIMATION_PLUGIN.dll)
Plugin found: AutoSeg (QAUTO_SEG_PLUGIN.dll)
Plugin found: CEA Virtual Broom (QBROOM_PLUGIN.dll)
Plugin found: CANUPO (QCANUPO_PLUGIN.dll)
Plugin found: Cloud layers (QCLOUDLAYERS_PLUGIN.dll)
Plugin found: Colorimetric Segmenter (QCOLORIMETRIC_SEGMENTER_PLUGIN.dll)
Plugin found: Compass (QCOMPASS_PLUGIN.dll)
Plugin found: Core I/O (QCORE_IO_PLUGIN.dll)
Plugin found: Cork (QCORK_PLUGIN.dll)
Plugin found: CSF Filter (QCSF_PLUGIN.dll)
Plugin found: CSV Matrix I/O (QCSV_MATRIX_IO_PLUGIN.dll)
Plugin found: DP (QDOT_PRODUCT_IO_PLUGIN.dll)
Plugin found: Draco (QDRACO_IO_PLUGIN.dll)
Plugin found: E57 (QE57_IO_PLUGIN.dll)
Plugin found: EDL Shader (QEDL_GL_PLUGIN.dll)
Plugin found: ELlipser (QELLIPSER_PLUGIN.dll)
Plugin found: Facet/fracture detection (QFACETS_PLUGIN.dll)
Plugin found: FBX (QFBX_IO_PLUGIN.dll)
Plugin found: Hough Normals Computation (QHOUGH_NORMALS_PLUGIN.dll)
Plugin found: Hidden Point Removal (QHPR_PLUGIN.dll)
Plugin found: Json RPC (Standard Plugin) (QJSON_RPC_PLUGIN.dll)
Plugin found: LAS (I/O Plugin) (QLAS_IO_PLUGIN.dll)
Plugin found: M3C2 Distance (QM3C2_PLUGIN.dll)
Plugin found: ManualSeg (QMANUAL_SEG_PLUGIN.dll)
Plugin found: Mesh Boolean (QMESH_BOOLEAN_PLUGIN.dll)
Plugin found: MPlane (QMPLANE_PLUGIN.dll)
Plugin found: PCD file I/O (QPCL_IO_PLUGIN.dll)
Plugin found: PCL wrapper (QPCL_PLUGIN.dll)
Plugin found: PCV / ShadeVis (QPCV_PLUGIN.dll)
Plugin found: Photoscan I/O (QPHOTOSCAN_IO_PLUGIN.dll)
Plugin found: PoissonRecon (QPOISSON_RECON_PLUGIN.dll)
Plugin found: RANSAC Shape Detection (QRANSAC_SD_PLUGIN.dll)
Plugin found: RDB2 (I/O Plugin) (QRDB_IO_PLUGIN.dll)
Plugin found: Riegl RDB I/O (QRIEGL_IO_PLUGIN.dll)
Plugin found: Surface of Revolution Analysis (QSRA_PLUGIN.dll)
Plugin found: SSAO Shader (QSSAO_GL_PLUGIN.dll)
Plugin found: Step file loader (I/O plugin) (QSTEP_IO_PLUGIN.dll)
[Plugin] Searching: C:/Users/user/AppData/Roaming/CCCorp/CloudCompare/plugins
[Plugin] Searching: C:/ProgramData/CCCorp/CloudCompare/plugins
[Plugin] Searching: C:/CloudCompare_v2.13.alpha_bin_x64/data/plugins
[Plugin] Searching: C:/CloudCompare_v2.13.alpha_bin_x64/data/CCCorp/CloudCompare/plugins
[Plugin][Additional I/O] New file extensions registered: ICM OUT PN POLY POV PV SOI SX
[Plugin][Core I/O] New file extensions registered: GEOREF MA OBJ OFF PDMS PTX SBF STL VTK
[Plugin][CSV Matrix I/O] New file extensions registered: CSV
[Plugin][DP] New file extensions registered: DP
[Plugin][Draco] New file extensions registered: DRC
[Plugin][E57] New file extensions registered: E57
[Plugin][FBX] New file extensions registered: FBX
[Plugin][LAS (I/O Plugin)] New file extensions registered: LAZ
[Plugin][PCD file I/O] New file extensions registered: PCD
[Plugin][Photoscan I/O] New file extensions registered: PSZ
[Plugin][RDB2 (I/O Plugin)] New file extensions registered: RDB2
[Plugin][Riegl RDB I/O] New file extensions registered: RDS
[Plugin][Step file loader (I/O plugin)] New file extensions registered: STEP
[Global Shift] Max abs. coord = 1e+04 / max abs. diag = 1e+06
Auto-save is disabled
Output export format (meshes) set to: BIN
New output extension for meshes: bin
[LOADING]
Opening file: 'tempFileCompared.bin'
[BIN] Opening file 'tempFileCompared.bin'...
[BIN] Version 5.3 (coords: float / scalar: float)
[I/O] File 'tempFileCompared.bin' loaded successfully
Found one mesh with 1119496 faces and 561347 vertices: 'Mesh'
[SF COLOR SCALE]
[XML] Item 'name': 'Cool2Warm [0-20]'
[XML] Item 'uuid': '{...}'
[XML] Item 'absolute': '1'
[XML] Item 'minValue': '0'
[XML] Item 'range': '20'
Set active S.F. name: 'C2M signed distances[<21]'
No point cloud loaded! (be sure to open one with "-O [cloud filename]" before "-SET_ACTIVE_SF")
Processed finished in 0.03 s.
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Convert active scalar field to RGB colors after Cloud-to-Mesh Distance

Post by daniel »

Hum, it seems the -SET_ACTIVE_SF option is only supported on clouds for now? I will try to take a look at this.

Apart from that, do you know that you can issue all the commands at once? (you don't need to save the meshes each time, and I believe it's ok to call the next commands on both the compared and reference meshes, since only one has a scalar field (the other won't be processed).
Daniel, CloudCompare admin
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Convert active scalar field to RGB colors after Cloud-to-Mesh Distance

Post by daniel »

Ok, I've just updated the latest 2.13.alpha version so that the -SET_ACTIVE_SF option will now work on meshes!
Daniel, CloudCompare admin
Post Reply