Skip to content

Phase 8b: flow_tree(optimize = TRUE) refinement - #30

Merged
schochastics merged 1 commit into
mainfrom
phase-8b-flowtree-optimize
Jul 24, 2026
Merged

Phase 8b: flow_tree(optimize = TRUE) refinement#30
schochastics merged 1 commit into
mainfrom
phase-8b-flowtree-optimize

Conversation

@schochastics

Copy link
Copy Markdown
Owner

The remaining deferred item from Phase 8 (see _docs/REFACTORING-PLAN.md). Opt-in.

What

  • flow_tree(object, xy, root, ..., optimize = TRUE) runs an approximate FLOWTREE refinement (Verbeek, Buchin & Speckmann 2011, §5).
  • Conservative by design: tree nodes (leaves, root, join/Steiner points) are held fixed, so 8a's planar skeleton is preserved. Only the interior points of each edge are relaxed for smoothness (FS) and to keep clear of node obstacles (Fobs), anchored to the spiral arc so the angle restriction isn't badly violated.
  • Factored arc sampling into a shared .spiral_arc() helper.

Scope note

FB (join-angle balancing) and Fstr (trunk straightening) are omitted because junctions are fixed; obstacle avoidance may slightly relax the strict alpha bound. Documented in the roxygen and plan.

Tests

optimize = TRUE preserves the edge count and every edge's endpoints (skeleton unchanged), stays planar (0 crossings), and is finite. FAIL 0 | PASS 162.

🤖 Generated with Claude Code

Add an approximate FLOWTREE refinement (Verbeek et al. 2011, section 5)
behind flow_tree(optimize = TRUE). The tree nodes (leaves, root, join
points) are held fixed so the planar spiral skeleton is preserved; only
the interior points of each edge are relaxed for smoothness and to keep
clear of node obstacles, anchored to the spiral arc so the angle
restriction is not badly violated. Factor the arc sampling into a shared
.spiral_arc() helper.

Tested: preserves the edge count and endpoints, stays planar (no
crossings), finite output.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@schochastics
schochastics merged commit af53d36 into main Jul 24, 2026
@schochastics
schochastics deleted the phase-8b-flowtree-optimize branch July 24, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant