Viviani's theorem in 3D