geop-ops-extrude-revolve
This page is a reference to the crate; these operations are taught in Lecture 26 to Lecture 28.
Extrude, revolve, sweep and loft operations. They resolve what their
arguments refer to — the sketch’s areas as profiles
(geop_ops_model::sketch::shape_profiles), the axis, the path — and sweep them
with geop-lib-sweep, which describes the sweeps
and how what they build is named. With the testing feature, testing
draws the sketches and pushes the extrusions other crates’ program tests
start from, and testing::bodies the boxes, cylinders and spheres the
stress sweeps of geop-ops-fillet and geop-ops-shell blend and shell.
Both features write sketches, so the sketch operations are optional
dependencies of theirs: the crate itself depends on no other operation.
Its examples — box_with_drill_hole, bracket, cross_drilled_shaft,
handle_with_hole, luggage_tag, revolved_cone_on_box,
parametric_plate, pipe, name_plate (a word embossed on a plate),
and edge_part and square_thread, drawn in the editor and kept
as the .geop text it saved (src/drawn/) — are registered with its
operations when the feature examples is on; each is
tested to round-trip and to build incrementally (example_tests.rs). The
programs from bug reports, rebuilt in Rust, are regression_tests.rs.
The operations
Sweep sweeps one sketch’s area along another sketch’s one chain or loop
of curves, starting at the end (or joint) of the path nearest the profile;
Loft lofts through several sketches’ single loops, in order. Both keep a
new body or take a Combine, and as a face build faces standing on
their own.
Extrude and Revolve are the operations a program uses (see
geop-core-editor):
they sweep a sketch of the part into a solid, and name everything after the sketch’s elements. A sketch’s
areas — each an outer loop and its holes — are swept together, each a lump
of the solid with caps of its own: the first area’s are start and end,
every other’s start and end followed by the least name of its outline’s
curves, extrude(E,end,K,c5#2). That is how a text is embossed or
engraved, a lump or a pocket per letter. Up to the next face takes one area
only, each area going as far as a face of its own; blind and through all
take any.
How far they go is an Extents: the first side a length — an angle, for
a revolve — UpToNext or ThroughAll, along the plane’s normal or, if
reversed, against it; symmetric, the same the other way (half a length
each way); or else an optional second side on its own terms. Up to next and
through all go as far as the target solid. Through all is just a length
reaching past all of it, so sides without up to next build one sweep between
their ends. A side going up to the next face is built on its own from the
sketch’s plane, long enough to reach past the target — for a revolve, short
of a full turn, which needs the target clear of the axis — and combined
with boolean_up_to_next (see geop-lib-booleans):
a join grows up to the target, a cut or an intersection takes the first
stretch of the target the profile passes through, and a new body — which
goes up to the next face of any solid of the part — is that piece alone,
the solids left as they are. If the target stops only part of the profile
and the rest goes on past, the side goes exactly as far as the profile
first meets the target (the nearest corner of where the two overlap) — or,
for a cut or an intersection meeting nothing up to there, on to where it
next meets it. The second side built so is named within side2.
As a face, they sweep the sketch’s curves — its area’s outline, or one
open chain of curves enclosing nothing — into faces standing on their own,
part of no solid: what Split cuts a solid with. A face going up to the
next face of a solid picked for it is trimmed where it meets it
(trim_up_to_next), leaving the solid as it is.
Editing one, the sketch is picked in the viewport and the extrude’s lengths
are handles. A revolve’s axis is any line in the sketch’s plane — a line of
the sketch, a datum axis, a frame’s axis, a straight edge: the area,
holes and all, lies on one side of it, and touches it only at points of the
sketch on it: where the constraints put them, or where the solved sketch
cannot tell them from the axis. A new revolve has no axis: the field waits
for a click. Dragging or typing the first length across the sketch plane turns a
join into a cut and back; on either side, how to combine stays what was
chosen — an extrude may cut upwards into a solid above its sketch. Both
take a Combine from geop-ops-model: keep the
result as a NewBody, or immediately unite, intersect or subtract it with a
target solid — which is why this crate depends on the booleans, not the
other way round.