_ _ _
| | (_) | |
__ _ ___ ___ __| | ___ _ __ __ _ _ _ __ | |_ ___ _ __
/ _` |/ __/ _ \ / _` |/ _ \ '_ \ / _` | | '_ \| __/ _ \ '__|
| (_| | (_| (_) | (_| | __/ |_) | (_| | | | | | || __/ |
\__, |\___\___/ \__,_|\___| .__/ \__,_|_|_| |_|\__\___|_|
__/ | | |
|___/ |_|
This project utilizes conda to manage the environment. To create the environment, run conda create --name gcodepainter python=3.8 and activate the environment with conda activate gcodepainter.
The following dependencies are required to run this project (included in requirements.txt):
- Python 3.8 (this is SPECIFICALLY required to ensure compatibility)
- rich
- opencv-python
- numpy
- opencv-contrib-python
- flask
Please clone my git repository with git clone https://github.com/PhysCorp/gcodepainter.git.
- Ensure that python3, python3-pip, and anaconda are installed on your system. Anaconda can be retrieved from here. If you are on Windows, you can install anaconda with chocolatey using
choco install anaconda3. - If not done from above, create a conda environment with
conda create --name gcodepainter python=3.8. - Activate the conda environment with
conda activate gcodepainter. - Install the requirements with
python3 -m pip install -r requirements.txt. - Run
python3 main.pyto start the program. By default, it launches the Flask GUI, available athttp://localhost:5000/. - (Optional) To install Pronterface for direct printing to plotting machines, please follow the instructions here. Pronterface standalone EXE must be placed in the
toolsdirectory, and namedpronterface.exe.
Here are some example commands to run the program:
# Run the program with the GUI with all defaults
python3 main.py
# Run in standalone mode with input filename = "test.png" in the temp folder, and output filename = "test.gcode" in the temp folder
python3 main.py --webui=false --input="test.png" --output="test.gcode"Additional commands and documentation are available with python3 main.py --help.
Coming soon: Task Runner support!
input -> "input.png"
output -> "output.gcode"
maximum_x -> 613
maximum_y -> 548
initial_speed -> 50000
border_x -> 50
border_y -> 50
debug -> False
display -> False
dwell_time -> 10000
acceleration -> 1000
camera_number -> 0
pi_mode -> False
input_pin -> 17 if "pi_mode" == False, else 0
execute -> False
webui -> True
camera_bounds -> "(150,60)(515,435)"To view the generated GCODE, we include a link to view the GCODE on an open-source plotting webpage at https://nraynaud.github.io/webgcode/. You are required to paste in the GCODE yourself. Alternatively, you can download the GCODE file directly. This program also supports the ability to execute the GCODE directly to a plotting machine, if you have one connected to your computer and if you have Pronterface installed on your WINDOWS computer.
- Deactivate the conda environment with
conda deactivate. - Remove the conda environment with
conda remove --name gcodepainter --all.
For more information, please also refer to the docs folder in the repository, which contains a project report!