tataratat / splinepy

Library for prototyping spline geometries of arbitrary dimensions and degrees, and IGA
https://tataratat.github.io/splinepy
Other
47 stars 13 forks source link

Ft cli #357

Closed clemens-fricke closed 10 months ago

clemens-fricke commented 10 months ago

Overview

Add cli options to splinepy as well as add automatic io loader function.

The automatic io loader module selects the correct io module for specific file extensions. These are not all tested completely, please check if they are correct and valid.

CLI OPTIONS


                    %%\ %%\                                         
                    %% |\__|                                        
 %%%%%%%\  %%%%%%\  %% |%%\ %%%%%%%\   %%%%%%\   %%%%%%\  %%\   %%\ 
%%  _____|%%  __%%\ %% |%% |%%  __%%\ %%  __%%\ %%  __%%\ %% |  %% |
\%%%%%%\  %% /  %% |%% |%% |%% |  %% |%%%%%%%% |%% /  %% |%% |  %% |
 \____%%\ %% |  %% |%% |%% |%% |  %% |%%   ____|%% |  %% |%% |  %% |
%%%%%%%  |%%%%%%%  |%% |%% |%% |  %% |\%%%%%%%\ %%%%%%%  |\%%%%%%% |
\_______/ %%  ____/ \__|\__|\__|  \__| \_______|%%  ____/  \____%% |
          %% |                                  %% |      %%\   %% |
          %% |                                  %% |      \%%%%%%  |
          \__|                                  \__|       \______/

usage: splinepy [-h] [-v] {show} ...

positional arguments:
  {show}         sub-command help
    show         Show the given spline.

optional arguments:
  -h, --help     show this help message and exit
  -v, --version  Show version of splinepy.

Version(s)

splinepy --version

splinepy version: 0.0.51.
numpy version: 1.26.4.
gustaf version: 0.0.23.
vedo version: Not Installed.
scipy version: Not Installed.
napf version: Not Installed.
meshio version: Not Installed.
k3d version: Not Installed.

or if all dependencies and dependencies of dependencies are installed

splinepy version: 0.0.51.
numpy version: 1.26.0.
gustaf version: 0.0.22.
vedo version: 2023.5.0.
scipy version: 1.11.2.
napf version: 0.0.6.
meshio version: 5.3.4.
k3d version: 2.16.0.

And show splines.

                    %%\ %%\                                         
                    %% |\__|                                        
 %%%%%%%\  %%%%%%\  %% |%%\ %%%%%%%\   %%%%%%\   %%%%%%\  %%\   %%\ 
%%  _____|%%  __%%\ %% |%% |%%  __%%\ %%  __%%\ %%  __%%\ %% |  %% |
\%%%%%%\  %% /  %% |%% |%% |%% |  %% |%%%%%%%% |%% /  %% |%% |  %% |
 \____%%\ %% |  %% |%% |%% |%% |  %% |%%   ____|%% |  %% |%% |  %% |
%%%%%%%  |%%%%%%%  |%% |%% |%% |  %% |\%%%%%%%\ %%%%%%%  |\%%%%%%% |
\_______/ %%  ____/ \__|\__|\__|  \__| \_______|%%  ____/  \____%% |
          %% |                                  %% |      %%\   %% |
          %% |                                  %% |      \%%%%%%  |
          \__|                                  \__|       \______/

usage: splinepy show [-h] [-i INPUT_FILE] [-o OUTPUT_FILE] [-e]

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT_FILE, --input-file INPUT_FILE
                        Input file name.
  -o OUTPUT_FILE, --output-file OUTPUT_FILE
                        Export graphic to file.
  -e, --interactive     Show graphic in interactive window even if save to file is on.

splinepy show -i spline_file_with_file_ending_that_can_be.imported -o output.png or leave the -o option then you can see the spline in interactive mode via vedo.

Addressed issues

Showcase

See above

Checklists

jzwar commented 10 months ago

That's cool, what about Show options like control points, ids and all that. Any way to configure this ? Especially the Resolution might be something the User wants to control