Phase 8b: flow_tree(optimize = TRUE) refinement - #30
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)..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
alphabound. Documented in the roxygen and plan.Tests
optimize = TRUEpreserves 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