Python script to convert a file in Abacus' INP format into the STL (STereoLithography) file format
Install the requirements if needed using:
$ python3 -m pip install --user numpy
inp2stl.py [-h] --input INPUT --output OUTPUT [--flip [FLIP]]
Detect peas.
optional arguments:
-h, --help show this help message and exit
--input INPUT Name of the input INP file.
--output OUTPUT Name of the output STL file.
--flip [FLIP] Flip normal vectors.
$ wget https://ndownloader.figshare.com/files/10269141
$ mv 10269141 male_model.inp
$ ./inp2stl.py --input male_model.inp --output male_model.stl
It's not pretty, isn't it?
$ ./inp2stl.py --flip --input male_model.inp --output male_model.stl
export the mesh as
a binary STL file.-bin
at the end of the filename.The file name should be much smaller than the ASCII file
$ ls -l male_model*.stl
-rw-r--r-- 1 franck users 5738284 Aug 19 16:29 male_model-bin.stl
-rw-r--r-- 1 franck users 27048282 Aug 19 16:28 male_model.stl
See...
The Python wrapper is installed in `/home/franck/gvxrWrapper-1.0.1/python3
on my computer.
$ cd /home/franck/gvxrWrapper-1.0.1/python3
$ ls
gvxrPython3.py _gvxrPython3.so test.py
PYTHONPATH
in my .bashrc
file with:$ echo "" >> ~/.bashrc
$ echo "# Install of gvxrPython3" >> ~/.bashrc
$ echo "export PYTHONPATH=/home/franck/gvxrWrapper-1.0.1/python3:$PYTHONPATH" >> ~/.bashrc
$ ./gvxrPythonTest.py