Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brick Layers / Staggered Perimeter implementation #8181

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

vipulrajan
Copy link
Contributor

@vipulrajan vipulrajan commented Jan 25, 2025

Brick layers have been a hot topic lately. I prefer calling it staggered perimeter. Printing alternate perimeters at an offset can create significantly stronger prints.
image

Screenshots/Recordings/Graphs

image

VID_20250125_123307.mp4

Tests

Currently testing with prints. Issues have been found. It's in alpha stage

@igiannakas
Copy link
Contributor

igiannakas commented Jan 25, 2025

Fantastic and what a legend! Excellent to see this being implemented natively, thank you!

@SoftFever
Copy link
Owner

This is an exciting stuff.
Looking forward 👍

@philyeahz
Copy link

Damn you beat me to it 😄

Additionally to what's already here, I implemented wall ordering which looks like this:

Before (Inner/Outer):
bambu-studio_2025-01-26_02-18-51_

After (Even/Odd):
bambu-studio_2025-01-26_02-08-19_

I don't know if this is actually an useful addition or counterproductive yet, but regardless, I thought it would be nice to share.

@theboee
Copy link

theboee commented Jan 26, 2025

Glad to finally see some progress on this! Thanks to everyone for all the time, discussion and research put into it.

#7282 #4133

@vipulrajan
Copy link
Contributor Author

@philyeahz
It's a collaborative effort. You add make a pull request for these orderings in my fork. Or you can let this be merged and then raise a pull request for those.
But I know how it feels to have someone beat you to the punch. I had been working on it for weeks. Orca code is very hard to sift through.

@philyeahz
Copy link

@vipulrajan
No hard feelings, I would love to collaborate on this.

I created an pull request on your fork for adding the wall sequencing independent of the staggered perimeters and also implemented the staggering for classic wall generator.

Next I would like to look at angled walls...
image
As you can see the walls do not align perfectly with the surface below. I got some ideas how to implement something to shift the loops according to the previous layer and insert something like a gap infill for classic wall generator. With arachne we already have variable width extrusion, so this should be easier to implement on that end with a special beading strategy.

Maybe this is an overkill optimization, but I think this could improve extrusion quality.
Will let you know if I make progress on that front!

@igiannakas
Copy link
Contributor

That would be necessary in order to avoid over extrusion on the top slanted surfaces. I think you could look at how the one wall top surface detects polygon edges based on the layer underneath and insert a half height (ie half flow) line to support the slant, basically the same as the first layer.

Just an idea, haven’t opened the code up in any detail but it may give a pointer :)

@vipulrajan
Copy link
Contributor Author

@philyeahz
The slope issue is certainly something that will need more thought. For now, I'm putting the pull request up for review. I will keep brainstorming about how slopes can be dealt with and I will let you know if I think of something.

@vipulrajan vipulrajan marked this pull request as ready for review January 26, 2025 17:26
@Anthony-Bec
Copy link

sorry for my ignorance but when will this be implemented in orca slicer?

@vipulrajan
Copy link
Contributor Author

@Anthony-Bec
A version of it is already available to test. That is how it works. It will be tested and then eventually merge into the main.
Go here https://github.com/SoftFever/OrcaSlicer/actions/runs/12976821206?pr=8181
and scroll to the bottom to find the download links

@Anthony-Bec
Copy link

Anthony-Bec commented Jan 26, 2025

@vipulrajan Thanks for the fast reply! I am new to github.

@theboee
Copy link

theboee commented Jan 27, 2025

One thing I'd recommend adding would be a way to adjust offset layer flow extrusion. The script by TengerTechnologies allows users to adjust the extrusion multiplier of the offset layers to help fill gaps. It will be hard to fix under/over extrusion with staggered perimeters with the traditional flow ratio.

walls for internal holes are not staggered
@TengerTechnologies
Copy link

TengerTechnologies commented Jan 27, 2025

