Three-dimensional boundary detection for particle methods