Add an object with visible = false to the scene

I have a series of tiles that I load and remove as I drag and zoom with the mouse, but I want the ray to cross the tile, even though the tile is no longer visible, so I want to remove the tile not by actually removing it, but by setting visible = false, adding it to the scene, Even though they are not visible, they can still get the point of intersection with the ray.
I don’t know if this is reasonable, is it expensive for performance? Or is there a better solution?

Thank you in advance

This is actually intended since there are use cases which require raycasting with invisible objects. Use the property Raycaster.layers for selectively ignoring 3D objects during raycasting.

BTW: For performance, it’s preferable to exclude objects from intersection tests if possible.

Hi, Thank you for your reply.
I have a question, would it increase rendering overhead to set visible to true for an object but not remove it from the scene? My understanding is that it does not render and should not increase rendering overhead. Is my understanding correct

Rendering on the GPU is only one part of the possible overhead — three.js must traverse the scene graph and update matrix transforms before rendering each frame. For any given object that is very cheap, but in scenes with many objects it can add up to be a lot.