One thing I'd recommend adding would be a way to adjust offset layer flow extrusion. The script by TengerTechnologies allows users to adjust the extrusion multiplier of the offset layers to help fill gaps. It will be hard to fix under/over extrusion with staggered perimeters with the traditional flow ratio.

Got a comment from @koenvanduffel2084 on my video with some testresults. The extrusion multiplier seams to increase strenght a bit if not overdone.

As promised some measurement data:
Samples are made with black ABS ex TM3filament in the netherlands and printed on an enclosed RatRig Vcore IDEX 500 at a chamber temperature of 70 °C and nozzle temperature of 260 °C. And sliced in OrcaSlicer.

                                             horizontal            vertical
reference:                                   47.9 MPa              17.7 MPa
Brick layers extrusion multiplier 1.00       47.5 MPa              19.7 MPa (11% increase)
Brick layers extrusion multiplier 1.05       51.2 MPa              20.9 MPa (18 % increase)
Brick layers extrusion multiplier 1.10       48.0 MPa              16.3 MPa (8% decrease) 

Horizontal means the stress in in layerline direction, vertical is perpendicular to the layer lines.

Remarks:

  • both the extrusion multiplier 1.05 and 1.10 look overextruded. Fr the 1.05 just a tiny bit, my guess is that 1.02~1.03 is optimal. I will print an additional set of samples at 1.025% to check this.
  • I had scarf seams on for these prints (outer and inner layers). wihtout scarf seams the reference value for the vertical samples is 24.1 Mpa.
    In my tests with regular slicing to my surprise scarf seams decrease the layer adhesion. I expected that not having the seam in 1 point would avoid a weak spot. When watching the print carefully I saw that while making the scarf quite bit of shear force was put on the samples which could well cause them to be slightly damaged already before the stress test itself. The fact that they all break at the bottom narrow point supports this. Hence for regular size prints scarf seams might still be stronger (or the same) as regular seams.

From the data it is clear that brick layers improve the layer adhesion and that a slightly increased extrusion multiplier is helpfull. Overdo it and the layer adhesion is worse (this probably also happens with regular slicing though I have not tested this). The flow rate for my prints is optimized using the OrcaSlicer test where I err to the higher side.

For the horizontal samples there seems to be an improvement as well. This is however, wihtin error, the additional amount of plastic extruded.

@igiannakas
Copy link
Contributor

In case you haven’t seen it already Igor dropped an excellent video testing this technique with some very interesting observations from his strength tests

https://youtu.be/YuLNVoUtaes?si=7MJAr1G-iOIwCR9k

@theboee
Copy link

theboee commented Feb 7, 2025

In case you haven’t seen it already Igor dropped an excellent video testing this technique with some very interesting observations from his strength tests

https://youtu.be/YuLNVoUtaes?si=7MJAr1G-iOIwCR9k

This proves that an offset flow multiplier will be necessary to get the gains in layer adhesion we're after.

@dewi-ny-je
Copy link
Contributor

dewi-ny-je commented Feb 7, 2025

In case you haven’t seen it already Igor dropped an excellent video testing this technique with some very interesting observations from his strength tests
https://youtu.be/YuLNVoUtaes?si=7MJAr1G-iOIwCR9k

This proves that an offset flow multiplier will be necessary to get the gains in layer adhesion we're after.

Only if the original flow is not optimised, which Igor never optimises, since he uses standard profiles. In fact that's a big downside of his tests, he relies on (basically) generic settings.

If you do flow calibration and you pick the setting resulting in the smoothest surface, the flow multiplier needed will be close to zero, because you can clearly understand that the gaps between perimeters are not 10% large.

@theboee
Copy link

theboee commented Feb 7, 2025

In case you haven’t seen it already Igor dropped an excellent video testing this technique with some very interesting observations from his strength tests
https://youtu.be/YuLNVoUtaes?si=7MJAr1G-iOIwCR9k

This proves that an offset flow multiplier will be necessary to get the gains in layer adhesion we're after.

Only if the original flow is not optimised, which Igor never optimises, since he uses standard profiles. In fact that's a big downside of his tests, he relies on (basically) generic settings.

