Differentiable Print Order: Stress-Aligned Curved Layers with Soft Nozzle Access

A multi-axis 3D printer can deposit plastic along curved surfaces instead of flat slices. That matters mechanically, because printed parts are weak where one layer is only glued to the next. On a liquid-crystal-polymer bracket, curving the layers so that load runs along the strands instead of across the bonds raised failure load from 2.6 N to 114.7 N (Stress Flow Guided Non-Planar Print Trajectory Optimization). The catch is that curved layers only help if the machine can actually print them in order. Each layer has to be reachable by the nozzle without hitting material already laid down, and without needing support underneath. Today, stress-driven layer design ignores that question, and collision-aware multi-axis planners ignore stress. One side designs layers for strength and hopes they are printable. The other designs layers for printability and ignores what the part has to carry.

This note proposes treating the print order itself as a smooth quantity that can be optimized. We represent "when each point gets printed" as a continuous scalar field. We then compute how much of the half-built part exists at each moment as a soft occupancy probability, the kind of per-voxel value between 0 and 1 used in probabilistic 3D mapping, rather than a hard solid/empty label. Once occupancy is soft, the question "can the nozzle reach this point without passing through printed material?" becomes a differentiable ray-transmittance calculation, borrowed from single-view 3D reconstruction. A single gradient-based optimization can then trade stress alignment against nozzle access and support-free growth. The claim is that this joint optimization finds curved-layer print orders that are stronger than geometry-only multi-axis plans and more often printable than stress-only plans, especially on concave parts where the two goals conflict.

Core Claim and Where It Sits

The mechanism has three parts. The first is a print-time field $\varphi(x)$, whose level sets are the curved layers. The second is soft occupancy of the part at print time $t$, $o(x,t)=\sigma\big((t-\varphi(x))/\tau\big)$, where $\sigma$ is the logistic function and $\tau$ is a temperature that we anneal toward zero, so occupancy tends to 0/1. The third is an access score for each point $x$. For each candidate nozzle direction $d$, we sample points $x+s_k d$ along the nozzle and head's swept profile and compute the probability that all of them are still empty when $x$ is printed. The access score is a soft maximum of this probability over directions:

$$A(x)=\operatorname{softmax}_{d}\ \prod_{k}\Big(1-o\big(x+s_k d,\ \varphi(x)\big)\Big).$$

This product is the same "all preceding voxels empty" term that Differentiable Ray Consistency uses to make ray termination differentiable for learning 3D shape from 2D views. Here we repurpose it from camera rays to nozzle rays; that paper supplies the method. The field is optimized to minimize

$$L(\varphi)=\sum_x w(x)\,\big(n(x)\cdot e_1(x)\big)^2+\lambda_h\big(|\nabla\varphi(x)|-1/h\big)^2+\lambda_a\big(1-A(x)\big)+\lambda_s\,S(x),$$

with the following terms. $n=\nabla\varphi/|\nabla\varphi|$ is the layer normal. $e_1$ is the principal tensile stress direction from finite-element analysis, and $w$ is its magnitude, so the first term pushes load into the layer plane and away from the weak interlayer bonds. $h$ is the target layer height, and the second term keeps layer thickness even. $S$ is a soft support term that penalizes points whose downward neighbors are unprinted at their print time, computed from the same occupancy.

Two lines of prior work motivate the gap from opposite sides. Stress Flow Guided Non-Planar Print Trajectory Optimization builds curved layers by offsetting from a base surface with the geodesic heat method and then traces stress-aligned in-layer paths. Its authors leave collisions to the user and report inertia-driven over-extrusion on a 5-axis head. Support-free volume printing by multi-axis motion decomposes volumes into collision-free, support-free curved layers on a robot arm using an advancing convex front and discrete shadowing checks on a binary voxel grid, but its layers follow geometry, not stress. Our method differs from the first by making access a first-class term that reshapes the layers. It differs from the second by replacing its non-differentiable binary sequencing with a relaxation that stress gradients can act on.

Three further papers constrain the design rather than supply it. The in-plane planners, More Stiffness with Less Fiber (adjoint optimization of 2D fiber coordinates) and Swarm-Based Trajectory Generation (agents balancing stress heading against spacing), show that path spacing and stress alignment genuinely conflict near holes. That is why we keep the in-layer path problem separate and reuse the swarm planner inside each optimized layer instead of solving everything at once. The manufacturing-constraint literature supports building constraints into the optimization instead of cleaning up afterward. Neuroshaper embeds feature-size rules as losses and loses only 1.2 points of efficiency (95.0% vs. 96.2%) while becoming manufacturable, and Differentiable Edge-based OPC projects gradients to zero near rule boundaries to get zero violations. Their evidence is from 2D masks and photonics, so it is suggestive, not proof, for 3D deposition.

Research Program

