Skip to main content

MateEntity

Struct MateEntity 

Source
pub struct MateEntity {
    pub on: Selected,
    pub at: Option<Selected>,
}
Expand description

What a mate holds by: the element on, of the part itself or of a part placed in it, however deep (see geop_core_program::placed) — and, for a joint’s frame, the element of the same part the frame sits at: a corner or a side of a face, an end of an edge (see MateEntity::frame). Saved as {"on": {"face": {"target": "/bolt:model", "name": "extrude(head,end)"}}}.

Fields§

§on: Selected§at: Option<Selected>

Implementations§

Source§

impl MateEntity

Source

pub fn on(on: Selected) -> MateEntity

A frame on on, sitting where nothing else says.

Source

pub fn of(part: &str, on: Selected) -> MateEntity

A frame on on, of the part placed at part, as that part names it.

Source

pub fn at(self, at: Selected) -> MateEntity

It with its frame put at at, of the same part as what it is on.

Source

pub fn part(&self) -> &str

The path of the placed part it is of: empty for the part itself.

Source

pub fn label(&self) -> String

How it reads in a list: bolt: face extrude(head,end).

Source

pub fn shape(&self, reader: &Reader<'_>) -> Result<Shape, GeopError>

What it is in its own part — the part reader reads, or the one placed in it that it is of. Reads no state: where that part is placed, locate says.

Source

pub fn surface( &self, reader: &Reader<'_>, ) -> Result<Option<NurbSurface<4>>, GeopError>

The surface of the wall the face it is on is of, in its own part — the part reader reads, or the one placed in it that it is of — its normal out of its solid: the face’s, and those of the faces it runs on into smoothly, joined (see [wall]). A cam’s side swept along a profile is a face per piece of the profile, and a follower rolls round all of them. None for any element but a face. Reads no state, as MateEntity::shape does not.

Source

pub fn curve( &self, reader: &Reader<'_>, ) -> Result<Option<NurbCurve<4>>, GeopError>

The curve it runs along, in its own part — the part reader reads, or the one placed in it that it is of: of an edge, the edge’s and those of the edges it runs on into smoothly at its ends, joined (see [run]): a slot’s rim is an edge per piece of its outline, and a pin runs round all of them. A sketch’s curve as it is; none for what is no curve. Reads no state.

Source

pub fn frame(&self, reader: &Reader<'_>) -> Result<CoordinateSystem, GeopError>

The frame it gives in its own part — the part reader reads, or the one placed in it that it is of. Reads no state: where that part is placed, locate says.

Its z axis is the element’s own, and what is turned about it, or slid along:

  • A planar face: its normal, out of its solid. at is where it sits in the plane, else the middle of the face.
  • A round face — a cylinder, a cone: its axis. at is where along it, as near as the axis is to it, else half way along the face.
  • A circular edge: the axis of its circle, at its center.
  • A straight edge: its direction. at is where along it — a vertex at one end, say — else the middle.
  • A point: the world’s axes, there.
  • A datum — a frame, an axis, a plane: its own.

Where the frame sits is a free choice, so it is sharp.

Source

pub fn frame_in_world( &self, reader: &Reader<'_>, ) -> Result<CoordinateSystem, GeopError>

The frame it gives, where the part it is of is placed in the part reader reads — in the world, as the part is drawn.

Trait Implementations§

Source§

impl Clone for MateEntity

Source§

fn clone(&self) -> MateEntity

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 Debug for MateEntity

Source§

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

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

impl<'de> Deserialize<'de> for MateEntity

Source§

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

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

impl PartialEq for MateEntity

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Selectable for MateEntity

A mate’s element is picked from what the editor draws of the part and the parts placed in it; a frame, with where it sits (see drawn::FRAME). Its element is held as the pick names it, of the placed part behind its path.

Source§

fn visuals(&self, reader: &Reader<'_>) -> Vec<Visual>

The frame it gives, as a triad where it is drawn: nothing for an element that gives none, which the mate says of it when it is held.

Source§

fn picked_from() -> Vec<&'static str>

The kinds of what an editor draws that a click picks one from.
Source§

fn from_picked(picked: &PickedElement) -> Option<MateEntity>

The value picked names as Selectable::picked does: what a field sent back held already.
Source§

fn picked(&self) -> PickedElement

The value as a pick names it: what the front end shows held.
Source§

fn select(reader: &Reader<'_>, hit: &PickedElement) -> Option<MateEntity>

The value a click on hit selects, read through reader: none, for a hit that selects none.
Source§

fn drawn(&self, reader: &Reader<'_>) -> Vec<PickedElement>

What an editor draws of it, to light while it is held.
Source§

impl Serialize for MateEntity

Source§

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
Source§

impl StructuralPartialEq for MateEntity

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