If you do flow calibration and you pick the setting resulting in the smoothest surface, the flow multiplier needed will be close to zero, because you can clearly understand that the gaps between perimeters are not 10% large.

Even if flow isn't optimized, the tests he did with brick layers at 1.0x flow show that the process inherently causes some under extrusion resulting in less layer adhesion.

The addition of an offset flow multiplier is going to be needed if we want to achieve maximum layer adhesion. Until more testing is done I doubt that the issue of under extrusion will be fixable with the standard flow ratio setting.

@iSteeb
Copy link

iSteeb commented Feb 7, 2025

Only if the original flow is not optimised, which Igor never optimises, since he uses standard profiles. In fact that's a big downside of his tests, he relies on (basically) generic settings.

If you do flow calibration and you pick the setting resulting in the smoothest surface, the flow multiplier needed will be close to zero, because you can clearly understand that the gaps between perimeters are not 10% large.

I'm only casually following this topic so I may have missed other data along the way... but this opinion seems to discount two major things:

  1. The fact that flow was increased up to 1.7x on one test with linear improvements (not 10% as you say, although I may have misunderstood your comment).
  2. There's at least 2 places I've seen/read that brick layers result in something like 7-15% strength gains. A far cry from the near 50% improvement in the final test.

Sure that 50% might be 'padded' due to what you're saying, but it seems to me that the difference is too great to put down to uncalibrated flow rate?

@dewi-ny-je
Copy link
Contributor

@iSteeb

  1. The fact that flow was increased up to 1.7x on one test with linear improvements (not 10% as you say, although I may have misunderstood your comment).
  2. There's at least 2 places I've seen/read that brick layers result in something like 7-15% strength gains. A far cry from the near 50% improvement in the final test.

Sure that 50% might be 'padded' due to what you're saying, but it seems to me that the difference is too great to put down to uncalibrated flow rate?

Indeed any print with a flow increased by just 10% would look terrible, while his prints looked incredibly fine.

The meaning of "multiplier" is then clearly different from what we think of it.

Probably the script he used has some issues or redefines stuff in a way we don't expect.

In other words: besides his strength testing, which is good to know, absolutely NO conclusion can be drawn about the requirements of flow multiplier.

@igiannakas
Copy link
Contributor

igiannakas commented Feb 7, 2025

The multiplier in the script increases directly the amount of filament extruded by multiplying the gcode e value with a number (the multiplier). It does not change line spacing to account for the wider/fatter lines so there does appear to be some “filling in the gaps” property here.

new_e_value = e_value * extrusion_multiplier

the code is available here: https://github.com/TengerTechnologies/Bricklayers/blob/27cd61b19bbc92c093d45598c853b113f08a6dcd/bricklayers.py#L114

In my view it’s a legitimate thing to explore.

Even if Igor used suboptimal flow I’d expect the strength gain to cap out where the extrusion multiplier hit the ideal spot, but it didn’t.

Seems like higher extrusion multiplier can force more material in the gap increasing layer adhesion just by virtue of putting higher pressure on the filament to flow around the gap created by the layer below. Kind of like a “mini injection moulding” process where plastic is pressurised to fill a mould. With this technique we are not just laying filament on top of each other any more, rather we are forcing it down to fill a gap between two perimeters.

Also something to explore is whether this extra flow only makes sense to apply when the sunken brick layer is between two neighbouring perimeters as this would contain the flow between them. Extra flow without perimeters left and right would merely cause the filament to flow outwards, or inwards towards the sparse infill.

Ie with 4 perimeters, 0 is standard, 1 is brick-extra flow, 2 is standard, 3 is brick no extra flow.

@igiannakas
Copy link
Contributor

igiannakas commented Feb 7, 2025

Also something to consider is whether it would be ideal to constrain the allowable number of perimeters to an even number so you never end up with a brick perimeter facing the infill.

