Skip to content

Add Optimized Gyroid infill (auto-tuned wavelength + amplitude)#10409

Draft
peyton-marcotte wants to merge 1 commit intobambulab:masterfrom
peyton-marcotte:feature/optimized-gyroid-infill
Draft

Add Optimized Gyroid infill (auto-tuned wavelength + amplitude)#10409
peyton-marcotte wants to merge 1 commit intobambulab:masterfrom
peyton-marcotte:feature/optimized-gyroid-infill

Conversation

@peyton-marcotte
Copy link
Copy Markdown

@peyton-marcotte peyton-marcotte commented Apr 28, 2026

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 gyroid are 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:

Parameter Formula Bounds Rationale
ω (omega) sqrt(density_adj) / sqrt(1 + layer_h / spacing) [0.5, 2.0] Euler-Bernoulli buckling: 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_density setting, the base period is compensated by cbrt(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's ScalarField. 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.

image

Files changed

  • src/libslic3r/Fill/FillGyroid.cpp — marching-squares optimized branch added; standard branch untouched
  • src/libslic3r/Fill/FillBase.hppgyroid_optimized field on FillParams
  • src/libslic3r/Fill/Fill.cppgyroid_optimized field on SurfaceFillParams, gated on pattern == ipGyroid
  • src/libslic3r/PrintConfig.{cpp,hpp}gyroid_optimized ConfigOptionBool on PrintRegionConfig, default false
  • src/libslic3r/Preset.cpp — added to s_Preset_print_options
  • src/slic3r/GUI/Tab.cpp — checkbox in Strength → Sparse infill optgroup
  • src/slic3r/GUI/ConfigManipulation.cpptoggle_line based on pattern == ipGyroid

Origin

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:

  • NASA: funded research, two NASA Space Grant awards via Rhode Island Space Grant (RISG)
  • Rhode Island Space Grant (RISG): administering body of the Space Grant funding
  • Brown University: host institution; compression testing performed at the Prince Laboratory on the Instron press
  • ELEGOO 3D: industry collaborator under signed Memorandum of Understanding
  • Polymaker: filament sponsor

Released open source for community use.

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.
@peyton-marcotte peyton-marcotte force-pushed the feature/optimized-gyroid-infill branch from 68d6506 to 6e62bc6 Compare May 3, 2026 03:46
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.

1 participant