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

Enhancement: Additional controls over bridges #8263

Merged

Conversation

igiannakas
Copy link
Contributor

@igiannakas igiannakas commented Jan 31, 2025

Description

Introducing additional controls over bridges.

This is the first in a potential series of PR's aiming to improve how bridging is handled by Orca. None of the upstream sources (prusa slicer / bambu slicer) have implemented logic to detect polygons directly above bridges, either internal or external, so we are going in new territory with this code and coming closer to the granularity of control over bridging that Cura has available today.

In this PR I am focusing on setting the foundation by detecting and carving out solid surfaces that are extruded over bridges and implementing some rudimentary improvements to the bridging logic (two bridge layers) that should already yield printing benefit.

Hopefully once this PR is merged, the community can take it to the next logical step which is to create dedicated surface types for layers over internal/external bridges with their own dedicated settings. This is a lot of work, hence splitting this in "chunks".

The first "chunk" is done - this PR now successfully allows Orca to detect and segment solid infill areas over internal and external bridges and tag them accordingly. The settings below have been implemented to yield some immediate benefit (as the bridges are now multi-layer, hence by default more reliable), but as said above, much more can be done now that we have those polygons tagged with their own surface types.

The following features have been developed

  1. Internal bridge density: can help improve internal bridge reliability by improving cooling efficacy for the bridge layer as the lines can be spaced a bit further apart. It can also help reduce over extrusion if thick internal bridges are selected as the extra spacing allows for the material to spread down/side more easily.
  2. Second bridge layer over internal bridge: significantly improves robustness of the internal solid infill, especially for high speed high acceleration printers, as it allows for multiple layers of material to be laid down slowly (using the internal bridge settings) before speeding up for internal solid infill. As a bonus it slightly reduces benchy hull line as material contraction is spread over more layers, more gradually.
  3. Second bridge layer over external bridge: significantly improves robustness of the external bridge before transitioning to the solid infill.

Fixes #6958
Fixes #3847
Fixes #3822

Screenshots/Recordings/Graphs

Internal Bridge Density
shown at 50% for display purposes. More realistic values are around the 80-90%
image

Second bridge layer over internal bridge:
Shown with bridge density at 50% for display purposes.
image

Second bridge layer over external bridge:
image
image

Small external bridges are filtered out as they do not benefit from the feature.
Bridges that are shorter and/or narrower than the total number of extruded walls in the region are omitted from the dual external bridge calculation.

image
image

Print results

Left - Old / Right - Two bridge layers enabled

Bridges are significantly improved, with no separation of the bridge layer from the perimeters caused by the faster infill
IMG_5467

Tests

Tested with simple and complex multi-layer/text cut out top surface models. No issues identified. Settings are on a per object basis.

Please note that the settings labels are slightly different from the final commit

Internal bridging tests
image
image
image

image
image
image

External bridging tests
image
image
image

@igiannakas igiannakas changed the title Additional control over bridges Enhancement: Additional controls over bridges Jan 31, 2025
@CCS86
Copy link

CCS86 commented Feb 1, 2025

I love it!

Have you considered adding a flow multiplier for the 2nd bridge layer? Printing the first bridge layer at less than 100% density can help avoid interference between lines. Then an above 1 multiplier on the next layer flow could help to fill in the gaps and recover more quickly.

Another thought I had for bridging in general, is to first print every other bridge line (let's call it odd numbers), then come back and fill in the remaining even lines. The thought there is to allow 100% density, without interference between lines as they cool and tighten up, then they potentially help scaffold the second pass of bridging between gaps.

@igiannakas
Copy link
Contributor Author

igiannakas commented Feb 1, 2025

For sure!! There are plenty of things that can be done with it, print the second bridge layer faster is also one of those :)

For now I’ve been focusing on generating the surfaces themselves, it as that part wasn’t simple at all (polygon calculations etc).

Hopefully either myself, time allowing, or the community can take the polygon calculations and the new logic and create new surface types that have their own dedicated attributes (speed, density, infill pattern type, flow etc).

@igiannakas igiannakas marked this pull request as draft February 1, 2025 09:58
@igiannakas igiannakas marked this pull request as ready for review February 1, 2025 12:28
@igiannakas
Copy link
Contributor Author

igiannakas commented Feb 1, 2025

OK so the PR is now ready for review. @SoftFever @Noisyfox for your review :)

Fully appreciate that there is a TON more that can be done with the new surface types created here (that differentiate the second bridge layer over internal and external bridges). Ideas include specific settings like the below:

  • speed,
  • acceleration,
  • flow,
  • fan speeds
  • density
  • patterns
  • etc etc...

However this is a pretty big undertaking, so I would really appreciate if the code could be included in orca, even if this is not 1000% feature complete, so the rest of the community can also step in and take them further, building on the work to identify, segment and create those new surface types :)

@Noisyfox
Copy link
Collaborator

Noisyfox commented Feb 1, 2025

This is a huge step forward and something that lots of people are desperting. Thanks for your awesome work!

@igiannakas
Copy link
Contributor Author

igiannakas commented Feb 1, 2025

This is a huge step forward and something that lots of people are desperting. Thanks for your awesome work!

Thank you, hugely appreciated :D I've run out of steam to do more with it, but hope that we can use the new surface types to do more cool stuff with them in the future : )

Trying to figure out the polygon math, where in the code to do them and actually coding them took the best out of me haha!

@igiannakas
Copy link
Contributor Author

igiannakas commented Feb 1, 2025

And some print results :)

Left - Old / Right - Two bridge layers enabled

Bridges are significantly improved, with no separation of the bridge layer from the perimeters caused by the faster infill, so even this simple approach works wonders already :D
IMG_5467

@sleewok
Copy link

sleewok commented Feb 1, 2025

