pub fn fillet_faces(
model: &mut Model,
a: &Shape,
b: &Shape,
radius: f64,
trim: bool,
tol: Tolerances,
) -> OgeomResult<Built>Expand description
Round the corner between two faces of separate shapes with a rolling
ball of radius.
The ball rolls on the side each face’s normal points to: it touches the front of both. Reverse a face to roll it on that face’s other side.
Where the faces’ surfaces share a direction or an axis the round has a closed form:
- two planes meet on a line, and planes and cylinders all along one
direction share it: the ball’s centre runs along that direction, it
touches each face along a line, and the round is a cylinder of
radiusrunning over the stretch both faces reach (where each face’s line of contact crosses it), ending square to the direction; - planes square to an axis and cylinders, cones, spheres and tori about
it share the axis: the ball’s centre turns about it, it touches each
face along a circle, and the round is a torus about the axis with
radiusfor its tube, running over the turn both faces reach and ending in half-planes through the axis, or all the way round where both lines of contact close on their faces.
Where such surfaces cross in more than one corner the ball touches both faces in (the walls of two drums fused side by side), every corner is rounded, each over its own run, as long as the corners stand apart.
Otherwise (a B-spline face, a cylinder at a slant to a plane) the ball
is marched along where the two surfaces cross, or, where they do not
cross and the round bridges a gap, along where the surfaces offset by
radius cross. A plane’s or a cylinder’s window is widened and a
B-spline patch continued past its face for the march, each written back
as the face’s own surface. The round is a B-spline band fitted through
the ball’s arcs over the stretch both faces reach, ending in the ball’s
sections there, or, where the ball touches both faces all the way round
a closed seat (a tube through a floor at a slant, two pipes crossing),
fitted closed round the loop with no ends. Where both faces let the
ball go round a closed seat, never at the same place, there is a round
over each stretch both hold it. It rides both faces within a tenth of a
degree.
With trim, each face is cut back to its line of contact (everything of
it on the round’s side of that line goes) and the result is one shell
of the two trimmed faces and the round, sharing an edge along each line
of contact; where a face’s line of contact runs past the round’s ends
(or closes round on itself), the rest of it stays free boundary. Over
several corners each face is cut back along every line of contact it
holds, and the shell holds every round; over several runs each face is
cut once along its line, which every run’s round shares, and the line
between the runs stays free boundary. Without it the faces are left
as they are and the result is the round alone, or a compound of the
rounds, its normal following the faces’ as in the shell.
History: each face generates every round; with trim, each face is
modified into its trimmed self.
§Errors
OgeomError::Construction, by
name, where:
radiusis not a positive length;- an argument is not a face, or the two are one face;
- a face is placed;
- a face is a trimmed or offset surface and the seat has no closed form;
- for a marched round, no ball seats on the front of both surfaces
along where they (or their offsets) meet, a line of contact does not
cut its face from boundary to boundary, or more than one corner holds
a ball touching both faces; with
trim, a line of contact closed round its face does not part it into pieces covering it once; - two planes are parallel, or no ball of
radiustouches the front of both surfaces, or it does not fit inside a curved face, or more than one does and touches both faces in corners close enough that their rounds could meet; - the ball touching both surfaces misses a face, or touches the two at the ends of a diameter, or its round would be a torus crossing its own axis;
- for two planes, a face does not reach its line of contact (it lies wholly beyond it, or wholly between it and the corner);
- where the seat has a closed form, a line of contact crosses its face
more than once; on a marched seat each crossing is a stretch and the
round a run over each overlap, but with
trima line crossing a face’s seam, or over a stretch no run lies along, is refused; - the stretches the two faces reach do not overlap;
- one face’s line of contact closes on itself across the face’s own boundary (round a seam) while the round spans only part of the turn;
- with
trim, cutting a face back over one stretch leaves it in more than one piece, or leaves a placed face, or, over several corners, a later corner’s line of contact misses what the earlier cuts left of the face or the cut along it rebuilds an earlier one’s edge.