Automating common workflows?

Feel free to ask any question here
Laserbrain
Posts: 51
Joined: Tue Sep 30, 2014 6:13 pm

Automating common workflows?

Post by Laserbrain »

Greetings.

I find myself doing the exact same steps in CC - like 100 times a month. I'd love to have a batch or script. It'd save hours and hours of time. But it seems like the CMD line version doesn't support many features at this point?

Any help or ideas would be great. This is what I do:

1) Import a bunch of already registered e57 files
2) Select all in the DB tree
3) Edit > Scalar Fields > Convert to RGB > Yes
4) Edit > Normals > Compute - Yes to default settings (occasionally need to adjust actree radius, but typically default works)
5) Edit > Merge
6) Poisson reconstruction > specific values I always use, not the defaults > ok
7) Then I adjust the scalar field clipping by hand
8) Min/Max > Export
9) Save mesh as PLY

Automating 2-6 would be a godsend.

Thanks!
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Automating common workflows?

Post by daniel »

Hi,

I believe you will be able to do everything up to 6 as the PoissonRecon plugin doesn't have a command line interface. But the real PoissonRecon project provides a command line tool that may be able to help for the following steps? (I don't know the tool well: see http://www.cs.jhu.edu/~misha/Code/PoissonRecon)
Daniel, CloudCompare admin
Laserbrain
Posts: 51
Joined: Tue Sep 30, 2014 6:13 pm

Re: Automating common workflows?

Post by Laserbrain »

Thanks, Daniel. I'll take a closer look at the command line options.
Laserbrain
Posts: 51
Joined: Tue Sep 30, 2014 6:13 pm

Re: Automating common workflows?

Post by Laserbrain »

Is it possible to open all files in a folder with a wildcard? Like cloudcompare -o *.e57?
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Automating common workflows?

Post by daniel »

Ah, no!
Daniel, CloudCompare admin
Laserbrain
Posts: 51
Joined: Tue Sep 30, 2014 6:13 pm

Re: Automating common workflows?

Post by Laserbrain »

Thanks to stack overflow...

This windows .bat works:

Code: Select all

setlocal EnableDelayedExpansion

for %%i in (*.e57) do set "files=-o "%%i" !files!"

cloudcompare -AUTO_SAVE OFF -C_EXPORT_FMT PLY %files% -OCTREE_NORMALS .01 -SF_CONVERT_TO_RGB TRUE -MERGE_CLOUDS -PLY_EXPORT_FMT BINARY_BE -SAVE_CLOUDS FILE "NormalsComputedAndMerged.ply"
pause
Last edited by Laserbrain on Wed Oct 28, 2020 4:37 pm, edited 1 time in total.
Laserbrain
Posts: 51
Joined: Tue Sep 30, 2014 6:13 pm

Re: Automating common workflows?

Post by Laserbrain »

For anyone interested, here is a batch command to accomplish 1-5:

cloudcompare -AUTO_SAVE OFF -C_EXPORT_FMT PLY -o <file names.e57> -OCTREE_NORMALS .01 -SF_CONVERT_TO_RGB FALSE -MERGE_CLOUDS -PLY_EXPORT_FMT BINARY_BE -SAVE_CLOUDS FILE "NormalsComputedAndMerged.ply"

OCTREE_NORMALS radius may need to be manually adjusted.

Don't forget to put the cloudcompare.exe into the system path (in Windows).

I used this in an input to the standalone poissonrecon.exe and output the Density.

But the density values didn't come into CC in a way that could be trimmed successfully with the SF display range.

Daniel, should this work? Maybe I need to change the poissonrecon parameters...
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Automating common workflows?

Post by daniel »

Not sure. How is the density output by the executable version? Or maybe you have to change the default SF index?
Daniel, CloudCompare admin
Laserbrain
Posts: 51
Joined: Tue Sep 30, 2014 6:13 pm

Re: Automating common workflows?

Post by Laserbrain »

Here is the file from the poissonrecon.exe being imported into CC. Notice 2 scalar fields. (neither works as expected).

In case you're interested
Screenshot 2020-10-30 132244.jpg
Screenshot 2020-10-30 132244.jpg (99.95 KiB) Viewed 8508 times
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Automating common workflows?

Post by daniel »

So no density scalar field?
Daniel, CloudCompare admin
Post Reply