Skip to main content

fillet_edge

Function fillet_edge 

Source
pub fn fillet_edge(
    model: &mut Model,
    solid: &Shape,
    edge: &Shape,
    radius: f64,
    tol: Tolerances,
) -> OgeomResult<Built>
Expand description

Round a convex edge of a solid with a constant-radius blend tangent to both of its faces.

Two seats are recognised, and each has a closed-form envelope: a straight edge between two planar faces, where the rolling ball traces a cylinder, and a circular rim where a cylindrical or conical wall meets a perpendicular planar cap, where it traces a torus. In both, the result is the boolean difference with a wedge whose curved face is that envelope, so the history reads as a cut: the faces are modified into their trimmed pieces, and the edge’s neighbourhood gains the blend face.

The blend is the one fillet_edges builds on this one edge. Where a face cuts the corner away past an end (a floor giving way to a ramp under a wall that carries on, or a boss’s cylinder past the end of a straight edge beside it), both run it out onto that face until its whole section has left the material. Where a host face narrows along the edge and the ball’s contact runs off it out of the solid, both cut the band off on the face that follows. Where a convex edge’s face is a planar strip narrower than the setback all along, its far edge convex too and its ends on faces square to the edge (a chamfer, a narrow top), the ball rolls between the planes either side of the strip, and where the strip lies wholly in the corner that ball takes off, the round is that ball’s cylinder and the strip goes with the corner. Where a concave edge’s face is such a strip and its far edge is straight and convex (the seam where two solids are fused at a slant), the ball touches the other face and rests on that far edge, and where it does so alone over the whole crease, clear of every other face, the round is the band fitted through those balls’ arcs. Where it rests there over part of the crease, coming down on a face either side or rolling round a corner of the strip onto its next edge, the round is a chain of such bands meeting tangent where the ball changes what it holds. One thing differs: where the edge ends against a neighbouring blend, this blend stops flush there instead of running on through it. Three such flush blends and their vertex are what round_vertex closes.

What solid shares with other shapes is copied before it is worked on (ogeom_algo::on_own_nodes), which leaves them as they are.

§Errors

OgeomError::Construction if the edge is neither of the seats above, is concave, or radius is not a usable length, or the ball sets back past the far side of a face into the material, or past it all along the edge where no strip is taken off and no far edge holds the ball as above; naming why where the ball rests on such a far edge but comes onto the face beyond it, rests on far edges either side at once, or leaves a face or comes within its radius of another along the crease.