smartavionics / Cura

3D printer / slicing GUI built on top of the Uranium framework
GNU Lesser General Public License v3.0
175 stars 11 forks source link

3D Honeycomb #250

Closed 5axes closed 5 months ago

5axes commented 5 months ago

As "Infill pattern lover" you should love to integrate this 3D Honeycomb pattern.

312217305-3b271c32-768e-4029-852b-7bfb5cea4402

Original source : https://github.com/SoftFever/OrcaSlicer/pull/4425
from @gringer

3.20.20 ?

smartavionics commented 5 months ago

Yes, it does look interesting. I looked at the code they use in OrcaSlicer and some day I may rewrite it for Cura. Too busy at the moment, though.

gringer commented 5 months ago

I already submitted code for Cura many years ago; it was rejected because I couldn't verify myself that the changes worked, and the developers didn't have enough incentive to test it out themselves:

https://github.com/Ultimaker/CuraEngine/pull/1167

It has suffered from bit rot since then (because Cura introduced other 3D infills with a different API), and the physical performance of the new infill pattern is substantially better than that initial pull request.

If you have an install script that works without issue on either an OSX or Linux system, I'd be happy to do the code side of it again with the other tweaks, but I can't test out the printer side of things (i.e. actually printing with that infill) due to work constraints about software.

smartavionics commented 5 months ago

Thanks for the offer of help. I would be very happy to take something that embodied the algorithm and merge it into my Cura but I no longer submit PRs for new functionality to the upstream repo.

smartavionics commented 5 months ago

So, I've literally just cut and pasted the code in your PR and it compiles and runs in my Cura. However, it doesn't look like the animation shown above as it is filling in horizontal squares...

Screenshot_2024-05-05_10-33-01

smartavionics commented 5 months ago

OK, I actually looked at the code and it's easy to disable those filled in regions.

https://github.com/smartavionics/Cura/assets/585618/d6e7ee43-b652-4654-86bd-a54c1b336e23

smartavionics commented 5 months ago

However, it is still duplicating a lot of the lines. Do you have any suggestions as to how that can be fixed? Thanks.

smartavionics commented 5 months ago

I've managed to fix the problems found, so far...

Screenshot_2024-05-05_21-13-39

gringer commented 5 months ago

That looks awesome, well done.

Sorry about the delay in response; timezones don't really work in my favour.

If it's working properly, then it should form regular hexagons and squares as shapes in the pattern. The most significant recent update changed from alternating between horizontal and perpendicular horizontal lines every layer, to only switching at the lowest bridge point on the squares (as seen in the GIF at the start of this post).

gringer commented 5 months ago

FWIW, I also did a bit of fiddling with line separation to fix density issues, trying to get the actual amount of extruded filament as close as possible to that of the rectilinear infill:

https://github.com/prusa3d/PrusaSlicer/pull/6434/commits/36ad27c49104fbd576277334f2fc38ea49fe012b

Not sure if this would be of interest to you. I only bothered with it because Stefan brought it up in one of his testing videos, and it was mentioned in a PrusaSlicer bug report.

smartavionics commented 5 months ago

Thanks, I have tweaked the density and also the Zscale computation which is currently lineSpacing * 1.85 (rather than sqrt(2)) as this gives more uniform shaped octagons. That was done by trial and error and I don't understand what the 1.85 relates to. Anyway, it's looking pretty good and will be in my next release.

PS I noticed when printing some sparse 3D honeycomb infill without walls that I was getting underextrusion following long travel moves so I have introduced a couple of settings that let you set travel distance proportional prime amounts at the start of infill lines. That completely fixes the underextrusion.

smartavionics commented 5 months ago

BTW, 4.20.20 has been released which includes the Honeycomb 3D infill pattern.