pub fn round_vertex(
model: &mut Model,
solid: &Shape,
vertex: &Shape,
radius: f64,
tol: Tolerances,
) -> OgeomResult<Built>Expand description
Round a solid’s vertex with a ball of radius.
The corner block spanned by the edges, less the ball seated a radius in from every host plane, is exactly the spike a rounded corner sheds, and the general boolean does the shedding. The block’s faces through the ball’s centre are square to the edges, so each edge’s flush band ends on the ball’s rim: three sequential fillets at a box corner followed by this call round the vertex the setback way. At a vertex of more edges the corner goes first and the fillets follow (four bands built before the corner crash into each other at a pyramid’s apex) and the block is the polyhedron of the N host planes and the N planes square to the edges.
Where one ball touches every face, a band that another of the corner’s bands stopped short of the block is carried back to it first. Rounded one at a time, an edge’s band runs out past the vertex where the face there leans out past its cap, and the band of an edge it crosses stops flush against it, further out than the block reaches. Carried back, that band too ends on the ball’s rim, as every band does at a corner where none ran out. A band stopped by anything else (a notch across its crease) is left as it stands, and the crease before it stays sharp.
A vertex whose planes share no tangent ball (a rectangular pyramid’s apex, any general N-edged vertex) is rounded by the envelope of every ball a radius in from all of them: a sphere at each vertex of the region the ball’s centre may occupy and a cylinder along each ridge between two of them, each cut with its own compartment, the spheres by the one-ball tool on their three planes and the ridges by the flush fillet of a virtual crease. The compartments meet on the planes square to the ridges, cap to cap.
A vertex where a curved face meets (fewer than three planes pass through it) is rounded by the one ball touching the three surfaces that do, wherever they curve: its centre walked to a radius in from each, the compartment bounded by the three planes through the centre and two touch points, clipped to the solid, less the ball.
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
vertex is not a vertex of the solid; if fewer than three planes pass
through it and other than three surfaces do, or the ball does not seat
inside every face; if the region the ball’s centre may occupy has a tip vertex touching more than three planes
without one ball touching all of the corner’s, or with other than three
edges leaving it; or if the corner turns out concave, where a ball adds
material instead of shedding it and a tool built from a cut cannot say
so. The corner may be oblique: the block is then the hexahedron bounded
by the host planes and the three planes through the ball’s centre
square to the edges.