Sunday, July 9, 2017

[3dprint] Adaptive slicing, smooth and optimized

IceSL 2.1 introduces per-layer settings, with a simple interface allowing to customize many parameters per-layer. Below is a screenshot for layer thickness (blue is thinner).

Model is https://www.thingiverse.com/thing:222814
The bar on the left represents the height of the print, and by simply placing keys (a setting value at a given height) you can precisely control how the parameter varies along the print. In between keys a smooth interpolation is done, avoiding abrupt changes that might produce visible differences (but if abrupt changes are required, simply place two keys with different values next to each others).

The idea that smoothness is important for adaptive slicing was recently introduced by Prusa. My experience with adaptive slicing is that indeed abrupt changes lead to noticeable differences in surface finish, and therefore if visual quality matters, smoothness is great. IceSL smoothly interpolates all per-layer parameters.

However, regarding adaptive slicing IceSL goes much further than just providing an interface. It features a novel, state of the art algorithm for automatic layer thickness selection. This is powered by an algorithm developed by Marc Alexa, Kristian Hildebrand and myself, that was recently published in ACM Transactions on Graphics (will be presented at SIGGRAPH this summer, don't miss it!).

What is different between this algorithm and previous work is that it computes a provably optimal result (in a discrete setting): the best possible choice of slice thicknesses that will minimize an error, in this case the part accuracy (the volume difference between the print and the actual geometry). Not only that, but it finds a solution for all possible number of slices in a single optimization pass.

The bottom line is that you get automatically a great selection of layer thicknesses, for a desired number of slices. Yes, this means you get to choose a number of slices (which strongly correlates with printing time in most cases), and the algorithm selects the slice thicknesses than provide the most accurate result for this choice.

One drawback of the algorithm as described in the paper is that it does not produce a smooth result. As smoothness is important for visual quality, I provide in IceSL a modified version that generates smooth results (but gives up optimal accuracy). Of course you can choose between both versions!

Let's see some results! (To activate the optimizer simply click on the "Optimize" button at the top of the left bar, in IceSL-slicer of IceSL-forge. After optimization a slider lets you choose the number of slices.)

Here is the castle for 999 slices from 0.1 to 0.3 mm, smooth solution. See how the algorithm uses thick slices in vertical parts and thinner ones in slanted/detailed regions. Keep in mind this is a compromise constrained by the chosen number of slices.

Result with 999 slices, smooth solution

One thing that cannot easily be seen, is that the position of the horizontal surfaces (tops) is now very accurate. When slicing at 0.3 mm, if a horizontal surface is located at height 1.05 mm, the positioning error is as large as 0.15 mm ! (because 3 slices give 0.9 mm, and 4 slices give 1.2mm, we cannot reach height 1.05mm). Our algorithm will insert one smaller slice to ensure the top part is accurately positioned, and this is true of all complex alignment cases that can occur.

Here is another solution with more slices (you can interactively select the number of slices you want in the print, with immediate feedback):

Result with 1499 slices, smooth solution
Great isn't it? And you can always fall back to manual selection, if you do not like the optimized result.

Stay tuned for other focuses on the new features of IceSL 2.1, and don't miss the SIGGRAPH presentation this summer about our algorithm (Session "Fabricating curves, surfaces and volumes, Tuesday, 1 August, 10:45 am-12:35 pm).

Follow us on @iceslapp


Thursday, December 8, 2016

[3dprint] IceSL online

We just released IceSL online. If you enjoy solid modeling (CSG) and 3D printing, don't miss it! You can directly model with code (in lua!), customize objects (in real time!) and generate G-code from your web browser.

 
From a technical point of view, IceSL online was quite an endeavor. Imagine taking a state-of-the-art GPU modeling and slicing engine, that by the way requires OpenGL 4.2 to run, and now squeeze it into a WebGL 1.0 javascript engine...

... Errr?

That's also how I felt the first time the thought occurred to me: no way! But well, who does not like a challenge :-) It turns out WebGL 1.0 is more or less at the level of what was available back in 2004-2006 when I was a PhD student and postdoc. And at the time, I had quite some fun with GPU programming. Only, 2016 GPUs are much much more powerful. This is a perfect situation for a complete abuse of good old-school OpenGL GPU programming! And this is what made IceSL-online possible. It is a new engine, yet it shares many (most) core algorithms with IceSL (the new version, not yet released) and SliceCrafter (slice STL files online).

I am hoping to find the time to describe how it works -- nothing ground breaking for experts, but it is quite fun. Even possibly a bit novel. In any case, I hope you'll enjoy using it!

Of course it has limitations compared to the desktop version and it will not support large designs, but most of my models work just fine in it. I have already made several projects, and it is super convenient to fire up the web browser, customize or model a little something and directly get the G-Code for a quick print. I am also hoping it can be a good educational tool, to learn programming and 3D printing.

Stay tuned for upcoming features, and please spread the word!

Friday, August 5, 2016

[3dprint] hierarchical rhombic infill

Rhombic infills are both strong and fast to print. If you are using IceSL, you probably already have seen these patterns as they have been the default infill for the past year. I also did a number of experiments with a hierarchical version of a rhombic infill. However, the question of how to select the subdivision level depends on the target application.


A recent article by Wu and colleagues explores interesting ways to subdivide a rhombic infill to strengthen objects, for instance using a finite element simulation to subdivide weak areas in priority. This increases the density of the structures locally to obtain stronger parts.

Beside their good properties (self supporting and mechanical strength), rhombic infills are also very efficient to generate and print. Our web based slicer, SliceCrafter, includes an improved rhombic infill that prints very fast because it only uses 45 degree angled print paths (an idea suggested by IceSL user Maze Mietner). Try it out!

Wednesday, June 15, 2016

[3dprint] Plastic deposition flow control in IceSL

IceSL has a nice feature to control plastic flow that I never took the time to explain.

There are several ways to produce the toolpaths for plastic deposition, and some of them result in paths that can slightly overlap : if you were to follow the paths with a thick marker, some places would receive color twice. Well, the same happens with plastic resulting in overflow! The reason a slicer might want to do that is to avoid the opposite: leaving a gap. IceSL tends to squeeze more paths within a slice so as to reduce some of these gaps (it is not perfect though, as some thin walls are still problematic).

While often small, if such overflows occur always at the same place across layers, they will accumulate and result in bad looking 'bumps' (or worse, the nozzle will collide with the part).

The 'flow' module of IceSL takes care of this. It uses OpenGL rendering tricks and follows the path with the virtual equivalent of a marker. Only, in each pixel it counts how much color (plastic, really) is deposited. If this amounts exceeds the target, it tunes down the extrusion rate so has to avoid overflow. This works quite well in practice! I believe this could also be used for SLA / laser engraving where 'beam energy' can also accumulate more than desired (the beam footprint is not an exact dot, but rather a small circle).

The two images at the end of the post show a slice before flow optimization, and the same afterwards. The grayscale levels indicate a reduction of the plastic flow ; they are especially visible in the thin areas (you might have to zoom in to appreciate the changes.

Now is this the best way to do this? Possibly not ; geometry analysis of the path thicknesses could be faster than the brute force GPU approach -- which is also quite approximate.

I am currently exploring better ways to limit gaps and overflows in IceSL. Stay tuned!





Sunday, January 31, 2016

[icesl] Things to do with IceSL: Arcade bartop!

After an exciting but somewhat stressful SIGGRAPH deadline I allowed myself a little fun and decided to use IceSL to model and laser cut (and 3D print) a complete Arcade bartop :-)

Here is the design in IceSL:

Of course it is fully parametric! It can easily be adapted to screens of different sizes, other joysticks and buttons. The bartop is quite small, I wanted something that would nicely fit on a table and not look bulky.

Here is a transparent 3D view and an exploded view in IceSL:


And the final result! 


All parts are laser cut using G-code produced by IceSL, using the 'laser' profile (gcode is sent to a smoothieboard driven CO2 laser cutter). This is using 3 mm plywood. 

The insides of the 'beast':


This is of course powered by a Raspberry Pi 2, running RetroPie. I went for Sanwa hardware ; no regrets, the buttons and joystick are indeed super nice. I use a small USB pad emulator board to plug the joystick and buttons -- but it seems GPIO pins could be used as well. The screen is a HDMI TFT panel, size 10.1 (ref LP101WH1), which has a reasonable resolution of 1366x768 -- but there are many other models out there, I picked this one based on price/availability. For the sound I took apart a pair of Logitech Z130 speakers (50mm diameter, fits nicely).

I learned quite a few lessons building this. The 3D preview in IceSL has been incredibly useful, as well as the ability to interactively move things around. I used 3D models of all electronics so that I could check for a proper layout and avoid collisions between the different parts. Nevertheless, I got a few things wrong mostly because I did not model the plugs (USB, HDMI, power) and these take *a lot* of space. This is the second prototype I made, the first one had a few issues and required some manual work to adjust. This one was taken right out of the cutter bed and assembled without requiring any drilling or gluing (everything tightly fits together).

I model all planks in their cutting position (thickness along Z), and define for each a transform to place it in the final 3D model. For instance the pad board is named 'pad_board' and its transform is 'pad_board_T' (just a matrix). To cut the board I use 'emit( pad_board )', whereas to display it in the final model I used 'emit( pad_board_T * pad_board )'. 

To create the finger joints I model only one side on one board and then use the following trick, e.g. between the left side board and the floor board:

side_L_board = difference( side_L_board , inverse(side_L_board_T) * floor_board_T * floor_board )

If you are not familiar with 3D matrices and transforms this may be a bit tricky to understand. 'side_L_board_T' is the transform (matrix) that puts the side board in position in the final model. Thus, inverse(side_L_board_T) is the matrix that moves everything back to the side board cutting space ; as if the entire final model was rotated to lie on the left side. Thus, writing 'inverse(side_L_board_T) * floor_board_T * floor_board' means that the floor board is first placed in the final model (by matrix floor_board_T) and then rotated back to the side (by matrix inverse(side_L_board_T) ). This is when I subtract the floor board from the side board. This effectively carves the connectors (from the floor board) out of the side board. By following this method you can easily model all connectors while being sure they will match. Another example of the power of CSG :-)

