DocsNodesModifiers

Corner Pattern

Asks about a face's corners rather than its middle, which is what an autotiler needs.

autotile, coastline, corners, marching squares, tile picker, shoreline, wang
Category
Modifiers
Outputs
field
Runs live in
no target yet

Every other field samples once per face at its centre, so nothing could say three of my four corners are land. That question is exactly what a tile needs in order to pick its shape.

How Many works on any face and is a coastline test on its own: one or two corners of four selected is the shore. The other readings need quads, and between them they turn the sixteen possible corner patterns into the six tiles those reduce to once rotation is allowed. Feed the tile choice to Fit To Faces and the turns to its rotation, and that is a complete autotiler.

Inputs

SocketTypeWiring
meshgeometry
selectionfield, optional

Parameters

NameTypeDefaultAvailable whenWhat it does
Readcount | code | class | turnscountalways

Watch out

Feed it something positional, like a noise or a height. A field that already reads per face gives the same answer at all four corners, which makes every pattern all-in or all-out.

Built with this node

See also

  • fitToFacesThe destination: the tile index and its rotation.
  • quadSubdivideIt needs quads for anything beyond the plain corner count.

Open the editor and try it