docs / features / Sweep

Sweep

Status: Implemented — polyline paths (translate), curved paths (pathAlign), closed paths (pathAlign, as a capless ring — flat or not), mitred corners (pathAlign on a cornered polyline) and the whole picture frame (pathAlign on a closed cornered polyline, flat or not). Not built: a corner at a curved segment.

Sweep feature dialog

Sweep carries a closed profile along a path in one of two modes, chosen by orientationMode:

The path isSet orientationMode toWhat you get
a cornered polyline (straight segments)translate (default)the profile keeps its orientation and slides along each segment's chord — one oblique prism per segment, so the corner is handled
smooth — curved, or segments meeting tangentiallypathAlignthe profile is carried by the path's own motion — it keeps the position and the angle you drew it at, and turns exactly as much as the path turns — swept as one continuous tube
smooth and closed (a circle, a rounded rectangle, a loop that leaves its plane)pathAlignthe same carry, all the way round and back to the section it started from — one capless ring, no end faces at all
cornered and you want the profile to follow itpathAligna mitre at every joint: the section is swept along each segment and both sweeps are cut off on the plane that bisects the joint, where they share one face loop — like a picture frame
cornered and closed (a picture frame's whole loop, flat or not)pathAligna frame: a mitre at every joint, the closing one included, and no caps at all
cornered at a curved segmentneither — refuseda mitre needs two straight directions to bisect; a curve has none, and nothing mitres some joints while skinning others
a closed path that crosses itselfneither — refusedthe sweep would pass through itself where the two sides cross

On a cornered polyline the two modes differ only in where the section sits: translate slides it without rotating it, pathAlign turns it through each joint and mitres. translate refuses a curved segment; pathAlign sweeps one. Within pathAlign, a joint smooth to within about 1° is skinned as one continuous tube, and anything sharper is a corner, mitred when both its segments are straight.

For a twisted sweep, use Path Sweep (SWP); this feature refuses a non-zero twist. Path Sweep is a different construction — see Related.

Walkthrough

Sweep walkthrough

Recorded from the running app by BREP_mcp/tests/videos/sweep.json; regenerate every walkthrough with ./build.sh docs-videos.

Inputs

Behaviour

Closed paths: a ring or a frame, with no end caps

A path that comes back to where it started — a circle, a rounded rectangle, a rectangle with sharp corners — has no ends, and under pathAlign it is built accordingly. A smooth loop is a ring (skinned round the loop) and a cornered one is a frame (mitred at every joint, below); both are the same capless shape:

A flat loop comes back to itself after one lap and the section meets itself at the seam. A loop that leaves its plane comes back rolled about the path by the path's holonomy — the solid angle its tangent direction sweeps out on the unit sphere — and the sweep closes it with the smallest counter-twist that does: minus that roll, spread evenly along the path, so there is no seam. A loop with a mirror symmetry, or one that lies on a sphere, comes back unrolled and gets no twist. A section centred on the path still gives A × path length, to the ring's own station accuracy.

A closed path must also not cross itself: two of its sides meeting anywhere but at a corner would make the sweep pass through itself there, so it is refused naming the two sides and how close they come.

A closed path is stationed by its turning as well as its length: 16 stations per quarter turn. Without that, a rounded rectangle's short corner arcs would get two stations each and the ring would cut the corner (measured 6 % low in volume on a 30 × 18 path with 4 mm corners: watertight, and wrong). With it the same path reads within 0.05 % of A × perimeter.

Face naming

Every face this feature builds is named after both the profile edge and the path segment that swept it, so nothing is named by position:

FaceNameContainer
side wall{tag}{profileEdge}:{pathSegment}_SW{tag}{profileEdge}_SW
start cap (portion 0){tag}{faceName}:L{loopId}_START{tag}{faceName}_START
end cap (last portion){tag}{faceName}:L{loopId}_END{tag}{faceName}_END
hole wall{id}:HOLE:L{loopId}:{pathSegment}{id}:HOLE:L{loopId}

{tag} is empty for an empty id, otherwise {id}:. {profileEdge} is the carried {sketchId}:G{gid} name, or EDGE_{i} when the profile edge has none; {pathSegment} is the path edge's own name the same way.

The container is a group name standing for that profile edge's (or hole loop's) faces along every path segment. A single-segment sweep's container holds exactly one face, so a reference stored under the old un-keyed spelling still resolves to the face it always meant. A face profile, which has no sketch loop identity, keeps the un-keyed _START / _END cap spelling.

Interior caps — where two portions meet — annihilate in the union, so only the chain's own two ends survive.