Thank you! Is there any way I can buy you a cup of coffee?

@Noisyfox
Copy link
Collaborator

Noisyfox commented Feb 1, 2025

And some print results :)

Left - Old / Right - Two bridge layers enabled

Bridges are significantly improved, with no separation of the bridge layer from the perimeters caused by the faster infill, so even this simple approach works wonders already :D IMG_5467

That is impressive!

@sheariley
Copy link

Yay! Looking forward to this getting released!

@igiannakas
Copy link
Contributor Author

igiannakas commented Feb 1, 2025

Thank you! Is there any way I can buy you a cup of coffee?

haha I do love a coffee! And had way too many for this one :P

In all seriousness though if you do feel like donating, and I know everyone would appreciate that highly no matter how small the amount, the official donation route is the way to go https://github.com/sponsors/SoftFever

@igiannakas igiannakas mentioned this pull request Feb 1, 2025
1 task
@dewi-ny-je
Copy link
Contributor

What is that Cura has? I don't remember such settings

@igiannakas
Copy link
Contributor Author

What is that Cura has? I don't remember such settings

It allows you to set multi-layer bridges like so:
image

@sleewok
Copy link

sleewok commented Feb 4, 2025

Is there anything we can do to help get this pushed to mainline?

@igiannakas
Copy link
Contributor Author

Some testing would definitely help. Mostly focusing on whether the bridge areas are identified correctly. I've done pretty extensive testing already on it but it always helps to double confirm.

Finally any print quality improvement testing always helps :)

@sleewok
Copy link

sleewok commented Feb 4, 2025

@igiannakas When I enable "two external bridge layers" It is creating bridges that do not exist when I have that option disabled. I have fuzzy skin enabled, but disabling it does not have any impact on the result.

I can change the value of the inner and outer wall width and it will get the extra bridge to disappear. In my test setting it to 0.4 outer and 0.42 inner triggers the odd bridge. Adjusting the internal solid infill width also has an impact.

Disabled:
image

Enabled:
image

Here is a closeup of one area it happens (in order of layers 27 to 29 in my slice):
image
image
image

@igiannakas
Copy link
Contributor Author

igiannakas commented Feb 11, 2025

OK some more changes done. Applied shrink expand operations, filtered out secondary internal bridge based on min width/height, introduced use of unions to ensure no overlapping polygons generate odd geometry later.

Hopefully this fixes it :S

If not I honestly dont know what else to look at haha!

edit: turns out I think I do …

@igiannakas
Copy link
Contributor Author

igiannakas commented Feb 11, 2025

OK not fully fixed yet. I'm guessing there is a race condition going on there. Will refactor the second internal bridge over sparse infill to move it to its own block after the existing infill detection and generation block is completed.

@igiannakas
Copy link
Contributor Author

igiannakas commented Feb 11, 2025

Code for the second internal bridge infill has been refactored into its own parallel for loop to remove race conditions with the existing infill code, that were causing the issue identified by @SoftFever above. As a bonus we got the second internal bridge infill type now defined properly as a surface.

That’s what happens when all your CompSci teaching about 24 years ago was done at single core machines 😂

Ready for testing.

@igiannakas igiannakas requested a review from SoftFever February 11, 2025 19:53
igiannakas and others added 3 commits February 12, 2025 07:24
…nal bridge layer.

This resulted in partly unsupported solid infill areas above as the remainder was too narrow to generate sparse infill
@SoftFever
Copy link
Owner

Looks all good now.
Thank you so much for the work!

@SoftFever SoftFever merged commit b4a7721 into SoftFever:main Feb 12, 2025
16 checks passed
@igiannakas igiannakas deleted the Enhancement-Additional-bridging-controls branch February 12, 2025 15:34
@igiannakas
Copy link
Contributor Author

No worries! Fingers crossed no more bugs 😂

@sheariley
Copy link

sheariley commented Feb 12, 2025

Nice work peeps! Can't wait to try this out! When can we expect this to be released?

@igiannakas
Copy link
Contributor Author

Nice work peeps! Can't wait to try this out! When can we expect this to be released?

It’s in the nightly release already if I’m not mistaken.

@sheariley
Copy link

sheariley commented Feb 12, 2025

Nice work peeps! Can't wait to try this out! When can we expect this to be released?

It’s in the nightly release already if I’m not mistaken.

Ah. Sorry about that. I didn't see the list of assets at the bottom of the post about nightly build, at first; so I was a bit confused.

@igiannakas
Copy link
Contributor Author

No worries :)

@CCS86
Copy link

CCS86 commented Feb 13, 2025

Hmm, just downloaded the nightly Windows build, and the extra bridge layer is missing on the first project I tried:

NoExtraBridge.mp4

@igiannakas
Copy link
Contributor Author

igiannakas commented Feb 13, 2025

Very small in length or very narrow in width bridges are filtered out as there is no benefit to them getting a second bridge layer. Basically any bridge that is less wide or less long than 2x the number of walls set in that area.
For example in your video below the feature is redundant as the bridge gap is tiny.

Tooltip explains it all :)

@igiannakas
Copy link
Contributor Author

Prusa just implemented something very similar to the second bridge layer in the latest prusa slicer alpha: prusa3d/PrusaSlicer@5430596

maybe consider in the future doing a merge between the two. Approach is very similar but they have gone the extra mile of defining a new surface type with its own speed too :)

@CCS86
Copy link

CCS86 commented Feb 21, 2025

Found a little glitch where it is inserting bridge inside a completely solid model:

image

Eave Corner 1.zip

@Ataraxia-Mechanica
Copy link

Further enhancements on this would be cool, like slowing down the outer wall on the second layer as well.
408798463-4456b54d-3119-4f88-9548-48ea041ccc8a

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