Polyhedra
sqrtPHIPHI2blueprintnGridgSpacePolyhedronDefedgesfaceedgecacheKeyverticesscaledmaxDistdistscaleVertexTransformscenterinvLenPolyhedraRendererinstancesoffsetsscalesrotations
const sqrt = Math.sqrt;
const PHI = (1 + sqrt(5)) / 2;
const PHI2 = PHI * PHI;
const c = [
0.9270509831248423,
0.5729490168751577,
1.8090169943749474,
0.6909830056250526,
1.1180339887498948,
0.463525491562421136153,
1.213525491562421136,
0.75,
0.7071067811865475,
0.6212264105565853116,
0.3377539738137523,
1.14261350892596209,
0.6212264106,
1.61803398874989,
0.809016994374947,
1.30901699437494,
0.381966011250105,
0.54823199289467,
0.887057998223667,
0.618033988749894,
1.224744871391589,
0.6123724356957945,
0.276393202250021,
0.7236067977499789,
0.4472135954999579,
1.0207080722873918,
0.3952485126314834,
0.9398558672524094,
0.37566029977943644,
0.8670176086393291,
0.720203526974015,
0.6713282848812459,
0.3574769316206112,
0.5795047951732327,
4.23606797749979,
1.8090169943749475,
3.9270509831248424,
3.73606797749979,
2.9270509831248424,
3.118033988749895,
2.118033988749895,
2.4270509831248424,
1.0274862967460157,
0.36000335968940234,
0.9425010317310091,
0.5541692503699379,
0.8966646826186098,
0.31751072718189904,
0.5137431483730078,
0.8312538755549068,
0.5824976720416067
];
function blueprint(
bg = "#447abd",
gCol = "#a2c2e8",
sCol = color(255, 255, 255, 200)
) {
push();
background(bg);
const w = width;
const nGrid = 20;
const gSpace = (w / nGrid) * 0.95;
push();
translate(-w / 2, -w / 2, 0);
stroke(gCol);
strokeWeight(0.3);
for (let i = 1; i <= nGrid; i++) {
for (let j = 1; j <= nGrid; j++) {
line(gSpace * i, gSpace, gSpace * i, w - gSpace);
line(gSpace, gSpace * i, w - gSpace, gSpace * i);
}
}
noFill();
strokeWeight(3);
rect(gSpace, gSpace, w - 2 * gSpace, w - 2 * gSpace);
pop();
fill(sCol);
stroke(gCol);
strokeWeight(0.5);
}
class PolyhedronDef {
constructor(baseVertices, faces, vertexGroups = {}) {
this.baseVertices = baseVertices;
this.faces = faces;
this.vertexGroups = vertexGroups;
this.faceSize = faces.length > 0 ? faces[0].length : 3;
this.cache = new Map();
this.edges = this.calculateEdges();
}
calculateEdges() {
const edges = new Set();
for (const face of this.faces) {
const len = face.length;
for (let i = 0; i < len; i++) {
const v1 = face[i];
const v2 = face[(i + 1) % len];
const edge = v1 < v2 ? `${v1}-${v2}` : `${v2}-${v1}`;
edges.add(edge);
}
}
return edges;
}
createVertices(params = {}) {
const cacheKey = JSON.stringify(params);
if (this.cache.has(cacheKey)) {
return this.cache.get(cacheKey);
}
const vertices = new Float32Array(this.baseVertices.flat());
for (const [groupName, transform] of Object.entries(params)) {
if (this.vertexGroups[groupName]) {
const { indices, method = "scaleFromOrigin" } = this.vertexGroups[
groupName
];
VertexTransforms[method](vertices, indices, transform);
}
}
this.cache.set(cacheKey, vertices);
return vertices;
}
getGeometryData(radius) {
const vertices = this.createVertices();
const scaled = new Float32Array(vertices.length);
let maxDist = 0;
for (let i = 0; i < vertices.length; i += 3) {
const dist =
vertices[i] * vertices[i] +
vertices[i + 1] * vertices[i + 1] +
vertices[i + 2] * vertices[i + 2];
if (dist > maxDist) maxDist = dist;
}
const scale = radius / Math.sqrt(maxDist);
for (let i = 0; i < vertices.length; i += 3) {
scaled[i] = vertices[i] * scale;
scaled[i + 1] = vertices[i + 1] * scale;
scaled[i + 2] = vertices[i + 2] * scale;
}
return {
vertices: scaled,
faces: this.faces,
edges: this.edges
};
}
}
const VertexTransforms = {
scaleFromCenter: (vertices, indices, scale) => {
const center = [0, 0, 0];
const len = indices.length;
for (let i = 0; i < len; i++) {
const idx = indices[i] * 3;
center[0] += vertices[idx];
center[1] += vertices[idx + 1];
center[2] += vertices[idx + 2];
}
const invLen = 1 / len;
center[0] *= invLen;
center[1] *= invLen;
center[2] *= invLen;
for (let i = 0; i < len; i++) {
const idx = indices[i] * 3;
vertices[idx] = center[0] + (vertices[idx] - center[0]) * scale;
vertices[idx + 1] = center[1] + (vertices[idx + 1] - center[1]) * scale;
vertices[idx + 2] = center[2] + (vertices[idx + 2] - center[2]) * scale;
}
},
scaleFromOrigin: (vertices, indices, scale) => {
const len = indices.length;
for (let i = 0; i < len; i++) {
const idx = indices[i] * 3;
vertices[idx] *= scale;
vertices[idx + 1] *= scale;
vertices[idx + 2] *= scale;
}
}
};
class PolyhedraRenderer {
constructor() {
this.instancedRenderer = {
initialized: false,
instances: [],
shaders: {
vert: `
attribute vec3 aPosition;
attribute vec3 aOffset;
attribute vec3 aScale;
attribute vec3 aRotation;
uniform mat4 uProjectionMatrix;
uniform mat4 uModelViewMatrix;
void main() {
float cx = cos(aRotation.x);
float sx = sin(aRotation.x);
float cy = cos(aRotation.y);
float sy = sin(aRotation.y);
mat4 rotX = mat4(
1.0, 0.0, 0.0, 0.0,
0.0, cx, -sx, 0.0,
0.0, sx, cx, 0.0,
0.0, 0.0, 0.0, 1.0
);
mat4 rotY = mat4(
cy, 0.0, sy, 0.0,
0.0, 1.0, 0.0, 0.0,
-sy, 0.0, cy, 0.0,
0.0, 0.0, 0.0, 1.0
);
vec4 scaledPos = vec4(aPosition * aScale, 1.0);
vec4 rotatedPos = rotY * rotX * scaledPos;
vec4 worldPos = rotatedPos + vec4(aOffset, 0.0);
gl_Position = uProjectionMatrix * uModelViewMatrix * worldPos;
}
`,
frag: `
precision mediump float;
uniform vec4 uColor;
void main() {
gl_FragColor = uColor;
}
`
}
};
this.geometryCache = new Map();
}
init(p5Instance) {
if (this.instancedRenderer.initialized) return;
const gl = p5Instance._renderer.GL;
this.gl = gl;
this.p5 = p5Instance;
this.shader = p5Instance.createShader(
this.instancedRenderer.shaders.vert,
this.instancedRenderer.shaders.frag
);
this.buffers = {
position: gl.createBuffer(),
offset: gl.createBuffer(),
scale: gl.createBuffer(),
rotation: gl.createBuffer()
};
this.instancedRenderer.initialized = true;
}
_queueInstance(shape, params) {
this.instancedRenderer.instances.push({
shape,
params
});
}
_render() {
if (!this.instancedRenderer.initialized) return;
this.p5.shader(this.shader);
const instances = this.instancedRenderer.instances;
const offsets = new Float32Array(instances.length * 3);
const scales = new Float32Array(instances.length * 3);
const rotations = new Float32Array(instances.length * 3);
instances.forEach((instance, i) => {
const { x, y, z, scaleX, scaleY, scaleZ, rotX, rotY } = instance.params;
const idx = i * 3;
offsets[idx] = x;
offsets[idx + 1] = y;
offsets[idx + 2] = z || 0;
scales[idx] = scaleX;
scales[idx + 1] = scaleY;
scales[idx + 2] = scaleZ;
rotations[idx] = rotX;
rotations[idx + 1] = rotY;
rotations[idx + 2] = 0;
});
const gl = this.gl;
gl.bindBuffer(gl.ARRAY_BUFFER, this.buffers.offset);
gl.bufferData(gl.ARRAY_BUFFER, offsets, gl.DYNAMIC_DRAW);
gl.bindBuffer(gl.ARRAY_BUFFER, this.buffers.scale);
gl.bufferData(gl.ARRAY_BUFFER, scales, gl.DYNAMIC_DRAW);
gl.bindBuffer(gl.ARRAY_BUFFER, this.buffers.rotation);
gl.bufferData(gl.ARRAY_BUFFER, rotations, gl.DYNAMIC_DRAW);
this.instancedRenderer.instances = [];
}
}
const polyRenderer = new PolyhedraRenderer();
function initPolyhedra() {
polyRenderer.init(this);
}
function drawPolyhedron(shape, x, y, radius, ...params) {
const transformParams = {};
if (shape.vertexGroups.outerVerts && params[0]) {
transformParams.outerVerts = params[0];
}
if (shape.vertexGroups.corners && params[0]) {
transformParams.corners = params[0];
}
if (shape.vertexGroups.horizontalPoints && params[0]) {
transformParams.horizontalPoints = params[0];
}
if (shape.vertexGroups.verticalPoints && params[1]) {
transformParams.verticalPoints = params[1];
}
if (shape.vertexGroups.depthPoints && params[2]) {
transformParams.depthPoints = params[2];
}
const vertices = shape.createVertices(transformParams);
const scaled = new Float32Array(vertices.length);
let maxDist = 0;
for (let i = 0; i < vertices.length; i += 3) {
const dist =
vertices[i] * vertices[i] +
vertices[i + 1] * vertices[i + 1] +
vertices[i + 2] * vertices[i + 2];
if (dist > maxDist) maxDist = dist;
}
const scale = radius / sqrt(maxDist);
for (let i = 0; i < vertices.length; i += 3) {
scaled[i] = vertices[i] * scale;
scaled[i + 1] = vertices[i + 1] * scale;
scaled[i + 2] = vertices[i + 2] * scale;
}
push();
translate(x, y);
for (const face of shape.faces) {
beginShape();
for (let vi of face) {
const idx = vi * 3;
vertex(scaled[idx], scaled[idx + 1], scaled[idx + 2]);
}
endShape(CLOSE);
}
noFill();
beginShape(LINES);
for (const edge of shape.edges) {
const [v1, v2] = edge.split("-").map(Number);
const idx1 = v1 * 3;
const idx2 = v2 * 3;
vertex(scaled[idx1], scaled[idx1 + 1], scaled[idx1 + 2]);
vertex(scaled[idx2], scaled[idx2 + 1], scaled[idx2 + 2]);
}
endShape();
beginShape(POINTS);
for (let i = 0; i < scaled.length; i += 3) {
vertex(scaled[i], scaled[i + 1], scaled[i + 2]);
}
endShape();
pop();
}
function renderPolyhedra() {
polyRenderer._render();
}
function dodecicosacron(radius = 100, stellation = 2) {
drawPolyhedron(DODECICOSACRON, 0, 0, radius, stellation);
}
function octahedron(
radius = 100,
horizontalScale = 1,
verticalScale = 1,
depthScale = 1
) {
drawPolyhedron(
OCTAHEDRON,
0,
0,
radius,
horizontalScale,
verticalScale,
depthScale
);
}
function icosahedron(radius = 100, peakScale = 1, equatorScale = 1) {
drawPolyhedron(ICOSAHEDRON, 0, 0, radius, peakScale, equatorScale);
}
const DODECICOSACRON = new PolyhedronDef(
[
[0.0, -c[0], c[1]],
[0.0, -c[0], -c[1]],
[0.0, c[0], c[1]],
[0.0, c[0], -c[1]],
[-c[0], c[1], 0.0],
[c[0], c[1], 0.0],
[-c[0], -c[1], 0.0],
[c[0], -c[1], 0.0],
[c[1], 0.0, -c[0]],
[c[1], 0.0, c[0]],
[-c[1], 0.0, -c[0]],
[-c[1], 0.0, c[0]],
[c[2], 0.0, c[3]],
[c[2], 0.0, -c[3]],
[-c[2], 0.0, c[3]],
[-c[2], 0.0, -c[3]],
[0.0, c[3], c[2]],
[0.0, c[3], -c[2]],
[0.0, -c[3], c[2]],
[0.0, -c[3], -c[2]],
[c[3], c[2], 0.0],
[-c[3], c[2], 0.0],
[c[3], -c[2], 0.0],
[-c[3], -c[2], 0.0],
[-c[4], -c[4], -c[4]],
[-c[4], -c[4], c[4]],
[c[4], -c[4], -c[4]],
[c[4], -c[4], c[4]],
[-c[4], c[4], -c[4]],
[-c[4], c[4], c[4]],
[c[4], c[4], -c[4]],
[c[4], c[4], c[4]]
],
[
[0, 18, 6, 14],
[0, 22, 9, 12],
[0, 25, 1, 24],
[0, 27, 11, 16],
[0, 23, 7, 26],
[1, 19, 7, 13],
[1, 23, 10, 15],
[1, 26, 0, 27],
[1, 24, 8, 17],
[1, 22, 6, 25],
[2, 16, 5, 12],
[2, 21, 11, 14],
[2, 31, 3, 30],
[2, 29, 9, 18],
[2, 20, 4, 28],
[3, 17, 4, 15],
[3, 20, 8, 13],
[3, 28, 2, 29],
[3, 30, 10, 19],
[3, 21, 5, 31],
[4, 14, 2, 16],
[4, 28, 6, 24],
[4, 29, 3, 20],
[4, 15, 11, 25],
[4, 21, 10, 17],
[5, 12, 8, 26],
[5, 20, 9, 16],
[5, 13, 3, 17],
[5, 31, 7, 27],
[5, 30, 2, 21],
[6, 14, 10, 28],
[6, 23, 11, 18],
[6, 15, 1, 19],
[6, 25, 4, 29],
[6, 24, 0, 22],
[7, 12, 0, 18],
[7, 26, 5, 30],
[7, 27, 1, 23],
[7, 13, 9, 31],
[7, 22, 8, 19],
[8, 13, 1, 22],
[8, 17, 5, 20],
[8, 26, 10, 24],
[8, 30, 7, 12],
[8, 19, 3, 28],
[9, 12, 2, 20],
[9, 18, 7, 22],
[9, 31, 11, 29],
[9, 27, 5, 13],
[9, 16, 0, 25],
[10, 15, 3, 21],
[10, 19, 6, 23],
[10, 28, 8, 30],
[10, 24, 4, 14],
[10, 17, 1, 26],
[11, 14, 0, 23],
[11, 16, 4, 21],
[11, 25, 9, 27],
[11, 29, 6, 15],
[11, 18, 2, 31]
],
{
outerVerts: {
indices: [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
method: "scaleFromOrigin"
},
corners: {
indices: [24, 25, 26, 27, 28, 29, 30, 31],
method: "scaleFromOrigin"
}
}
);
const OCTAHEDRON = new PolyhedronDef(
[
[1, 0, 0],
[-1, 0, 0],
[0, 1, 0],
[0, -1, 0],
[0, 0, 1],
[0, 0, -1]
],
[
[0, 2, 4],
[2, 1, 4],
[1, 3, 4],
[3, 0, 4],
[0, 2, 5],
[2, 1, 5],
[1, 3, 5],
[3, 0, 5]
],
{
horizontalPoints: {
indices: [0, 1],
method: "scaleFromOrigin"
},
verticalPoints: {
indices: [2, 3],
method: "scaleFromOrigin"
},
depthPoints: {
indices: [4, 5],
method: "scaleFromOrigin"
}
}
);
const ICOSAHEDRON = new PolyhedronDef(
[
[0, 1, PHI],
[0, -1, PHI],
[0, 1, -PHI],
[0, -1, -PHI],
[PHI, 0, 1],
[-PHI, 0, 1],
[PHI, 0, -1],
[-PHI, 0, -1],
[1, PHI, 0],
[-1, PHI, 0],
[1, -PHI, 0],
[-1, -PHI, 0]
],
[
[0, 1, 4],
[0, 4, 8],
[0, 8, 9],
[0, 9, 5],
[0, 5, 1],
[3, 2, 7],
[3, 7, 11],
[3, 11, 10],
[3, 10, 6],
[3, 6, 2],
[2, 6, 8],
[2, 8, 9],
[2, 9, 7],
[11, 7, 5],
[11, 5, 1],
[11, 1, 10],
[10, 1, 4],
[10, 4, 6],
[6, 4, 8],
[7, 5, 9]
],
{
peaks: {
indices: [0, 1, 2, 3],
method: "scaleFromOrigin"
},
equator: {
indices: [4, 5, 6, 7, 8, 9, 10, 11],
method: "scaleFromOrigin"
}
}
);
const DODECAHEDRON = new PolyhedronDef(
[
[1, 1, 1],
[1, 1, -1],
[1, -1, 1],
[1, -1, -1],
[-1, 1, 1],
[-1, 1, -1],
[-1, -1, 1],
[-1, -1, -1],
[0, PHI, 1 / PHI],
[0, PHI, -1 / PHI],
[0, -PHI, 1 / PHI],
[0, -PHI, -1 / PHI],
[PHI, 1 / PHI, 0],
[PHI, -1 / PHI, 0],
[-PHI, 1 / PHI, 0],
[-PHI, -1 / PHI, 0],
[1 / PHI, 0, PHI],
[-1 / PHI, 0, PHI],
[1 / PHI, 0, -PHI],
[-1 / PHI, 0, -PHI]
],
[
[0, 8, 4, 17, 16],
[0, 12, 1, 9, 8],
[0, 16, 2, 13, 12],
[4, 8, 9, 5, 14],
[4, 14, 15, 6, 17],
[2, 16, 17, 6, 10],
[2, 10, 11, 3, 13],
[1, 12, 13, 3, 18],
[1, 18, 19, 5, 9],
[3, 11, 7, 19, 18],
[6, 15, 7, 11, 10],
[5, 19, 7, 15, 14]
],
{
corners: {
indices: [0, 1, 2, 3, 4, 5, 6, 7],
method: "scaleFromOrigin"
},
topPentagon: {
indices: [8, 9, 12, 1, 0],
method: "scaleFromCenter"
},
bottomPentagon: {
indices: [10, 11, 13, 2, 3],
method: "scaleFromCenter"
},
middleBand: {
indices: [16, 17, 18, 19, 14, 15],
method: "scaleFromOrigin"
}
}
);
const MEDIAL_RHOMBIC_TRIACONTAHEDRON = new PolyhedronDef(
[
[c[7], 0.0, c[6]],
[c[7], 0.0, -c[6]],
[-c[7], 0.0, c[6]],
[-c[7], 0.0, -c[6]],
[c[6], c[7], 0.0],
[c[6], -c[7], 0.0],
[-c[6], c[7], 0.0],
[-c[6], -c[7], 0.0],
[0.0, c[6], c[7]],
[0.0, c[6], -c[7]],
[0.0, -c[6], c[7]],
[0.0, -c[6], -c[7]],
[c[5], 0.0, c[7]],
[c[5], 0.0, -c[7]],
[-c[5], 0.0, c[7]],
[-c[5], 0.0, -c[7]],
[c[7], c[5], 0.0],
[c[7], -c[5], 0.0],
[-c[7], c[5], 0.0],
[-c[7], -c[5], 0.0],
[0.0, c[7], c[5]],
[0.0, c[7], -c[5]],
[0.0, -c[7], c[5]],
[0.0, -c[7], -c[5]]
],
[
[0, 14, 7, 22],
[0, 22, 11, 17],
[0, 17, 1, 16],
[0, 16, 9, 20],
[0, 20, 6, 14],
[3, 13, 5, 23],
[3, 23, 10, 19],
[3, 19, 2, 18],
[3, 18, 8, 21],
[3, 21, 4, 13],
[1, 15, 6, 21],
[1, 21, 8, 16],
[2, 19, 11, 22],
[2, 22, 5, 12],
[4, 21, 6, 20],
[4, 20, 2, 12],
[5, 13, 9, 16],
[5, 16, 8, 12],
[6, 15, 11, 19],
[6, 19, 10, 14],
[7, 15, 1, 23],
[7, 23, 5, 22],
[8, 18, 7, 14],
[8, 14, 10, 12],
[9, 15, 7, 18],
[9, 18, 2, 20],
[10, 23, 1, 17],
[10, 17, 4, 12],
[11, 15, 9, 13],
[11, 13, 4, 17]
],
{
axialVerts: {
indices: [0, 1, 2, 3, 4, 5, 6, 7],
method: "scaleFromOrigin"
},
medialVerts: {
indices: [8, 9, 10, 11],
method: "scaleFromOrigin"
},
innerVerts: {
indices: [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
method: "scaleFromOrigin"
}
}
);
const TETRAHEDRON = new PolyhedronDef(
[
[1, 1, 1],
[-1, -1, 1],
[-1, 1, -1],
[1, -1, -1]
],
[
[0, 1, 2],
[0, 3, 1],
[0, 2, 3],
[1, 3, 2]
],
{
top: {
indices: [0],
method: "scaleFromOrigin"
},
bottom: {
indices: [1, 2, 3],
method: "scaleFromOrigin"
}
}
);
const TETRAHEMIHEXAHEDRON = new PolyhedronDef(
[
[0.0, 0.0, c[8]],
[0.0, 0.0, -c[8]],
[c[8], 0.0, 0.0],
[-c[8], 0.0, 0.0],
[0.0, c[8], 0.0],
[0.0, -c[8], 0.0]
],
[
[0, 2, 1, 3],
[0, 5, 1, 4],
[2, 4, 3, 5],
[0, 2, 4],
[0, 3, 5],
[1, 2, 5],
[1, 3, 4]
],
{
zAxis: {
indices: [0, 1],
method: "scaleFromOrigin"
},
xAxis: {
indices: [2, 3],
method: "scaleFromOrigin"
},
yAxis: {
indices: [4, 5],
method: "scaleFromOrigin"
}
}
);
const SNUBCUBE = new PolyhedronDef(
[
[c[9], c[10], c[11]],
[c[9], -c[10], -c[11]],
[-c[9], -c[10], c[11]],
[-c[9], c[10], -c[11]],
[c[11], c[9], c[10]],
[c[11], -c[9], -c[10]],
[-c[11], -c[9], c[10]],
[-c[11], c[9], -c[10]],
[c[10], c[11], c[9]],
[c[10], -c[11], -c[12]],
[-c[10], -c[11], c[12]],
[-c[10], c[11], -c[12]],
[c[10], -c[9], c[11]],
[c[10], c[9], -c[11]],
[-c[10], c[9], c[11]],
[-c[10], -c[9], -c[11]],
[c[11], -c[10], c[12]],
[c[11], c[10], -c[12]],
[-c[11], c[10], c[12]],
[-c[11], -c[10], -c[12]],
[c[9], -c[11], c[10]],
[c[9], c[11], -c[10]],
[-c[9], c[11], c[10]],
[-c[9], -c[11], -c[10]]
],
[
[2, 12, 0, 14],
[3, 13, 1, 15],
[4, 16, 5, 17],
[7, 19, 6, 18],
[8, 21, 11, 22],
[9, 20, 10, 23],
[0, 8, 14],
[1, 9, 15],
[2, 10, 12],
[3, 11, 13],
[4, 0, 16],
[5, 1, 17],
[6, 2, 18],
[7, 3, 19],
[8, 4, 21],
[9, 5, 20],
[10, 6, 23],
[11, 7, 22],
[12, 16, 0],
[13, 17, 1],
[14, 18, 2],
[15, 19, 3],
[16, 20, 5],
[17, 21, 4],
[18, 22, 7],
[19, 23, 6],
[20, 12, 10],
[21, 13, 11],
[22, 14, 8],
[23, 15, 9],
[8, 0, 4],
[9, 1, 5],
[10, 2, 6],
[11, 3, 7],
[12, 20, 16],
[13, 21, 17],
[14, 22, 18],
[15, 23, 19]
],
{
zAxis: {
indices: [0, 1],
method: "scaleFromOrigin"
},
xAxis: {
indices: [2, 3],
method: "scaleFromOrigin"
},
yAxis: {
indices: [4, 5],
method: "scaleFromOrigin"
}
}
);
const ICOSIDODECAHEDRON = new PolyhedronDef(
[
[0.0, 0.0, c[13]],
[0.0, 0.0, -c[13]],
[c[13], 0.0, 0.0],
[-c[13], 0.0, 0.0],
[0.0, c[13], 0.0],
[0.0, -c[13], 0.0],
[0.5, c[14], c[15]],
[0.5, c[14], -c[15]],
[0.5, -c[14], c[15]],
[0.5, -c[14], -c[15]],
[-0.5, c[14], c[15]],
[-0.5, c[14], -c[15]],
[-0.5, -c[14], c[15]],
[-0.5, -c[14], -c[15]],
[c[15], 0.5, c[14]],
[c[15], 0.5, -c[14]],
[c[15], -0.5, c[14]],
[c[15], -0.5, -c[14]],
[-c[15], 0.5, c[14]],
[-c[15], 0.5, -c[14]],
[-c[15], -0.5, c[14]],
[-c[15], -0.5, -c[14]],
[c[14], c[15], 0.5],
[c[14], c[15], -0.5],
[c[14], -c[15], 0.5],
[c[14], -c[15], -0.5],
[-c[14], c[15], 0.5],
[-c[14], c[15], -0.5],
[-c[14], -c[15], 0.5],
[-c[14], -c[15], -0.5]
],
[
[0, 8, 16, 14, 6],
[0, 10, 18, 20, 12],
[1, 7, 15, 17, 9],
[1, 13, 21, 19, 11],
[2, 15, 23, 22, 14],
[2, 16, 24, 25, 17],
[3, 18, 26, 27, 19],
[3, 21, 29, 28, 20],
[4, 23, 7, 11, 27],
[4, 26, 10, 6, 22],
[5, 24, 8, 12, 28],
[5, 29, 13, 9, 25],
[0, 6, 10],
[0, 12, 8],
[1, 9, 13],
[1, 11, 7],
[2, 14, 16],
[2, 17, 15],
[3, 19, 21],
[3, 20, 18],
[4, 22, 23],
[4, 27, 26],
[5, 25, 24],
[5, 28, 29],
[6, 14, 22],
[7, 23, 15],
[8, 24, 16],
[9, 17, 25],
[10, 26, 18],
[11, 19, 27],
[12, 20, 28],
[13, 29, 21]
],
{
outerVerts: {
indices: [0, 1, 2, 3, 4, 5],
method: "scaleFromOrigin"
},
middleVerts: {
indices: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21],
method: "scaleFromOrigin"
},
innerVerts: {
indices: [22, 23, 24, 25, 26, 27, 28, 29],
method: "scaleFromOrigin"
}
}
);
const RHOMBIDODECADODECAHEDRON = new PolyhedronDef(
[
[0.190983005625052, 0.0, c[15]],
[0.190983005625052, 0.0, -c[15]],
[-0.190983005625052, 0.0, c[15]],
[-0.190983005625052, 0.0, -c[15]],
[c[15], 0.190983005625052, 0.0],
[c[15], -0.190983005625052, 0.0],
[-c[15], 0.190983005625052, 0.0],
[-c[15], -0.190983005625052, 0.0],
[0.0, c[15], 0.190983005625052],
[0.0, c[15], -0.190983005625052],
[0.0, -c[15], 0.190983005625052],
[0.0, -c[15], -0.190983005625052],
[0.5, 0.5, 1.11803398874989],
[0.5, 0.5, -1.11803398874989],
[0.5, -0.5, 1.11803398874989],
[0.5, -0.5, -1.11803398874989],
[-0.5, 0.5, 1.11803398874989],
[-0.5, 0.5, -1.11803398874989],
[-0.5, -0.5, 1.11803398874989],
[-0.5, -0.5, -1.11803398874989],
[1.11803398874989, 0.5, 0.5],
[1.11803398874989, 0.5, -0.5],
[1.11803398874989, -0.5, 0.5],
[1.11803398874989, -0.5, -0.5],
[-1.11803398874989, 0.5, 0.5],
[-1.11803398874989, 0.5, -0.5],
[-1.11803398874989, -0.5, 0.5],
[-1.11803398874989, -0.5, -0.5],
[0.5, 1.11803398874989, 0.5],
[0.5, 1.11803398874989, -0.5],
[0.5, -1.11803398874989, 0.5],
[0.5, -1.11803398874989, -0.5],
[-0.5, 1.11803398874989, 0.5],
[-0.5, 1.11803398874989, -0.5],
[-0.5, -1.11803398874989, 0.5],
[-0.5, -1.11803398874989, -0.5],
[0.309016994374947, c[14], 1.0],
[0.309016994374947, c[14], -1.0],
[0.309016994374947, -c[14], 1.0],
[0.309016994374947, -c[14], -1.0],
[-0.309016994374947, c[14], 1.0],
[-0.309016994374947, c[14], -1.0],
[-0.309016994374947, -c[14], 1.0],
[-0.309016994374947, -c[14], -1.0],
[1.0, 0.309016994374947, c[14]],
[1.0, 0.309016994374947, -c[14]],
[1.0, -0.309016994374947, c[14]],
[1.0, -0.309016994374947, -c[14]],
[-1.0, 0.309016994374947, c[14]],
[-1.0, 0.309016994374947, -c[14]],
[-1.0, -0.309016994374947, c[14]],
[-1.0, -0.309016994374947, -c[14]],
[c[14], 1.0, 0.309016994374947],
[c[14], 1.0, -0.309016994374947],
[c[14], -1.0, 0.309016994374947],
[c[14], -1.0, -0.309016994374947],
[-c[14], 1.0, 0.309016994374947],
[-c[14], 1.0, -0.309016994374947],
[-c[14], -1.0, 0.309016994374947],
[-c[14], -1.0, -0.309016994374947]
],
[
[0, 40, 24, 26, 42],
[1, 43, 27, 25, 41],
[2, 38, 22, 20, 36],
[3, 37, 21, 23, 39],
[4, 46, 30, 31, 47],
[5, 45, 29, 28, 44],
[6, 51, 35, 34, 50],
[7, 48, 32, 33, 49],
[8, 53, 13, 17, 57],
[9, 56, 16, 12, 52],
[10, 59, 19, 15, 55],
[11, 54, 14, 18, 58],
[0, 46, 12, 14, 44],
[1, 45, 15, 13, 47],
[2, 48, 18, 16, 50],
[3, 51, 17, 19, 49],
[4, 53, 20, 21, 52],
[5, 54, 23, 22, 55],
[6, 56, 25, 24, 57],
[7, 59, 26, 27, 58],
[8, 40, 28, 32, 36],
[9, 37, 33, 29, 41],
[10, 38, 34, 30, 42],
[11, 43, 31, 35, 39],
[0, 42, 30, 46],
[0, 44, 28, 40],
[1, 41, 29, 45],
[1, 47, 31, 43],
[3, 39, 35, 51],
[3, 49, 33, 37],
[5, 44, 14, 54],
[5, 55, 15, 45],
[6, 50, 16, 56],
[6, 57, 17, 51],
[7, 49, 19, 59],
[7, 58, 18, 48],
[8, 36, 20, 53],
[8, 57, 24, 40],
[9, 41, 25, 56],
[9, 52, 21, 37],
[11, 39, 23, 54],
[11, 58, 27, 43],
[12, 16, 18, 14],
[12, 46, 4, 52],
[13, 15, 19, 17],
[13, 53, 4, 47],
[22, 23, 21, 20],
[22, 38, 10, 55],
[26, 24, 25, 27],
[26, 59, 10, 42],
[32, 28, 29, 33],
[32, 48, 2, 36],
[34, 35, 31, 30],
[34, 38, 2, 50]
],
{
outerVerts: {
indices: [4, 5, 6, 7, 8, 9, 10, 11],
method: "scaleFromOrigin"
},
middleVerts: {
indices: [
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35
],
method: "scaleFromOrigin"
},
innerVerts: {
indices: [
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59
],
method: "scaleFromOrigin"
}
}
);
const PENTAKIS_DODECAHEDRON = new PolyhedronDef(
[
[0.0, c[16], 1.0],
[0.0, c[16], -1.0],
[0.0, -c[16], 1.0],
[0.0, -c[16], -1.0],
[1.0, 0.0, c[16]],
[1.0, 0.0, -c[16]],
[-1.0, 0.0, c[16]],
[-1.0, 0.0, -c[16]],
[c[16], 1.0, 0.0],
[c[16], -1.0, 0.0],
[-c[16], 1.0, 0.0],
[-c[16], -1.0, 0.0],
[c[17], 0.0, c[18]],
[c[17], 0.0, -c[18]],
[-c[17], 0.0, c[18]],
[-c[17], 0.0, -c[18]],
[c[18], c[17], 0.0],
[c[18], -c[17], 0.0],
[-c[18], c[17], 0.0],
[-c[18], -c[17], 0.0],
[0.0, c[18], c[17]],
[0.0, c[18], -c[17]],
[0.0, -c[18], c[17]],
[0.0, -c[18], -c[17]],
[c[19], c[19], c[19]],
[c[19], c[19], -c[19]],
[c[19], -c[19], c[19]],
[c[19], -c[19], -c[19]],
[-c[19], c[19], c[19]],
[-c[19], c[19], -c[19]],
[-c[19], -c[19], c[19]],
[-c[19], -c[19], -c[19]]
],
[
[12, 0, 2],
[12, 2, 26],
[12, 26, 4],
[12, 4, 24],
[12, 24, 0],
[13, 3, 1],
[13, 1, 25],
[13, 25, 5],
[13, 5, 27],
[13, 27, 3],
[14, 2, 0],
[14, 0, 28],
[14, 28, 6],
[14, 6, 30],
[14, 30, 2],
[15, 1, 3],
[15, 3, 31],
[15, 31, 7],
[15, 7, 29],
[15, 29, 1],
[16, 4, 5],
[16, 5, 25],
[16, 25, 8],
[16, 8, 24],
[16, 24, 4],
[17, 5, 4],
[17, 4, 26],
[17, 26, 9],
[17, 9, 27],
[17, 27, 5],
[18, 7, 6],
[18, 6, 28],
[18, 28, 10],
[18, 10, 29],
[18, 29, 7],
[19, 6, 7],
[19, 7, 31],
[19, 31, 11],
[19, 11, 30],
[19, 30, 6],
[20, 8, 10],
[20, 10, 28],
[20, 28, 0],
[20, 0, 24],
[20, 24, 8],
[21, 10, 8],
[21, 8, 25],
[21, 25, 1],
[21, 1, 29],
[21, 29, 10],
[22, 11, 9],
[22, 9, 26],
[22, 26, 2],
[22, 2, 30],
[22, 30, 11],
[23, 9, 11],
[23, 11, 31],
[23, 31, 3],
[23, 3, 27],
[23, 27, 9]
],
{
baseVerts: {
indices: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
method: "scaleFromOrigin"
},
outerVerts: {
indices: [
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31
],
method: "scaleFromOrigin"
}
}
);
const RHOMBIC_DODECAHEDRON = new PolyhedronDef(
[
[0.0, 0.0, c[20]],
[0.0, 0.0, -c[20]],
[c[20], 0.0, 0.0],
[-c[20], 0.0, 0.0],
[0.0, c[20], 0.0],
[0.0, -c[20], 0.0],
[c[21], c[21], c[21]],
[c[21], c[21], -c[21]],
[c[21], -c[21], c[21]],
[c[21], -c[21], -c[21]],
[-c[21], c[21], c[21]],
[-c[21], c[21], -c[21]],
[-c[21], -c[21], c[21]],
[-c[21], -c[21], -c[21]]
],
[
[6, 0, 8, 2],
[6, 2, 7, 4],
[6, 4, 10, 0],
[9, 1, 7, 2],
[9, 2, 8, 5],
[9, 5, 13, 1],
[11, 1, 13, 3],
[11, 3, 10, 4],
[11, 4, 7, 1],
[12, 0, 10, 3],
[12, 3, 13, 5],
[12, 5, 8, 0]
],
{
baseVerts: {
indices: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
method: "scaleFromOrigin"
},
outerVerts: {
indices: [12, 13],
method: "scaleFromOrigin"
}
}
);
const SMALL_TRIAMBIC_ICOSAHEDRON = new PolyhedronDef(
[
[0.0, c[22], c[23]],
[0.0, c[22], -c[23]],
[0.0, -c[22], c[23]],
[0.0, -c[22], -c[23]],
[c[23], 0.0, c[22]],
[c[23], 0.0, -c[22]],
[-c[23], 0.0, c[22]],
[-c[23], 0.0, -c[22]],
[c[22], c[23], 0.0],
[c[22], -c[23], 0.0],
[-c[22], c[23], 0.0],
[-c[22], -c[23], 0.0],
[c[16], 0.0, c[19]],
[c[16], 0.0, -c[19]],
[-c[16], 0.0, c[19]],
[-c[16], 0.0, -c[19]],
[c[19], c[16], 0.0],
[c[19], -c[16], 0.0],
[-c[19], c[16], 0.0],
[-c[19], -c[16], 0.0],
[0.0, c[19], c[16]],
[0.0, c[19], -c[16]],
[0.0, -c[19], c[16]],
[0.0, -c[19], -c[16]],
[c[24], c[24], c[24]],
[c[24], c[24], -c[24]],
[c[24], -c[24], c[24]],
[c[24], -c[24], -c[24]],
[-c[24], c[24], c[24]],
[-c[24], c[24], -c[24]],
[-c[24], -c[24], c[24]],
[-c[24], -c[24], -c[24]]
],
[
[12, 0, 14, 30, 22, 26],
[12, 26, 17, 5, 16, 24],
[12, 24, 20, 28, 14, 2],
[12, 2, 22, 9, 17, 4],
[12, 4, 16, 8, 20, 0],
[15, 1, 13, 27, 23, 31],
[15, 31, 19, 6, 18, 29],
[15, 29, 21, 25, 13, 3],
[15, 3, 23, 11, 19, 7],
[15, 7, 18, 10, 21, 1],
[13, 1, 21, 8, 16, 5],
[13, 5, 17, 9, 23, 3],
[13, 25, 16, 4, 17, 27],
[14, 0, 20, 10, 18, 6],
[14, 6, 19, 11, 22, 2],
[14, 28, 18, 7, 19, 30],
[20, 8, 21, 29, 18, 28],
[20, 24, 16, 25, 21, 10],
[22, 11, 23, 27, 17, 26],
[22, 30, 19, 31, 23, 9]
],
{
baseVerts: {
indices: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
method: "scaleFromOrigin"
},
outerVerts: {
indices: [
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31
],
method: "scaleFromOrigin"
}
}
);
const GEODESIC_CUBE_8 = new PolyhedronDef(
[
[0.0, 0.0, c[25]],
[0.0, 0.0, -c[25]],
[c[25], 0.0, 0.0],
[-c[25], 0.0, 0.0],
[0.0, c[25], 0.0],
[0.0, -c[25], 0.0],
[c[26], 0.0, c[27]],
[c[26], 0.0, -c[27]],
[-c[26], 0.0, c[27]],
[-c[26], 0.0, -c[27]],
[c[27], c[26], 0.0],
[c[27], -c[26], 0.0],
[-c[27], c[26], 0.0],
[-c[27], -c[26], 0.0],
[0.0, c[27], c[26]],
[0.0, c[27], -c[26]],
[0.0, -c[27], c[26]],
[0.0, -c[27], -c[26]],
[0.0, c[26], c[27]],
[0.0, c[26], -c[27]],
[0.0, -c[26], c[27]],
[0.0, -c[26], -c[27]],
[c[27], 0.0, c[26]],
[c[27], 0.0, -c[26]],
[-c[27], 0.0, c[26]],
[-c[27], 0.0, -c[26]],
[c[26], c[27], 0.0],
[c[26], -c[27], 0.0],
[-c[26], c[27], 0.0],
[-c[26], -c[27], 0.0],
[c[28], c[28], c[29]],
[c[28], c[28], -c[29]],
[c[28], -c[28], c[29]],
[c[28], -c[28], -c[29]],
[-c[28], c[28], c[29]],
[-c[28], c[28], -c[29]],
[-c[28], -c[28], c[29]],
[-c[28], -c[28], -c[29]],
[c[29], c[28], c[28]],
[c[29], c[28], -c[28]],
[c[29], -c[28], c[28]],
[c[29], -c[28], -c[28]],
[-c[29], c[28], c[28]],
[-c[29], c[28], -c[28]],
[-c[29], -c[28], c[28]],
[-c[29], -c[28], -c[28]],
[c[28], c[29], c[28]],
[c[28], c[29], -c[28]],
[c[28], -c[29], c[28]],
[c[28], -c[29], -c[28]],
[-c[28], c[29], c[28]],
[-c[28], c[29], -c[28]],
[-c[28], -c[29], c[28]],
[-c[28], -c[29], -c[28]],
[c[30], 0.0, c[30]],
[c[30], 0.0, -c[30]],
[-c[30], 0.0, c[30]],
[-c[30], 0.0, -c[30]],
[c[30], c[30], 0.0],
[c[30], -c[30], 0.0],
[-c[30], c[30], 0.0],
[-c[30], -c[30], 0.0],
[0.0, c[30], c[30]],
[0.0, c[30], -c[30]],
[0.0, -c[30], c[30]],
[0.0, -c[30], -c[30]],
[c[31], c[32], c[31]],
[c[31], c[32], -c[31]],
[c[31], -c[32], c[31]],
[c[31], -c[32], -c[31]],
[-c[31], c[32], c[31]],
[-c[31], c[32], -c[31]],
[-c[31], -c[32], c[31]],
[-c[31], -c[32], -c[31]],
[c[31], c[31], c[32]],
[c[31], c[31], -c[32]],
[c[31], -c[31], c[32]],
[c[31], -c[31], -c[32]],
[-c[31], c[31], c[32]],
[-c[31], c[31], -c[32]],
[-c[31], -c[31], c[32]],
[-c[31], -c[31], -c[32]],
[c[32], c[31], c[31]],
[c[32], c[31], -c[31]],
[c[32], -c[31], c[31]],
[c[32], -c[31], -c[31]],
[-c[32], c[31], c[31]],
[-c[32], c[31], -c[31]],
[-c[32], -c[31], c[31]],
[-c[32], -c[31], -c[31]],
[c[33], c[33], c[33]],
[c[33], c[33], -c[33]],
[c[33], -c[33], c[33]],
[c[33], -c[33], -c[33]],
[-c[33], c[33], c[33]],
[-c[33], c[33], -c[33]],
[-c[33], -c[33], c[33]],
[-c[33], -c[33], -c[33]]
],
[
[0, 6, 30, 18],
[0, 18, 34, 8],
[0, 8, 36, 20],
[0, 20, 32, 6],
[1, 7, 33, 21],
[1, 21, 37, 9],
[1, 9, 35, 19],
[1, 19, 31, 7],
[2, 10, 38, 22],
[2, 22, 40, 11],
[2, 11, 41, 23],
[2, 23, 39, 10],
[3, 12, 43, 25],
[3, 25, 45, 13],
[3, 13, 44, 24],
[3, 24, 42, 12],
[4, 14, 46, 26],
[4, 26, 47, 15],
[4, 15, 51, 28],
[4, 28, 50, 14],
[5, 16, 52, 29],
[5, 29, 53, 17],
[5, 17, 49, 27],
[5, 27, 48, 16],
[54, 6, 32, 68],
[54, 68, 40, 22],
[54, 22, 38, 66],
[54, 66, 30, 6],
[55, 7, 31, 67],
[55, 67, 39, 23],
[55, 23, 41, 69],
[55, 69, 33, 7],
[56, 8, 34, 70],
[56, 70, 42, 24],
[56, 24, 44, 72],
[56, 72, 36, 8],
[57, 9, 37, 73],
[57, 73, 45, 25],
[57, 25, 43, 71],
[57, 71, 35, 9],
[58, 10, 39, 75],
[58, 75, 47, 26],
[58, 26, 46, 74],
[58, 74, 38, 10],
[59, 11, 40, 76],
[59, 76, 48, 27],
[59, 27, 49, 77],
[59, 77, 41, 11],
[60, 12, 42, 78],
[60, 78, 50, 28],
[60, 28, 51, 79],
[60, 79, 43, 12],
[61, 13, 45, 81],
[61, 81, 53, 29],
[61, 29, 52, 80],
[61, 80, 44, 13],
[62, 14, 50, 86],
[62, 86, 34, 18],
[62, 18, 30, 82],
[62, 82, 46, 14],
[63, 15, 47, 83],
[63, 83, 31, 19],
[63, 19, 35, 87],
[63, 87, 51, 15],
[64, 16, 48, 84],
[64, 84, 32, 20],
[64, 20, 36, 88],
[64, 88, 52, 16],
[65, 17, 53, 89],
[65, 89, 37, 21],
[65, 21, 33, 85],
[65, 85, 49, 17],
[90, 66, 38, 74],
[90, 74, 46, 82],
[90, 82, 30, 66],
[91, 67, 31, 83],
[91, 83, 47, 75],
[91, 75, 39, 67],
[92, 68, 32, 84],
[92, 84, 48, 76],
[92, 76, 40, 68],
[93, 69, 41, 77],
[93, 77, 49, 85],
[93, 85, 33, 69],
[94, 70, 34, 86],
[94, 86, 50, 78],
[94, 78, 42, 70],
[95, 71, 43, 79],
[95, 79, 51, 87],
[95, 87, 35, 71],
[96, 72, 44, 80],
[96, 80, 52, 88],
[96, 88, 36, 72],
[97, 73, 37, 89],
[97, 89, 53, 81],
[97, 81, 45, 73]
],
{
baseVerts: {
indices: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
method: "scaleFromOrigin"
},
outerVerts: {
indices: [
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97
],
method: "scaleFromOrigin"
}
}
);
const RECTIFIED_RHOMBICOSIDODECAHEDRON = new PolyhedronDef(
[
[1.0, 0.0, c[34]],
[1.0, 0.0, -c[34]],
[-1.0, 0.0, c[34]],
[-1.0, 0.0, -c[34]],
[c[34], 1.0, 0.0],
[c[34], -1.0, 0.0],
[-c[34], 1.0, 0.0],
[-c[34], -1.0, 0.0],
[0.0, c[34], 1.0],
[0.0, c[34], -1.0],
[0.0, -c[34], 1.0],
[0.0, -c[34], -1.0],
[0.0, 1.0, c[34]],
[0.0, 1.0, -c[34]],
[0.0, -1.0, c[34]],
[0.0, -1.0, -c[34]],
[c[34], 0.0, 1.0],
[c[34], 0.0, -1.0],
[-c[34], 0.0, 1.0],
[-c[34], 0.0, -1.0],
[1.0, c[34], 0.0],
[1.0, -c[34], 0.0],
[-1.0, c[34], 0.0],
[-1.0, -c[34], 0.0],
[0.5, c[35], c[36]],
[0.5, c[35], -c[36]],
[0.5, -c[35], c[36]],
[0.5, -c[35], -c[36]],
[-0.5, c[35], c[36]],
[-0.5, c[35], -c[36]],
[-0.5, -c[35], c[36]],
[-0.5, -c[35], -c[36]],
[c[36], 0.5, c[35]],
[c[36], 0.5, -c[35]],
[c[36], -0.5, c[35]],
[c[36], -0.5, -c[35]],
[-c[36], 0.5, c[35]],
[-c[36], 0.5, -c[35]],
[-c[36], -0.5, c[35]],
[-c[36], -0.5, -c[35]],
[c[35], c[36], 0.5],
[c[35], c[36], -0.5],
[c[35], -c[36], 0.5],
[c[35], -c[36], -0.5],
[-c[35], c[36], 0.5],
[-c[35], c[36], -0.5],
[-c[35], -c[36], 0.5],
[-c[35], -c[36], -0.5],
[c[35], c[15], c[37]],
[c[35], c[15], -c[37]],
[c[35], -c[15], c[37]],
[c[35], -c[15], -c[37]],
[-c[35], c[15], c[37]],
[-c[35], c[15], -c[37]],
[-c[35], -c[15], c[37]],
[-c[35], -c[15], -c[37]],
[c[37], c[35], c[15]],
[c[37], c[35], -c[15]],
[c[37], -c[35], c[15]],
[c[37], -c[35], -c[15]],
[-c[37], c[35], c[15]],
[-c[37], c[35], -c[15]],
[-c[37], -c[35], c[15]],
[-c[37], -c[35], -c[15]],
[c[15], c[37], c[35]],
[c[15], c[37], -c[35]],
[c[15], -c[37], c[35]],
[c[15], -c[37], -c[35]],
[-c[15], c[37], c[35]],
[-c[15], c[37], -c[35]],
[-c[15], -c[37], c[35]],
[-c[15], -c[37], -c[35]],
[c[14], c[38], c[39]],
[c[14], c[38], -c[39]],
[c[14], -c[38], c[39]],
[c[14], -c[38], -c[39]],
[-c[14], c[38], c[39]],
[-c[14], c[38], -c[39]],
[-c[14], -c[38], c[39]],
[-c[14], -c[38], -c[39]],
[c[39], c[14], c[38]],
[c[39], c[14], -c[38]],
[c[39], -c[14], c[38]],
[c[39], -c[14], -c[38]],
[-c[39], c[14], c[38]],
[-c[39], c[14], -c[38]],
[-c[39], -c[14], c[38]],
[-c[39], -c[14], -c[38]],
[c[38], c[39], c[14]],
[c[38], c[39], -c[14]],
[c[38], -c[39], c[14]],
[c[38], -c[39], -c[14]],
[-c[38], c[39], c[14]],
[-c[38], c[39], -c[14]],
[-c[38], -c[39], c[14]],
[-c[38], -c[39], -c[14]],
[c[40], c[41], c[38]],
[c[40], c[41], -c[38]],
[c[40], -c[41], c[38]],
[c[40], -c[41], -c[38]],
[-c[40], c[41], c[38]],
[-c[40], c[41], -c[38]],
[-c[40], -c[41], c[38]],
[-c[40], -c[41], -c[38]],
[c[38], c[40], c[41]],
[c[38], c[40], -c[41]],
[c[38], -c[40], c[41]],
[c[38], -c[40], -c[41]],
[-c[38], c[40], c[41]],
[-c[38], c[40], -c[41]],
[-c[38], -c[40], c[41]],
[-c[38], -c[40], -c[41]],
[c[41], c[38], c[40]],
[c[41], c[38], -c[40]],
[c[41], -c[38], c[40]],
[c[41], -c[38], -c[40]],
[-c[41], c[38], c[40]],
[-c[41], c[38], -c[40]],
[-c[41], -c[38], c[40]],
[-c[41], -c[38], -c[40]]
],
[
[0, 50, 82, 80, 48],
[1, 49, 81, 83, 51],
[2, 52, 84, 86, 54],
[3, 55, 87, 85, 53],
[4, 57, 89, 88, 56],
[5, 58, 90, 91, 59],
[6, 60, 92, 93, 61],
[7, 63, 95, 94, 62],
[8, 68, 76, 72, 64],
[9, 65, 73, 77, 69],
[10, 66, 74, 78, 70],
[11, 71, 79, 75, 67],
[0, 12, 2, 14],
[1, 15, 3, 13],
[4, 16, 5, 17],
[6, 19, 7, 18],
[8, 20, 9, 22],
[10, 23, 11, 21],
[24, 48, 96, 72],
[25, 73, 97, 49],
[26, 74, 98, 50],
[27, 51, 99, 75],
[28, 76, 100, 52],
[29, 53, 101, 77],
[30, 54, 102, 78],
[31, 79, 103, 55],
[32, 56, 104, 80],
[33, 81, 105, 57],
[34, 82, 106, 58],
[35, 59, 107, 83],
[36, 84, 108, 60],
[37, 61, 109, 85],
[38, 62, 110, 86],
[39, 87, 111, 63],
[40, 64, 112, 88],
[41, 89, 113, 65],
[42, 90, 114, 66],
[43, 67, 115, 91],
[44, 92, 116, 68],
[45, 69, 117, 93],
[46, 70, 118, 94],
[47, 95, 119, 71],
[0, 14, 26, 50],
[0, 48, 24, 12],
[1, 13, 25, 49],
[1, 51, 27, 15],
[2, 12, 28, 52],
[2, 54, 30, 14],
[3, 15, 31, 55],
[3, 53, 29, 13],
[4, 17, 33, 57],
[4, 56, 32, 16],
[5, 16, 34, 58],
[5, 59, 35, 17],
[6, 18, 36, 60],
[6, 61, 37, 19],
[7, 19, 39, 63],
[7, 62, 38, 18],
[8, 22, 44, 68],
[8, 64, 40, 20],
[9, 20, 41, 65],
[9, 69, 45, 22],
[10, 21, 42, 66],
[10, 70, 46, 23],
[11, 23, 47, 71],
[11, 67, 43, 21],
[24, 72, 76, 28],
[25, 29, 77, 73],
[26, 30, 78, 74],
[27, 75, 79, 31],
[32, 80, 82, 34],
[33, 35, 83, 81],
[36, 38, 86, 84],
[37, 85, 87, 39],
[40, 88, 89, 41],
[42, 43, 91, 90],
[44, 45, 93, 92],
[46, 94, 95, 47],
[48, 80, 104, 96],
[49, 97, 105, 81],
[50, 98, 106, 82],
[51, 83, 107, 99],
[52, 100, 108, 84],
[53, 85, 109, 101],
[54, 86, 110, 102],
[55, 103, 111, 87],
[56, 88, 112, 104],
[57, 105, 113, 89],
[58, 106, 114, 90],
[59, 91, 115, 107],
[60, 108, 116, 92],
[61, 93, 117, 109],
[62, 94, 118, 110],
[63, 111, 119, 95],
[64, 72, 96, 112],
[65, 113, 97, 73],
[66, 114, 98, 74],
[67, 75, 99, 115],
[68, 116, 100, 76],
[69, 77, 101, 117],
[70, 78, 102, 118],
[71, 119, 103, 79],
[12, 24, 28],
[13, 29, 25],
[14, 30, 26],
[15, 27, 31],
[16, 32, 34],
[17, 35, 33],
[18, 38, 36],
[19, 37, 39],
[20, 40, 41],
[21, 43, 42],
[22, 45, 44],
[23, 46, 47],
[96, 104, 112],
[97, 113, 105],
[98, 114, 106],
[99, 107, 115],
[100, 116, 108],
[101, 109, 117],
[102, 110, 118],
[103, 119, 111]
],
{
baseVerts: {
indices: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
method: "scaleFromOrigin"
},
outerVerts: {
indices: [
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
100,
101,
102,
103,
104,
105,
106,
107,
108,
109,
110,
111,
112,
113,
114,
115,
116,
117,
118,
119
],
method: "scaleFromOrigin"
}
}
);
const DELTOIDAL_HEXECONTAHEDRON = new PolyhedronDef(
[
[0.0, 0.0, c[42]],
[0.0, 0.0, -c[42]],
[c[42], 0.0, 0.0],
[-c[42], 0.0, 0.0],
[0.0, c[42], 0.0],
[0.0, -c[42], 0.0],
[0.0, c[43], c[44]],
[0.0, c[43], -c[44]],
[0.0, -c[43], c[44]],
[0.0, -c[43], -c[44]],
[c[44], 0.0, c[43]],
[c[44], 0.0, -c[43]],
[-c[44], 0.0, c[43]],
[-c[44], 0.0, -c[43]],
[c[43], c[44], 0.0],
[c[43], -c[44], 0.0],
[-c[43], c[44], 0.0],
[-c[43], -c[44], 0.0],
[c[45], 0.0, c[46]],
[c[45], 0.0, -c[46]],
[-c[45], 0.0, c[46]],
[-c[45], 0.0, -c[46]],
[c[46], c[45], 0.0],
[c[46], -c[45], 0.0],
[-c[46], c[45], 0.0],
[-c[46], -c[45], 0.0],
[0.0, c[46], c[45]],
[0.0, c[46], -c[45]],
[0.0, -c[46], c[45]],
[0.0, -c[46], -c[45]],
[c[47], c[48], c[49]],
[c[47], c[48], -c[49]],
[c[47], -c[48], c[49]],
[c[47], -c[48], -c[49]],
[-c[47], c[48], c[49]],
[-c[47], c[48], -c[49]],
[-c[47], -c[48], c[49]],
[-c[47], -c[48], -c[49]],
[c[49], c[47], c[48]],
[c[49], c[47], -c[48]],
[c[49], -c[47], c[48]],
[c[49], -c[47], -c[48]],
[-c[49], c[47], c[48]],
[-c[49], c[47], -c[48]],
[-c[49], -c[47], c[48]],
[-c[49], -c[47], -c[48]],
[c[48], c[49], c[47]],
[c[48], c[49], -c[47]],
[c[48], -c[49], c[47]],
[c[48], -c[49], -c[47]],
[-c[48], c[49], c[47]],
[-c[48], c[49], -c[47]],
[-c[48], -c[49], c[47]],
[-c[48], -c[49], -c[47]],
[c[50], c[50], c[50]],
[c[50], c[50], -c[50]],
[c[50], -c[50], c[50]],
[c[50], -c[50], -c[50]],
[-c[50], c[50], c[50]],
[-c[50], c[50], -c[50]],
[-c[50], -c[50], c[50]],
[-c[50], -c[50], -c[50]]
],
[
[18, 0, 8, 32],
[18, 32, 56, 40],
[18, 40, 10, 38],
[18, 38, 54, 30],
[18, 30, 6, 0],
[19, 1, 7, 31],
[19, 31, 55, 39],
[19, 39, 11, 41],
[19, 41, 57, 33],
[19, 33, 9, 1],
[20, 0, 6, 34],
[20, 34, 58, 42],
[20, 42, 12, 44],
[20, 44, 60, 36],
[20, 36, 8, 0],
[21, 1, 9, 37],
[21, 37, 61, 45],
[21, 45, 13, 43],
[21, 43, 59, 35],
[21, 35, 7, 1],
[22, 2, 11, 39],
[22, 39, 55, 47],
[22, 47, 14, 46],
[22, 46, 54, 38],
[22, 38, 10, 2],
[23, 2, 10, 40],
[23, 40, 56, 48],
[23, 48, 15, 49],
[23, 49, 57, 41],
[23, 41, 11, 2],
[24, 3, 12, 42],
[24, 42, 58, 50],
[24, 50, 16, 51],
[24, 51, 59, 43],
[24, 43, 13, 3],
[25, 3, 13, 45],
[25, 45, 61, 53],
[25, 53, 17, 52],
[25, 52, 60, 44],
[25, 44, 12, 3],
[26, 4, 16, 50],
[26, 50, 58, 34],
[26, 34, 6, 30],
[26, 30, 54, 46],
[26, 46, 14, 4],
[27, 4, 14, 47],
[27, 47, 55, 31],
[27, 31, 7, 35],
[27, 35, 59, 51],
[27, 51, 16, 4],
[28, 5, 15, 48],
[28, 48, 56, 32],
[28, 32, 8, 36],
[28, 36, 60, 52],
[28, 52, 17, 5],
[29, 5, 17, 53],
[29, 53, 61, 37],
[29, 37, 9, 33],
[29, 33, 57, 49],
[29, 49, 15, 5]
],
{
baseVerts: {
indices: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
method: "scaleFromOrigin"
},
outerVerts: {
indices: [
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61
],
method: "scaleFromOrigin"
}
}
);
function dodecicosacron(
radius = 100,
stellation1 = 1,
stellation2 = stellation1
) {
drawPolyhedron(DODECICOSACRON, 0, 0, radius, stellation1, stellation2);
}
function octahedron(
radius = 100,
horizontalScale = 1,
verticalScale = 1,
depthScale = 1
) {
drawPolyhedron(
OCTAHEDRON,
0,
0,
radius,
horizontalScale,
verticalScale,
depthScale
);
}
function icosahedron(radius = 100, peakScale = 1, equatorScale = 1) {
drawPolyhedron(ICOSAHEDRON, 0, 0, radius, peakScale, equatorScale);
}
function dodecahedron(radius = 100, cornerScale = 1, middleScale = 1) {
drawPolyhedron(DODECAHEDRON, 0, 0, radius, cornerScale, middleScale);
}
function medialRhombicTriacontahedron(
radius = 100,
axialScale = 1,
medialScale = 1,
innerScale = 1
) {
drawPolyhedron(
MEDIAL_RHOMBIC_TRIACONTAHEDRON,
0,
0,
radius,
axialScale,
medialScale,
innerScale
);
}
function tetrahedron(radius = 100, topScale = 1, bottomScale = 1) {
drawPolyhedron(TETRAHEDRON, 0, 0, radius, topScale, bottomScale);
}
function tetrahemihexahedron(radius = 100, zScale = 1, xScale = 1, yScale = 1) {
drawPolyhedron(TETRAHEMIHEXAHEDRON, 0, 0, radius, zScale, xScale, yScale);
}
function snubCube(radius = 100, zScale = 1, xScale = 1, yScale = 1) {
drawPolyhedron(SNUBCUBE, 0, 0, radius, zScale, xScale, yScale);
}
function icosidodecahedron(
radius = 100,
stellation1 = 1,
stellation2 = stellation1
) {
drawPolyhedron(ICOSIDODECAHEDRON, 0, 0, radius, stellation1, stellation2);
}
function rhombidodecadodecahedron(
radius = 100,
stellation1 = 1,
stellation2 = stellation1
) {
drawPolyhedron(
RHOMBIDODECADODECAHEDRON,
0,
0,
radius,
stellation1,
stellation2
);
}
function pentakisDodecahedron(radius = 100, scale1 = 1, scale2 = scale1) {
drawPolyhedron(PENTAKIS_DODECAHEDRON, 0, 0, radius, scale1, scale2);
}
function rhombicDodecahedron(radius = 100, scale1 = 1, scale2 = scale1) {
drawPolyhedron(RHOMBIC_DODECAHEDRON, 0, 0, radius, scale1, scale2);
}
function smallTriambicIcosahedron(radius = 100, scale1 = 1, scale2 = scale1) {
drawPolyhedron(SMALL_TRIAMBIC_ICOSAHEDRON, 0, 0, radius, scale1, scale2);
}
function geodesicCube8(radius = 100, scale1 = 1, scale2 = scale1) {
drawPolyhedron(GEODESIC_CUBE_8, 0, 0, radius, scale1, scale2);
}
function rectifiedRhombicosidodecahedron(
radius = 100,
scale1 = 1,
scale2 = scale1
) {
drawPolyhedron(
RECTIFIED_RHOMBICOSIDODECAHEDRON,
0,
0,
radius,
scale1,
scale2
);
}
function deltoidalHexecontahedron(radius = 100, scale1 = 1, scale2 = scale1) {
drawPolyhedron(DELTOIDAL_HEXECONTAHEDRON, 0, 0, radius, scale1, scale2);
}
let r, t;
function setup() {
createCanvas(400, 400, WEBGL);
r = 30;
}
function draw() {
blueprint("#4c6160", "#7ebdba", color(245, 235, 223, 250));
t = frameCount / 50;
orbitControl();
s = 80;
push();
translate(-width / 2 + s, -height / 2 + s);
rot();
dodecicosacron(r, 1);
pop();
push();
translate(-width / 2 + s + width / 5, -height / 2 + s);
rot();
octahedron(r, 0.75, 0.85, 1);
pop();
push();
translate(-width / 2 + s + (2 * width) / 5, -height / 2 + s);
rot();
icosahedron(r, 0.95, 1);
pop();
push();
translate(-width / 2 + s + (3 * width) / 5, -height / 2 + s);
rot();
dodecahedron(r * 0.9, 1, 1);
pop();
push();
translate(-width / 2 + s, -height / 2 + s * 2);
rot();
medialRhombicTriacontahedron(r * 0.9, 1, 1, 1);
pop();
push();
translate(-width / 2 + s + width / 5, -height / 2 + s * 2);
rot();
tetrahedron(r, 1, 1.2);
pop();
push();
translate(-width / 2 + s + (2 * width) / 5, -height / 2 + s * 2);
rot();
tetrahemihexahedron(r, 1, 1.2, 1);
pop();
push();
translate(-width / 2 + s + (3 * width) / 5, -height / 2 + s * 2);
rot();
snubCube(r, 1, 1, 1);
pop();
push();
translate(-width / 2 + s + (0 * width) / 5, -height / 2 + s * 3);
rot();
icosidodecahedron(r, 1);
pop();
push();
translate(-width / 2 + s + (1 * width) / 5, -height / 2 + s * 3);
rot();
rhombidodecadodecahedron(r, 1);
pop();
push();
translate(-width / 2 + s + (2 * width) / 5, -height / 2 + s * 3);
rot();
pentakisDodecahedron(r, 1, 1);
pop();
push();
translate(-width / 2 + s + (3 * width) / 5, -height / 2 + s * 3);
rot();
rhombicDodecahedron(r, 1, 1);
pop();
push();
translate(-width / 2 + s + (0 * width) / 5, -height / 2 + s * 4);
rot();
smallTriambicIcosahedron(r, 1, 1);
pop();
push();
translate(-width / 2 + s + (1 * width) / 5, -height / 2 + s * 4);
rot();
geodesicCube8(r, 1, 1);
pop();
push();
translate(-width / 2 + s + (2 * width) / 5, -height / 2 + s * 4);
rot();
rectifiedRhombicosidodecahedron(r, 1, 1);
pop();
push();
translate(-width / 2 + s + (3 * width) / 5, -height / 2 + s * 4);
rot();
deltoidalHexecontahedron(r, 1, 1);
pop();
}
function rot() {
rotateX(-t);
rotateY(t / 2);
}