Export STL or .depth file of only the mesh visible from the camera

Hi there,
Does anyone know if there’s a way to export an STL of .depth file of the scene, but keeping only the mesh visible from the active camera (instead of all the meshes even if they can’t be seen from the camera), centered on the position of the camera? I have been looking for it for a while, as I think it can be really interesting for virtual tour representations, but I can’t find a way.
Thanks!