# A look at adaptive layers

## Recommended Posts

Posted (edited) · A look at adaptive layers

Hi,

I wanted to fiddle with the adaptive layers, and after tweaking the settings I see a consistent pattern in the gcode (i.e not adaptive)

I modeled a perfect 50mm sphere and cut it in half (25mm tall) and generate the gcode in Cura 3.2.1.

I used 0.1mm layer height and 0.02 for maximum variation, 0.001 for variation step size and 200 for theshold

, the last layers in the top should have the lowest layerheight, say from 24mm towards 25mm, and it should be that every layer is smaller in height than the previous to maintain the smoothness

here are the Z layer heights from 24mm and up

G0 X60.555 Y57.02 Z24.076

G0 X60.612 Y57.618 Z24.156

G0 X58.233 Y60 Z24.236

G0 X59.494 Y60.504 Z24.316

G0 X60.06 Y64.822 Z24.396

G0 X59.993 Y64.464 Z24.476

G0 X60.057 Y64.044 Z24.556

so the slicer takes the base layer height - maximum variation and its the same for each layer....each layer is 0.08mm tall

Changing maximum variation to 0.05, and variation step size to 0.05, threshold to 2, and the whole print is done with layers of 0.05

I know its probably not an easy task to write this algoritm to check and calculate for every possible geometry out there, but if the math is adjusted to check for step size to next layer in x or y direction, we could maybe get better results.

Edited by catohagen
• 1
##### Share on other sites

Posted · A look at adaptive layers

I made a macro with the math to generate a sphere with adaptive layers, and generating a 50mm sphere (actually a 500mm sphere to get more numbers)

I set that the max allowed stepover is 0.1mm (in any horizontal direction) so the 'adaptive' Z value is calculated based on that.

Here is the visualized 'layers' from my macro

Here not a single layer is equal, since its a continuous slope or arc.

Side view

in the lower right in the picture, if you think of this as stairs, every step inwards is 0.1mm, the Z layerheigh is different on each layer, gradually decreasing towards the top.

The last 10 layers is probably unprintable (numbers is 10x for accuracy) as the difference is 0.038mm then 0.034mm, etc but it may give better results to implement adaptive layers like this.

I have a CNC machining background and CAM software have this way of generating toolpaths, its called 'stepover' or 'ridge height'

• 1
##### Share on other sites

Posted · A look at adaptive layers

I set up a milling operation on a 50mm sphere, using a stepover limit, you see from the simulation the small Z steps at the top, and how its progressively increases cut depth when the slope gets steeper towards the center of the sphere. You see the H,V,D coordinates at the bottom of the screen, D is the Z axis.

Would be great to get similar behaviour with adaptive layers,the surface would be incredibly smooth,  instead of the current static layer heights Cura generates at different parts of the print.

##### Share on other sites

Posted (edited) · A look at adaptive layers

1) Look at the code, it's very much adaptive (as in it looks at the mesh wall angles to determine layer height). in case of a sphere, this would be a continuous decrease indeed. you can prevent this by choosing a larger step size.

2) 3D printing is not milling, so I don't see how that milling technique would result in a 'perfectly smooth surface' in case of 3D printing.

3) It's in the experimental section because it's, well, experimental. We push out features as early as possible to get feedback rather than stay in our own world.

4) It's Free an Open Source Software, so feel free to contribute.

Edited by ChrisTerBeke
grammar
##### Share on other sites

Posted · A look at adaptive layers

Milling such as demonstrated is subtractive in nature while 3D printing is additive. Kinda polar opposites.

##### Share on other sites

Posted · A look at adaptive layers

What I find so good about topics like this is the visualization they evoke.  Apart from the discussion on the particular way in which adaptive layers are currently implemented, there is a fresh look at the geometry of layers on difficult surfaces ( I consider a sphere to be such a case with XY geometry printers)  and a perspective that may help shape the approach to a future printing corner case.

And, nerd alert, I would love to know what software generated those mockups.  I assume a CAD package, but certainly not mine....

.

All the best

John

##### Share on other sites

Posted · A look at adaptive layers
2 hours ago, ctbeke said:

1) Look at the code, it's very much adaptive (as in it looks at the mesh wall angles to determine layer height). in case of a sphere, this would be a continuous decrease indeed. you can prevent this by choosing a larger step size.

2) 3D printing is not milling, so I don't see how that milling technique would result in a 'perfectly smooth surface' in case of 3D printing.

3) It's in the experimental section because it's, well, experimental. We push out features as early as possible to get feedback rather than stay in our own world.

4) It's Free an Open Source Software, so feel free to contribute.

1. From VariSlice, their video and demonstration isnt showing segments of different layer heights, on my sphere, in the first picture i posted, all the last 100 layers from the top is the same layerheight, but VariSlice sphere looks like this

2. 3D printing and 3D milling both follows a toolpath, put a nozzle at the tip of that mill and invert the direction (start at bottom and go up) and you basicly have a 3D printer that prints a sphere

3 . Yes I know its a first implementation and are thankful for all the work that's  been put into Cura lately,  I don't think its quite working optimal, that's why I started this discussion

