pub struct Direction {
pub along: Option<PatternDirection>,
pub reversed: bool,
pub count: NumericInput,
pub spacing: Spacing,
}Expand description
One direction of a row or a grid of instances.
Fields§
§along: Option<PatternDirection>What gives the direction: a line — a straight edge, an axis, a sketch line — or a plane, along its normal; none, for a step that has not picked one.
reversed: boolGo against it instead.
count: NumericInputHow many instances along it, the seed included: a number, or a formula of the part’s parameters.
spacing: SpacingHow far apart they are.
Implementations§
Source§impl Direction
impl Direction
Sourcepub fn along(axis: FrameAxis) -> Direction
pub fn along(axis: FrameAxis) -> Direction
Along the origin’s axis axis, three instances a unit apart.
Sourcepub fn unit(&self, reader: &Reader<'_>) -> Result<Vector<3>, GeopError>
pub fn unit(&self, reader: &Reader<'_>) -> Result<Vector<3>, GeopError>
The unit vector it goes along, as reader reads the part.
Sourcepub fn row(&self, reader: &Reader<'_>) -> Result<Row, GeopError>
pub fn row(&self, reader: &Reader<'_>) -> Result<Row, GeopError>
The instances along it, as reader reads the parameters.
Sourcepub fn fields<'a, A>(
&self,
f: &mut EditForm<'a, A>,
before: &Reader<'a>,
at: Option<Vector<3>>,
suffix: &str,
set: impl Fn(&mut A, Direction) + Clone + 'a,
)where
A: 'a,
pub fn fields<'a, A>(
&self,
f: &mut EditForm<'a, A>,
before: &Reader<'a>,
at: Option<Vector<3>>,
suffix: &str,
set: impl Fn(&mut A, Direction) + Clone + 'a,
)where
A: 'a,
Its fields in f, keyed with suffix: what it goes along, its
sense, the count and the spacing, with handles from at. set puts
the direction set where the arguments keep it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Direction
impl<'de> Deserialize<'de> for Direction
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Direction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Direction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Direction
impl Serialize for Direction
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Direction
Auto Trait Implementations§
impl Freeze for Direction
impl RefUnwindSafe for Direction
impl Send for Direction
impl Sync for Direction
impl Unpin for Direction
impl UnsafeUnpin for Direction
impl UnwindSafe for Direction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more