Skip to main content

SolidOp

Enum SolidOp 

Source
pub enum SolidOp {
Show 31 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, }, RevolveToFaceOf { profile: Profile, kind: SweepKind, shape: Vec<u8>, transform: Option<Box<[[f64; 4]; 4]>>, point: [f64; 3], 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, corner: FilletCorner, distances: Option<RoundDistances>, auto: bool, variable: Option<VariableRadius>, }, BlendFaces { radius: f64, faces: [FaceProbe; 2], }, Chamfer { spec: ChamferSpec, flip: bool, edges: EdgeSelection, follow_tangent: bool, corner: ChamferCorner, }, 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>, }, TransformCopies { transforms: Vec<[[f64; 4]; 4]>, originals: Vec<usize>, }, Pattern { steps: Vec<PatternStep>, originals: Vec<usize>, skipped: Vec<u32>, }, Boolean { tool_brep: Vec<u8>, kind: BoolKind, tool_transform: Option<[[f64; 4]; 4]>, }, Surface(SurfaceOp), WithTolerance { tolerance: f64, op: Box<SolidOp>, }, Project { profile: Profile, faces: Vec<FaceProbe>, mode: ProjectMode, height: f64, }, Wrap { profile: Profile, faces: Vec<FaceProbe>, mode: ProjectMode, height: f64, }, HalfSpace { origin: [f64; 3], normal: [f64; 3], }, OffsetSolid { distance: f64, }, Scale { factors: [f64; 3], centre: Option<[f64; 3]>, }, KeepPiece { near: [f64; 3], },
}
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]
§

RevolveToFaceOf

Revolve a profile until it meets a face of another shape (native-format shape, moved by transform into this body’s frame): the face of it nearest point, a face another body lends this one. kind is a Revolve, whose own termination is not read.

Fields

§profile: Profile
§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. With distances, the round meets one face radius from the edge and the other distances.other. With auto and one edge, a face too narrow for radius takes its contact as far as it goes while the other’s goes on to radius, the round turning elliptical. With variable, the radius runs from radius along the edges.

Fields

§radius: f64
§follow_tangent: bool
§auto: bool
§

BlendFaces

Round between two faces of the running solid, which need share no edge: the ball rolling between them, its round filling or taking off what lies between it and the faces’ meeting (a step across a groove).

Fields

§radius: f64
§faces: [FaceProbe; 2]
§

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

TransformCopies

SolidOp::Transform with the originals themselves left out: the steps originals names build their tools without adding or cutting them, so only the transformed copies go in. With originals empty the running solid gives way to its copies.

Fields

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

Pattern

SolidOp::Transform whose transforms the chain works out from steps where the op stands, so a step may follow an edge of the solid as it is there. Occurrence 0 is the original; with it among skipped, only the copies go in, as SolidOp::TransformCopies.

Fields

§originals: Vec<usize>
§skipped: Vec<u32>

Occurrences left out, by index: 0 the original, then each copy in the order the steps make them.

§

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.

§

WithTolerance

op with its booleans run at a stated tolerance: geometry within tolerance mm of touching counts as touching, so faces that nearly meet are joined rather than left with a gap or a sliver between them. The op keeps its place in the chain, as a pattern’s originals count it.

Fields

§tolerance: f64
§

Project

A sketch carried along its plane’s normal onto faces of the running solid, each face split along the curves where they land; mode says whether the regions the curves enclose then stand out of the faces or sink into them by height.

Fields

§profile: Profile
§height: f64
§

Wrap

A sketch wrapped onto the curved surface its faces lie on: the sketch’s middle lands where a straight projection along its plane’s normal puts it, and the rest is laid onto the surface from there. A cylinder or cone is unrolled, every length kept, the way across the axis turning about it and the way along the axis following it; any other surface takes it as a flat sheet laid by geodesic polar coordinates, lengths out from the middle kept and lengths across them stretched by the surface’s curvature. Otherwise as SolidOp::Project.

Fields

§profile: Profile
§height: f64
§

HalfSpace

Keep the running solid’s material on one side of a plane: the side normal points to from origin. A plane that leaves nothing on that side fails, saying so.

Fields

§origin: [f64; 3]
§normal: [f64; 3]
§

OffsetSolid

Grow the running solid by distance everywhere along its faces’ outward normals, or shrink it with a negative one: every face moved that far and the faces around it following, its topology kept.

Fields

§distance: f64
§

Scale

Scale the running solid by factors along the body’s X, Y and Z about centre, or about the middle of its bounding box when that is None. Equal factors keep its surfaces’ kinds; unequal ones restate them as the kernel’s general transform does.

Fields

§factors: [f64; 3]
§centre: Option<[f64; 3]>
§

KeepPiece

Keep one piece of the running shape: of its solids, the one nearest near, the others left out.

Fields

§near: [f64; 3]

Implementations§

Source§

impl SolidOp

Source

pub fn size_limit_key(&self) -> Option<u64>

What a fillet’s or chamfer’s largest size depends on, hashed: the op with its sizes left out. None for any other op.

Source§

impl SolidOp

Source

pub fn inner(&self) -> &SolidOp

The op itself, out of any SolidOp::WithTolerance around it.

Source

pub fn boolean_tolerance(&self) -> Option<f64>

The tolerance the op’s booleans run at, when one is stated: the outermost SolidOp::WithTolerance’s.

Source

pub fn with_boolean_tolerance(self, tolerance: Option<f64>) -> SolidOp

The op with its booleans run at tolerance, or as it is with none.

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.