Skip to main content

Module walk

Module walk 

Source
Expand description

One walker, several conditions.

Following a curve nobody can write down is the same problem every time. Surface intersection tracks on both surfaces; a silhouette tracks the normal is square to the view; a rolling-ball blend tracks the ball touches both supports and its section stands where the guide says. The conditions are different and the geometry is different, but the walk is not: take a step along the curve’s own direction, correct back onto the condition, measure how far the chord sagged, and set the next step from that.

So the walk lives here once, over a Condition, and what changes per problem is the condition’s own residual and derivatives. The step control, the stall reporting and the closure test are written once and inherited, which matters, because they are the parts that took the longest to get right and would be the easiest to get subtly wrong a second time.

§What a condition owes the walker

n unknowns and n − 1 equations. That shortfall is not an oversight: the solution set of n − 1 equations in n unknowns is a curve, which is what there is to follow. The walker supplies the missing equation itself (a plane across the direction of travel, saying how far along to land), and that is what turns “somewhere on the curve” into “the next point”.

The direction of travel comes free. The curve’s tangent in parameter space is the null vector of the condition’s own Jacobian, and a condition that has a cheaper or more careful formula for it (the intersector does, and uses it to refuse a crossing too shallow to trust) says so by overriding Condition::tangent.

Structs§

Walked
One walked curve.

Traits§

Condition
A curve stated as what it satisfies, and everything needed to follow it.

Functions§

follow
Follow a condition’s curve both ways from a starting point.
walk_one_way
Walk one way from a start.