We will build a GPU implementation on a sparse voxel grid, since uniform grids are memory-bound, as the DRC paper notes at $64^3$. The grid will hold $\varphi$ and an FEA stress field computed once on the target geometry. Nozzle-access rays will be cast over a discretized hemisphere of directions, restricted by the joint limits of a 5-axis kinematic model. We will initialize $\varphi$ from the geodesic-distance field of Huang et al., so that the method starts from a printable plan and moves toward stress alignment. The temperature $\tau$ is annealed to zero.

After convergence, we threshold occupancy and run an exact mesh-based collision check with the true nozzle and carriage geometry. A small repair step then fixes any residual violations; how often that repair is needed is itself a reported metric. Within each resulting layer, we generate in-layer toolpaths with the swarm planner so that the path generator is identical across all compared methods. Stiffness and strength are predicted with an anisotropic FEA material model that treats interlayer directions as weak. Selected designs are then printed physically.

The first analysis question is where the gains come from. We will stratify every benchmark part by how much its principal-stress directions disagree with its geometry-only layer normals. The prediction is that joint optimization helps most where that disagreement is high and access is tight, and roughly ties elsewhere.

Baselines

The naive reference is planar 2.5D slicing with supports and the same in-layer paths. It establishes the floor, and the Fork result of 2.6 N from Guidetti et al. tells us roughly where it sits for anisotropic polymers.

The strongest stress-side competitor is the Guidetti et al. pipeline itself: geodesic offset layers plus Dirichlet-energy stress-aligned paths. It is the only method in the file with a reported physical result on stress-aligned curved layers, 114.7 N failure load and 14.8 N/mm stiffness on the LCP Fork. To make the comparison fair, we run it with the same FEA field, the same swarm in-layer planner, and the same exact collision checker. We report both its mechanical score and its fraction of collision-violating or support-needing layers, which that paper does not report.

The strongest printability-side competitor is Huang et al.'s peeling-governed decomposition. It reports 61 minutes on the 540.6k-voxel Armadillo, down from 5,455. We run it on the same voxelizations with the same nozzle model and time budget. No reported result found on Lacuna for a stress-alignment or interlayer-stress metric on its outputs, so we measure that ourselves.

We also include a sequential two-stage baseline: Guidetti layers, then Huang-style discrete collision repair that splits and reorders offending regions. It is given the same wall-clock budget as our optimizer.

Beating the baselines means two things. Against Guidetti, we need equal or better FEA-predicted stiffness together with a strictly higher printable fraction. Against Huang and the two-stage method, we need higher predicted stiffness and lower interlayer tensile stress at equal printable fraction. Two ablations isolate the key ingredient. The first replaces the soft access term with a hard check and straight-through gradients. The second removes the access term and keeps only a local overhang-angle penalty.

Why not just…?

Why not just run the stress-aligned slicer and then repair collisions? This is the two-stage baseline above, and it is a real threat on convex, open parts where few layers collide. Our expectation is that repair on concave parts either splits regions, which destroys layer continuity along the load path, or rotates layers away from stress, which gives back the gain. The stratified analysis will show whether the joint method's advantage really concentrates in high-conflict parts. If it does not, the two-stage pipeline wins and we will say so.

Why not just use a local overhang-angle constraint, which is cheap and already differentiable? Overhang angle guarantees self-support, but nozzle collision is non-local: the carriage hits material several centimeters from the deposition point. The second ablation measures this directly as the collision-violation rate with overhang-only regularization on recessed models such as Fertility and the Candelabra. If overhang-only matches our violation rate, the occupancy machinery is unnecessary.

Why not just inflate the nozzle by a safety margin to absorb the ±1 mm robot positioning error that Huang et al. report? For hardware noise, a margin probably does work, and we do not claim probabilistic occupancy beats it there. The same margin is applied to every method. Our use of soft occupancy is about making print order optimizable, not about modeling sensor uncertainty.

Why not use a smooth signed distance field of the printed-so-far part? That distance field would have to be recomputed each time $\varphi$ changes, and it is not a simple function of $\varphi$. Soft occupancy is a closed-form function of the field, so gradients are direct. We will nevertheless test a distance-field approximation as a secondary ablation, and report it if it is competitive.

Proposed Experiments

The benchmark set combines Huang et al.'s models (hollowed Bunny, Fertility, Candelabra, Mech-Part, Woman-Pully, Armadillo) with Guidetti's Fork. Load cases are defined on each model and documented for reuse. We report five metrics throughout. Printable fraction is the share of layers passing the exact collision and support check before repair. Repair volume is the fraction of voxels moved during repair. Load-weighted interlayer stress is the mean of $w(n\cdot e_1)^2$. We also report FEA-predicted stiffness and strength under the anisotropic model, and optimization time.

The decisive physical check is to print the Fork, where the target is to match Guidetti's 114.7 N without manual collision inspection, and one concave bracket on a 5-axis desktop conversion in the style of Open5x, in several replicates per method. On the concave bracket, the Guidetti pipeline is expected to need manual intervention or fail, and Huang's plan to be weaker.

The idea is falsified if either of two things happens. One is that the two-stage baseline matches our stiffness and printable fraction on the high-conflict stratum. The other is that the hard-check ablation performs just as well, which would mean the probabilistic relaxation contributes nothing.