Skip to main content

SolidOp

Enum SolidOp 

Source
pub enum SolidOp {
Show 20 variants Shape { brep: Vec<u8>, }, Sweep { profile: Profile, kind: SweepKind, op: BooleanOp, }, SweepFace { face: FaceProbe, kind: SweepKind, op: BooleanOp, }, SweepFaceOf { shape: Vec<u8>, transform: Option<Box<[[f64; 4]; 4]>>, point: [f64; 3], kind: SweepKind, op: BooleanOp, }, LoftThrough { sections: Vec<LoftSection>, ruled: bool, closed: bool, op: BooleanOp, }, Loft { sections: Vec<Profile>, ruled: bool, closed: bool, op: BooleanOp, }, Pipe { profile: Profile, spine: Profile, frame: PipeFrame, corner: PipeCorner, sections: Vec<Profile>, op: BooleanOp, }, PipeThrough { profile: LoftSection, path: PipePath, frame: PipeFrame, corner: PipeCorner, sections: Vec<LoftSection>, op: BooleanOp, }, Primitive { kind: PrimitiveKind, placement: Placement, op: BooleanOp, }, Fillet { radius: f64, edges: EdgeSelection, follow_tangent: bool, }, Chamfer { spec: ChamferSpec, flip: bool, edges: EdgeSelection, follow_tangent: bool, }, Draft { angle_deg: f64, neutral_point: [f64; 3], neutral_normal: [f64; 3], pull_dir: Option<[f64; 3]>, faces: Vec<[f64; 3]>, face_names: Vec<TopoName>, }, Refine, OffsetFaces { faces: Vec<[f64; 3]>, face_names: Vec<TopoName>, distance: f64, }, MoveFaces { faces: Vec<[f64; 3]>, face_names: Vec<TopoName>, transform: [[f64; 4]; 4], }, RemoveFaces { faces: Vec<[f64; 3]>, face_names: Vec<TopoName>, }, Thickness { value: f64, open_faces: Vec<[f64; 3]>, open_face_names: Vec<TopoName>, inward: bool, join: ThicknessJoin, both_sides: bool, }, Transform { transforms: Vec<[[f64; 4]; 4]>, originals: Vec<usize>, }, Boolean { tool_brep: Vec<u8>, kind: BoolKind, tool_transform: Option<[[f64; 4]; 4]>, }, Surface(SurfaceOp),
}
Expand description

One step in a body’s build history. Shape-producing steps (Sweep, Loft, Pipe, Primitive) carry a BooleanOp; the remaining steps modify or combine the running solid directly.

A package builds these, so a variant keeps its fields for as long as the contract’s minor version holds: a new option comes as a new variant, or as a new struct that derives Default.

Variants§

§

Shape

Start the chain from a snapshot of another solid, in the native format SolidBuildResult::brep_blob carries. Only ever the first op.

Fields

§brep: Vec<u8>
§

Sweep

Fields

§profile: Profile
§

SweepFace

Extrude a flat face of the running solid: its outer and inner boundaries are the profile and its outward normal the sketch normal. kind is an Extrude.

Fields

§

SweepFaceOf

Extrude a flat face of another shape (native-format shape, moved by transform into this body’s frame): the face of it at point, a face another body lends this one.

Fields

§shape: Vec<u8>
§transform: Option<Box<[[f64; 4]; 4]>>
§point: [f64; 3]
§

LoftThrough

Skin through two or more sections (in order), each a profile, a flat face of the running solid (its boundary) or a point, which only the first or last may be.

Fields

§sections: Vec<LoftSection>
§ruled: bool
§closed: bool
§

Loft

Skin through two or more section profiles (in order).

Fields

§sections: Vec<Profile>
§ruled: bool
§closed: bool
§

Pipe

Sweep a profile along an open or closed spine wire from another sketch, the section turning as frame says and turning its corners as corner says. With sections, the section changes shape down the path, passing through each of them where it crosses the path, in order, the profile first.

