Use .cmd file with command line

Feel free to ask any question here
Post Reply
flutes
Posts: 4
Joined: Fri Mar 29, 2019 12:51 pm

Use .cmd file with command line

Post by flutes »

Hi,
I would like to use CloudCompare on the command line. I have no problem using the console directly, but using a .cmd file does not seem to work ...

Here is my .cmd file :

Code: Select all

set pocPath = "C:\PointCloudFilePath\pointCloud.e57"
set cloudComparePath = "C:\CloudComparePath\CloudCompare.exe"
set xmlPath = "C:\optionsPath\options.xml"

%cloudComparePath% -O %pocPath% -CROSS_SECTION %xmlPath%
When I execute my "program", the window closes directly after, and the treatments have not been executed ... Should I do it in another way?
Thank you,
Flutes.

EDIT :
My excuses, I made a small syntax error, here is the file that works:

Code: Select all

set pocPath="C:\PointCloudFilePath\pointCloud.e57"
set cloudComparePath="C:\CloudComparePath\CloudCompare.exe"
set xmlPath="C:\optionsPath\options.xml"

%cloudComparePath% -O %pocPath% -CROSS_SECTION %xmlPath%
Last edited by flutes on Fri Mar 29, 2019 1:23 pm, edited 1 time in total.
daniel
Site Admin
Posts: 7717
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Use .cmd file with command line

Post by daniel »

What happens if you execute this script while in a console? Can you see any error message?
Daniel, CloudCompare admin
flutes
Posts: 4
Joined: Fri Mar 29, 2019 12:51 pm

Re: Use .cmd file with command line

Post by flutes »

I edited my message, I made a small syntax error.
TMC
Posts: 9
Joined: Tue Mar 12, 2019 1:29 pm

Re: Use .cmd file with command line

Post by TMC »

Hello dear forum,

I have an additional question to this topic, but first let me try to explain what I want to achieve.

I have a very big point cloud of an forest. I want to extract a cross section for each tree.
I have an file with the x, y and z coordinates for each tree.
My approach would be to use those coordinates and "cut" out an box with aprox. 10 x 10 x 40 m dimensions and save that box into a new file.

I think using the cross_section command line with an xml file would do? Is that right?
If I'm understanding the plugin and the following post from Daniel correctly it is possible to extract multiple sections of one point cloud.
daniel wrote: Fri Jan 25, 2019 8:55 am And you also have the more evolved -CROSS_SECTION option (if you want to extract multiple sections / boxes at a time)
But how would I modify the xml file with all my Box_center coordinates in that manner that the large point cloud is only loaded once and then create the cross sections from that given xml?

Code: Select all

http://www.cloudcompare.org/doc/cross_section_params.xml
I guess filling the xml file with my coordinates I have to figure out on my self, but I have over 800 coordinates ( more precise over 800 trees) so I'll try an automatic approach.

So my first Question would be: Is this approach the right one or even possible?
And the second one would be: How to modify the xml accordingly or do I need to create for eacht tree a single xml file?

I hope you can help me and I look forward to hear from you.

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

Re: Use .cmd file with command line

Post by daniel »

Actually the cross section tool allows you to extract multiple sections, but in a grid-like manner (each section is repeated along one or more direction, with an optional gap between each). Therefore you can't use it for your need.

Same thing with the -CROP option (that would be simpler) but you would need to load the cloud each time once again...

Your only option would be to change the behavior of the behavior of the CROSS_SECTION tool so as to be able to input various box centers. But it would require some development skills of course.
Daniel, CloudCompare admin
TMC
Posts: 9
Joined: Tue Mar 12, 2019 1:29 pm

Re: Use .cmd file with command line

Post by TMC »

daniel wrote: Thu Apr 04, 2019 6:49 pm Actually the cross section tool allows you to extract multiple sections, but in a grid-like manner (each section is repeated along one or more direction, with an optional gap between each). Therefore you can't use it for your need.
Well,l thats what I was afraid of. But still it is a quite useful tool.
daniel wrote: Thu Apr 04, 2019 6:49 pm Your only option would be to change the behavior of the behavior of the CROSS_SECTION tool so as to be able to input various box centers. But it would require some development skills of course.
I have some java/phyton expierences, if I have the time I might be able to tweak it. Can you direct me in the rough direction where to look?
daniel wrote: Thu Apr 04, 2019 6:49 pm Same thing with the -CROP option (that would be simpler) but you would need to load the cloud each time once again...
Since this is an approach I could do right now I might start with that approach. Seems like I have to divide and conquer ;)


Thank you daniel :)
Post Reply