Conversation
chore: sync release v0.5.2 (changelog + version)
…ntrol point The avoid router measured obstacle clearance against the straight start->end chord, but the drawn path is a cubic that bows away from that chord - so a curve could clip a box whose chord cleared it, and no belly was emitted at all. The belly also displaced both control points equally, attenuating to zero at the endpoints, so end-adjacent obstacles could never be cleared regardless of avoidPadding. routeOffset is replaced by routeBellies: it samples the cubic that will actually render (chord-scaled density, ~1 per 25px), finds the worst padded-box penetration, and splits the correction across the two control points by their Bezier basis weights at the blocker's parameter - iterating up to 4 times until the resampled curve clears. Exact endpoint samples are excluded and t* is clamped to the interior so the vanishing basis weights can't produce NaN or runaway overshoot; displacement is capped at 1.5x chord length for geometry no single cubic can clear. The empirical BOW=1.6 amplifier in scroll-arrow is gone - the solver converges on the displacement actually needed. Existing avoid arrows will render with minimal rather than 1.6x-amplified bows, so this should ship in a minor release. Closes #55
- Raise samplePath's sample cap to 400 so small padded obstacles are still detected on page-scale chords (probe: 6000px chord missed a straddling box at the old 100-sample cap) - Make the issue #55 repro test actually fire routing (tight sibling pill inside the padded approach) and assert nonzero bellies, so an always-zero router fails it - Test buildPath's per-control belly wiring directly (a b1/b2 swap previously passed the whole suite) - Stub SVGElement getTotalLength in the avoid tests instead of swallowing constructor errors with a bare try/catch - Reuse unitNormal, hoist per-obstacle geometry out of the solver's iteration loop, clean up comments, format
feat(avoid): curve-aware detection and per-control-point belly routing
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.
Proposed release:
v0.6.0Features