From 029e6f3161a1509262331863a846a9552874c904 Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Wed, 1 Nov 2023 11:49:42 +1100 Subject: [PATCH] Added 600-cell and 120-cell --- polytopes.js | 78 +++++++++++++--------------------------------------- 1 file changed, 19 insertions(+), 59 deletions(-) diff --git a/polytopes.js b/polytopes.js index 986d0f4..a28b2c5 100644 --- a/polytopes.js +++ b/polytopes.js @@ -393,28 +393,6 @@ function link_labels(nodes, link) { -export const cell120 = () => { - const nodes = make_120cell_vertices(); - const links = auto_detect_edges(nodes, 4); - - label_120cell(nodes); - - return { - name: '120-cell', - nodes: nodes, - links: links, - geometry: { - node_size: 0.02, - link_size: 0.02 - }, - base: {}, - options: [ - [ 'One inscribed 600-cell', {} ], - [ 'All inscribed 600-cells', {} ], - ] - } -} - export const cell120_layered = (max) => { const nodes = make_120cell_vertices(); const links = auto_detect_edges(nodes, 4); @@ -453,7 +431,7 @@ export const cell120_inscribed = () => { } return { - name: '120-cell inscribed', + name: '120-cell', nodes: nodes, links: links, geometry: { @@ -462,14 +440,12 @@ export const cell120_inscribed = () => { }, options: [ { name: "none", links: [ 0 ]}, - { name: "one", links: [ 0, 1 ] }, - { name: "all", links: [ 0, 1, 2, 3, 4, 5 ] } + { name: "one inscribed 600-cell", links: [ 0, 1 ] }, + { name: "five inscribed 600-cells", links: [ 0, 1, 2, 3, 4, 5 ] } ] } } -// export const cell120_inscribed = () => cell120_some_inscribed([1]); -// export const cell120_all_inscribed = () => cell120_some_inscribed([1,2,3,4,5]); // Schoute's partition via https://arxiv.org/abs/1010.4353 @@ -647,48 +623,31 @@ export const cell600 = () => { const nodes = make_600cell_vertices(); const links = auto_detect_edges(nodes, 12); + links.map((l) => l.label = 0); + + for( const p of [1, 2, 3, 4, 5]) { + const nodes24 = nodes.filter((n) => n.label === p); + const links24 = auto_detect_edges(nodes24, 8); + links24.map((l) => l.label = p); + links.push(...links24); + } + return { + name: '600-cell', nodes: nodes, links: links, - geometry: { - node_size: 0.02, - link_size: 0.02 - } - } -} - - - -const cell600_some_inscribed = (ps) => { - const nodes = make_600cell_vertices(); - const links = auto_detect_edges(nodes, 12); - - const all_links = links; - all_links.map((l) => l.label = 0); - - for( const p of ps) { - const nodes24 = nodes.filter((n) => n.label === p); - const links24 = auto_detect_edges(nodes24, 8); - links24.map((l) => l.label = p); - all_links.push(...links24); - } - - return { - nodes: nodes, - links: all_links, geometry: { node_size: 0.02, link_size: 0.02 }, + options: [ + { name: "none", links: [ 0 ]}, + { name: "one 24-cell", links: [ 0, 1 ] }, + { name: "five 24-cells", links: [ 0, 1, 2, 3, 4, 5 ] } + ] } } - -export const cell600_inscribed = () => cell600_some_inscribed([1]); -export const cell600_all_inscribed = () => cell600_some_inscribed([1,2,3,4,5]); - - - function make_dodecahedron_vertices() { const phi = 0.5 * (1 + Math.sqrt(5)); const phiinv = 1 / phi; @@ -771,6 +730,7 @@ export const build_all = () => { cell16(), tesseract(), cell24(), + cell600(), cell120_inscribed() ]; } \ No newline at end of file