routine to find the shared neighbours of n vertices for the next layer

This commit is contained in:
Mike Lynch 2026-02-05 12:15:10 +11:00
parent 128788c490
commit e809e72083

View File

@ -134,6 +134,21 @@ export function face_vertices(shape, f1, f2, f3) {
return ns; return ns;
} }
export function shared_neighbours(shape, nodes) {
// for f1/f2/f3 forming a triangular face, return the two vertices of the
// adjacent tetrahedra
let ns = shape.nodes.map((n) => n.id);
for( const n of nodes ) {
ns = neighbours_in_subset(shape, ns, n);
}
return ns;
}
export function layer_neighbours(cell600, layer) { export function layer_neighbours(cell600, layer) {
console.log("Layer neighbours"); console.log("Layer neighbours");
for( const n of layer ) { for( const n of layer ) {