pub enum Measure {
Linear {
a: P2,
b: P2,
along: P2,
},
Radial {
center: P2,
radius: f64,
diameter: bool,
},
Angular {
vertex: P2,
from: P2,
to: P2,
sweep: f64,
},
}Expand description
What a dimension measures, where it is in the plane.
Variants§
Linear
From a to b, along the direction along: an aligned distance
along b - a, a horizontal or a vertical one along an axis.
Radial
The radius of a circle — or, diameter, its diameter.
Angular
The angle at vertex between its sides along the directions from
and to, measured turning sweep radians counter-clockwise from
from.
Implementations§
Source§impl Measure
impl Measure
Sourcepub fn lines(&self, label: P2) -> Vec<Vec<P2>>
pub fn lines(&self, label: P2) -> Vec<Vec<P2>>
The lines it is drawn with when its value is shown at label: for a
linear one, extension lines from what it measures out to a
dimension line through the label, along what it measures — and on
to the label if it is beside them; for a radial one, a leader from
the centre — a diameter’s from the far rim — across the circle, out
to the label if it is beyond the rim; for an angle, an arc about its
vertex through the label, and its sides out to the arc. None for
what has no direction to be drawn along.
Sourcepub fn arrows(&self, label: P2) -> Vec<(P2, P2)>
pub fn arrows(&self, label: P2) -> Vec<(P2, P2)>
Its arrowheads, as drafting draws them, with its value at label:
each tip, and the unit direction it points in. A linear dimension’s
point out from between its extension lines, a radius’ out at the
rim — a diameter’s at both rims — and an angle’s along its arc, out
at either end.