Force layout Barnes-Hut status
Current state
- Barnes-Hut is already used for repulsive forces in
src/force_layout.cppduringForceLayout::step. - The quadtree implementation lives in
src/force_layout_quad_tree.hppand is built every iteration from the current XY positions. - The algorithm is 2D-only (uses
glm::dvec2from each node's X/Y position); Z is ignored. - The Barnes-Hut opening angle (
theta) is currently hardcoded to0.5when callingcomputeRepulsion.
If we revisit this later
- Decide whether the force layout should be 2D-only or full 3D. For 3D, replace the quadtree with an octree and update the Barnes-Hut traversal to use
glm::dvec3positions. - If we need configurable accuracy, plumb a
thetaparameter throughForceLayoutand the Lua binding so it can be tuned from Fennel/Lua. - Add a small regression/perf test for the repulsive-force step to avoid accidental removal of Barnes-Hut or unbounded O(n^2) regressions.
