Derive the bend lengths from the geometry#71
Merged
Merged
Conversation
Follow the BendP renames of pals#262 (bend_field_ref -> Bn0_ref,
rho_ref -> radius_ref, plus Kn0_from_g_ref), and fill in the lengths
that go with a bend's shape: L_chord, L_rectangle and L_sagitta.
Any two of {curvature, a length, angle_ref} fix the shape, which is
what bend.md lets an author give, so the resolver reduces whichever
pair it finds to (length, angle_ref) and derives the rest from there.
The formulas go through sinc, so a straight or nearly straight bend
needs no special case and the sagitta survives the cancellation. A
value the author set is checked against the geometry and reported when
it disagrees, never overwritten.
Co-Authored-By: Claude Opus 4.8 <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.
Follows the
BendPrenames of pals#262 —bend_field_ref→Bn0_ref,rho_ref→radius_ref, and the newKn0_from_g_ref— and fills in the lengths that go with a bend's shape:L_chord,L_rectangleandL_sagitta.Any two of {curvature, a length,
angle_ref} fix the shape, which is exactly whatbend.mdlets an author give. The resolver reduces whichever pair it finds to(length, angle_ref)— inverting a chord or a rectangle through an arcsine on the principal branch — and derives the rest from there:Written through
sincnothing divides by the curvature, so a straight bend is not a special case and a nearly straight one keeps its sagitta instead of losing it to cancellation. An element given its angle and radius but no length now has the length derived, and it carries downstream into s-positions.A value the author set is never overwritten: it is checked against what the geometry gives and an inconsistency is reported, matching how the rest of the dependent-parameter resolution behaves.
New bookkeeper tests cover the derived length, the chord inversion, the straight and near-straight bends, and the inconsistent chord. All 167 tests pass locally.
🤖 Generated with Claude Code