openscad-remote/README.md
2021-08-31 22:49:27 +01:00

69 lines
2.3 KiB
Markdown

# OpenSCAD-Remote
Send a bunch of files and get an STL out of it
- [:hammer_and_wrench: Build & Run](#hammer-and-wrench-build-run)
- [:whale: Docker](#whale-docker)
- [:snake: Python + uWSGI](#snake-python-uwsgi)
- [:information_source: Usage](#information-source-usage)
## :hammer_and_wrench: Build & Run
### :whale: Docker
Using `docker` is the simplest way to build, start, and host this piece of software:
```bash
# Build the image
docker build -t openscad-remote:latest .
# Start the container
docker run --rm -it -p 5000:5000 openscad-remote:latest
```
Alternatively, you can use `docker-compose` which should simplify the above commands:
```bash
# Build the image
docker-compose build
# Start the container
docker-compose up
```
### :snake: Python + uWSGI
Running this with pure Python and uWSGI has a few requirements:
* Flask
* Flask-Cors
* OpenSCAD
* uWSGI
OpenSCAD and uWSGI should be installed with your Linux distribution's package manager. Flask and Flask-Cors can be installed with `pip`, just use the `requirements.txt` file for maximum lazyness.
Once everything is installed, start the server with the following command:
```
uwsgi --ini uwsgi.ini
```
## :information_source: Usage
[![Multi-uploader status](https://img.shields.io/website?label=Multi-uploader&style=for-the-badge&url=https%3A%2F%2Fcad.interstellai.re%2Fmulti-uploader.html)](https://cad.interstellai.re/multi-uploader.html)
**The below tool can be currently found online at the following URL : https://cad.interstellai.re/multi-uploader.html. However, it is not guarantee to be always up. Look at the badge above to check the status, refresh the page to refresh the status.**
The service is exposed on port 5000. You can send the files through a `POST` request and the server will answer with an STL file (given that it worked).
**Documentation of the payload and entrypoint is coming soon...**
Alternatively, you can serve the `multi-uploader.html` with Python and access it from a browser:
```bash
# Go into the tools folder if not already done
cd tools
python -m http.server 8000
```
You can then access a neat little interface (_work in progress_) from your browser at http://localhost:8000/multi-uploader.html
**More is coming: a better server for the UI, maybe integrate this project into a bigger one, more documentation, Matrix bot ?...**