Scalar field to Coordinate on Command line

Feel free to ask any question here
Post Reply
gil
Posts: 5
Joined: Sat Feb 02, 2019 9:41 am

Scalar field to Coordinate on Command line

Post by gil »

It will be great if a SF_TO_COORD will be available on command line.
Regards Gil
Last edited by gil on Tue Mar 01, 2022 4:09 pm, edited 2 times in total.
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Scalart field too Coordinate on Command line

Post by daniel »

I added this to the TODO list ;)
Daniel, CloudCompare admin
20cent
Posts: 9
Joined: Sat Dec 15, 2018 4:58 pm

Re: Scalar field to Coordinate on Command line

Post by 20cent »

Is there any chance you add this soon to CC?
It would be nice ;-)
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Scalar field to Coordinate on Command line

Post by daniel »

This will be available in the new 2.13.alpha version (see the -SF_TO_COORD command description in the wiki)
Daniel, CloudCompare admin
Rene Geelen
Posts: 3
Joined: Wed Sep 27, 2023 3:32 pm

Re: Scalar field to Coordinate on Command line

Post by Rene Geelen »

Hello. I am a newby to CloudCompare and I am interested in using -SF_TO_COORD as well. I have downloaded CloudCompare version 2.13.beta on Windows.
When I run a command line like CloudCompare.exe -O "D:\test_C2M_DIST.ply" -NO_TIMESTAMP -C_EXPORT_FMT PLY -M_EXPORT_FMT PLY -SF_TO_COORD 0 z , an error is logged in the console, saying Unknown or misplaced command: '-SF_TO_COORD' .
What am I doing wrong ? Or is it that -SF_TO_COORD does not yet work in version 2.13.beta ?

BTW, file "D:\test_C2M_DIST.ply" is the result of a -C2M_DIST command and it contains a SF, named C2M signed distances . I want to apply -SF_TO_COORD on this SF and then save the result to disk again for processing as a surface in MountainsMap software of DigitalSurf.
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Scalar field to Coordinate on Command line

Post by daniel »

Interestingly, this is a bug that has just been fixed in the latest 2.13.beta version (online since Sunday only). Can you try again? (or first you can simply check that your version is prior to the 24th of September).
Daniel, CloudCompare admin
Rene Geelen
Posts: 3
Joined: Wed Sep 27, 2023 3:32 pm

Re: Scalar field to Coordinate on Command line

Post by Rene Geelen »

Hello Daniel.
My 2.13.beta version was Aug 25. I downloaded version of Sep 24 and now the error "Unknown or misplaced command: '-SF_TO_COORD'" is no longer there.
Instead, I get another error : [SF_TO_COORD] (in black) and then 'No point cloud available. Be sure to open or generate one first.' (in red).

When I work with CloudCompare interactively via the GUI, after loading my PLY file, I see in DB tree an item, labeled 'Vertices' and a checkbox which is not checked.
I select 'Vertices' by clicking on it and then I go to menu 'Edit ==> Scalar Fields ==> Set SF as coordinates(s)'. That works fine.
Now I want to do the same thing via command line. Which command does the same thing as selecting point cloud 'Vertices' in interactive mode ?
I guess that if I include that command prior to -SF_TO_COORD, the error 'No point cloud available' will be gone. Right ?

And how can I selected 2 meshes or 2 clouds or 1 cloud and 1 mesh in command line mode ?
Imagine the following workflow in interactive mode via the GUI :
1. I load my PLY file
2. I expand DB tree to see cloud 'Vertices' and select it
3. I run RANSAC in order to detect 2 planes. The result is 2 planes, Plane_0001 and Plane_0002, each consisting of a cloud and a primitive (dip & dip dorection having 2 faces).
4. I expand DB tree and select both dip objects and merge them together, yielding 'Merged mesh'
5. I select 'Merged mesh' and resample points to 1000000, yielding cloud 'Merged mesh.sampled'
6. I select cloud 'Vertices' and 'Merged mesh.sampled' and perform a C2C distance
7. I go to menu 'Edit ==> Scalar Fields ==> Set SF as coordinates(s)' and then save the flattened cloud to a file on disk for post-processing in MountainsMap software
Which sequence of commands in command line mode would execute this workflow automatically ?
Especially, how can I simulate an action like 'I select a specific cloud or mesh somewhere in DB tree' or even 2 such objects in command line mode ?
Or is this a complexity which is beyond command line mode ?
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Scalar field to Coordinate on Command line

Post by daniel »

You have to use the -EXTRACT_VERTICES option (to 'convert' the mesh vertices to a standalone point cloud). So that you are able to use cloud-only tools on it (such as Ransac SD).

Then -MERGE_MESHES if you want to merge all detected shapes. Then -SAMPLE_MESH, etc.

See https://www.cloudcompare.org/doc/wiki/i ... _line_mode
Daniel, CloudCompare admin
Rene Geelen
Posts: 3
Joined: Wed Sep 27, 2023 3:32 pm

Re: Scalar field to Coordinate on Command line

Post by Rene Geelen »

Hello Daniel. Thanks a lot for clearing the mist. It works now. Super !
Post Reply