Code Monkey home page Code Monkey logo

fabinventors's Introduction

FabInventors

Software to facilitate multi-head 3D Printer control, provide print time duration estimates, and calculate energy and material consumption.

Intro

3D Printers need input instructions on how to fabricate a given part.

These instructions are usually provided in a file format called G-Code.

A G-Code file is basically a series of points (along with speed, extrusion and some other properties)

A sample of G-Code can be seen here:

image

Description:

  • G1 = Line with material extrusion
  • G0 = Line without material extrusion (travel line)
  • F = Print Head Speed
  • X = X coordinate
  • Y = Y coordinate
  • Z = Z coordinate (not shown here - 3D parts are printed layer by layer, so z changes happen with less frequency)
  • E = Amount of material extruded

Problem to Solve

To reduce the manufacturing time, FabInventors is developing a Multi-Head 3D Printer.

In order to properly provide G-Code instructions to this Multi-Head 3D Printer, they would have to be sliced, according to the spatial distribution of the various print heads.

However, in order to slice G-Code instructions, one needs to calculate intersections.

And in order to calculate intersections, one needs lines. But G-Code instructions consist of a series of points.

Goal

Therefore, this software intends to:

  1. Receive a G-Code input
  2. Parse it from a series of points, to a series of lines
  3. Slice said series of lines (with a dynamic number of rows and columns, to accommodate any table distribution of print-heads) into multiple files.
  4. Convert each slice file back into a the G-Code format
  5. Feed the G-Code file of each slice into each head of the Multi-Head 3D Printer.

This flow can also be seen here:

Flowchart

(higher quality version here: Flowchart.pdf)

Desired JSON Format

The G-Code files should be parsed into a JSON with the following format:

data = {
    "input": "xyz.gcode",
    "lines": [
        {"points": [(0, 0, "z2"), ("x2", "y2", "z2")], # Milimeters
        "speed": "F", # Milimeters per Minute
        "extrusion": "E", # Milimeters
        "type": "TRAVEL(if 'G0' in line_content) / WALL-OUTER / WALL-INNER / SKIN / FILL / SUPPORT / SKIRT",
        "mesh": "MESH_NAME/NONMESH"
        },
        {"points": [("x1", "y1", "z1"), ("x2", "y2", "z2")], # Milimeters
        "speed": "F", # Milimeters per Minute
        "extrusion": "E", # Milimeters
        "type": "TRAVEL(if 'G0' in line_content) / WALL-OUTER / WALL-INNER / SKIN / FILL / SUPPORT / SKIRT",
        "mesh": "MESH_NAME/NONMESH"
        },
        {"points": [("x1", "y1", "z1"), ("x2", "y2", "z2")], # Milimeters
        "speed": "F", # Milimeters per Minute
        "extrusion": "E", # Milimeters
        "type": "TRAVEL(if 'G0' in line_content) / WALL-OUTER / WALL-INNER / SKIN / FILL / SUPPORT / SKIRT",
        "mesh": "MESH_NAME/NONMESH"
        },
    ]
}

Extras

The software will also feature:

  • A series of estimators for print-time duration, energy consumption and material expenditure. (IN PROGRESS)
  • A fully-adjustable 3D Visualizer, complete with color features and able to project both complete parts and slices.

Estimator Physics

The estimators will perform calculations on several physical factors like:

  • motor strength
  • material weight
  • print head acceleration
  • etc

Visualizer

The 3D Visualizer can be seen here:

image

Potential Improvements

  • Implement tests, to see if all final products match the Original G-Code products.
  • Once all tests are passed, implement some CI (maybe with GitHub Actions) to automatically run all tests whenever new code is pushed to master, to ensure quality and guarantee that no new code compromises product integrity.

fabinventors's People

Contributors

antoniopgs avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fabinventors's Issues

Should I make a generator that only reads one line at a time?

Right now, generator reads two lines at a time and updates old variables.

Alternatives:

  • Read two lines at a time, and use no "old variables". Read previous and current value every iteration.
  • Read one line at a time, and keep "previous values" in memory.

Which is better?

Change If Statement Order

The most frequent type of line is G0/G1.
Maybe I should put that if statement first, to make it faster.

Implement Decorators

  • Main Functions (parse, estimate, visualize)

    • If name != main: run normally
    • elif __name == main: take path input and create folder with txt json output
  • Secondary Functions (get, get_previous, check_type, etc.)

    • Only run if imported (find out how to implement this)

Confirm Z is working properly

Not sure Z is working properly.
It doesn't always precede a new layer (at the beginning of the file).
Confirm with Nuno

Plot Titles

Now the parser retrieves title, so I still have titles in plots when importing the visualize module.
But what if I want to place time estimates in the plots?
Should I join "estimate" and "visualize"?

Flowchart

When validating JSON I should not only compare plots, but also compare material expenditure and energy consumption.
Should add this later to the flowchart.
Maybe I could also compare print time estimations (making the necessary adjustments)...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.