Choice of location

Hey guys!! i want to add for example a cube to a scene that contain a plane geometry, when the cube is added to the scene, automaticly a part or parts of the plane became colored (it’s a sign that the cube can be placed in this colored zone according to his dimensions).
I can use the raycaster but i don’t know how. any help plz!

I suspect the code for the voxel painter example could be re-adapted to fit your scenario, or, it may give you some ideas on how to structure your scene to make what you want to do a little easier.