Bridge: a support surface's shape read about a station in its middle has the right signs

Support::station reads the curve leaving a boundary from five samples: one-sided where the
support ends at the station, central where the surface goes on past it. The central five-point
formulas had the first and second derivatives' signs reversed ((-f0 + 8 f1 - 8 f3 + f4) and
(f0 - 16 f1 + 30 f2 - 16 f3 + f4) over 12h, 12h^2, the negatives of the standard ones), so the
curvature read there pointed away from where the surface bends. Truck's half cylinders ended at
every picked line and read one-sided; SMLib's cylinder is one periodic face, the seam is inside it,
and the central branch read the wall bending outward (+radial / R): the G2 and G3 matches to it
built sheets bending the wrong way, and the continuity check, reading the same frames, called
them G2. The central formulas are now the standard ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jyviko
2026-10-29 01:35:48 -04:00
committed by Irakli Kourtis
parent bb0b146a94
commit d5bd1ebfd1
+3 -2
View File
@@ -490,8 +490,9 @@ impl Support {
let d3 = (f0 * -5.0 + f1 * 18.0 + f2 * -24.0 + f3 * 14.0 + f4 * -3.0) * (1.0 / (2.0 * h * h * h));
(d1, d2, d3)
} else {
let d1 = (f0 * -1.0 + f1 * 8.0 + f3 * -8.0 + f4) * (1.0 / (12.0 * h));
let d2 = (f0 + f1 * -16.0 + f2 * 30.0 + f3 * -16.0 + f4) * (1.0 / (12.0 * h * h));
// Five-point central differences at the middle sample f2.
let d1 = (f0 + f1 * -8.0 + f3 * 8.0 + f4 * -1.0) * (1.0 / (12.0 * h));
let d2 = (f0 * -1.0 + f1 * 16.0 + f2 * -30.0 + f3 * 16.0 + f4 * -1.0) * (1.0 / (12.0 * h * h));
let d3 = (f0 * -1.0 + f1 * 2.0 + f3 * -2.0 + f4) * (1.0 / (2.0 * h * h * h));
(d1, d2, d3)
};