Skip to main content
MaterialNest

Wood fence material formulas

The published formulas for post topology, clear bays, vertical boards, panels, rail-stock cuts, fasteners, contingencies, and packages.

Published Updated Reviewed

Transparent variables, rounding decisions, and scope limits for every result.

Formula version: 1.1.0. This methodology describes a planning estimator, not structural design or installation approval.

Post topology and clear gates

Run lengths use post centrelines. A clear face-to-face gate beginning at clearStart, with clear width gateWidth and post face width postWidth, becomes two fixed gate-post centre nodes:

left centre = clearStart − postWidth ÷ 2

right centre = clearStart + gateWidth + postWidth ÷ 2

The existing MaterialNest fence-post engine divides every uninterrupted centreline interval into equal spans no greater than the user-entered maximum. Shared endpoint IDs are counted once. Clear bay width subtracts half of each adjacent post face from the centre spacing.

Boards and panels

For solid vertical boards, each bay uses ceil(clear bay ÷ board width) boards. A partial final board is reported as a rip and is blocked unless the user allows it.

For spaced pickets, the user chooses either equal gaps only between pickets or equal gaps between pickets and at both post faces. The smallest whole count satisfying the selected gap-slot convention and entered maximum gap is tested. The resulting gap must be nonnegative and no greater than the maximum; the both-edge mode also supports a single-picket bay.

Panels are rounded independently in every bay. A residual panel is permitted only when the user confirms cutting; remnants are not silently reused across runs.

Rail stock and fasteners

Every rail row in every bay creates a distinct cut. The cut is either post-centre to post-centre or clear bay plus the user-entered bearing at both ends. Stock allocation uses the deterministic objective: fewest pieces, least purchased length, least discarded remainder, most reusable remainder, then stable IDs.

A cut shorter than the remaining stock consumes its length plus entered kerf. A cut that exactly reaches the stock end within 0.001 mm consumes no trailing kerf. The allocation method and its work-limit fallbacks are described under Bounded stock optimization below; reaching the small-search limit does not discard its best valid plan.

Fasteners are the sum of rail-end connections, board-to-rail connections, panel-end connections, and user-entered gate fasteners. Contingency is applied before package division; packages round up. Package surplus is kept separate from contingency and cut loss.

Limitations

This vertical-infill model excludes horizontal, shadowbox, board-on-board, sloped and racked layouts. The calculator page provides separate horizontal-board, overlapping-infill and sloped-bay worksheets with their own methods and limits. Structural gate design, post/footing selection, wind resistance, permits and code compliance remain excluded. Manufacturer examples may explain terminology but do not become hidden defaults.

Primary workflow references: 811 Before You Dig and The Home Depot panel guide.

Corrections can be reported to feedback@materialnest.com.

Bounded stock optimization

Rail cuts from the measured bays are assigned to the selected rail-stock lengths with the entered kerf and reusable-remnant threshold. A small bounded search starts with a valid plan and retains its best plan if the work limit is reached, labelled heuristic rather than optimal. Larger lists use deterministic placement; if that placement would exceed its work limit, or cannot supply a plan, each cut receives its own shortest fitting stock item and the result is labelled conservative. Board/panel counts and fastener packages follow their separate rules above. Saved quantities change only when explicitly recalculated.