Added tesseract inscriptions
parent
fc5acaeda8
commit
7c49116bba
4
main.js
4
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(),
|
||||
}
|
||||
|
|
20
polytopes.js
20
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 },
|
||||
|
|
Loading…
Reference in New Issue