Applied the new colour scheme to the 120-cell / 5-cell partition

This commit is contained in:
Mike Lynch 2026-02-07 17:56:29 +11:00
parent 8cc2622ae4
commit 301609fd41
4 changed files with 1275 additions and 48 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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);

View File

@ -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));

View File

@ -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()
];
}