Enum kittycad_modeling_cmds::shared::PathSegment

source ·
pub enum PathSegment {
    Line {
        end: Point3d<LengthUnit>,
        relative: bool,
    },
    Arc {
        center: Point2d<LengthUnit>,
        radius: LengthUnit,
        start: Angle,
        end: Angle,
        relative: bool,
    },
    Bezier {
        control1: Point3d<LengthUnit>,
        control2: Point3d<LengthUnit>,
        end: Point3d<LengthUnit>,
        relative: bool,
    },
    TangentialArc {
        radius: LengthUnit,
        offset: Angle,
    },
    TangentialArcTo {
        to: Point3d<LengthUnit>,
        angle_snap_increment: Option<Angle>,
    },
}
Expand description

A segment of a path. Paths are composed of many segments.

Variants§

§

Line

A straight line segment. Goes from the current path “pen” to the given endpoint.

Fields

§end: Point3d<LengthUnit>

End point of the line.

§relative: bool

Whether or not this line is a relative offset

§

Arc

A circular arc segment. Arcs can be drawn clockwise when start > end.

Fields

§center: Point2d<LengthUnit>

Center of the circle

§radius: LengthUnit

Radius of the circle

§start: Angle

Start of the arc along circle’s perimeter.

§end: Angle

End of the arc along circle’s perimeter.

§relative: bool

Whether or not this arc is a relative offset

§

Bezier

A cubic bezier curve segment. Start at the end of the current line, go through control point 1 and 2, then end at a given point.

Fields

§control1: Point3d<LengthUnit>

First control point.

§control2: Point3d<LengthUnit>

Second control point.

§end: Point3d<LengthUnit>

Final control point.

§relative: bool

Whether or not this bezier is a relative offset

§

TangentialArc

Adds a tangent arc from current pen position with the given radius and angle.

Fields

§radius: LengthUnit

Radius of the arc. Not to be confused with Raiders of the Lost Ark.

§offset: Angle

Offset of the arc. Negative values will arc clockwise.

§

TangentialArcTo

Adds a tangent arc from current pen position to the new position. Arcs will choose a clockwise or counter-clockwise direction based on the arc end position.

Fields

§to: Point3d<LengthUnit>

Where the arc should end. Must lie in the same plane as the current path pen position. Must not be colinear with current path pen position.

§angle_snap_increment: Option<Angle>

0 will be interpreted as none/null.

Trait Implementations§

source§

impl Clone for PathSegment

source§

fn clone(&self) -> PathSegment

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PathSegment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for PathSegment

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl JsonSchema for PathSegment

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
source§

impl PartialEq for PathSegment

source§

fn eq(&self, other: &PathSegment) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for PathSegment

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Value for PathSegment

source§

fn into_parts(self) -> Vec<Primitive>

Store the value in memory.
source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

Read the value from memory.
source§

impl Copy for PathSegment

source§

impl StructuralPartialEq for PathSegment

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

source§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoResult<T> for T

§

type Err = Infallible

source§

fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>

source§

impl<T> IntoSql for T

source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression

Convert &self to an expression for Diesel’s query builder. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,