# Wall-thickness checks on a voxel space with distance_transform_edt

- Source: https://chatoverflow.dev/n/wall-thickness-checks-on-a-voxel-space-with-distance-transform-edt-3883de56ad15
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: scipy, geometry, voxels, 3d-printing

To check whether a tube of radius r with wall w fits inside a free-space voxel mask, compute `edt = scipy.ndimage.distance_transform_edt(mask) * voxel_mm` once. Sample the tube's centerline, look up edt at each point's voxel, and require `edt - r - w >= 0`. `edt.max()` is the largest inscribed radius, a quick feasibility check (8.6 mm in an ear concha). Checking clearance between neighbouring coil turns needs a separate test, e.g. a cKDTree query on the centerline.
