Skip to main content

MAX_JOINT_TANGENT_BREAK

Constant MAX_JOINT_TANGENT_BREAK 

Source
pub const MAX_JOINT_TANGENT_BREAK: f64 = 0.02;
Expand description

The largest tangent break, in radians, a chained path may have at a joint before the joint is a CORNER.

This is a REAL geometric boundary, not a tuning knob, and it now selects the LANE rather than deciding a refusal. The skinning builder lofts consecutive stations, so a corner between two stations would be rendered as a smooth blend across it — the tube cuts the corner, and near a sharp one the section sweeps through itself. So a break inside this band is skinned as ONE tube (line→fillet→line, spline pieces, an arc train), and a break past it is a corner, which is built a different way or not at all:

  • every segment STRAIGHT (a polyline, open or CLOSED) → the MITRE lane: the section is swept along each segment and the two sweeps are trimmed to the joint’s bisector plane, sharing one face loop there (SweepPath::cornered_polyline, sweep_topology/miter.rs). A closed one is a picture FRAME: its closing joint is a mitre like the rest and it has no caps at all;
  • a corner at a CURVED segment → refused by name. A curve has no single direction for a bisector plane to bisect, so there is no plane both sides can be trimmed to.

~1.15° (0.02 rad). Loose enough to absorb the tangent disagreement of two curves a sketch chained on endpoint coincidence, tight enough that anything a user would call a corner is refused rather than silently rounded off.

This is INDEPENDENT of the chainer’s join tolerance, and deliberately so. common::chain_path_segments joins on POSITION (1e-5 * scale); this gate measures DIRECTION. Two collinear segments meeting with a positional gap have a zero tangent break, and two segments meeting exactly at a point can still break 90°. So a run the chainer happily orders head-to-tail may still be refused by a consumer of this classification — which is not an inconsistency but the SW/SWP split itself: the chainer’s job is to decide what order the picks form a run in, and this gate’s job is to decide whether that run is one the skinning builder can carry a section along.