From 301609fd414c34b913517f1af6175494efb7386a Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Sat, 7 Feb 2026 17:56:29 +1100 Subject: [PATCH] Applied the new colour scheme to the 120-cell / 5-cell partition --- cellindex.js | 1223 +++++++++++++++++++++++++++++++++++- colours.js | 4 +- label_inscribed_600cell.js | 49 +- polytopes.js | 47 +- 4 files changed, 1275 insertions(+), 48 deletions(-) diff --git a/cellindex.js b/cellindex.js index 8288e71..40f30f9 100644 --- a/cellindex.js +++ b/cellindex.js @@ -233,11 +233,1214 @@ export const CELL600_METAMAP = { 600: 10, }; + export const CELL120_CELL5 = { - "tetras": { - }, - "cell5s": { - "1": [ + "1": { + "nodes": [ + 27, + 28, + 264, + 309, + 275 + ], + "label": 1 + }, + "2": { + "nodes": [ + 223, + 76, + 238, + 84, + 225 + ], + "label": 2 + }, + "3": { + "nodes": [ + 253, + 44, + 283, + 304, + 42 + ], + "label": 4 + }, + "4": { + "nodes": [ + 419, + 112, + 197, + 578, + 521 + ], + "label": 3 + }, + "5": { + "nodes": [ + 339, + 14, + 384, + 382, + 337 + ], + "label": 4 + }, + "6": { + "nodes": [ + 331, + 4, + 335, + 390, + 386 + ], + "label": 5 + }, + "7": { + "nodes": [ + 427, + 160, + 551, + 146, + 557 + ], + "label": 2 + }, + "8": { + "nodes": [ + 265, + 60, + 64, + 295, + 246 + ], + "label": 5 + }, + "9": { + "nodes": [ + 473, + 100, + 495, + 213, + 462 + ], + "label": 3 + }, + "10": { + "nodes": [ + 393, + 6, + 328, + 397, + 326 + ], + "label": 2 + }, + "11": { + "nodes": [ + 539, + 164, + 439, + 561, + 142 + ], + "label": 4 + }, + "12": { + "nodes": [ + 511, + 122, + 456, + 595, + 181 + ], + "label": 3 + }, + "13": { + "nodes": [ + 555, + 154, + 152, + 545, + 429 + ], + "label": 5 + }, + "14": { + "nodes": [ + 95, + 202, + 486, + 500, + 465 + ], + "label": 5 + }, + "15": { + "nodes": [ + 471, + 208, + 502, + 484, + 89 + ], + "label": 1 + }, + "16": { + "nodes": [ + 347, + 21, + 348, + 374, + 373 + ], + "label": 4 + }, + "17": { + "nodes": [ + 487, + 203, + 94, + 468, + 497 + ], + "label": 3 + }, + "18": { + "nodes": [ + 165, + 139, + 542, + 568, + 434 + ], + "label": 1 + }, + "19": { + "nodes": [ + 367, + 18, + 355, + 368, + 353 + ], + "label": 5 + }, + "20": { + "nodes": [ + 231, + 78, + 86, + 236, + 217 + ], + "label": 2 + }, + "21": { + "nodes": [ + 356, + 17, + 366, + 354, + 365 + ], + "label": 3 + }, + "22": { + "nodes": [ + 503, + 205, + 470, + 92, + 481 + ], + "label": 4 + }, + "23": { + "nodes": [ + 527, + 106, + 584, + 195, + 421 + ], + "label": 1 + }, + "24": { + "nodes": [ + 239, + 73, + 222, + 228, + 81 + ], + "label": 1 + }, + "25": { + "nodes": [ + 543, + 138, + 168, + 435, + 565 + ], + "label": 2 + }, + "26": { + "nodes": [ + 48, + 46, + 302, + 281, + 255 + ], + "label": 4 + }, + "27": { + "nodes": [ + 248, + 62, + 293, + 58, + 267 + ], + "label": 1 + }, + "28": { + "nodes": [ + 440, + 141, + 562, + 540, + 163 + ], + "label": 5 + }, + "29": { + "nodes": [ + 274, + 30, + 312, + 261, + 29 + ], + "label": 3 + }, + "30": { + "nodes": [ + 179, + 128, + 597, + 450, + 505 + ], + "label": 5 + }, + "31": { + "nodes": [ + 376, + 22, + 375, + 346, + 345 + ], + "label": 3 + }, + "32": { + "nodes": [ + 320, + 11, + 405, + 401, + 319 + ], + "label": 2 + }, + "33": { + "nodes": [ + 448, + 173, + 130, + 587, + 519 + ], + "label": 1 + }, + "34": { + "nodes": [ + 460, + 102, + 211, + 489, + 479 + ], + "label": 5 + }, + "35": { + "nodes": [ + 388, + 2, + 392, + 329, + 333 + ], + "label": 2 + }, + "36": { + "nodes": [ + 512, + 182, + 596, + 121, + 455 + ], + "label": 3 + }, + "37": { + "nodes": [ + 592, + 170, + 516, + 443, + 133 + ], + "label": 5 + }, + "38": { + "nodes": [ + 120, + 189, + 529, + 570, + 411 + ], + "label": 4 + }, + "39": { + "nodes": [ + 420, + 198, + 577, + 522, + 111 + ], + "label": 3 + }, + "40": { + "nodes": [ + 272, + 69, + 65, + 290, + 243 + ], + "label": 5 + }, + "41": { + "nodes": [ + 488, + 93, + 498, + 204, + 467 + ], + "label": 3 + }, + "42": { + "nodes": [ + 156, + 150, + 547, + 553, + 431 + ], + "label": 1 + }, + "43": { + "nodes": [ + 252, + 53, + 286, + 297, + 55 + ], + "label": 4 + }, + "44": { + "nodes": [ + 532, + 192, + 117, + 410, + 571 + ], + "label": 2 + }, + "45": { + "nodes": [ + 400, + 7, + 321, + 396, + 323 + ], + "label": 2 + }, + "46": { + "nodes": [ + 580, + 199, + 417, + 110, + 523 + ], + "label": 1 + }, + "47": { + "nodes": [ + 296, + 63, + 245, + 266, + 59 + ], + "label": 5 + }, + "48": { + "nodes": [ + 600, + 125, + 178, + 508, + 451 + ], + "label": 1 + }, + "49": { + "nodes": [ + 68, + 72, + 269, + 242, + 291 + ], + "label": 5 + }, + "50": { + "nodes": [ + 324, + 8, + 399, + 322, + 395 + ], + "label": 4 + }, + "51": { + "nodes": [ + 499, + 96, + 485, + 466, + 201 + ], + "label": 1 + }, + "52": { + "nodes": [ + 406, + 12, + 317, + 318, + 402 + ], + "label": 3 + }, + "53": { + "nodes": [ + 563, + 144, + 437, + 162, + 537 + ], + "label": 4 + }, + "54": { + "nodes": [ + 234, + 88, + 219, + 229, + 80 + ], + "label": 1 + }, + "55": { + "nodes": [ + 350, + 24, + 349, + 371, + 372 + ], + "label": 4 + }, + "56": { + "nodes": [ + 444, + 134, + 515, + 169, + 591 + ], + "label": 2 + }, + "57": { + "nodes": [ + 258, + 40, + 39, + 277, + 307 + ], + "label": 3 + }, + "58": { + "nodes": [ + 285, + 56, + 251, + 54, + 298 + ], + "label": 4 + }, + "59": { + "nodes": [ + 546, + 151, + 153, + 430, + 556 + ], + "label": 2 + }, + "60": { + "nodes": [ + 98, + 215, + 475, + 493, + 464 + ], + "label": 5 + }, + "61": { + "nodes": [ + 474, + 214, + 99, + 461, + 496 + ], + "label": 3 + }, + "62": { + "nodes": [ + 357, + 20, + 363, + 359, + 364 + ], + "label": 3 + }, + "63": { + "nodes": [ + 490, + 212, + 459, + 101, + 480 + ], + "label": 4 + }, + "64": { + "nodes": [ + 185, + 116, + 415, + 533, + 574 + ], + "label": 2 + }, + "65": { + "nodes": [ + 378, + 16, + 343, + 341, + 380 + ], + "label": 5 + }, + "66": { + "nodes": [ + 218, + 85, + 235, + 77, + 232 + ], + "label": 2 + }, + "67": { + "nodes": [ + 342, + 15, + 377, + 379, + 344 + ], + "label": 4 + }, + "68": { + "nodes": [ + 458, + 209, + 491, + 477, + 104 + ], + "label": 1 + }, + "69": { + "nodes": [ + 514, + 135, + 441, + 590, + 172 + ], + "label": 3 + }, + "70": { + "nodes": [ + 226, + 83, + 75, + 237, + 224 + ], + "label": 2 + }, + "71": { + "nodes": [ + 530, + 119, + 569, + 190, + 412 + ], + "label": 1 + }, + "72": { + "nodes": [ + 38, + 37, + 257, + 308, + 278 + ], + "label": 1 + }, + "73": { + "nodes": [ + 414, + 113, + 188, + 575, + 536 + ], + "label": 3 + }, + "74": { + "nodes": [ + 362, + 19, + 358, + 361, + 360 + ], + "label": 5 + }, + "75": { + "nodes": [ + 334, + 1, + 330, + 387, + 391 + ], + "label": 5 + }, + "76": { + "nodes": [ + 438, + 161, + 538, + 143, + 564 + ], + "label": 2 + }, + "77": { + "nodes": [ + 550, + 157, + 426, + 560, + 147 + ], + "label": 4 + }, + "78": { + "nodes": [ + 566, + 167, + 137, + 544, + 436 + ], + "label": 5 + }, + "79": { + "nodes": [ + 126, + 177, + 452, + 507, + 599 + ], + "label": 2 + }, + "80": { + "nodes": [ + 284, + 41, + 254, + 43, + 303 + ], + "label": 4 + }, + "81": { + "nodes": [ + 494, + 97, + 476, + 463, + 216 + ], + "label": 1 + }, + "82": { + "nodes": [ + 200, + 109, + 418, + 524, + 579 + ], + "label": 2 + }, + "83": { + "nodes": [ + 263, + 25, + 26, + 276, + 310 + ], + "label": 3 + }, + "84": { + "nodes": [ + 300, + 50, + 52, + 249, + 287 + ], + "label": 1 + }, + "85": { + "nodes": [ + 558, + 145, + 428, + 159, + 552 + ], + "label": 4 + }, + "86": { + "nodes": [ + 403, + 9, + 316, + 315, + 407 + ], + "label": 3 + }, + "87": { + "nodes": [ + 74, + 82, + 227, + 221, + 240 + ], + "label": 2 + }, + "88": { + "nodes": [ + 289, + 66, + 244, + 271, + 70 + ], + "label": 5 + }, + "89": { + "nodes": [ + 306, + 34, + 280, + 33, + 259 + ], + "label": 3 + }, + "90": { + "nodes": [ + 572, + 118, + 531, + 409, + 191 + ], + "label": 4 + }, + "91": { + "nodes": [ + 207, + 90, + 472, + 483, + 501 + ], + "label": 4 + }, + "92": { + "nodes": [ + 369, + 23, + 370, + 351, + 352 + ], + "label": 3 + }, + "93": { + "nodes": [ + 585, + 132, + 175, + 517, + 446 + ], + "label": 1 + }, + "94": { + "nodes": [ + 105, + 196, + 528, + 583, + 422 + ], + "label": 4 + }, + "95": { + "nodes": [ + 241, + 67, + 292, + 71, + 270 + ], + "label": 1 + }, + "96": { + "nodes": [ + 425, + 148, + 559, + 549, + 158 + ], + "label": 5 + }, + "97": { + "nodes": [ + 525, + 193, + 108, + 423, + 582 + ], + "label": 2 + }, + "98": { + "nodes": [ + 174, + 129, + 588, + 447, + 520 + ], + "label": 5 + }, + "99": { + "nodes": [ + 313, + 10, + 404, + 408, + 314 + ], + "label": 2 + }, + "100": { + "nodes": [ + 413, + 187, + 576, + 535, + 114 + ], + "label": 3 + }, + "101": { + "nodes": [ + 573, + 186, + 416, + 115, + 534 + ], + "label": 1 + }, + "102": { + "nodes": [ + 49, + 51, + 299, + 288, + 250 + ], + "label": 4 + }, + "103": { + "nodes": [ + 449, + 180, + 127, + 598, + 506 + ], + "label": 1 + }, + "104": { + "nodes": [ + 469, + 91, + 206, + 504, + 482 + ], + "label": 5 + }, + "105": { + "nodes": [ + 513, + 171, + 589, + 136, + 442 + ], + "label": 3 + }, + "106": { + "nodes": [ + 279, + 35, + 305, + 260, + 36 + ], + "label": 3 + }, + "107": { + "nodes": [ + 389, + 3, + 385, + 336, + 332 + ], + "label": 2 + }, + "108": { + "nodes": [ + 593, + 183, + 509, + 454, + 124 + ], + "label": 5 + }, + "109": { + "nodes": [ + 149, + 155, + 554, + 432, + 548 + ], + "label": 1 + }, + "110": { + "nodes": [ + 325, + 5, + 394, + 327, + 398 + ], + "label": 4 + }, + "111": { + "nodes": [ + 453, + 123, + 510, + 184, + 594 + ], + "label": 2 + }, + "112": { + "nodes": [ + 383, + 13, + 338, + 340, + 381 + ], + "label": 5 + }, + "113": { + "nodes": [ + 311, + 31, + 273, + 32, + 262 + ], + "label": 3 + }, + "114": { + "nodes": [ + 581, + 107, + 526, + 424, + 194 + ], + "label": 4 + }, + "115": { + "nodes": [ + 61, + 57, + 268, + 247, + 294 + ], + "label": 5 + }, + "116": { + "nodes": [ + 87, + 79, + 230, + 220, + 233 + ], + "label": 2 + }, + "117": { + "nodes": [ + 301, + 47, + 45, + 256, + 282 + ], + "label": 1 + }, + "118": { + "nodes": [ + 131, + 176, + 445, + 518, + 586 + ], + "label": 2 + }, + "119": { + "nodes": [ + 210, + 103, + 457, + 478, + 492 + ], + "label": 4 + }, + "120": { + "nodes": [ + 140, + 166, + 567, + 433, + 541 + ], + "label": 1 + } +}; + + + +export const CELL120_CELL5_old = { + "1": [ 27, 28, 264, @@ -1077,8 +2280,9 @@ export const CELL120_CELL5 = { 433, 541 ] - }, - "some_cell5s": { +}; + +export const SOME_CELL5s = { "1": [ 27, 28, @@ -1170,16 +2374,15 @@ export const CELL120_CELL5 = { 545, 429 ] -} - - }; + + // my application of Schoute's partition onto one inscribed 600-cell of the // 120-cell, which is why this is only 120 out of 600 vertices. This is used // to give a coherent colour scheme to the inscribed 5-cells -export const CELL120_CELL5_LABELS { +export const CELL120_CELL5_LABELS = { "1": [ 27, 38, diff --git a/colours.js b/colours.js index 47c7542..f08e3f6 100644 --- a/colours.js +++ b/colours.js @@ -9,8 +9,8 @@ export const get_colours = (basis) => { const luminance = hslb['color'][2]; const scheme = new ColorScheme; scheme.from_hue(hue).scheme("tetrade").distance(0.75); - const scolours = scheme.colors(); - const colours = [ ...scolours, ...scolours, ...scolours, ...scolours, ...scolours, ...scolours, ...scolours, ...scolours ]; + const colours = scheme.colors(); + colours.reverse(); const hsl = colours.map((c) => Color("#" + c).hsl()); const resaturated = hsl.map((hslc) => hslc.saturationl(saturation).rgbNumber()); resaturated.unshift(basis); diff --git a/label_inscribed_600cell.js b/label_inscribed_600cell.js index 09816f4..64361e3 100644 --- a/label_inscribed_600cell.js +++ b/label_inscribed_600cell.js @@ -363,20 +363,47 @@ export function check_metamap_completeness() { export function metamap_to_labels() { const b600 = base_600cell(); const i600 = make_one_600cell(); - const labels = { - 1: [], - 2: [], - 3: [], - 4: [], - 5: [], - }; + const mapping = {}; for( const inode of i600.nodes ) { - const ml = meta600_label(b600, inode.id); - labels[ml].push(inode.id); + mapping[inode.id] = meta600_label(b600, inode.id);; } - console.log(JSON.stringify(labels, null, 2)); + return mapping; } +export function cell5_labels() { + const labels = metamap_to_labels(); -metamap_to_labels(); + // now build a dict of the 120 cell5s with the colours from the above + + const cell5map = {}; + const CELL5S = CELLINDEX.CELL120_CELL5.cell5s; + + for( const c5i in CELL5S ) { + const n1 = CELL5S[c5i][0]; // label 1 node; + const ml = labels[n1]; + cell5map[c5i] = ml; + } + return cell5map; +} + +export function rebuild_cell5_index() { + + const labels = metamap_to_labels(); + const new_cell5s = {}; + const CELL5S = CELLINDEX.CELL120_CELL5; + + for( const c5i in CELL5S ) { + const n1 = CELL5S[c5i][0]; // label 1 node; + const ml = labels[n1]; + new_cell5s[c5i] = { + nodes: CELL5S[c5i], + label: ml + } + } + return new_cell5s; +} + +const nc5 = rebuild_cell5_index(); + +console.log(JSON.stringify(nc5, null, 4)); diff --git a/polytopes.js b/polytopes.js index a421370..4af268d 100644 --- a/polytopes.js +++ b/polytopes.js @@ -474,15 +474,6 @@ export const cell120_inscribed = () => { links.push(...links600); } - const CELL5S = CELLINDEX.CELL120_CELL5.cell5s; - - for( const c5 in CELL5S ) { - const nodes5 = nodes.filter((n) => CELL5S[c5].includes(n.id)); - const links5 = auto_detect_edges(nodes5, 5); - links5.map((l) => l.label = 8); - links.push(...links5); - } - return { name: '120-cell', nodes: nodes, @@ -491,14 +482,11 @@ export const cell120_inscribed = () => { { name: "none", links: [ 0 ]}, { name: "one inscribed 600-cell", links: [ 0, 1 ] }, { name: "five inscribed 600-cells", links: [ 0, 1, 2, 3, 4, 5 ] }, - { name: "120 inscribed 5-cells", links: [ 0, 8 ] }, - ], + ], description: `The 120-cell is the four-dimensional analogue of the dodecahedron, and consists of 120 dodecahedra joined at 720 faces, with three dodecahedra around each edge. It is dual to the 600-cell, - and five 600-cells can be inscribed in its vertices. The converse - of this allows 120 5-cells (each of which has one vertex in each - of the 5 600-cells) to be inscribed in the 120-cell.`, + and five 600-cells can be inscribed in its vertices.` , } } @@ -523,28 +511,37 @@ export const cell120_alt = () => { export const cell120_inscribed_cell5 = () => { const nodes = make_120cell_vertices(); - const links = []; + const links = auto_detect_edges(nodes, 4); - const CELL5S = CELLINDEX.CELL120_CELL5.cell5s; + links.map((l) => l.label = 0); + + const CELL5S = CELLINDEX.CELL120_CELL5; for( const c5 in CELL5S ) { - const nodes5 = nodes.filter((n) => CELL5S[c5].includes(n.id)); + const nodes5 = nodes.filter((n) => CELL5S[c5].nodes.includes(n.id)); const links5 = auto_detect_edges(nodes5, 5); - links5.map((l) => l.label = Number(c5)); + links5.map((l) => l.label = CELL5S[c5].label); links.push(...links5); - nodes5.map((n) => n.label = Number(c5)); + nodes5.map((n) => n.label = CELL5S[c5].label); } - const show_links = Array.from({ length: 128 }, (_, i) => i); - return { - name: '120 5-cells', + name: '120-cell with 5-cells', nodes: nodes, links: links, options: [ - { name: "none", links: show_links}, + { name: "all", links: [0, 1, 2, 3, 4, 5] }, + { name: "24", links: [0, 1 ] }, + { name: "48", links: [0, 1, 2 ] }, + { name: "72", links: [0, 1, 2, 3 ] }, + { name: "96", links: [0, 1, 2, 3, 4 ] }, + { name: "hide 1200-cell", links: [ 1, 2, 3, 4, 5 ] }, ], - description: `The 120 5-cells from the 120-cell, without the latter's links. This colouring is pretty arbitrary, being based on the algorithm which partitioned the nodes: a later version will have something that's based on the symmetries of the 600-cells which each of the 5-cells has its nodes in.`, + description: `The vertices of the 120-cell can also be partitioned + into 120 5-cells: each 5-cell has one vertex in each of the five + 600-cells which can be inscribed in the 120-cell. The colours here + are taken from the partition of the inscribed 600-cells' vertices + into five 24-cells.` } } @@ -1079,7 +1076,7 @@ export const build_all = () => { cell600(), cell600_layered(), cell120_inscribed(), - cell120_test_metamap(), + cell120_inscribed_cell5(), cell120_layered() ]; }