diff --git a/explore_120cell.js b/explore_120cell.js index 134652c..6ea33b7 100644 --- a/explore_120cell.js +++ b/explore_120cell.js @@ -419,6 +419,38 @@ function cell5_tetras(cell120, all5, c5) { } +function coherent_5cells_r(cell120, all5, c5s, c50) { + // Find next set of c5s, see if there are any we haven't seen, + // recurse into those ones + const c5ns = cell5_tetras(cell120, all5, c50); + const c5unseen = c5ns.filter((c5) => { + const matched = c5s.filter((c5b) => c5match(c5b, c5)); + return matched.length === 0; + }); + for( const c5u of c5unseen ) { + c5s.push(c5u); + } + for( const c5u of c5unseen ) { + coherent_5cells_r(cell120, all5, c5s, c5u); + } +} + + + +function coherent_5cells(cell120, all5) { + // pick a starting point, collect coherent 5_cells, continue till + // there aren't any new ones + + const c5set = []; + let c5 = all5[0]; + + const c5s = []; + coherent_5cells_r(cell120, all5, c5s, c5); + return c5s; +} + + + @@ -426,10 +458,9 @@ function cell5_tetras(cell120, all5, c5) { const cell120 = POLYTOPES.cell120_inscribed(); const all5 = gather_5cells(cell120); -const c5 = all5[0] - -const c5s = cell5_tetras(cell120, all5, c5); +const c5s = coherent_5cells(cell120, all5); const celli = c5s.map((c5) => [ "1", "2", "3", "4", "5" ].map((l) => c5[l])); console.log(celli); +console.log(celli.length);