Expand description
Residual builders for the supported rule classes.
Linear rules: fix, equal, linear relation (sum/difference/ratio/min/max with constant coefficients), equal spacing.
Geometric rules: coincident, horizontal, vertical, fixed point, distance (point–point, signed point–line), point on line/circle, length, equal length, parallel, perpendicular, angle, concentric, radius, equal radius, line–circle and circle–circle tangency.
Every builder returns residual rows; the solver decides linearity from the expressions themselves. Residuals of direction rules are normalized (sine/cosine of angles) so their scale is 1 regardless of segment length.
Enums§
- Circle
Tangency - Tangency between two circles.
- Cmp
- Linear comparison operators.
Functions§
- all_
equal - Equal values:
v₀ = v₁ = …. - angle
- Signed angle from segment 1 to segment 2 equals
theta(radians). The residual is the wrapped angle difference, smooth everywhere except at ±π. - at_
least a ≥ min.- at_most
a ≤ max.- coincident
- Coincident points.
- concentric
- Concentric circles/arcs.
- distance
|q − p| = d.- distance_
cmp |q − p| (cmp) d.- equal
a = b.- equal_
length - Equal segment lengths.
- equal_
radius - Equal radii.
- equal_
spacing - Consecutive differences are equal:
v₁−v₀ = v₂−v₁ = …. - fix
v = value.- fix_
point - Point fixed at a location.
- horizontal
- Same Y.
- length
- Segment length.
- linear
Σ cᵢ·eᵢ (cmp) rhs.- parallel
- Parallel (or anti-parallel) segments:
sin(angle) = 0. - perpendicular
- Perpendicular segments:
cos(angle) = 0. - point_
line_ distance - Signed point–line distance equals
d(sign selects the side). - point_
on_ circle - Point lies on the circle
(c, r). - point_
on_ line - Point lies on the infinite line through
a,b. - polar_
point - Point expression of an arc/circle point at an angle:
c + r·(cos a, sin a). - radius
- Radius equals
value. - ratio
a = k · b(constant ratio).- signed_
line_ distance - Signed distance from
pto the linea → b(positive on the left). - tangent_
circles - Circle–circle tangency.
- tangent_
line_ circle - Line
a → btangent to circle(c, r);side(±1) keeps the circle on its current side of the line. - v
- Convenience: variable expression.
- vertical
- Same X.