Skip to main content

Crate geop_lib_sweep

Crate geop_lib_sweep 

Source
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 at origin + 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 closed path (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. None where 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 (see mark and the module docs).
Skinned
What skin built, 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 i from joint i to 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 a closed path, which has as many spans as stations; an open one has one fewer.
StripCap
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.
SweepLoop
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§

StripGeometry
Where a strip’s entities are: its joints, curves, laterals and walls, by station s, span j, joint or curve i.

Functions§

circle_at
A circle of radius r around (cx, cy) as four quarter arcs, counter-clockwise.
extrude
Extrudes loops — the first the outer loop, counter-clockwise in plane’s (u, v), the rest holes in it, clockwise — along plane.w() through heights (see extrusion): into a solid named solid, 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() through heights (in multiples of w, two or more, each further the same way than the one before): the profile, drawn in the plane’s (u, v), at stations start, l1, l2, …, end, and a span between each two, named q0, q1, … where there are several.
loft
Lofts through sections (see the module docs): closed loops into a solid named solid — capped by the first and last sections — or, without one, into sheets; open chains into sheets only. Its ends may 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 (see Apex). 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 profile with a joint at point, and that joint’s name: the joint already there, or — where point lies along a curve — a new one named joint, the curve split there, its second half X#joint. Where exactly along the curve is a free choice within where point could be: the halves are exact pieces of it either way. An error if point is 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 for crate::extrude::extrude.
polyline
The open chain of lines through points — the simplest profile for crate::revolve::revolve_at_oriented.
profile_centre
Where the profile loops, drawn in plane, 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() through axes.origin(), from the angle from to to — either way round — in degrees, angles turning from axes.u() towards axes.v(): a profile point (r, z) at angle a lies at origin + 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 — from from to to degrees around axes (see revolution): into a solid named solid, its start cap at from, or, without one, into sheets. Either way round, the solid comes out with its faces pointing outwards.
revolve_at_oriented
Revolves profile a full turn around axes.w() into a solid named solid — the way the basic shapes are built: profile runs “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 for revolve, the first the outer loop counter-clockwise, the rest holes in it, clockwise — along the screw motion of screw_path into a solid named solid, 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() through axes.origin(): turning from axes.u() as helix says, right-handed — from u towards v — or left-handed. A profile point (r, z) travels along the helix of radius r raised by z: the stations and middles of the path are the control rows of NurbCurve3D::helix (see helix_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 strips and their caps to spec, named in names (see the module docs): first each strip’s vertices, station curves and lateral edges, then every strip’s walls, then the caps.
starting_near
chain starting where it comes nearest to centre: 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 loops along path: into a solid named solid, 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 in plane’s (u, v), the rest holes in it, clockwise — along chain, changing as control says (see [followed]): into a solid named solid, or, without one, into sheets. Either way round, the solid comes out with its faces pointing outwards.
sweep_drawn
sweeps loops as 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 along e1 × e2, where a counter-clockwise outer loop would sweep walls facing inwards.