Skip to content

Function: generateSubstitution() ​

ts
function generateSubstitution(
   rule, 
   size, 
   ctx, 
   label, 
   idPrefix?
): RawTile[];

Subdivide rule's seed until the final tiles have edge size, keeping only pieces near the region, and assemble them. ctx.origin places the center of the seed patch; ctx.rotation turns the whole pattern.

Parameters ​

ParameterTypeDefault value
ruleSubstitutionRuleundefined
sizenumberundefined
ctxGenerateContextundefined
labelstringundefined
idPrefixstring"s"

Returns ​

RawTile[]

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).