The hypothesis is that a offset in Z inner most perimeter doesn’t contribute to part strength as the staggering effect would overflow into the sparse infill instead of between a perimeter sandwich.

Also consider that topologically, islands can have any number of perimeters up to the max allowable by the users. So when there are less than even perimeters in an island, whether brick sequencing needs to be constrained to the first set of even perimeters, with at least 3 needed to run this.

Fortunately we already have algorithms in place to identify this - they are used to run the IOI wall ordering. We can identify how many neighbouring perimeters an island has by running the depth first, contour priority, proximity search used in the IOI wall ordering :)

@theboee
Copy link

theboee commented Feb 8, 2025

Only if the original flow is not optimised, which Igor never optimises, since he uses standard profiles. In fact that's a big downside of his tests, he relies on (basically) generic settings.
If you do flow calibration and you pick the setting resulting in the smoothest surface, the flow multiplier needed will be close to zero, because you can clearly understand that the gaps between perimeters are not 10% large.

I'm only casually following this topic so I may have missed other data along the way... but this opinion seems to discount two major things:

  1. The fact that flow was increased up to 1.7x on one test with linear improvements (not 10% as you say, although I may have misunderstood your comment).
  2. There's at least 2 places I've seen/read that brick layers result in something like 7-15% strength gains. A far cry from the near 50% improvement in the final test.

Sure that 50% might be 'padded' due to what you're saying, but it seems to me that the difference is too great to put down to uncalibrated flow rate?

I believe the results you quote on (2) come from CNCKitchen's initial test. He tested Brick Layers by using a modifiable slicer. He had a lot of variance in his tests which I suspect were likely caused due to under extrusion. He is supposedly testing the TenTech script so we should get another data set when that drops.

@theboee
Copy link

theboee commented Feb 8, 2025

Also something to consider is whether it would be ideal to constrain the allowable number of perimeters to an even number so you never end up with a brick perimeter facing the infill.

The hypothesis is that a offset in Z inner most perimeter doesn’t contribute to part strength as the staggering effect would overflow into the sparse infill instead of between a perimeter sandwich.

Also consider that topologically, islands can have any number of perimeters up to the max allowable by the users. So when there are less than even perimeters in an island, whether brick sequencing needs to be constrained to the first set of even perimeters, with at least 3 needed to run this.

Fortunately we already have algorithms in place to identify this - they are used to run the IOI wall ordering. We can identify how many neighbouring perimeters an island has by running the depth first, contour priority, proximity search used in the IOI wall ordering :)

Limiting wall amount, beyond 1 wall, for the option is probably not a great idea. A better idea, that I propose, would be to have a warning UI element pop up upon activating the brick layer option.

(This setting works best with wall amounts of 3 or higher. We recommend sticking to odd numbers to prevent an offset occuring towards the infill.)

For Floating sections of perimeter, I am unsure as to whether having those be brick layers also would help improve overall part strength. Although I don't think it would hurt it.

@igiannakas
Copy link
Contributor

Sorry what I mean is that each island can have up to N perimeters. Not always guaranteed N. The generated number of perimeters is always variable. The slicer will attempt to generate N but it may not have space to, in which case it generates less.

if during this less than 3 perimeters are generated, set a constraint for min 3 and always even number of perimeters to generate a brick layer.

2 perimeters with a brick layer would yield no benefit (or might even hurt performance) as the brick layer has nothing to anchor to if that makes sense?

@theboee
Copy link

theboee commented Feb 9, 2025

@mubeenkhan94 forked @TengerTechnologies pthyon post script and added a lot of useful stuff. New things in his fork include -

  • Adaptive Precision Engine - Auto-detects optimal processing mode based on model characteristics
  • Structural Layer Shifting - Full-layer or per-perimeter Z-axis alternation patterns
  • Smart Feature Preservation - Maintains critical details while optimizing print geometry
  • Industrial-Grade Parameters - Configurable for professional-grade printing requirements
  • Advanced Diagnostics - Detailed path analysis and memory optimization

May be useful to reference what he has to benefit the in-slicer implementation @vipulrajan.

