LHEEA / meshmagick

A command line tool and a python package to manipulate hydrodynamics meshes
GNU General Public License v3.0
48 stars 27 forks source link

Python 3 implmentation and documentation #17

Open saltynexus opened 4 years ago

saltynexus commented 4 years ago

I installed meshmagick the other day by issuing the following command

conda install -c frongere meshmagick

I'm able to run meshmagick from the terminal command line (e.g. meshmagick my_mesh.stl --show) and import in python 3.7 (e.g. import meshmagick) without any trouble, however I'm not sure how to work with meshmagick in python. Right now I execute things like

os.system('meshmagick my_mesh.stl --show')

and it works as intended, but it's obviously not running explicitly in python. When I execute meshmagick.__version__ it returns '1.0.5' which from the README should be something like '2.0'?

I'm confused on what versions are available and where. Is the installation method above suppose to install the latest version (just installed the other day)? Is any documentation on how to use meshmagic explicitly in python (not via terminal command line)?

mancellin commented 4 years ago

Unfortunately, the documentation and the conda package are not always up-to-date. You can use

pip install https://github.com/LHEEA/meshmagick/archive/master.zip

to be sure to install the latest version.

meshmagick.__version__ need also to be updated... In the mean time, use pip list or conda list to check the current installed version.

The python API is documented here, but is indeed missing some example. In short, use the mmio submodule to load the vertices and faces, and a Mesh instance to handle the mesh.

saltynexus commented 4 years ago

Interesting...conda list shows version 2.0. I suppose I am using the latest version! I just assumed __version__ was up to date.

As for the docs...it might help to title that last section "Python Modules" (we already know the docs are with respect to Meshmagick). I did initially read the docs you pointed to, but I guess I just overlooked the fact you were talking about the Python API.

Also, the version on the docs says "1.05" ... might want to update that too so readers know it's with reference to your most up to date version.