I still have a few things to add to finalize the bartop: external USB/Ethernet plugs, and most importantly an independent power supply (it requires three power plugs!) and of course paint and stickers. But for now, let's play some retro-games!

Tuesday, July 28, 2015

[3dprint] 3d infilling: faster, stronger, simpler



Sparsity: 80% empty (compared to volume of full cube)
Strenght: I applied 90 kg on each face and it remained perfectly rigid (cube is 40x40 mm).

We are working hard on the next release of IceSL.One thing I really wanted to improve are the infill patterns. The 'sine wave' patterns we are currently using look fancy, but they have a number of severe drawbacks ; one of them is resonance on less robust printers, and another is a slow print time.

I have been thinking about this for some time now. What I wanted was: 1) something rigid (obviously!) 2) something that prints quickly 3) something that prints without putting stress on the printer and 4) something easy and fast to compute.

These requirements are quite high.

Regarding rigidity, I dislike that most infill patterns are simple extrusions along z. What is really called for is a pattern forming 3D cells inside the volume for maximum rigidity (side note: I just found about slic3r 3d honeycomb while writing this post, these look great ; there may be more prior work as I haven't checked in details yet - please comment if you know some).

Printing fast essentially means going along diagonals in straight lines - something IceSL doesn't do well currently. Avoiding stress on the printer also means moving as much as possible along straight lines (no vibrations, constant speed, constant pressure in nozzle). Unfortunately anything fancy (such as 3d honeycomb) quickly leads to some turns and broken lines. Finding out something simple and fast to compute just makes it harder. 

The idea. More than just a specific infill, this is a general way to build simple and fast to print 3D infills. Let me warn you this is, indeed, very simple (once understood) -- but I am unaware of anything like that in the slicers I know.

The initial intuition was to consider the walls of a regular axis aligned 3D grid. Now, we do not want that, because the horizontal planes would create flat surfaces. So, one possibility is to rotate the entire grid so that the diagonal of the cubic cells align with the z (up) direction. Take one slice through this rotated grid. The intersection is a pattern made of straight lines -- so that seems promising. At first sight, this also seems tricky to compute: the lines have to follow a very specific pattern and meet exactly at the right locations to form the 3D cells.

Well, it turns out this is in fact trivial. What is a regular grid? It is defined as the intersection of three sets of equally spaced parallel planes; the three sets having non-coplanar normals. In 2D, for instance, draw two sets of parallel lines: this forms a regular subdivision. You can even define coordinates in this grid by numbering the spaces between the sets of lines (planes in 3D).

There is no need to worry about the exact position of the planes: when you draw two sets of parallel lines on paper they always form a proper grid (as long as the two sets are not parallel). What this means is that we can easily produce an infill generating closed 3D cells simply by printing three independent sets of parallel planes!

This gets even better. In a slice each set of planes becomes a set of parallel 2D lines (see top of the print in image). Whenever we go up by one slice the position of the lines have to shift: each line is the intersection of a slice and a slanted plane in 3D. This can clearly be seen on the sides of the print, in the image above. What this means is that you can produce an infill forming 3D cells simply by tracing three independent sets of parallel lines in each slice! It suffices to make sure the lines shift correctly from one slice to the next, which is absolutely trivial to do.

For the initial tests I chose 2D lines which are angled at 0, 45 and 135 degrees so that 2 lines over 3 print diagonally (speed). The lines shift from one slice to the next to produce a 45 degree angle in 3D. All of this is easily controllable, the angle and spacing may vary for each direction and even between planes of a same set. More than three sets can be used to form more complex subdivisions.

The first prototype was coded in less than 10 minutes (!). Count on it for the next release of IceSL!

(Edit: if you include similar infills in your slicer, please cite this blog post, in the spirit of the CC BY license. Enjoy!)