bringing back 24-cell indexing
parent
1a12c82a5d
commit
d8b5d4eacb
14
polytopes.js
14
polytopes.js
|
@ -125,17 +125,23 @@ export const tesseract = () => {
|
||||||
|
|
||||||
|
|
||||||
const CELL24_INDEXING = {
|
const CELL24_INDEXING = {
|
||||||
x: { y: 'RED', z: 'BLUE', w: 'GREEN' },
|
x: { y: 0, z: 2, w: 1 },
|
||||||
y: { z: 'GREEN', w: 'BLUE' },
|
y: { z: 1, w: 2 },
|
||||||
z: { w: 'RED' }
|
z: { w: 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const cell24 = () => {
|
export const cell24 = () => {
|
||||||
const nodes = PERMUTE.coordinates([0, 0, 1, 1], 0);
|
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);
|
index_nodes(nodes);
|
||||||
const links = auto_detect_edges(nodes, 6);
|
const links = auto_detect_edges(nodes, 8);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
nodes: nodes,
|
nodes: nodes,
|
||||||
|
|
Loading…
Reference in New Issue