Skip to content

Derive the bend lengths from the geometry#71

Merged
DavidSagan merged 1 commit into
mainfrom
bend-lengths
Jul 23, 2026
Merged

Derive the bend lengths from the geometry#71
DavidSagan merged 1 commit into
mainfrom
bend-lengths

Conversation

@DavidSagan

Copy link
Copy Markdown
Member

Follows the BendP renames of pals#262bend_field_refBn0_ref, rho_refradius_ref, and the new Kn0_from_g_ref — and fills 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 exactly what bend.md lets 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:

L_chord     = length * sinc(angle/2)
L_rectangle = length * sinc(angle)
L_sagitta   = length * angle/8 * sinc(angle/4)^2

Written through sinc nothing 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

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>
@DavidSagan
DavidSagan merged commit 1b79140 into main Jul 23, 2026
3 checks passed
@DavidSagan
DavidSagan deleted the bend-lengths branch July 23, 2026 02:51
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