pub enum Spacing {
Step(NumericInput),
Extent(NumericInput),
}Expand description
How far apart the instances of a pattern are: each Step from the
last, or spread evenly over the Extent from the first to the last —
a length, or an angle in degrees, plain or a formula of the part’s
parameters. Serialized as {"step": 2.0}, {"extent": 10.0} or
{"step": {"formula": "pitch"}}.
Variants§
Step(NumericInput)
Extent(NumericInput)
Implementations§
Source§impl Spacing
impl Spacing
Sourcepub fn step(step: impl Into<NumericInput>) -> Self
pub fn step(step: impl Into<NumericInput>) -> Self
Each step — a number, or a formula’s text — from the last.
Sourcepub fn extent(extent: impl Into<NumericInput>) -> Self
pub fn extent(extent: impl Into<NumericInput>) -> Self
Spread evenly over extent — a number, or a formula’s text.
Sourcepub fn value(&self) -> &NumericInput
pub fn value(&self) -> &NumericInput
The number it holds, whichever it is.
Sourcepub fn along(&self, count: usize, reader: &Reader<'_>) -> GeopResult<Row>
pub fn along(&self, count: usize, reader: &Reader<'_>) -> GeopResult<Row>
count instances in a row along a line, this spacing coming to a
length as reader reads the parameters. Refuses a spacing that puts
them on top of each other.
Sourcepub fn round(&self, count: usize, reader: &Reader<'_>) -> GeopResult<Row>
pub fn round(&self, count: usize, reader: &Reader<'_>) -> GeopResult<Row>
count instances in a row round an axis, this spacing coming to an
angle in degrees as reader reads the parameters — an extent of a
full turn spreading them over it, the last a step short of the
first. Refuses a spacing that puts them on top of each other, or
brings them round onto the first again.
Sourcepub fn fields<'a, A, T>(
&self,
f: &mut EditForm<'a, A, T>,
key: &str,
labels: [&str; 2],
number: impl FnOnce(&str, &NumericInput) -> Number,
set: impl Fn(&mut A, Spacing) + Clone + 'a,
)
pub fn fields<'a, A, T>( &self, f: &mut EditForm<'a, A, T>, key: &str, labels: [&str; 2], number: impl FnOnce(&str, &NumericInput) -> Number, set: impl Fn(&mut A, Spacing) + Clone + 'a, )
Its fields in f: which kind — keyed {key}_mode — and the number,
keyed key, made by number(label, value) (see
[NumericInput::number]). Switching the kind keeps the number. set
puts the spacing set where the arguments keep it.