offset · ·

A pocketed block grown past its pocket's corner radius

offset/pocketed-block-grown-past-its-corners · offset, grow, analytic, concave-edge, vanishing-face, adversarial

The block from (−20, −15, 0) to (20, 15, 10) with a pocket cut down into its top: the rectangle from (−10, −7) to (10, 7), its four corners rounded to radius 2, from the top down to a flat floor at z = 4. Grow it by 3, more than the pocket's corner radius: the solid of every point within 3 of the pocketed block.

The block grows as a box does: each face moves 3 outward, each outer edge becomes a quarter of a cylinder of radius 3, each corner an eighth of a ball. In the pocket, every point within 3 of its walls or its floor is filled: the floor rises to z = 7, the walls come in 3, and the rounded corners, of radius 2, close up, so the pocket left below the grown top is the rectangle from (−7, −4) to (7, 4) with square corners, from z = 7 up to z = 10. Above the pocket, a point is within 3 of the block only within 3 of the pocket's rim, so the grown top dips there: over the straight parts of the rim the dip is bounded by quarter cylinders of radius 3 about the rim's edges, and over each rounded corner by the inner side of a tube of radius 3 about the corner's arc. Section by section, at a height u above the top (0 ≤ u ≤ 3) the opening left is the pocket's outline shrunk by √(9 − u²): the rounded rectangle with its sides moved in that far and its corners' radius 2 − √(9 − u²) where that is positive, square where it is not.

As a set:

$$\Bigl([-20,20]\times[-15,15]\times[0,10] \;\setminus\; \bigl(R \times [4, 10]\bigr)\Bigr) \oplus B_{3},\quad R = \bigl([-8,8]\times[-5,5]\bigr) \oplus B_2$$

expectedclosed form
volume25008.10866V₀ − [(w − 2d)(h − 2d)(D − d) + whd − π(w + h)d²/2 + 8d³/3 − (4 − π)J], V₀ = abc + 2(ab + bc + ca)d + π(a + b + c)d² + 4πd³/3, J = r²(d − q) − 2r(πd²/4 − qr/2 − (d²/2)·asin(q/d)) + d²(d − q) − (d³ − q³)/3, q = √(d² − r²), a = 40, b = 30, c = 10, w = 20, h = 14, r = 2, D = 6, d = 3
area5633.355635A₀ − (wh − (4 − π)r²) + (w − 2d)(h − 2d) + (2(w + h) − 8d)(D − d) + π(w + h)d − 8d² + (2π − 8)d(r·asin(r/d) − (d − q)), A₀ = 2(ab + bc + ca) + 2π(a + b + c)d + 4πd², with the values above

Drawing

Top view
Top
Isometric view
Isometric
Front view
Front
Right view
Right

Third-angle projection, the three views at one scale. Drawn from occt's result, which passed.

Results

cad-kernelocctarriskentronvcadsolidcraftbrepkitpopkernaetherisnext.BREPgeopcadrssmlibspringrepgeomsolveranvilcad
outcomepasspass–––refused–––pass–pass–wrong–refused
volume err.1.5e-162.8e-123.1e-131.5e-162.2e-03
area err.3.2e-164.4e-142.2e-130.0e+002.5e-02
time128 ms659 ms123 ms730 ms44 ms85 ms1.1 ms
CPU time197 ms658 ms122 ms730 ms80 ms84 ms950 µs
memory15.6 MB370.7 MB49.3 MB44 MB12.7 MB10.3 MB3.5 MB
LOC1114112212264

† works around a missing feature. Pick an entry to see its solid, its measures and its code.

offset/pocketed-block-grown-past-its-corners.md, the case as written.