Added refactored tesseract

feature-120-cell-layers
Mike Lynch 2023-11-01 11:14:57 +11:00
parent 42d1871a9e
commit 76f463ae03
2 changed files with 19 additions and 4 deletions

View File

@ -62,7 +62,7 @@ for( const face_m of face_ms ) {
}
const STRUCTURES = [ POLYTOPES.cell120_inscribed() ];
const STRUCTURES = POLYTOPES.build_all();
const STRUCTURES_BY_NAME = {};

View File

@ -133,6 +133,15 @@ export const tesseract = () => {
scale_nodes(nodes, Math.sqrt(2) / 2);
const links = auto_detect_edges(nodes, 4);
links.map((l) => { l.label = 0 });
for( const p of [ 1, 2 ] ) {
const nodes16 = nodes.filter((n) => n.label === p);
const links16 = auto_detect_edges(nodes16, 6);
links16.map((l) => l.label = p);
links.push(...links16);
}
return {
name: 'tesseract',
@ -142,10 +151,10 @@ export const tesseract = () => {
node_size: 0.02,
link_size: 0.02
},
base: {},
options: [
[ 'One inscribed 16-cell', {} ],
[ 'Both inscribed 16-cells', {} ],
{ name: 'normal', links: [ 0 ] },
{ name: 'one 16-cell', links: [ 0, 1 ] },
{ name: 'both 16-cells', links: [ 0, 1, 2 ] },
],
};
}
@ -785,3 +794,9 @@ export const dodecahedron_inscribed = () => dodecahedron_some_inscribed([1]);
export const dodecahedron_all_inscribed = () => dodecahedron_some_inscribed([1,2,3,4,5]);
export const build_all = () => {
return [
tesseract(),
cell120_inscribed()
];
}