Manual labelling

feature-120-cell-index
Mike Lynch 2023-08-17 08:32:41 +10:00
parent 2f609594e5
commit e1047a46e8
2 changed files with 39 additions and 2 deletions

View File

@ -349,7 +349,7 @@ function auto_120cell_faces(links) {
for( const face of shared ) {
const fp = fingerprint(face);
if( !seen[fp] ) {
faces.push({ id: id, nodes: face });
faces.push({ id: id, edge: edge.id, v1: edge.source, v2: edge.target, fingerprint: fp, nodes: face });
id++;
seen[fp] = true;
}
@ -360,6 +360,9 @@ function auto_120cell_faces(links) {
const cell120 = () => {
const nodes = make_120cell_vertices();
const links = auto_detect_edges(nodes, 4);
@ -786,5 +789,17 @@ function naive_label_120cell(nodes, links, n) {
const nodes = make_120cell_vertices();
const links = auto_detect_edges(nodes, 4);
const faces = auto_120cell_faces(links);
console.log('links');
for( const link of links ) {
console.log(link);
}
console.log('faces');
for( const face of faces ) {
console.log(face);
}

View File

@ -368,6 +368,28 @@ function naive_label_120cell(nodes, links, n) {
}
function manual_label_120cell(nodes, links) {
const faces = auto_120cell_faces(links);
const cfaces = [ 1, 2, 4, 145, 169 ];
const ns = new Set();
for( const fid of cfaces ) {
const face = faces.filter((f)=> f.id === fid );
console.log(face);
if( face.length > 0 ) {
for ( const nid of face[0].nodes ) {
ns.add(nid);
}
}
}
label_nodes(nodes, Array.from(ns), 4);
}
@ -376,7 +398,7 @@ export const cell120 = () => {
const nodes = make_120cell_vertices();
const links = auto_detect_edges(nodes, 4);
naive_label_120cell(nodes, links);
manual_label_120cell(nodes, links);
return {
nodes: nodes,