2011-08-22

My own 3D slicing code...

There are several bits of code used for 3D printing, and one of the most important is the code to turn the 3D model (in STL file format) in to instructions to drive the printer.

The common one, because it is so flexible and powerful, is skeinforge. It is python based and works well.

However, being me, I have written my own code now, which is what all this polygon library stuff was for.

Having not touched the 3D printing for a few weeks I thought I would have a bash at making it work yesterday afternoon - and it does. I have made the GCODE output stage and it actually prints.

I think my inset algorithm and polygon functions are producing more precise output. It is looking better, but it is hard to be sure as the settings are not easy to exactly mirror between the systems, and that can make a difference. One thing I noticed with skeinforge, for example, is to make this gear fit a 5mm spindle I had to make the design have a 6mm hole. My tools seems to not have this issue.

Some things skeinforge did are almost certainly better. The fill logic is an area I have done completely differently. I can't, yet, handle single outline skins, i.e. very thin walls, as I will always extrude both inside and outside. I also do not yet have the logic to reduce flow on sharp points where the plastic overlaps. This is all related, and on the todo list.

However, one bit that seems to work really well is anchors. Basically, getting the print started is hard work - often you get too little or too much plastic as you start. It can take a few cm of extrusion before it is sticking. It needs special attention. Skeinforge offers a raft solution and I have come up with an anchor.

The raft idea is that you make a lattice of plastic first. The first layer being lots of extruded plastic slowly, so it cannot be dragged thin and cannot fail to stick to the bed. Then a thinner layer on top, and then the print. This has issues - mainly how to separate the print from the raft afterwards. The print does not have a good bottom layer either as not printed on a flat surface, and that can be important as many things have a flat base. I never got on with rafts, but I know some people use them with success.

The anchor idea is slightly different - I make a layer of plastic around the shape. This is several loops, starting at the outside and working inwards. If the first loop does not print properly, no problem. The default is 4 loops. They touch each other, and make a solid mat that is stuck to the bed. The final inside loop is separate from the artwork with a gap, and has chevrons that go from the anchor to the artwork and touch it at regular intervals. The result is a large mat that prints first and stays stuck down, with the artwork touching it. The artwork is not the first thing to print, so by the time it starts the extrusion is running smoothly. The artwork is held in place by this mat, but easy to snap off when finished without leaving marks. The base of the artwork is flat on the bed. So far the results are very encouraging.

One concept being considered is whether it is possible to create support structures automatically to handle overhangs. This may need more work and experimentation.

Next questions is if and when I publish the code for others to play with...

No comments:

Post a Comment

Comments are moderated purely to filter out obvious spam, but it means they may not show immediately.

Playing cards

One of the fun diversions I have had in my time was making playing cards. I did a whole chapter in my biography on this. My playing card des...