G-Code - STL
This project allows users to assemble G-code and view it through a web interface and download the result as a .STL file, featuring a Flask backend and a React front-end for visualizing G-code commands. The entire project can be started with a single command.
- Prerequisites
- Installation and Setup
- Usage
- Alternative Usage with
test.ipynb - Troubleshooting
- Notes
- License
- Python (3.x): Ensure Python is installed and added to your PATH. Download Python here
- Node.js and npm: This project requires Node.js and npm for managing front-end dependencies.
- Download Node.js and npm and ensure they’re added to your PATH.
-
Clone this repository:
git clone https://github.com/Aryagarg23/G-Code-Assembler.git cd G-Code-Assembler -
Run the Project Setup: Execute the following command based on your operating system:
- Linux/Mac:
./run_project.sh
- Windows:
Double-click
run_project.batin the project directory, or open Command Prompt, navigate to the directory, and run:run_project.bat
This command will automatically:
- Install Python dependencies.
- Start the Flask backend.
- Install npm dependencies and start the front-end server.
- Linux/Mac:
After running the setup script, your project’s components should now be running:
- The Flask backend serves API endpoints at
http://localhost:5000. - The React front-end is available at
http://localhost:3000.
- Open a web browser and go to
http://localhost:3000to see the G-code viewer. - The backend Flask server will run concurrently, handling API requests in the background.
If you only need to generate STL files and don’t require the web interface, you can use the Jupyter notebook test.ipynb to work with STL files directly:
-
Install Dependencies: From the
G-Code-Assemblerdirectory, install the required Python packages:pip install -r requirements.txt
-
Run the Jupyter Notebook: Open
test.ipynbusing Jupyter Notebook or Jupyter Lab:jupyter notebook test.ipynb
This notebook allows you to generate STL files without needing to set up or run the front end. Simply run each cell in
test.ipynbto execute the required operations.
- Module Installation Issues:
- If you encounter an error with
from stl import mesh, please refer to this issue: numpy-stl Issue #55.
- If you encounter an error with
- Node.js Not Found:
- If the script indicates that
npmis missing, install it manually from the link in the Prerequisites and ensure it's added to your PATH.
- If the script indicates that
- During the npm installation, you may see warnings about deprecated packages. These are non-critical, and the application should still run without issues.
- For any further customization or additional troubleshooting, please refer to the documentation of Flask and React.
This project is licensed under the MIT License.