Skip to content

Commit

Permalink
add compile documentation for python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
David Jourdan committed Aug 8, 2024
1 parent 07e069c commit 3f5c8ab
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,31 @@ cmake --build build -j $(nproc)
```
Provided that you have the necessary graphics packages installed (if not the case, see [here](Dependencies.md)) CMake will download the required dependencies and compile the executable.

## Python bindings
To compile the Python bindings and install dependencies:
```
cmake -B build -DPYTHON_BINDINGS=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build --target install -j $(nproc)
pip install -r python/requirements.txt
```
Then you can run the Python app: ```python python/main.py```

## Optional dependencies

These libraries can downloaded for better performance:
- [OR-Tools](https://developers.google.com/optimization/install/cpp/binary_linux): the path where the downloaded archive has been extracted should be specified in the ```${ORTOOLS_PATH}``` variable in ```CMakeLists.txt```.
- [MKL Pardiso](https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-download.html)
CMake will automatically detect if you have either [MKL Pardiso](https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-download.html) or [SuiteSparse](https://people.engr.tamu.edu/davis/suitesparse.html) installed on your system, in which case they will be used for faster linear system solving.

## How to run
From the command line, specify which mesh file (stored in ```/data/```) should be opened. For example with ```beetle.obj``` simply run
```
build/shrink_morph beetle
build/app/shrink_morph_app data/beetle.obj
```
For those who prefer to use a command-line version of a the app, use the ```shrink_morph_cli``` executable:
```
build/shrink_morph_cli mesh wD width nFmin
build/app/shrink_morph_cli mesh wD width nFmin
```
with ```mesh``` the name of the input mesh, ```wD``` the smoothing factor (0 by default), ```width``` the width of the flattened plate in mm, and ```nFmin``` the minimum number of faces in the input mesh (it gets iteratively subdivided until reaching this value). For example, to generate the same results as the ```hat``` model in the paper, type:
```
build/shrink_morph_cli hat 0.1 100 10000
build/app/shrink_morph_cli data/hat.obj 0.1 100 10000
```

To generate the final gcode files, use the togcode.py script. Its inputs are the .path file generated by the app, the name of your printer (only a few have been tested, use with caution!) and optionally the name of the output file, here is an example:
Expand Down

0 comments on commit 3f5c8ab

Please sign in to comment.