Tessellation & Tiling

Last update: 8 April 2021

Tessellation

Rectangular

//Create a null layer at the top named "Start Tiles" with a Slider effect "Columns", 
//and one at the bottom named "End Tiles"

// For Position:
var controlLayer = thisComp.layer("Start Tiles");
var numColumns = Math.floor(thisComp.layer("Start Tiles").effect("Columns")("Slider").value);
var tileIndex = index - controlLayer.index-1;
var columnIndex = tileIndex%numColumns;
var rowIndex = Math.floor(tileIndex/numColumns);
var columnWidth = thisComp.width/numColumns;
var firstTile = thisComp.layer(controlLayer.index+1);
var rowHeight = firstTile.height/firstTile.width*columnWidth;
var xPos = columnWidth*(columnIndex+.5);
var yPos = rowHeight*(rowIndex+.5);[xPos, yPos];

// For Scale:
var controlLayer = thisComp.layer("Start Tiles");
var numColumns = Math.floor(thisComp.layer("Start Tiles").effect("Columns")("Slider").value);
var columnWidth = thisComp.width/numColumns;
var firstTile = thisComp.layer(controlLayer.index+1);
var rowHeight = firstTile.width/firstTile.height*columnWidth;
var xyScale = columnWidth/width*100;[xyScale, xyScale]

Hexagonal

heighttowidth ratio of regular hexagon=1:1.1547005height-to-width\ ratio\ of \ regular \ hexagon= 1:1.1547005

Layer slider with responsive positioning

Parameters:

  1. Layer can be aligned in x-axis with adjustable even space in-between

    1. For that to happen, the anchor points of the layers must be centered

    2. This prevents inconsistent opacity for the layers on both sides

  2. If a layer scale changes, the spacing should change accordingly

  3. Create a control that just change the active "tile";

Tiling formula

(target.width/2space)(active.width/2)(target.width/2-space)-(active.width/2)

Last updated

Was this helpful?