SinterPixels Demos: Two Tone Hexagonal Tiling
Building on the previous post, here’s a two tone hexagonal tiling, and the 42 line script that makes the tiling and the movie:
tell application "SinterPixels"
set tileDoc to make new document with properties {name:"Tile", height:60, width:60}
tell tileDoc
make new polygon with properties {position:{0, 0}, vertex count:6, radius:30, rotation:0, line width:0, closed:false, fill color:{0.5, 1.0, 0.5, 1.0}}
make new polygon with properties {position:{0, 0}, vertex:{{-31, -31}, {0, -31}, {0, 31}, {-31, 31}}, fill color:{0.5, 0.5, 1.0, 1.0}, line width:0, blend mode:sourceIn}
make new circle with properties {position:{30, 0}, radius:14.1, color:blue, fill color:{0.5, 0.5, 1.0, 1.0}, line width:4, blend mode:sourceIn}
make new circle with properties {position:{-30, 0}, radius:14.1, color:blue, fill color:{0.5, 1.0, 0.5, 1.0}, line width:4, blend mode:sourceIn}
make new polygon with properties {vertex:{{0, -30}, {0, 30}}, position:{0, 0}, line width:4, closed:false, color:blue, fill color:clear, blend mode:sourceIn}
set tilePNG to get PNG data
end tell
set mosaicDoc to make new document with properties {name:"Mosaic", height:450, width:600}
repeat with x from 1 to 11
repeat with y from 1 to 5
set newPosition to {(x * 52) - 321, ((2 * y) * 45) - 285}
set newRotation to some item of {30, 150, 270}
tell mosaicDoc
set nthLayer to make new layer with properties {image data:tilePNG, rotation:newRotation, position:newPosition}
end tell
set newPosition to {(x * 52) - 295, (((2 * y) + 1) * 45) - 285}
set newRotation to some item of {30, 150, 270}
tell mosaicDoc
set nthLayer to make new layer with properties {image data:tilePNG, rotation:newRotation, position:newPosition}
end tell
end repeat
end repeat
tell mosaicDoc
start filming
record movie frame
repeat 15 times
set y to some item of {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
set x to some item of {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
set n to x + y * 11
set nthTile to layer n
set rot to rotation of nthTile
repeat with r from 1 to 60
set rotation of nthTile to rot + (r * 2)
record movie frame
end repeat
end repeat
stop filming
end tell
end tell