Add Optimized Gyroid infill (auto-tuned wavelength + amplitude)#10409
Draft
peyton-marcotte wants to merge 1 commit intobambulab:masterfrom
Draft
Add Optimized Gyroid infill (auto-tuned wavelength + amplitude)#10409peyton-marcotte wants to merge 1 commit intobambulab:masterfrom
peyton-marcotte wants to merge 1 commit intobambulab:masterfrom
Conversation
Mirrors the design accepted in OrcaSlicer #13379. Adds a boolean config option `gyroid_optimized` (default false) that, when enabled on a region using the Gyroid infill pattern, replaces the analytical wave generator with a marching-squares iso-extraction on the gyroid implicit field with anisotropic Z-axis frequency scaling. Behavior: - omega = sqrt(1 / density_adj), clamped [1.0, 2.0]. Maximum boost at low density (long, slender vertical strands); clamps to no-op at ~30%+ density. - fz = omega * baseline; fx = fy = baseline. Tightens vertical wave to shorten effective column length under Z-axis compression. - Filament use is preserved at the same `sparse_infill_density` setting (verified via slicer + Python sim, ratio ~ 1.000). - Existing profiles using `gyroid` are byte-identical when the checkbox is off. User-facing: "Z-buckling bias optimization (experimental)" under Print Settings -> Strength -> Sparse infill, visible only when the sparse infill pattern is Gyroid.
68d6506 to
6e62bc6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an experimental "Optimize gyroid wave" option to the existing Gyroid infill pattern. When enabled, the gyroid wave is parameterized per region from density, line spacing, and layer height to bias the strand toward higher buckling resistance under compression. The user does not see or set the underlying parameter; density is still picked by the user.
The option appears as a checkbox under Print Settings → Strength → Infill, visible only when the sparse infill pattern is set to Gyroid. Existing profiles using
gyroidare byte-identical when the box is unchecked.Physics
Standard gyroid surface:
sin(x)cos(y) + sin(y)cos(z) + sin(z)cos(x) = 0. The optimized variant tightens the wave along the Z (layer-stacking) axis using a buckling-derived frequency multiplier:sqrt(density_adj) / sqrt(1 + layer_h / spacing)[0.5, 2.0]P_cr ∝ 1/L². Shorter vertical wavelength under denser infill raises the critical buckling load of each strand.The Z-axis was chosen because it is the typical compression-load axis for FFF parts and is not at delamination risk under compression — the dominant failure mode is column buckling of the vertical strands, which shorter vertical wavelength directly resists.
To preserve mass at the same
sparse_infill_densitysetting, the base period is compensated bycbrt(omega)so the geometric mean of (fx, fy, fz) returns to the standard baseline. Net effect:fz = ω^(2/3) * baseline,fx = fy = ω^(-1/3) * baseline.Implementation
The optimized wave is extracted via marching squares on the gyroid implicit scalar field, modeled on
FillTpmsFK.cpp'sScalarField. This produces smoother transitions between vertical and horizontal regimes than the analytical asin-based generator. When the option is off, behavior is byte-identical to the standard parametric gyroid path.Files changed
src/libslic3r/Fill/FillGyroid.cpp— marching-squares optimized branch added; standard branch untouchedsrc/libslic3r/Fill/FillBase.hpp—gyroid_optimizedfield onFillParamssrc/libslic3r/Fill/Fill.cpp—gyroid_optimizedfield onSurfaceFillParams, gated onpattern == ipGyroidsrc/libslic3r/PrintConfig.{cpp,hpp}—gyroid_optimizedConfigOptionBoolonPrintRegionConfig, default falsesrc/libslic3r/Preset.cpp— added tos_Preset_print_optionssrc/slic3r/GUI/Tab.cpp— checkbox in Strength → Sparse infill optgroupsrc/slic3r/GUI/ConfigManipulation.cpp—toggle_linebased onpattern == ipGyroidOrigin
Developed as part of the CRAMP project at Brown University: Compression Research for Additive Manufacturing Performance. CRAMP identifies and validates high-performance additive-manufacturing infill architectures for compression in spaceflight applications, where every gram and every Newton of load matters.
Candidate architectures were generated by a custom AI over the space of triply-periodic minimal-surface (TPMS) infills, then printed and compression-tested on the Instron press at Brown University's Prince Laboratory against standard rectilinear and concentric baselines. Winning architectures beat commodity baselines by up to 60% in compressive strength-to-mass. The optimized gyroid variant submitted here is a parameterized version of one such candidate, surfaced from that search.
Sponsors and partners:
Released open source for community use.