pub enum SolidOp {
Show 26 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,
},
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>,
},
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,
},
}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.
Sweep
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.
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
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
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.
Loft
Skin through two or more section profiles (in order).
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
corner: PipeCornerPipeThrough
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.
Primitive
Fillet
Round the selected edges; with follow_tangent, every edge meeting
one of them tangentially joins the selection, and so on along the
chain.
Chamfer
Bevel the selected edges, taking tangent chains as a fillet does.
Draft
Tilt the selected faces by angle_deg about their intersection with
the neutral plane.
Fields
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.
MoveFaces
Move faces of the running solid rigidly by transform (row-major,
a translation or a rotation), the faces around them following.
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.
Thickness
Hollow the solid, removing the faces sampled by open_faces.
Fields
open_face_names: Vec<TopoName>The name of each open face, one per point; empty or zero where a face has none.
join: ThicknessJoinHow the walls meet where the solid’s faces meet.
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.
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.
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
steps: Vec<PatternStep>Boolean
Boolean against an external solid (another body’s shape snapshot, ogeom native-format text bytes).
Fields
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.
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.
Wrap
A sketch unrolled onto the cylinder or cone its faces lie on, so
its lengths are kept on the surface: the sketch’s middle lands where
a straight projection along its plane’s normal puts it, and the
rest is laid round the surface from there, the way across the
axis turning about it and the way along the axis following it.
Otherwise as SolidOp::Project.
Implementations§
Source§impl SolidOp
impl SolidOp
Sourcepub fn inner(&self) -> &SolidOp
pub fn inner(&self) -> &SolidOp
The op itself, out of any SolidOp::WithTolerance around it.
Sourcepub fn boolean_tolerance(&self) -> Option<f64>
pub fn boolean_tolerance(&self) -> Option<f64>
The tolerance the op’s booleans run at, when one is stated: the
outermost SolidOp::WithTolerance’s.
Sourcepub fn with_boolean_tolerance(self, tolerance: Option<f64>) -> SolidOp
pub fn with_boolean_tolerance(self, tolerance: Option<f64>) -> SolidOp
The op with its booleans run at tolerance, or as it is with none.
Sourcepub fn starts_shape(&self) -> bool
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.
Sourcepub fn boolean_op(&self) -> Option<BooleanOp>
pub fn boolean_op(&self) -> Option<BooleanOp>
The boolean role of a shape-producing step; None for modifiers.