How to retrieve a cube collision by faces

I work for a while on a minecraft game (voxel). I am front a problem for a long time about the collision detection. I want recover the cubes collision from my highlighted black's cube like on the picture , but only on the sides. And not on the edges ! Actually i got all cubes in red and green when i check with the boundingBox method. Actually i use the method with the class "BoundingBox" to check for collisions. Can anyone help me or direct me on the best way for retrive the right cube ?

Code example with the boundingBox methode for check the collision

List<Node> nodeParent = regions[modelSelected.regionIndex].Nodes[modelSelected.Id].Where(m => modelSelected.BoundingBox.Intersects(m.boundingBox)).ToList();


i want to get only the green cube and not the red .. From the black cube in the middle

Thank's a lot guy

you are in a voxel engine which means that each box should have a discrete x, y and z coordinate thus:

if you have a box at index (x, y, z) then you can get all neighbouring boxes by getting the boxes at index (x, y +/- 1, z), (x +/- 1, y, z) and (x, y, z +/- 1)

thus instead of intersecting with the bounding box of the cube you intersect with 3 lines strechting from (x, y-1, z) to (x, y+1, z) and (x-1, y, z) to (x+1, y, z) and (x, y, z-1) to (x, y, z+1)