Infill & Toolpaths
Triply Periodic Minimal Surfaces (Gyroid Infill): Traditional rectilinear grid infills are anisotropic, failing under shear and transverse tension. The Gyroid is a non-self-intersecting minimal surface discovered by Alan Schoen (1970). Sliced along the Z axis, its undulating sinusoidal paths never cross on the same layer, delivering isotropic mechanical stiffness and continuous nozzle extrusion.
Gyroid Geometric Properties:
1import math23def gyroid_level_set(x, y, z, scale=1.0, iso=0.0):4 """5 Evaluates Triply Periodic Minimal Surface (TPMS) Gyroid equation:6 f(x, y, z) = sin(x)*cos(y) + sin(y)*cos(z) + sin(z)*cos(x) - iso = 0.7 Provides isotropic strength-to-weight ratio in all 3 spatial directions.8 """9 sx, sy, sz = x * scale, y * scale, z * scale10 return (11 math.sin(sx) * math.cos(sy) +12 math.sin(sy) * math.cos(sz) +13 math.sin(sz) * math.cos(sx) - iso14 )
Continuous Toolpath Planning (Fermat Spirals): Every time an extruder nozzle halts, retracts filament, and rapid-travels to another island, print time increases and molten plastic oozes, creating surface stringing and seam zits. Connected Fermat spirals fill closed boundaries in a single, unbroken extrusion curve winding outwards and interleaving back to the center.
Retraction-Free Infill:
1import numpy as np23def generate_fermat_spiral(r_max=2.0, num_turns=6, num_samples=300):4 """5 Generates a continuous, non-retracting Fermat spiral toolpath (r = a * sqrt(theta)).6 Transitions seamlessly from outward winding to inward return without crossing itself.7 """8 max_theta = (2.0 * np.pi) * num_turns9 theta = np.linspace(0, max_theta, num_samples)1011 # Fermat outward branch: r = c * sqrt(theta)12 r_out = r_max * np.sqrt(theta / max_theta)13 x_out = r_out * np.cos(theta)14 y_out = r_out * np.sin(theta)1516 # Inward interleaved return branch shifted by pi17 x_in = r_out[::-1] * np.cos(theta[::-1] + np.pi)18 y_in = r_out[::-1] * np.sin(theta[::-1] + np.pi)1920 # Connected continuous toolpath without nozzle lift21 full_x = np.concatenate([x_out, x_in])22 full_y = np.concatenate([y_out, y_in])23 return list(zip(full_x, full_y))
Related Concepts
3D printing slicing, infill generation, and support structures.
Interactive geometrical visualization of mesh contour slicing and adaptive layer heights.
Interactive geometrical visualization of critical angle detection and tree support scaffolding.