From d8b5d4eacbd1ee4d7b8dde69b0fd82025b839d8b Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Fri, 4 Aug 2023 15:21:02 +1000 Subject: [PATCH] bringing back 24-cell indexing --- polytopes.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/polytopes.js b/polytopes.js index 8247eb1..d54060f 100644 --- a/polytopes.js +++ b/polytopes.js @@ -125,17 +125,23 @@ export const tesseract = () => { const CELL24_INDEXING = { - x: { y: 'RED', z: 'BLUE', w: 'GREEN' }, - y: { z: 'GREEN', w: 'BLUE' }, - z: { w: 'RED' } + x: { y: 0, z: 2, w: 1 }, + y: { z: 1, w: 2 }, + z: { w: 0 } }; export const cell24 = () => { const nodes = PERMUTE.coordinates([0, 0, 1, 1], 0); + + for( const n of nodes ) { + const axes = ['x', 'y', 'z', 'w'].filter((a) => n[a] !== 0); + n.label = CELL24_INDEXING[axes[0]][axes[1]]; + } + index_nodes(nodes); - const links = auto_detect_edges(nodes, 6); + const links = auto_detect_edges(nodes, 8); return { nodes: nodes,