pub enum RuleSpec {
Show 25 variants
Fix {
param: ParamRef,
value: f64,
},
Equal {
a: ParamRef,
b: ParamRef,
},
AllEqual {
params: Vec<ParamRef>,
},
Linear {
terms: Vec<Term>,
op: Cmp,
rhs: f64,
},
Ratio {
a: ParamRef,
b: ParamRef,
k: f64,
},
EqualSpacing {
params: Vec<ParamRef>,
},
Coincident {
a: AnchorRef,
b: AnchorRef,
},
Horizontal {
a: AnchorRef,
b: AnchorRef,
},
Vertical {
a: AnchorRef,
b: AnchorRef,
},
FixPoint {
a: AnchorRef,
at: Point,
},
Distance {
a: AnchorRef,
b: AnchorRef,
value: f64,
},
PointLineDistance {
point: AnchorRef,
line: LineRef,
value: f64,
},
PointOnLine {
point: AnchorRef,
line: LineRef,
},
PointOnCircle {
point: AnchorRef,
circle: EntityId,
},
Length {
line: LineRef,
value: f64,
},
EqualLength {
a: LineRef,
b: LineRef,
},
Parallel {
a: LineRef,
b: LineRef,
},
Perpendicular {
a: LineRef,
b: LineRef,
},
Angle {
a: LineRef,
b: LineRef,
value: f64,
},
Concentric {
a: EntityId,
b: EntityId,
},
Radius {
circle: EntityId,
value: f64,
},
EqualRadius {
a: EntityId,
b: EntityId,
},
TangentLineCircle {
line: LineRef,
circle: EntityId,
side: f64,
},
TangentCircles {
a: EntityId,
b: EntityId,
internal: bool,
sign: f64,
},
Expression {
entity: EntityId,
lhs: String,
op: Cmp,
rhs: String,
},
}Expand description
Constraint kinds.
Variants§
Fix
param = value.
Equal
a = b.
AllEqual
All parameters equal.
Linear
Σ coef·param (op) rhs — sums, differences, minimums, maximums.
Ratio
a = k · b.
EqualSpacing
Consecutive differences equal (equally spaced values).
Coincident
Coincident anchors.
Horizontal
Two anchors share Y.
Vertical
Two anchors share X.
FixPoint
Anchor fixed at a point.
Distance
Distance between anchors.
PointLineDistance
Signed distance from an anchor to a line (positive = left of the line).
PointOnLine
Anchor on the infinite line.
PointOnCircle
Anchor on a circle/arc entity.
Length
Line length.
EqualLength
Equal line lengths.
Parallel
Parallel lines.
Perpendicular
Perpendicular lines.
Angle
Signed angle from a to b.
Concentric
Circles/arcs share their center.
Radius
Radius value.
EqualRadius
Equal radii.
TangentLineCircle
Line tangent to circle; side (±1) is the side of the line the circle is on.
TangentCircles
Circle–circle tangency.
Fields
Expression
Expression rule in the Dotloom expression language, evaluated in Rust:
lhs (op) rhs, e.g. "self.offset + self.width" <= "host.length".