Skip to content

Aryagarg23/G-Code-Assembler

Repository files navigation

G-Code Assembler and Viewer

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.

Table of Contents

Prerequisites

  1. Python (3.x): Ensure Python is installed and added to your PATH. Download Python here
  2. Node.js and npm: This project requires Node.js and npm for managing front-end dependencies.

Installation and Setup

  1. Clone this repository:

    git clone https://github.com/Aryagarg23/G-Code-Assembler.git
    cd G-Code-Assembler
  2. Run the Project Setup: Execute the following command based on your operating system:

    • Linux/Mac:
      ./run_project.sh
    • Windows: Double-click run_project.bat in 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.

Usage

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.

To view the project:

  1. Open a web browser and go to http://localhost:3000 to see the G-code viewer.
  2. The backend Flask server will run concurrently, handling API requests in the background.

Alternative Usage with test.ipynb

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:

  1. Install Dependencies: From the G-Code-Assembler directory, install the required Python packages:

    pip install -r requirements.txt
  2. Run the Jupyter Notebook: Open test.ipynb using 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.ipynb to execute the required operations.

Troubleshooting

  • Module Installation Issues:
    • If you encounter an error with from stl import mesh, please refer to this issue: numpy-stl Issue #55.
  • Node.js Not Found:
    • If the script indicates that npm is missing, install it manually from the link in the Prerequisites and ensure it's added to your PATH.

Notes

  • 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.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages