diff --git a/main.js b/main.js index 1cb3ed4..f273da1 100644 --- a/main.js +++ b/main.js @@ -65,17 +65,17 @@ const STRUCTURES = { 'tesseract': POLYTOPES.tesseract(), '24-cell': POLYTOPES.cell24(), '120-cell': POLYTOPES.cell120(), - '120-cell-all-inscribed': POLYTOPES.cell120_all_inscribed(), '600-cell': POLYTOPES.cell600(), - '600-cell-all-inscribed': POLYTOPES.cell600_all_inscribed(), }; const INSCRIBED = { + 'tesseract': POLYTOPES.tesseract_inscribed(), '120-cell': POLYTOPES.cell120_inscribed(), '600-cell': POLYTOPES.cell600_inscribed(), }; const ALL_INSCRIBED = { + 'tesseract': POLYTOPES.tesseract_all_inscribed(), '120-cell': POLYTOPES.cell120_all_inscribed(), '600-cell': POLYTOPES.cell600_all_inscribed(), } diff --git a/polytopes.js b/polytopes.js index 07ab69c..1969a81 100644 --- a/polytopes.js +++ b/polytopes.js @@ -143,6 +143,26 @@ export const tesseract = () => { } +const tesseract_some_inscribed = (ps) => { + const t = tesseract(); + + const i_links = []; + + for( const p of ps ) { + const nodes16 = t.nodes.filter((n) => n.label === p); + const links16 = auto_detect_edges(nodes16, 6); + links16.map((l) => l.label = p); + i_links.push(...links16); + } + + t.links.push(...i_links); + return t; +} + + +export const tesseract_inscribed = () => tesseract_some_inscribed([1]); +export const tesseract_all_inscribed = () => tesseract_some_inscribed([1,2]); + const CELL24_INDEXING = { x: { y: 1, z: 3, w: 2 },