@jesstelford
Copy link

@theboee, it looks like @mubeenkhan94's fork has been merged back into @TengerTechnologies's version (at least, it's not showing any changes in the GitHub UI).

@theboee
Copy link

theboee commented Feb 10, 2025

@theboee, it looks like @mubeenkhan94's fork has been merged back into @TengerTechnologies's version (at least, it's not showing any changes in the GitHub UI).

This is the repository I was referring to -

https://github.com/mubeenkhan94/Bricklayers/tree/more_sophisticated_geometry_processing

@jesstelford
Copy link

Used a CI build to try Staggered layers, and it worked beautifully!

No issues or errors, and part strength feels stronger across layer lines for the PETG I printed with (totally subjective; I just snapped a piece by hand) 👌

Thank you all for this fantastic feature!

@bistory
Copy link
Contributor

bistory commented Feb 14, 2025

Hi, I made my tests too, for a part that needed additional strength in layer lines direction.
It works great, the part that used to break in a blink of an eye resists with bricklayers.

However, I observed a degradation in overhangs quality. The part is a small dome for a ball joint mechanism.

20250213_084759

I printed it with supports but the dome didn't print well.

I did a simple test : print the same part with the same filament (PETG), same settings (3 walls) and at the same time :

  • One without bricklayers
  • One with bricklayers with the recommended parameters (when ticking the box)

Here is the result (left is bricklayers enabled, right is default parameters) :

20250214_173137
20250214_173154

I didn't make more reseaches at the moment, but do you have some ideas ?

@Noisyfox
Copy link
Collaborator

Hi, I made my tests too, for a part that needed additional strength in layer lines direction. It works great, the part that used to break in a blink of an eye resists with bricklayers.

However, I observed a degradation in overhangs quality. The part is a small dome for a ball joint mechanism.

20250213_084759

I printed it with supports but the dome didn't print well.

I did a simple test : print the same part with the same filament (PETG), same settings (3 walls) and at the same time :

  • One without bricklayers
  • One with bricklayers with the recommended parameters (when ticking the box)

Here is the result (left is bricklayers enabled, right is default parameters) :

20250214_173137 20250214_173154

I didn't make more reseaches at the moment, but do you have some ideas ?

What wall order were you using? Inner/outer?

@bistory
Copy link
Contributor

bistory commented Feb 14, 2025

Hi, I made my tests too, for a part that needed additional strength in layer lines direction. It works great, the part that used to break in a blink of an eye resists with bricklayers.
However, I observed a degradation in overhangs quality. The part is a small dome for a ball joint mechanism.
20250213_084759
I printed it with supports but the dome didn't print well.
I did a simple test : print the same part with the same filament (PETG), same settings (3 walls) and at the same time :

  • One without bricklayers
  • One with bricklayers with the recommended parameters (when ticking the box)

Here is the result (left is bricklayers enabled, right is default parameters) :
20250214_173137 20250214_173154
I didn't make more reseaches at the moment, but do you have some ideas ?

What wall order were you using? Inner/outer?

Yes :-)
Default parameters for Bambulab A1 but with 3 perimeters 😊

@Noisyfox
Copy link
Collaborator

Hi, I made my tests too, for a part that needed additional strength in layer lines direction. It works great, the part that used to break in a blink of an eye resists with bricklayers.
However, I observed a degradation in overhangs quality. The part is a small dome for a ball joint mechanism.
20250213_084759
I printed it with supports but the dome didn't print well.
I did a simple test : print the same part with the same filament (PETG), same settings (3 walls) and at the same time :

  • One without bricklayers
  • One with bricklayers with the recommended parameters (when ticking the box)

Here is the result (left is bricklayers enabled, right is default parameters) :
20250214_173137 20250214_173154
I didn't make more reseaches at the moment, but do you have some ideas ?

What wall order were you using? Inner/outer?

Yes :-) Default parameters for Bambulab A1 but with 3 perimeters 😊

