pub type Constraint = Constraint;Expand description
A sketch constraint as a program holds it.
Aliased Type§
pub enum Constraint {
Show 26 variants
Coincident {
a: PointId,
b: PointId,
},
PointOnCurve {
point: PointId,
curve: CurveId,
},
Horizontal {
line: CurveId,
},
Vertical {
line: CurveId,
},
Parallel {
a: CurveId,
b: CurveId,
},
Perpendicular {
a: CurveId,
b: CurveId,
},
Collinear {
a: CurveId,
b: CurveId,
},
Tangent {
a: CurveId,
b: CurveId,
},
Equal {
a: CurveId,
b: CurveId,
},
Concentric {
a: CurveId,
b: CurveId,
},
Center {
point: PointId,
curve: CurveId,
},
Midpoint {
point: PointId,
curve: CurveId,
},
Symmetric {
a: PointId,
b: PointId,
line: CurveId,
},
Fix {
point: PointId,
x: Scalar,
y: Scalar,
},
Distance {
a: PointId,
b: PointId,
value: Scalar,
},
DistanceX {
a: PointId,
b: PointId,
value: Scalar,
},
DistanceY {
a: PointId,
b: PointId,
value: Scalar,
},
PointLineDistance {
point: PointId,
line: CurveId,
value: Scalar,
},
Length {
curve: CurveId,
value: Scalar,
},
Radius {
curve: CurveId,
value: Scalar,
},
Diameter {
curve: CurveId,
value: Scalar,
},
Angle {
a: CurveId,
b: CurveId,
value: Scalar,
},
Moved {
a: PointId,
b: PointId,
by: CurveId,
},
EqualSweep {
a: CurveId,
b: CurveId,
},
Offset {
a: CurveId,
b: CurveId,
value: Scalar,
},
OffsetAt {
a: CurveId,
at: Scalar,
b: CurveId,
on: Scalar,
by: CurveId,
across: bool,
},
}Variants§
Coincident
a and b are the same point.
PointOnCurve
point lies on curve (a line’s infinite extension, an arc’s full
circle, or a circle).
Horizontal
Vertical
Parallel
Perpendicular
Collinear
Two lines on one infinite line.
Tangent
Two curves meet tangentially: at a shared endpoint if they have one (lines, arcs and splines), else a line touching a circle/arc, or two circles/arcs touching each other.
Equal
Equal length (two lines) or equal radius (two circles/arcs).
Concentric
Two circles/arcs share a center.
Center
point is the center of a circle or arc.
Midpoint
point is the midpoint of a line or arc.
Symmetric
a and b are mirror images across line.
Fix
point stays at (x, y).
Distance
DistanceX
b.x - a.x = value.
DistanceY
b.y - a.y = value.
PointLineDistance
Length
Length of a line or arc.
Radius
Radius of a circle or arc.
Diameter
Diameter of a circle or arc.
Angle
The counter-clockwise angle from line a’s direction to line b’s.
Moved
b is a moved the way by carries its start onto its end: along
a line, shifted by it; round an arc, turned about the arc’s center
by its sweep. How a pattern’s copies follow what they copy (see
[crate::copies]).
EqualSweep
Two arcs turn by the same angle: an arc whose ends are the images of another’s, under a motion or a reflection, is then its image.
Offset
b runs value from a: two parallel lines value apart, or two
concentric circles/arcs whose radii differ by value (see
[crate::offset]).
OffsetAt
The point on along the spline b lies the radius of the circle
by from the point at along the spline a, along a’s normal
there — or, across, only that far across it: anywhere on the line
a’s offset runs along there. Each as a fraction of the spline’s
domain. The offset of a spline is no spline: a spline fitted through
such points is held to it (see [crate::offset]).