offset · ·

A ball cut by two planes shrunk by 1

offset/barrel-shrunk · offset, shrink, sphere, planar, analytic, adversarial

A barrel: the ball of radius 5 centered on the origin, cut by the planes z = −3 and z = 3, keeping the part between them, whose flat ends are disks of radius 4. Shrink it by 1: keep every point of it at least 1 from its boundary.

A point is at least 1 inside the ball and at least 1 inside each plane exactly when it is in the ball of radius 4 and between the planes z = −2 and z = 2, so the result is the same kind of barrel: the ball of radius 4 about the origin cut by z = ±2, its flat ends disks of radius √12. Its edges, where the sphere meets the ends, are convex and stay sharp.

As a set:

$$\bigl(B_5 \cap \{\,|z| \le 3\,\}\bigr) \ominus B_1 = B_4 \cap \{\,|z| \le 2\,\}$$

expectedclosed form
volume184.306769∫ π((R − d)² − z²) dz over |z| ≤ h − d = 176π/3, R = 5, h = 3, d = 1
area175.92918862π(R − d)·2(h − d) + 2π((R − d)² − (h − d)²) = 56π

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–––pass–––pass–pass–pass–pass
volume err.0.0e+003.9e-143.1e-161.5e-161.5e-164.6e-161.8e-11
area err.3.2e-166.1e-141.6e-166.5e-161.6e-161.6e-161.9e-11
time8.7 ms629 ms1.27 s33 ms2.8 ms2.4 ms13 ms
CPU time11 ms628 ms1.27 s28 ms2.5 ms2.2 ms12 ms
memory11.3 MB367.9 MB57.3 MB20.8 MB8.7 MB8.6 MB5.3 MB
LOC111071010116

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

offset/barrel-shrunk.md, the case as written.