I think that explains the overhang degradation since it forces outer/inner when brick wall is enabled.

@theboee
Copy link

theboee commented Feb 16, 2025

Did some test prints with this version and noticed that the top walls aren't being adjusted to keep it flat. The outside wall is considered the last layer by the slicer and is at the appropriate height. The internal walls are lower than the outside.

Last Layer as displayed by the slicer.
7111

Previous Layer showing no adjustment.
7112

Layer below what should be the last layer.
7113

To fix this issue, an adjustment layer is needed.
7114

Print is a simple cube, 5 walls, stagger perimeters on, 0 top layers, 0 infill.

@theboee
Copy link

theboee commented Feb 16, 2025

The multiplier in the script increases directly the amount of filament extruded by multiplying the gcode e value with a number (the multiplier). It does not change line spacing to account for the wider/fatter lines so there does appear to be some “filling in the gaps” property here.

new_e_value = e_value * extrusion_multiplier

the code is available here: https://github.com/TengerTechnologies/Bricklayers/blob/27cd61b19bbc92c093d45598c853b113f08a6dcd/bricklayers.py#L114

In my view it’s a legitimate thing to explore.

Even if Igor used suboptimal flow I’d expect the strength gain to cap out where the extrusion multiplier hit the ideal spot, but it didn’t.

Seems like higher extrusion multiplier can force more material in the gap increasing layer adhesion just by virtue of putting higher pressure on the filament to flow around the gap created by the layer below. Kind of like a “mini injection moulding” process where plastic is pressurised to fill a mould. With this technique we are not just laying filament on top of each other any more, rather we are forcing it down to fill a gap between two perimeters.

Also something to explore is whether this extra flow only makes sense to apply when the sunken brick layer is between two neighbouring perimeters as this would contain the flow between them. Extra flow without perimeters left and right would merely cause the filament to flow outwards, or inwards towards the sparse infill.

Ie with 4 perimeters, 0 is standard, 1 is brick-extra flow, 2 is standard, 3 is brick no extra flow.

I've been testing just upping overall flow rate to fix underextrsuion caused by the new setting and while it is possible to do, it also causes the rest of the part to be out of spec. The part is most affected in the XY plane but does see some issues with Z the higher flow you go. In order to achieve tight tolerances while also getting the most adhesion, a separate flow multiplier that only applies to offset perimeters is a must. Plus I would say IOI wall order should be the default.

I am using a K1 Max, and perfect flow rate for my machine is usually in the range of 1.015-1.03 depending on material, but at this setting the parts under extrude allowing you to view gaps between layers when separated. Around 1.06 is was where I saw great layer stacking but parts were swollen and ugly. Especially on top layers.

@@ -1291,6 +1291,29 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
extrusion_paths_append(paths, *extrusion, role, is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow);
}

auto check_and_stagger_path = [perimeter_generator](ExtrusionPath& cur_path) {
bool was_staggered = false;
if (perimeter_generator.layer_id == 1 && perimeter_generator.number_of_layers >= 4) // i.e. layer after the first one
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to make more sense to just check the number_of_layers at the beginning.

if(perimeter_generator.number_of_layers < 4)
    return false;

@@ -1291,6 +1291,29 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
extrusion_paths_append(paths, *extrusion, role, is_external ? perimeter_generator.ext_perimeter_flow : perimeter_generator.perimeter_flow);
}

auto check_and_stagger_path = [perimeter_generator](ExtrusionPath& cur_path) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the codes below, would it be better call it "update_stagger_path" for clarity?

@@ -1304,6 +1327,14 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
}
assert(extrusion_loop.paths.front().first_point() == extrusion_loop.paths.back().last_point());

//This is for staggered layers.
//All odd perimeters are staggerd up by half the layer height
if (extrusion->inset_idx % 2 == 1 && perimeter_generator.config->staggered_perimeters) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to do perimeter_generator.config->staggered_perimeters check first, the it won't waste computation on odd check when the option is off.

