Added tesseract inscriptions

feature-3d-shapes
Mike Lynch 2023-09-09 17:47:49 +10:00
parent fc5acaeda8
commit 7c49116bba
2 changed files with 22 additions and 2 deletions

View File

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

View File

@ -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 },