You are browsing as a guest. Sign up (or log in) to start making projects!

2D Printer Simulation

  • 10 Devlogs
  • 17 Total hours

The 2D Printer Simulator is a Python application that simulates the operation of a 2D printer cuz im too broke to afford a real printer or a 3D printer.

Ship #1

I built a 2D printer simulation in Python that simulates a pen plotter type thing from start to finish. It has an SVG slicer that converts vector graphics into a custom .banana printer instruction format, and a printer capable of reading those instructions and printing them out live on your screen!

The biggest challenges were designing my own printer instruction language, generating printable paths from SVGs, and implementing polygon infill so the printed result closely matches the original image. Another challenge was making the printed output persist on the virtual print bed, since Pygame generally requiring the entire scene to be redrawn every frame.

When trying it out, make sure that the image you are attempting to slice is in the .svg format and prefered to be under 10 kb, otherwise expect long slicing times...

Thanks for looking at my lil project =D

  • 10 devlogs
  • 17h
Try project → See source code →
Open comments for this post

1h 42m 11s logged

im so close to finishing this!

Slicer stuff

I refactored the slicer scripts and then made a cool tkinter GUI. You can move around your SVG(Sadly you cant print multiple at the same time).

Printer stuff

Using tkinter, I added a load button so you can load your .banana files way faster than using command line arguments.

Whats next?

  • Better sprites for 2d printer app
  • Get ready to ship(pls get me out of the depths of python)

more stardance logos!!! =D

0
0
3
Open comments for this post

2h 31m 16s logged

GUI time!

I tried to fix my slicer issues, but that was a waste of time. I then fixed an issue present in the older versions of the slicer where the printer would begin extruding for infills before it reached the X Y coordinate of where it should start infilling. The slicer struggles to do really complex images howver, but I am okay with that because even being able to slice was a big challenge for me to complete.

Whats next?

  • Basic GUI
    • Move around print
    • Allow user to load custom SVG’s

Quote of the devlog

guh…

0
0
3
Open comments for this post

2h 13m 55s logged

Bottom tier 2D printer moment

The slicer is absolutely NOT cooperating. I made two versions, each of which are better suited to different scenarios.

SlicerV2(left logo) Good when across the x axis, there are multiple points

SlicerV3(right logo) Good when there are multiple points along y axis.

They both are kinda bad, but I did optimize the slicer a bit. When from 35 elements/sec to around 25 elements/sec. Slicing still kinda takes a while though

send food pls, im hungry

0
0
5
Open comments for this post

17m 5s logged

it made stardance logo(trust i should get an award for this)

This was a result of TONS of tuning(took like 50 min, but ig hackatime doesn’t support my slicer =p ) The printer needs some work on when to start and stop extruding.

im not gonna put a whats next here, i made like 3 devlogs today 😭

0
0
4
Open comments for this post

1h 9m 21s logged

The intelligence of my slicer is now not 0

I took a lot of time rewriting the slicer’s infill methods, and now the slicer can print objects that aren’t squares. I also added padding so the image you print isn’t crammed into the corner

Whats next

  • testing with more advanced svgs
  • GUI slicer
0
0
1
Open comments for this post

1h 7m 22s logged

My image slicer is finally working =o

I finally got the slicer to start giving me sliced files(only took like an hr =D )
The first image is the image i am supposed to get, but the next image is what i got lol. I still have a lot of stuff to do to get the slicer working better.

Whats next?

  • add padding so that im not printing on the edge of the build plate
  • fix the slicer infill issues
  • add padding to slicer infill extrusions
  • try actual SVG images
  • GUI slicer:
    • Allow user to move around pieces on the build plate
    • Make settings like printspeed and stuff load from sliced files
0
0
3
Open comments for this post

1h 16m 26s logged

SVG stuff =D
I finally made a basic SVG shape extractor. It uses the svgelements python library to get information about svg images.

The next step will be making a basic slicer, which will be able to use this information to “slice” the svg into a .banana file for the printer. Infill is gonna be annoying to implement though.

0
0
6
Open comments for this post

3h 37m logged

I finally decided to put this project on stardance. Currently, you can print simple drawings(very annoying to slice them). The printer works like this:

  1. Sliced files:
    • Takes an argument from running to run a .banana file
    • Interpret and convert back into commands that the printer can understand
  2. Renderer and movement
    • Python class stores x y info with a bunch of other stuff to send to renderer
    • Interpolation between points
  3. Printing
    • Using pygame permanent canvas that doesn’t get erased when pygame.flip() is called.

Features as of now:

  • Printing =0
  • Toolhead path preview(“T” key)
  • Make printhead slightly transparent(“shift” key, allows you to see the rest of the drawing if the printhead covers any part of it)
  • Test path(runs path but doesn’t print and goes way faster)

Currently printing is pretty finished. The next goal will be making a slicer that slices scalable vector graphics(svg) into .banana files

0
0
1

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…