delete faces not visible from outside

Hello !

At work we often get very technical CAD models that we have to reduce to use them in Unity. Because we just need certain machines to be visible from outside I thought of a way to delete inner parts. The idea is to use baking (lightmapping) to genereate an image where every face, that is completely black can be deleted from the mesh.

Im able to select certain faces and delete them with my script, but i don’t know how to gather information of the color of a certain face depending on the uv position on the texture.

I would really appreciate some help. (sorry for my english)

I managed to delete the face that is selected in the uv editor and ich can read out the pixel values of the image, but I can’t figure out how to get the uv coordinate of a certain pixel. Does somebody know how to do that in python ?