I get a tiny sense that you feel I'm criticising your or Cura wrongly, or I'm being negative which I assure you I'm not.

Currently its very difficult to get desirable results, and are merely suggesting some feedback....I can set some numbers and see its starting with the tiniest layerheights at the bottom of the sphere and 0.3mm layers towards the top...like the opposite effect....(but maybe having total configurability is a good thing)

I have gotten some better results today, but you need to sit and try hundreds of numbers and had to use step size of 0.001 for getting the smooth looking preview.

Im printing a sphere now, I'll post picture.....it looks good in preview, so i'm hoping it turn out awesome.

##### Share on other sites

Posted · A look at adaptive layers
3 hours ago, kmanstudios said:

Milling such as demonstrated is subtractive in nature while 3D printing is additive. Kinda polar opposites.

I wasn't trying to show milling, its the logic behind the toolpath generation of CAM packages, its the same as Cura does with adaptive layers  (creating a smooth surface)

As I replyed here earlyer,  put a nozzle at the tip of that mill and invert the direction (start at bottom and go up) and you basicly have a 3D printer that prints a sphere

##### Share on other sites

Posted · A look at adaptive layers
2 hours ago, JohnInOttawa said:

What I find so good about topics like this is the visualization they evoke.  Apart from the discussion on the particular way in which adaptive layers are currently implemented, there is a fresh look at the geometry of layers on difficult surfaces ( I consider a sphere to be such a case with XY geometry printers)  and a perspective that may help shape the approach to a future printing corner case.

And, nerd alert, I would love to know what software generated those mockups.  I assume a CAD package, but certainly not mine....

.

All the best

John

Yes, discussions like this are interesting, and getting Cura to do awesome gcode generation with this adaptive layers will jump us way ahead towards smarter software.

The cam software I'm using is GibbsCam, I've used it since 2005 for programming CNC lathes and mills (was my dayjob)

The macro is something I wrote back in 1997 when I got my own cnc in the garage, I had no access to cam software then...but I used my macro on an Amiga 1200 to make gcode

to mill out wooden bowls, as with 3d printing, if you use the same layerheight on a sphere, its always ugly at the top/bottom, so I had to figure out how to do smoother surfaces, so

I implemented adaptive cut depths in my macro.

Yesterday I dug out the macro and implemented the same math into a macro for GibbsCam, so I can 'see' the layers.

##### Share on other sites

Posted · A look at adaptive layers

Getting better results, at least the layerview looks good

Base layerheight is 0.3, so it looks like it varies from 0.32 to 0.16 with these settings, threshold currently 85, the higher the theshold is, the less gap you get from min-max

Setting it back to 200, gives layerheight from 0.24-0.34

Going smaller and the gap between min-max increases (setting it to 30 gives layers of 0.1-0.31)

##### Share on other sites

Posted · A look at adaptive layers

WIth the same settings as the sphere, I made a 100mm tall cylinder with a ballnose....then I got this :

which make no sense, it starts with the smallest layerheight at the bottom, and it gradually varies it up the cylinder even if the geometry is the same.

then by adjusting the base layerheight to 0.1 it looks as one would expect :

with 0.3mm layerheight on all of the cylinder part, and gradually decrease the values towards the top, which is superb (but settings make no sense)

so atleast it works   so you can forget about my ramblings above, i'm happy with results even if it takes some time to get there.

• 2
##### Share on other sites

Posted · A look at adaptive layers
2 hours ago, catohagen said:

I wasn't trying to show milling, its the logic behind the toolpath generation of CAM packages, its the same as Cura does with adaptive layers  (creating a smooth surface)

As I replyed here earlyer,  put a nozzle at the tip of that mill and invert the direction (start at bottom and go up) and you basicly have a 3D printer that prints a sphere

If'n yas says so

##### Share on other sites

Posted · A look at adaptive layers

No worries, not taking any of it personally

Btw, here's a shortcut to the CuraEngine code that's used for calculating adaptive layers: https://github.com/Ultimaker/CuraEngine/blob/master/src/settings/AdaptiveLayerHeights.cpp.

##### Share on other sites

Posted · A look at adaptive layers

Also note that the first layer height will always be the first layer height entered in the settings (needed for proper adhesion), so you might see a gradient from that layer height upwards depending on other settings.

##### Share on other sites

Posted · A look at adaptive layers

two spheres with 0.3mm layerheight, adaptive layering smoothed the one in the left rather nicely

##### Share on other sites

Posted · A look at adaptive layers

Having great results lately, and its a huge timesaver

My coffee container is very popular amongst family and friends and it's a great gift, I've printed out quite a few of these, and its always been a rather long print.

There are some curves included as details, and I like keeping its original shape and not dull these down just because its prints easier, but any higher layers than 0.2 and it starts to

string and fail on the curves.

The base container takes around 17hrs to print, with 0.15mm layers (0.6mm nozzle)

WIth adaptive layers, varying from 0.15-0.45mm its printed under 8 hours (7hrs,43min ) because most of the layers can be 0.45mm+ the threads came out perfect.

Top of the container to the left, two visible threads with 0.15mm layers and you see the transition to 0.45 after thread stops

