The mapping seems to work, for the artic circle at least

This commit is contained in:
Mike Lynch 2026-02-01 17:45:06 +11:00
parent 14d5186a45
commit 64cb9540b2
2 changed files with 66 additions and 1 deletions

View File

@ -104,6 +104,21 @@ export const LAYERS120 = {
163,219,271,223,167] 163,219,271,223,167]
}; };
export const CELL600_METAMAP = {
419: 41,
223: 49,
253: 45,
331: 53,
427: 109,
339: 105,
511: 51,
265: 107,
473: 111,
539: 55,
555: 43,
393: 47
};
export const CELL120_CELL5 = { export const CELL120_CELL5 = {
"tetras": { "tetras": {
}, },

View File

@ -604,6 +604,56 @@ export const cell120_inscribe_cell5_subset = () => {
} }
} }
export const cell120_test_metamap = () => {
const o600 = cell600();
const nodes = make_120cell_vertices();
const links = auto_detect_edges(nodes, 4);
for( const cstr in CELLINDEX.INDEX120 ) {
label_nodes(nodes, CELLINDEX.INDEX120[cstr], Number(cstr));
}
links.map((l) => l.label = 0);
const mm = CELLINDEX.CELL600_METAMAP;
const mm_ids = Object.keys(mm).map((i) => Number(i));
console.log(mm_ids);
for( const p of [ 1 ]) {
const nodes600 = nodes.filter((n) => n.label === p);
const links600 = auto_detect_edges(nodes600, 12);
console.log(links600);
const mm_links = links600.filter((l) => {
//console.log(`${l.id} ${l.source} ${l.target}`);
return mm_ids.includes(l.source) && mm_ids.includes(l.target)
});
console.log(mm_links);
mm_links.map((l) => l.label = p);
links.push(...mm_links);
}
nodes.map((n) => {
if( mm_ids.includes(n.id) ) {
const mapid = mm[n.id];
const n600 = o600.nodes.filter((n) => n.id === mapid);
n.label = n600[0].label;
} else {
n.label = 0;
}
});
return {
name: '120-cell-metamap',
nodes: nodes,
links: links,
options: [
{ name: "none", links: [ 0 ]},
{ name: "one inscribed 600-cell", links: [ 0, 1 ] },
],
description: `foo`,
}
}
function partition_coord(i, coords, invert) { function partition_coord(i, coords, invert) {
const j = invert ? -i : i; const j = invert ? -i : i;
if( j >= 0 ) { if( j >= 0 ) {
@ -1029,7 +1079,7 @@ export const build_all = () => {
cell600(), cell600(),
cell600_layered(), cell600_layered(),
cell120_inscribed(), cell120_inscribed(),
cell120_inscribed_cell5(), cell120_test_metamap(),
cell120_layered() cell120_layered()
]; ];
} }