Skip to main content

Module route

Module route 

Source
Expand description

The path a cable takes: through Waypoints, in order, as a chain of straight lines and circular arcs (RoutePath), and what it measures (Measure): how long it is and how tightly it bends.

§Why lines and arcs

A cable is laid the way a pipe is bent: straight runs and bends of one radius each. Between two waypoints, each with the direction the route has there, the route is a biarc — two circular arcs, tangent to each other where they meet and to the given directions at the ends, either of them straight where the geometry is. That makes the whole route tangent-continuous, and everything about it exact:

  • its length is the sum of chords and of radius times angle, an enclosure of the true length, not an approximation of it;
  • its bend radii are the arcs’ radii, so the minimum bend radius is checked exactly, arc by arc, and a violation names the two waypoints the arc lies between;
  • the bundle swept along it is made of cylinders and pieces of tori, which the path sweep builds exactly (see geop_lib_sweep::sweep_along).

§The biarc

From P0 heading T0 to P1 heading T1 (unit vectors), the two arcs meet at J = (Q1 + Q2) / 2 with Q1 = P0 + d T0 and Q2 = P1 - d T1, the arcs’ middle control points: the arc from P0 to J has both legs d long, as has the one from J to P1, which is what makes each a circular arc. |Q2 - Q1| = 2d gives d as the positive root of

2 (T0·T1 - 1) d² - 2 v·(T0 + T1) d + v·v = 0,    v = P1 - P0,

which always has exactly one, since the leading coefficient is never positive and the constant always is. Equal legs on both arcs is the usual choice among the biarcs between two ends (it is a one-parameter family); it is symmetric, and a straight route or a single arc comes out as exactly that. Everything is computed in the scalars’ own arithmetic, so the arcs are honest enclosures, recognized as arcs by everything downstream.

§Directions

A point — a vertex, a sketch’s point, a datum point — leaves the direction free, and the route chooses it (see RoutePath::through). A circular edge — a clip, a grommet — says the axis the route passes along, and the route passes the way it is going. Anything else gives a coordinate system — a datum frame, or the frame on a face or an edge (see MateEntity::frame) — which says which way the cable leaves it: along its z axis — out of a connector at the start, into one (against its z axis) at the end, along it in between.

Structs§

Bend
A bend of a route: the arc curve of its chain, of radius radius.
Measure
What a route measures.
RoutePath
A route: a chain of lines and arcs through waypoints, named for the solid swept along it — w{i} the i-th waypoint, m{i} where the two arcs between it and the next meet, a{i} the arc from w{i} to m{i} (or the line from w{i} to w{i+1}, if both are straight) and b{i} the arc from m{i} on.
Waypoint
A point the route runs through, and which way.

Enums§

Heading
Which way the route is told to run through a Waypoint.