• 3
##### Share on other sites

Posted · A look at adaptive layers
On 2/25/2018 at 6:41 PM, catohagen said:

Well if that doesn't sell me on "it's worth tweaking the settings" then nothing is.

I agree, there's something basically wrong when this is the result. It's not to disparage the fine folks working on all this, it is a sign that things both have potential and aren't done yet. :-)

• 1
##### Share on other sites

Posted · A look at adaptive layers

Great examples!

@catohagen any chance you can share the STL file of that cup holder? I'm writing a report on adaptive layers and I think it would make a great example use case!

##### Share on other sites

Posted · A look at adaptive layers
3 hours ago, ctbeke said:

Great examples!

@catohagen any chance you can share the STL file of that cup holder? I'm writing a report on adaptive layers and I think it would make a great example use case!

Not sure what holder you referring to but  i'll attach the coffee container I used (its for storing 500g of coffee beans for coffee machines)

coffe_v2.stl

##### Share on other sites

Posted · A look at adaptive layers

That's the one I meant, thanks!

##### Share on other sites

Posted · A look at adaptive layers

Printed with Colorfabb Bronzefill 0.4SS nozzle, layers between 0.10 and 0.26mm (you can actually see the transitions where layerheight creeps towards 0.10)

Not too happy with the top finish, get gaps between walls and top layers...might be too much retraction, but the layering are awesome....

• 1
##### Share on other sites

Posted · A look at adaptive layers

Cool, might need some setting tweaking indeed. I also want to improve the gradual change in the future, starting a bit earlier so it also covers the lower part of a slope. It's a bit tricky because it would need to 'look ahead', but we'll see.

##### Share on other sites

• 2 months later...
Posted · A look at adaptive layers

I have used adaptive layers to reduce print times and improve quality.

My latest print was a high part, 180mm in PETG, 0.25mm steps.

As you can see the side walls are pretty crappy until it reaches the angled face.

I used the default settings for adaptive layers.

Just a warning if you have tall parts.

Lez0

##### Share on other sites

Posted · A look at adaptive layers

I'd like the see the same print with fixed layers the size of your course steps.

It's a little unfair to blame the adaptive layers for just giving  you the bigger layers you asked for. If it's specific to adaptive layers, however, it would be good for us all to know!

• 1
##### Share on other sites

Posted · A look at adaptive layers

I did a small test piece which was the centre section of this part about 2 inches high.

I used exactly the same settings as before only I turned off adaptive layers and it was perfect.

I am just saying that if you have a tall part and you use the default setting you could get a bad print like this.

I think Cura is a great software and use it all the time for printing, and I understand that parts of it are experimental.

I am trying to be helpful.

Lez0

## Create an account

Register a new account

• ### Our picks

• In this stable release, Cura 5.3 achieves yet another huge leap forward in 3D printing thanks to material interlocking! As well as introducing an expanded recommended print settings menu and lots of print quality improvements. Not to mention, a whole bunch of new printer profiles for non-UltiMaker printers!
• 56 replies
• The UltiMaker S7 is built on the success of the UltiMaker S5 and its design decisions were heavily based on feedback from customers.

So what’s new?
The obvious change is the S7’s height. It now includes an integrated Air Manager. This filters the exhaust air of every print and also improves build temperature stability. To further enclose the build chamber the S7 only has one magnetically latched door.

The build stack has also been completely redesigned. A PEI-coated flexible steel build plate makes a big difference to productivity. Not only do you not need tools to pop a printed part off. But we also don’t recommend using or adhesion structures for UltiMaker materials (except PC, because...it’s PC). Along with that, 4 pins and 25 magnets make it easy to replace the flex plate perfectly – even with one hand.

The re-engineered print head has an inductive sensor which reduces noise when probing the build plate. This effectively makes it much harder to not achieve a perfect first layer, improving overall print success. We also reversed the front fan direction (fewer plastic hairs, less maintenance), made the print core door magnets stronger, and add a sensor that helps avoid flooding.

The UltiMaker S7 also includes quality of life improvements:
Reliable bed tilt compensation (no more thumbscrews) 2.4 and 5 GHz Wi-Fi A 1080p camera (mounted higher for a better view) Compatibility with 280+ Marketplace materials Compatibility with S5 project files (no reslicing needed) And a whole lot more
Curious to see the S7 in action?
We’re hosting a free tech demo on February 7.
It will be live and you can ask any questions to our CTO, Miguel Calvo.
Register here for the Webinar
• 18 replies
• Are you a fan of tree support, but dislike the removal process and the amount of filament it uses? Then we would like to invite you to try this special release of UltiMaker Cura. Brought to you by our special community contributor @thomasrahm

We generated a special version of Cura 5.2 called 5.3.0 Alpha + Xmas. The only changes we introduced compared to UltiMaker Cura 5.2.1 are those which are needed for the new supports. So keep in mind, this is not a sneak peek for Cura 5.3 (there are some really cool new features coming up) but a spotlight release highlighting this new version of tree supports.
• 29 replies
×

• #### Activity

• UltiMaker.com
×
• Create New...