How to run CSF plugin on windows powershell

Feel free to ask any question here
Post Reply
Thiva
Posts: 5
Joined: Tue Feb 09, 2021 9:55 pm

How to run CSF plugin on windows powershell

Post by Thiva »

Hi there, I would like to run the windows PowerShell to perform certain tasks to identify the weld defects in a 3d weld object. Ideally i would like to create a script that would run the powershell and automatically open compute whatever necessary and produce the output in a separate file.

My computing process are as follow

1. create a sample point mesh.
2. unroll the surface using the projection function.
3.align the surface of the weld to be on the front face instead of the side face.
4. apply the Csf filter
5. obtain the off ground points and export the scalar fields to Z axis.
6. Take a screenshot of the front surface and save the file.

Specifically, i would like to know how to change the location where the file will be saved, how to run the csf plugin on the command window, and capture certain view port and save in a file.
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: How to run CSF plugin on windows powershell

Post by WargodHernandez »

I don't believe that the csf plugin is available through the command line at this point.

for the rest you'll need to use powershells method of passing arguments to an executable. the basics of the arguments and structure are outlined here
Thiva
Posts: 5
Joined: Tue Feb 09, 2021 9:55 pm

Re: How to run CSF plugin on windows powershell

Post by Thiva »

Is there anyway that I could enable CSF filter to be operated through windows. I would like to know if could develop a script probably to develop it. I would need your advise on this matter.

Apart from that, i dont seem to find the Unroll and level tool from the basic arguments, does that means that this two tools cannot be used or is there another way of working this out.
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: How to run CSF plugin on windows powershell

Post by WargodHernandez »

well for an example of what would need to be written for CSF I will include links to the command line stuff I wrote for the qRansac plugin

Here is a link to the first commit that shows exactly what was added to get the minimum functionality

Hmm nevermind, while looking at what I did to see what you would have to do for CSF I noticed someone already did it!

qCSFCommands.h


So it looks like it just never made it into the Command line Wiki

I haven't looked at the code close enough to know what parameters are expected, ordering, etc.. but here are the commands that are being looked for:

Code: Select all

COMMAND_CSF[] = "CSF"; 
COMMAND_CSF_SCENE[] = "SCENES";
COMMAND_CSF_SCENE_SLOPE[] = "SLOPE";
COMMAND_CSF_SCENE_RELIEF[] = "RELIEF";
COMMAND_CSF_SCENE_FLAT[] = "FLAT";
COMMAND_CSF_PROC_SLOPE[] = "PROC_SLOPE"; 
COMMAND_CSF_CLOTH_RESOLUTION[] = "CLOTH_RESOLUTION";
COMMAND_CSF_MAX_ITERATION[] = "MAX_ITERATION";
COMMAND_CSF_CLASS_THRESHOLD[] = "CLASS_THRESHOLD";
COMMAND_CSF_EXPORT_GROUND[] = "EXPORT_GROUND";
COMMAND_CSF_EXPORT_OFFGROUND[] = "EXPORT_OFFGROUND";
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: How to run CSF plugin on windows powershell

Post by WargodHernandez »

Here are the CSF commands description from the change log

Code: Select all

qCSF:

    added support for command line mode with all available options, except cloth export
    use -CSF to run the plugin with the next optional settings:
        -SCENES [scene]: name of the scene (SLOPE|RELIEF|FLAT)
        -PROC_SLOPE: turn on slope post processing for disconnected terrain
        -CLOTH_RESOLUTION [value]: double value of cloth resolution (ex 0.5)
        -MAX_ITERATION [value]: integer value of max iterations (ex. 500)
        -CLASS_THRESHOLD [value]: double value of classification threshold (ex. 0.5)
        -EXPORT_GROUND: exports the ground as a .bin file
        -EXPORT_OFFGROUND: exports the off-ground as a .bin file
here is the PR that added the functionality
this is only available in the 2.12 Alpha version
Thiva
Posts: 5
Joined: Tue Feb 09, 2021 9:55 pm

Re: How to run CSF plugin on windows powershell

Post by Thiva »

Thanks that helps a lot, by the way how about the unroll tool is it available in the command line as well?
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: How to run CSF plugin on windows powershell

Post by WargodHernandez »

I don't see anything that leads me to believe unroll is available, no.
Thiva
Posts: 5
Joined: Tue Feb 09, 2021 9:55 pm

Re: How to run CSF plugin on windows powershell

Post by Thiva »

Is there a way to create the unroll command on cloud compare?
WargodHernandez
Posts: 187
Joined: Tue Mar 05, 2019 3:59 pm

Re: How to run CSF plugin on windows powershell

Post by WargodHernandez »

Yes just need to follow the examples in the code base, or find someone motivated to do it if your not a developer, if you take a shot at it we can help refine the code during the pull request
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to run CSF plugin on windows powershell

Post by daniel »

Yes, it's pretty easy to add an option indeed. Just duplicate an existing one:
- look at the https://github.com/CloudCompare/CloudCo ... Commands.h header file were all the commands are declared. And then add the corresponding code in the cpp file (there are many different options, and you just need to duplicate one that is close to what you want to do - for instance -CROP2D or -SOR, etc.)
- then don't forget to 'register' this new command in https://github.com/CloudCompare/CloudCo ... r.cpp#L596
Daniel, CloudCompare admin
Post Reply