Welcome! Log In Create A New Profile

Advanced

Slicing a 2D drawing

Posted by i-make-robots 
Slicing a 2D drawing
July 04, 2016 01:03PM
I have a robot that draws 2D pictures with a sharpie. Currently I can load a DXF and draw the outlines, like so:

[www.instagram.com]

Assuming I can find closed loop sections and I know the size of my sharpie, how would I then infill appropriate regions?
My app is open source in Java, and I'm looking for some help to take this to the next level.

[github.com]

I imagine it's some kind of scan line to flood fill. 3D slicers have already solved this very nicely and I'd like to not reinvent the wheel.
Is there an open source lib I have failed to google that would be helpful? Any tips you have would be greatly appreciated.

Thank you!

Edited 1 time(s). Last edit at 07/04/2016 01:03PM by i-make-robots.
Re: Slicing a 2D drawing
July 05, 2016 08:24AM
I would suggest using OpenScad. No need to learn a great deal about it to do what you want.

1) Download and install (free) OpenScad from [www.openscad.org]
2) Run Openscad.
3) Click in the white window on the left side of the OpenScad GUI and type the following: "linear_extrude(height=0.25)"
3) Drag & drop your DXF file into the white window on the left of the OpenScad Gui. This will result in the line "import("{DXF file path and name}");" being inserted after the line you just entered.
The white window should now look similar to this:
linear_extrude(height=1)
import("C:/Designs/dxf/MyDesign.DXF");
4) Press F6 - you should see the DXF model appear in the top right window.
If the pane goes completely yellow, it is zoomed in too much. You can click in this window and use the mouse wheel or "view" pull-down to zoom in and out, and the mouse buttons to move it.
5) In OpenScad click "File", "Export", "Export as STL" and save the resulting STL somewhere

You then use that STL in Slc3r to create a 3D G-code. The number you typed after the "height=" will determine the thickness of the shape in mm, and if you set it to the same height as the first layer height in Slic3r, the G-code will be a single layer filled-in shape, so you then just need to get your robotic sharpie to understand the G codes, or convert the G-codes to whatever language your sharpie uses. Set the extrusion width in Slicer to the width of the line your sharpie draws to get a complete fill.

Dave

Edited 2 time(s). Last edit at 07/05/2016 08:33AM by dmould.
Sorry, only registered users may post in this forum.

Click here to login