Skip to main content

Module operation

Module operation 

Source
Expand description

The operations a crate::Program is made of.

Each is a unit struct implementing Operation, with an Args struct holding everything it needs. Arguments are plain design data — f64 lengths, sketches — and refer to existing entities of the part only by name, never by an internal id: an id only means something inside the one build that produced it, a name means the same thing in every build of the same program (see geop_core_part’s crate docs).

Entities a step builds on directly — a sketch’s plane, what a datum is built from — are EntityRefs: a vertex, edge, face or datum by name, or the origin, a world axis or a base plane.

PartOperation is any one of them together with its arguments: what a program step holds, and what serializes as {"operation": "extrude", "args": {...}}.

Structs§

AddDatum
Adds a datum to the part, named by the operation’s id: a point, an axis or a plane built from the selected entities by one of the Constructions. Like a sketch’s plane, it is built when the step runs and stays where it was, whatever later steps do to what it was built from.
AddDatumArgs
AddSketch
Adds a sketch on a plane to the part, named by the operation’s id: a base plane, a planar face or a datum plane (see EntityRef). The plane is resolved when the sketch is added: a sketch on a face stays where the face was, whatever later operations do to the face.
AddSketchArgs
ArgSchema
One argument of an operation.
Boolean
Combines the solids named a and b into one solid named boolean(B) for the operation B, consuming both.
BooleanArgs
ConstructionSchema
One way to build a datum (see crate::Construction): what it builds, what it needs selected — one entity per input, in any order — and the values it takes besides.
Extrude
Extrudes every region of a sketch along the sketch plane’s normal, into one solid named extrude(E) for the operation E.
ExtrudeArgs
Geometry
Everything an entity can be used as. An entity is usually several at once: a straight edge is a line and a curve, a circular edge an arc, a curve and something round, a datum point a point and a frame.
Handle
One draggable value of a step.
OperationSchema
One operation: its kind (as a program step spells it), a short label, what it does, and its arguments.
Revolve
Revolves every region of a sketch a full turn around one of its lines, into one solid named revolve(R) for the operation R — or, with RevolveArgs::combine, combines that with another solid (see Combine), the result named revolve(R) all the same.
RevolveArgs
SelectionFit
What an editor offers for a selection: what each entity can be used as, and which constructions fit — by the same matching a step applies.

Enums§

ArgKind
What kind of value an argument holds — and so how an editor lets a user enter it.
Combine
What an extrude or revolve does with the solid it builds: keep it as a new body, or combine it with the solid named target — which that consumes, like a Boolean does. Difference cuts the new solid out of the target: an extruded pocket, a drilled hole.
Construction
How a datum is built from its selection: one variant per way, with the values it takes besides. Serialized with its method: {"method": "offset", "distance": 1.0}.
EntityRef
Something picked to build on.
HandleGroup
What a handle belongs to, so an editor can offer only what fits what the user is doing: a feature’s parameters while looking at the part, a sketch’s points while sketching.
HandleMotion
How a handle moves, and how that maps onto its step’s arguments.
PartOperation
An operation together with its arguments, not yet applied to any part.
Role
What a construction needs an input to be.
WorldAxis
One of the world’s three axes.

Constants§

CONSTRUCTIONS
Every Construction, described for an editor.

Traits§

Operation
One kind of operation on a Part.
OperationArgs
An operation’s arguments, described field by field — implemented by #[derive(OperationArgs)].

Functions§

arg_path
A path from &str segments.
inspect_selection
Which constructions fit selection in part (see SelectionFit).
resolve_plane
The frame of the plane plane refers to in part: u/v a sketch’s x/y on it, w = u x v its normal. Fails if it is not a plane.

Type Aliases§

ArgPath
Where a handle writes in its step: field names into the arguments as they serialize — ["distance"], or ["sketch", "points", "7", "x"].