Fields

§profile: Profile
§spine: Profile
§corner: PipeCorner
§sections: Vec<Profile>
§

PipeThrough

A pipe whose profile may be a flat face of the running solid, whose path may be edges of a solid, and whose last section may be a point it closes to; the rest reads as for Pipe.

Fields

§profile: LoftSection
§corner: PipeCorner
§sections: Vec<LoftSection>
§

Primitive

Fields

§placement: Placement
§

Fillet

Round the selected edges; with follow_tangent, every edge meeting one of them tangentially joins the selection, and so on along the chain.

Fields

§radius: f64
§follow_tangent: bool
§

Chamfer

Bevel the selected edges, taking tangent chains as a fillet does.

Fields

§flip: bool
§follow_tangent: bool
§

Draft

Tilt the selected faces by angle_deg about their intersection with the neutral plane.

Fields

§angle_deg: f64
§neutral_point: [f64; 3]
§neutral_normal: [f64; 3]
§pull_dir: Option<[f64; 3]>
§faces: Vec<[f64; 3]>
§face_names: Vec<TopoName>

The name of each face, one per point, found by name first; empty or zero where a face has none.

§

Refine

Merge adjacent faces of the solid that lie on one plane: the split a fuse or cut leaves where two pieces meet flush.

§

OffsetFaces

Offset faces of the running solid along their outward normals by distance (negative into the material), the faces around them following on their own surfaces.

Fields

§faces: Vec<[f64; 3]>
§face_names: Vec<TopoName>
§distance: f64
§

MoveFaces

Move faces of the running solid rigidly by transform (row-major, a translation or a rotation), the faces around them following.

Fields

§faces: Vec<[f64; 3]>
§face_names: Vec<TopoName>
§transform: [[f64; 4]; 4]
§

RemoveFaces

Remove faces of the running solid and close the openings from the neighbouring faces’ own geometry: a hole, a boss or a fillet taken away. Faces as points on them, named where they have names.

Fields

§faces: Vec<[f64; 3]>
§face_names: Vec<TopoName>
§

Thickness

Hollow the solid, removing the faces sampled by open_faces.

Fields

§value: f64
§open_faces: Vec<[f64; 3]>
§open_face_names: Vec<TopoName>

The name of each open face, one per point; empty or zero where a face has none.

§inward: bool
§join: ThicknessJoin

How the walls meet where the solid’s faces meet.

§both_sides: bool

The walls stand on both sides of the solid’s faces, value each way, rather than on the one inward says.

§

Transform

Re-apply earlier steps’ tool solids (or the whole current solid when originals is empty) under each transform, fusing additive tools and cutting subtractive ones. originals holds chain indices of earlier shape-producing steps.

Fields

§transforms: Vec<[[f64; 4]; 4]>
§originals: Vec<usize>
§

Boolean

Boolean against an external solid (another body’s shape snapshot, ogeom native-format text bytes).

Fields

§tool_brep: Vec<u8>
§tool_transform: Option<[[f64; 4]; 4]>

Where the tool sits in this chain’s frame, when the two bodies are placed differently: a rigid row-major 4×4 matrix.

§

Surface(SurfaceOp)

A surface step: a sheet added to the body, or the body’s sheets joined, trimmed or mirrored.

Implementations§

Source§

impl SolidOp

Source

pub fn starts_shape(&self) -> bool

Whether the step makes a shape of its own, so a chain may begin with it: a new solid, or a surface step that adds a sheet.

Source

pub fn boolean_op(&self) -> Option<BooleanOp>

The boolean role of a shape-producing step; None for modifiers.

Trait Implementations§

Source§

impl Clone for SolidOp

Source§

fn clone(&self) -> Self

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 SolidOp

Source§

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

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

impl<'de> Deserialize<'de> for SolidOp

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 PartialEq for SolidOp

Source§

fn eq(&self, other: &Self) -> 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 SolidOp

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 SolidOp

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.