MAGMA

Magma Rectilinear Pattern — Design Note (locked)

Second Magma infill pattern, after Triangle and before Tri-hex. This note is the implementation reference; the design below is settled.

Terminology: rectilinear (a.k.a. “square”) cells pair into the same U-tube as the triangle pattern — two adjacent cells joined by a window gap at their shared wall, injected down one and vented up the other. It is the degenerate 1-leg manifold, exactly like triangle; only the cell shape and line families differ.

1. Lattice — square grid

2. Cell geometry — SquareGeometry (MagmaGeometry impl)

Walls are single shared beads centred on the grid lines, so the open interior is inset by line_width/2 on each of the four sides → inset (open) square side = spacing − lw.

3. Window placement — square_window_cuts (pattern-owned)

For each open U-tube pair (the solver decides which pairs are open on a given layer):

Intervals are merged per line index. Simpler than the triangle, which must classify the shared edge into three families (horizontal / 60° / 120°).

4. Toolpath — FillMagmaRectilinear::_fill_surface_single

5. Solver / injection / preview — UNCHANGED

6. New vs reused