Expand description
Sweeping planar profiles into B-rep solids and sheets: extruding them
along a straight path (extrude), revolving them around an axis
(revolve, screw), carrying them along a chain of curves
(sweep_along) — all one sweep along a Path (see sweep) — and
lofting through several of them (loft). Every one of them skins a
grid of sections, as a blend’s tool does too (skin).
An algorithm here takes geometry — Profiles
in a plane’s coordinates, Chains, planes —
and builds into a NamedModel. Resolving
a sketch or a picked edge into that geometry, and combining what is
built with a solid, is the operations’ part (geop-ops-extrude-revolve).
With the testing feature — which only other crates’ tests turn on —
[shapes] also builds basic solids directly: cubes, cylinders, spheres,
the fixtures those tests are written against.
Structs§
- Apex
- A point a loft comes to before its first section or after its last:
every curve of the profile next to it runs into it, as a cone into its
apex. Its station is named
name. - Control
- How the profile changes as it travels, besides being carried along the
path (see
sweep_along). Every section of the sweep is the profile mapped about the path’s start point in the profile’s plane — its centre — by a turn and a scale: - Frame
- Where the profile’s plane is at one station of a path: a profile point
(x, y)lies atorigin + x e1 + y e2. - Path
- What a profile is swept along: its stations, and the spans between
consecutive ones — around to the first again for a
closedpath (a full turn), which has as many spans as stations; an open one has one fewer. - Rebuild
- Rebuilds a body some of whose faces were put on new surfaces, around
them: [
geop_lib_shell::rebuilt] and [geop_lib_shell::room], which this crate cannot depend on (its tests sweep their solids), handed in by the caller.Nonewhere the caller has none: a corner at an arc or a spline is then refused. - Section
- One profile to loft through: a closed loop or an open chain, drawn in
plane‘s(u, v)— a closed one counter-clockwise, as a sketch’s outer loop runs — and what its station is called.matched: the joints of a closed loop matched with the other sections’, in the order they are matched (seemarkand the module docs). - Skinned
- What
skinbuilt, by strip, station and joint or curve: the vertices, and the curves’ edges, each with whether it runs against its curve — none for a curve on the axis that no cap bounds. - Strip
- One strip of a skinned body (see the module docs): a loop of joints and
the curves between them — curve
ifrom jointito the next, around to the first for a closed loop, which has as many curves as joints; an open chain has one fewer — through stations and the spans between consecutive ones, around to the first again on aclosedpath, which has as many spans as stations; an open one has one fewer. - Strip
Cap - A flat cap closing off strips at one station: on
surface, its loops one per strip, the outer first, each the strip’s curves there by their pcurves — each running the way its curve does. At the start of the strips (forward), it runs every loop as the curves do; at the end, backwards: the walls run them the other way. - Sweep
Loop - One profile loop or chain to sweep, and which of its joints are poles and which of its curves lie on the axis (see the module docs). A curve on the axis runs between two poles.
Enums§
- Ends
- How a loft ends: before its first section and after its last, a cap
or a point it comes to (see
Apex) — or nowhere, closing on itself from its last section round to its first. - Glue
- What a strip is joined to that was built before it.
- Orientation
- Which way the profile faces as it travels along the path.
- Span
- How the profile travels from one station to the next.
Traits§
- Strip
Geometry - Where a strip’s entities are: its joints, curves, laterals and walls,
by station
s, spanj, joint or curvei.
Functions§
- circle_
at - A circle of radius
raround(cx, cy)as four quarter arcs, counter-clockwise. - extrude
- Extrudes
loops— the first the outer loop, counter-clockwise inplane’s(u, v), the rest holes in it, clockwise — alongplane.w()throughheights(seeextrusion): into a solid namedsolid, its start cap at the first height, or, without one, into sheets. Either way round the solid comes out with its faces pointing outwards, whichever way the plane is handed. - extrusion
- The straight path along
plane.w()throughheights(in multiples ofw, two or more, each further the same way than the one before): the profile, drawn in the plane’s(u, v), at stationsstart,l1,l2, …,end, and a span between each two, namedq0,q1, … where there are several. - loft
- Lofts through
sections(see the module docs): closed loops into a solid namedsolid— capped by the first and last sections — or, without one, into sheets; open chains into sheets only. Itsendsmay instead be points the loft comes to before its first section and after its last: there it closes in a point instead of a cap (seeApex). The tangent of a smooth loft into an apex is a free choice, as at any end section: from its neighbours (see [through]). Or the loft closes on itself (Ends::Closed), running smoothly on from its last section round to its first, through three sections or more, with no caps: a ring. - mark
- The closed
profilewith a joint atpoint, and that joint’s name: the joint already there, or — wherepointlies along a curve — a new one namedjoint, the curve split there, its second halfX#joint. Where exactly along the curve is a free choice within wherepointcould be: the halves are exact pieces of it either way. An error ifpointis on no curve of the profile. - polygon
- The closed polygon through
points(and back to the first), one line per side — the simplest profile loop forcrate::extrude::extrude. - polyline
- The open chain of lines through
points— the simplest profile forcrate::revolve::revolve_at_oriented. - profile_
centre - Where the profile
loops, drawn inplane, is: the centre of its outer loop’s joints — a point to find the nearest end of the path from. - revolution
- The path around the axis
axes.w()throughaxes.origin(), from the anglefromtoto— either way round — in degrees, angles turning fromaxes.u()towardsaxes.v(): a profile point(r, z)at anglealies atorigin + r (cos a u + sin a v) + z w. - revolve
- Revolves
loops— the first the outer loop, counter-clockwise in(r, z), the rest holes in it, clockwise — fromfromtotodegrees aroundaxes(seerevolution): into a solid namedsolid, its start cap atfrom, or, without one, into sheets. Either way round, the solid comes out with its faces pointing outwards. - revolve_
at_ oriented - Revolves
profilea full turn aroundaxes.w()into a solid namedsolid— the way the basic shapes are built:profileruns “top-down”, walked from its first point to its last the region it bounds together with the axis lies on its right (e.g.(0, h) -> (r, h) -> (r, 0) -> (0, 0)for a cylinder). An open chain starts and ends on the axis, and every point of it there is a pole; a closed loop stays clear of the axis and sweeps a ring. - screw
- Sweeps
loops— in(r, z)as forrevolve, the first the outer loop counter-clockwise, the rest holes in it, clockwise — along the screw motion ofscrew_pathinto a solid namedsolid, its faces pointing outwards: a thread, for a profile at most a pitch wide. The profile must stay clear of the axis, and narrower along it than the pitch, or the turns run into each other. - screw_
path - The path of a screw motion around the axis
axes.w()throughaxes.origin(): turning fromaxes.u()ashelixsays, right-handed — fromutowardsv— or left-handed. A profile point(r, z)travels along the helix of radiusrraised byz: the stations and middles of the path are the control rows ofNurbCurve3D::helix(seehelix_rows), exactly on the cylinder, the height within 0.53 % of the pitch of the true helix. Tapered, the profile moves out as it rises, each of its points on a cone, as a pipe thread’s does. - skin
- Adds
stripsand theircapstospec, named innames(see the module docs): first each strip’s vertices, station curves and lateral edges, then every strip’s walls, then the caps. - starting_
near chainstarting where it comes nearest tocentre: an open one at its nearer end, a closed one at its nearest joint. Which is a free choice of where to start; the nearest is what the profile is drawn at.- sweep
- Sweeps
loopsalongpath: into a solid namedsolid, or, without one, into sheets — a shell of walls per loop, with no caps. - sweep_
along - Sweeps
loops— the first the outer loop, counter-clockwise inplane’s(u, v), the rest holes in it, clockwise — alongchain, changing ascontrolsays (see [followed]): into a solid namedsolid, or, without one, into sheets. Either way round, the solid comes out with its faces pointing outwards. - sweep_
drawn sweepsloopsas they are drawn — the outer loop counter-clockwise in the stations’(e1, e2), the holes clockwise — each run the other way first if the path runs alonge1 × e2, where a counter-clockwise outer loop would sweep walls facing inwards.