What pathAlign builds

pathAlign applies to the profile the same rigid motion the path itself undergoes. At each point along the path, the section is

section(t) = P(t) + R(t) · (x − P(0))

— the profile x as drawn, moved from the path's start point P(0) to P(t) and turned by R(t), the rotation that carries the path's starting tangent frame to its frame at t. The profile's position relative to the path, and its angle to the path, are the ones you drew. Consequences:

Every other curve — a spline, a solid's edge, including one that happens to be helical — turns the profile the least it can while following the path (a rotation-minimizing frame). On any chain of lines and arcs that is exactly the turning each arc does about its own centre, so the rules above hold piece by piece. It is not a helix's screw: without the axis, a profile carried up a helix slowly rolls about the path — by 170° over three turns of a radius-5, pitch-5 coil. The joints between pieces pass the profile on without a jump.

The start cap lies in the sketch plane, where you drew the profile. The path does not have to start on the profile, or touch it; an offset profile on a curved path sweeps the ring that offset traces.

A section wider than its own bend

A round section carried through a bend TIGHTER than the section is wide does not fold: it sweeps a real solid, and Sweep builds it. Think of a wire bent round a mandrel narrower than the wire — the material on the inside of the bend reaches past the centre of the turn and out the other side, and everything it passes through is swept.

This is built for one shape: a circular section carried along a circular path, drawn on the path and square to it under pathAlign (or any circular section under Path Sweep's Transplant placement, which moves the section onto the path anyway). The result is the region the moving disc actually covers, a shape of revolution:

Refused:

Under the bar — a section narrower than its bend — the section is skinned between stations as usual.

Cornered paths under pathAlign: a mitre

A joint where two straight segments meet at an angle is built as a mitre, the way a picture frame's corner is cut:

Two joints are refused, both quoting what they measured:

A closed cornered path: the whole frame

A closed cornered polyline — a picture frame's whole loop — is built as the frame, with a mitre at every joint including the closing one and no caps at all. On a FLAT loop the section carried once round comes back exactly as it started, so the closing mitre is cut like any other and the result has no seam and no start or end face.

A loop that is not flat comes back rolled about the path, and the frame is closed by a counter-twist: the roll is shared out over the sides in proportion to their length, and each side turns its share about its own centre line over the middle half of its length, where no mitre cuts the section — the mitres stay exact, and there is still one wall per (side × profile edge). A section centred on the path still gives A × perimeter; an offset one follows the corner law with each corner reading the section as it arrives, already turned.

For n sides and a section of m edges: n · m walls and nothing else, n · m vertices and 2 · n · m edges, so V − E + F = 0 — the same genus 1 a smooth ring has.

Refused, each quoting what it measured:

A frame's section may sit anywhere across the path — centred on it, or offset so the frame hangs inside or outside the loop you drew. Centred, the volume is exactly section area × path perimeter; offset, it is A × perimeter − 2 · (∫ξ dA) · Σ tan(θ/2). A 6 × 4 section round a 40 × 28 rectangle, drawn 1 toward the inside, measures 3072 against that closed form to fifteen significant figures — where four un-mitred prisms unioned would read 3008 and their plain sum 3264.

A path that MIXES the two — some joints sharp, some segments curved (a rectangle with one corner rounded) — is refused: the mitre needs every segment straight, the smooth lane needs every joint tangent-continuous, and nothing builds one construction for some joints and the other for the rest. Round every corner, or leave every corner sharp.

Face naming under pathAlign

On a smooth path pathAlign builds one tube, so there is exactly one side wall per profile edge, named with the container spelling from the table above, {tag}{profileEdge}_SW. Caps keep the loop-keyed {tag}{faceName}:L{loopId}_START / _END, and there are no interior caps.

A mitred path has a wall per (profile edge × path segment), so it takes exactly the per-segment spelling translate uses — {tag}{profileEdge}:{pathSegment}_SW, under the same container. A reference into a mitred pathAlign sweep and one into a translate sweep of the same path are the same string. A mitre joint has no cap, and a closed cornered path registers no _START / _END name, exactly as a ring does not.

Because both modes key on the carried {sketchId}:G{gid} profile-edge name, re-picking the path or inserting a segment never moves a name, and a reference stored against the container resolves under both modes — switching orientationMode does not break it. A reference to a specific per-segment wall (…:{pathSegment}_SW) will not resolve after a switch to smooth pathAlign, because that face no longer exists.

Limitations

Where to find it

Offered in the Modeling and All workbenches. Type code SW.