@@ -1325,6 +1356,15 @@ static ExtrusionEntityCollection traverse_extrusions(const PerimeterGenerator& p
multi_path.paths.emplace_back(std::move(*it_path));
}

//This is for staggered layers.
//All odd perimeters are staggerd up by half the layer height
if (extrusion->inset_idx % 2 == 1 && perimeter_generator.config->staggered_perimeters) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.
Change to if (perimeter_generator.config->staggered_perimeters && extrusion->inset_idx % 2 == 1) for better performance

@@ -3239,7 +3286,7 @@ void PerimeterGenerator::process_arachne()
// printf("Layer ID %d, Outer index %d, inner index %d, second inner index %d, maximum internal perimeter %d \n",layer_id,outer,first_internal,second_internal, max_internal);
if (outer > -1 && first_internal > -1 && second_internal > -1) { // found all three perimeters to re-order? If not the perimeters will be processed outside in.
std::vector<PerimeterGeneratorArachneExtrusion> inner_outer_extrusions; // temporary array to hold extrusions for reordering
inner_outer_extrusions.resize(max_internal - position + 1); // reserve array containing the number of perimeters before a new island. Variables are array indexes hence need to add +1 to convert to position allocations
inner_outer_extrusions.reserve(max_internal - position + 1); // reserve array containing the number of perimeters before a new island. Variables are array indexes hence need to add +1 to convert to position allocations
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason why this was changed to reserve()?
The original resize() call is correct, as per my understanding, since we use the expression inner_outer_extrusions[max_internal - arr_j] = xxxbelow.

ExtrusionPath(double overhang_degree, int curve_degree, ExtrusionRole role, double mm3_per_mm, float width, float height) : overhang_degree(overhang_degree), curve_degree(curve_degree), mm3_per_mm(mm3_per_mm), width(width), height(height), m_role(role) {}
//These properties are just for staggered perimeter production.
float z_offset; //z_offset to be multiplied to the layer height, default is 0
float extrusion_multiplier; //increase in extrusion, default is 1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new member variable is not necessary.
We can directly adjust mm3_per_mm in check_and_stagger_path function.

ExtrusionPath(ExtrusionRole role, double mm3_per_mm, float width, float height, bool no_extrusion = false) : mm3_per_mm(mm3_per_mm), width(width), height(height), m_role(role), m_no_extrusion(no_extrusion) {}
ExtrusionPath(double overhang_degree, int curve_degree, ExtrusionRole role, double mm3_per_mm, float width, float height) : overhang_degree(overhang_degree), curve_degree(curve_degree), mm3_per_mm(mm3_per_mm), width(width), height(height), m_role(role) {}
//These properties are just for staggered perimeter production.
float z_offset; //z_offset to be multiplied to the layer height, default is 0
Copy link
Owner

@SoftFever SoftFever Feb 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind to rename it to something like staggered_perimeter_z_offset to avoid poteintial confusion?

@SoftFever
Copy link
Owner

Did some test prints with this version and noticed that the top walls aren't being adjusted to keep it flat. The outside wall is considered the last layer by the slicer and is at the appropriate height. The internal walls are lower than the outside.

Last Layer as displayed by the slicer. 7111

Previous Layer showing no adjustment. 7112

Layer below what should be the last layer. 7113

To fix this issue, an adjustment layer is needed. 7114

Print is a simple cube, 5 walls, stagger perimeters on, 0 top layers, 0 infill.

Agreed. We need some special handling for top layers.

@SoftFever
Copy link
Owner

I have suggestion regarding the name, shall we call it Brick layer since this name is widely used already.
My another concern is that we already have a parameter called "Staggered inner seams", "Staggered wall" might confuse people

@vipulrajan
Copy link
Contributor Author

@SoftFever I will make those changes. I have few a other things to look at. In the coming week I will make all these changes.

@theboee
Copy link

theboee commented Feb 17, 2025

From what I can tell, the setting reverts back to normal for layers with large or steep overhangs. We should also have a correction layer to make those change areas flat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.