← All resources

Marching Squares/Cubes (BorisTheBrave)

Auto-discovered

Blog Intermediate

BorisTheBrave

Visit resource ↗

Description

First article in Boris The Brave's free meshing series (Adam Newgas) on boristhebrave.com. It explains marching cubes as extracting a boundary mesh from a sampled scalar field, using destructible terrain as the main example.

The walkthrough uses 2D marching squares: grid cells, inside/outside corner tests, a sixteen-case lookup table, and stitched iso-contours. Adaptive edge placement from field values reduces the usual 45-degree stair-stepping.

For intermediate readers comfortable with zero crossings and mesh basics. Concept-first prose with diagrams; code detail is in the companion mc-dc Python repo (2D/3D marching cubes and dual contouring, CC0).

Follow-on posts cover 3D marching cubes and dual contouring. Free on the blog, no paywall.

Often listed on procedural-generation catalogs including the Cyanilux resources gist; mc-dc is the usual reference implementation for the series.