Skip to main content

Loft

Struct Loft 

Source
pub struct Loft;
Expand description

Lofts through the profiles of two or more sketches, in order, into a solid named loft(L) for the operation L — each sketch’s one area, a single loop — kept as a new body or combined with another solid (see Combine). Or, as faces (Output::Faces), into faces standing on their own: through the sketches’ loops, or through open chains of curves — between two curves, the ruled surface joining them.

Two profiles are joined by ruled walls, more by walls running smoothly through them all (see geop_lib_sweep::loft). A sketch of a single point, first or last, is a point the loft comes to: the walls run into it, as a cone into its apex, the vertex loft(L,K) for the sketch K. Through its first profile again at the end, it closes on itself: a ring running smoothly round through three profiles or more, with no caps. The profiles’ corners — the sketch points where their curves meet at an angle — are lofted into each other, in order round the loops, so every profile with corners needs as many: a D and a triangle are refused, naming both. A profile without corners, a circle, is lined up as a whole. Between two corners, the curves are cut alike, each where another profile has a joint at the same fraction of the way along: a piece X cut gives X#cut1, X#cut2, …, with the joints X@cut1, …. Sketch points on the profiles’ loops picked among the LoftArgs::matches say instead which points are lofted into each other: each profile’s first with the others’ first, its second with their second, and so on — the curve such a point lies on split there, its second half named X#P.

Or guide curves (LoftArgs::guides) say which points match: sketches whose one chain of curves runs from a point of the first profile through every other to the last. Each guide’s point on each profile is matched, as a joint K,G of the profile K for the guide G, and between the profiles the walls follow the guides (see geop_lib_sweep::loft) rather than run straight.

Named after the first sketch’s elements — X a piece of a curve and P a joint of the sketch K — and the sketches K, M, … themselves:

  • loft(L,K,X): the wall from X — loft(L,K,X,M>N) for the one between the sketches M and N, when there are more than two;
  • loft(L,K,X,M): the curve of the sketch M the wall X meets there;
  • loft(L,K,P) (or loft(L,K,P,M>N)) / loft(L,K,P,M): the edge from P between two profiles, and its vertex on M;
  • loft(L,start) / loft(L,end): the caps, the first and last profile.

Trait Implementations§

Source§

impl Clone for Loft

Source§

fn clone(&self) -> Loft

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Loft

Source§

impl Debug for Loft

Source§

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

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

impl Default for Loft

Source§

fn default() -> Loft

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Loft

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 Editable for Loft

Source§

const INFO: OperationInfo = <Loft as ::geop_core_editor::part_operation::PartOperation>::INFO

Source§

type EditingState = FormState<<Loft as PartOperation>::Session>

What the editor keeps about a step while it is edited, beyond its arguments, starting from the default whenever a step is opened.
Source§

fn new_args(context: &Context<'_>) -> Self::Args

The arguments of a new step: sensible defaults, taking the part it is inserted into into account.
Source§

fn presentation( context: &Context<'_>, args: &Self::Args, editing: &Self::EditingState, ) -> Form

What the editor shows while the step is edited. Never fails: an editor needs the form most exactly when the arguments do not build, so whatever is wrong is said in it.
Source§

fn process_user_event( context: &Context<'_>, args: &Self::Args, editing: &Self::EditingState, event: Event, ) -> (Self::Args, Self::EditingState)

The step’s arguments and editing state after event.
Source§

impl ModelOperation for Loft

Source§

fn build( model: &mut NamedModel, reader: &Reader<'_>, step: &str, args: &LoftArgs, ) -> GeopResult<()>

Builds the step step — what everything it makes is named after — into model, reading whatever else it builds on through reader, so the step is rebuilt when that changes.
Source§

impl Operation for Loft

Source§

const KIND: &'static str = <Loft as ::geop_core_editor::part_operation::PartOperation>::KIND

The name programs store its steps under.
Source§

type Args = <Loft as PartOperation>::Args

What a step of the operation is given. It is saved with the program, so it names targets and elements, never holds their internal ids.
Source§

fn run(ctx: &mut StepContext<'_>, args: &Self::Args) -> __GeopResult<()>

Declares what the step produces, through ctx (see StepContext::produce): cheap, since it runs in every run. What takes work is done in the makes, which run only when what they read changed.
Source§

impl PartOperation for Loft

Source§

fn new_args(context: &Context<'_>) -> LoftArgs

Through the two newest sketches, joined to the newest solid if there is one.

Source§

fn form<'a>( context: &'a Context<'a>, args: &LoftArgs, _: &FormState<()>, ) -> EditForm<'a, LoftArgs>

The sketches, picked in order; the points matched on them, or the guide curves; whether a face; and how to combine.

Source§

const KIND: &'static str = "loft"

The name programs store its steps under.
Source§

const INFO: OperationInfo

Source§

type Args = LoftArgs

What a step is given. It is saved with the program, so it names targets and elements, never holds their internal ids.
Source§

type Session = ()

What the editor keeps while a step is edited besides its arguments and the visuals selected: () for most.
Source§

fn run(ctx: &mut StepContext<'_>, args: &LoftArgs) -> GeopResult<()>

Declares what the step produces, through ctx (see StepContext::produce).
Source§

fn begin_event(session: &mut Self::Session)

What the session forgets at the start of every event, before the event is handled: nothing, by default.
Source§

fn canvas( context: &Context<'_>, edit: Edit<'_, Self::Args, Self::Session>, event: &CanvasEvent, )

What the pointer or a key did on the canvas: nothing, by default.
Source§

impl PartialEq for Loft

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for Loft

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 StructuralPartialEq for Loft

Auto Trait Implementations§

§

impl Freeze for Loft

§

impl RefUnwindSafe for Loft

§

impl Send for Loft

§

impl Sync for Loft

§

impl Unpin for Loft

§

impl UnsafeUnpin for Loft

§

impl UnwindSafe for Loft

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<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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<O> ErasedEditable for O
where O: Editable,

Source§

fn info(&self) -> &'static OperationInfo

Source§

fn new_args(&self, context: &Context<'_>) -> Result<Value, GeopError>

Source§

fn initial_editing(&self) -> Box<dyn Any>

Source§

fn presentation( &self, context: &Context<'_>, args: &Value, editing: &(dyn Any + 'static), ) -> Result<Form, GeopError>

Source§

fn process_user_event( &self, context: &Context<'_>, args: &Value, editing: &(dyn Any + 'static), event: Event, ) -> Result<Edited, GeopError>

Source§

impl<O> ErasedOperation for O
where O: Operation,

Source§

fn kind(&self) -> &'static str

Source§

fn check_args(&self, args: &Value) -> Result<(), GeopError>

Whether args are arguments of the operation, as saved.
Source§

fn run(&self, ctx: &mut StepContext<'_>, args: &Value) -> Result<(), GeopError>

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> ToOwned for T
where T: Clone,

Source§

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>,

Source§

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>,

Source§

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.