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
impl MateEntity
Sourcepub fn of(part: &str, on: Selected) -> Self
pub fn of(part: &str, on: Selected) -> Self
A frame on on, of the part placed at part, as that part names it.
Sourcepub fn at(self, at: Selected) -> Self
pub fn at(self, at: Selected) -> Self
It with its frame put at at, of the same part as what it is on.
Sourcepub fn shape(&self, reader: &Reader<'_>) -> GeopResult<Shape>
pub fn shape(&self, reader: &Reader<'_>) -> GeopResult<Shape>
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.
Sourcepub fn surface(&self, reader: &Reader<'_>) -> GeopResult<Option<NurbSurface3D>>
pub fn surface(&self, reader: &Reader<'_>) -> GeopResult<Option<NurbSurface3D>>
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.
Sourcepub fn curve(&self, reader: &Reader<'_>) -> GeopResult<Option<NurbCurve3D>>
pub fn curve(&self, reader: &Reader<'_>) -> GeopResult<Option<NurbCurve3D>>
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.
Sourcepub fn frame(&self, reader: &Reader<'_>) -> GeopResult<CoordinateSystem>
pub fn frame(&self, reader: &Reader<'_>) -> GeopResult<CoordinateSystem>
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.
atis where it sits in the plane, else the middle of the face. - A round face — a cylinder, a cone: its axis.
atis 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.
atis 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.
Sourcepub fn frame_in_world(
&self,
reader: &Reader<'_>,
) -> GeopResult<CoordinateSystem>
pub fn frame_in_world( &self, reader: &Reader<'_>, ) -> GeopResult<CoordinateSystem>
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
impl Clone for MateEntity
Source§fn clone(&self) -> MateEntity
fn clone(&self) -> MateEntity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MateEntity
impl Debug for MateEntity
Source§impl<'de> Deserialize<'de> for MateEntity
impl<'de> Deserialize<'de> for MateEntity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for MateEntity
impl PartialEq for MateEntity
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.
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>
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>
fn picked_from() -> Vec<&'static str>
Source§fn from_picked(picked: &PickedElement) -> Option<Self>
fn from_picked(picked: &PickedElement) -> Option<Self>
picked names as Selectable::picked does: what a
field sent back held already.