How to remove internal geometry programmatically in all meshes in .OBJ file? I have an .OBJ 3D model with many complex meshes shape.

The meshes are complex because each of them have multiple internal mesh located in it.

Meshes with internal geometry is defined as a mesh, which consists of many nested geometry.
For example: a tank in .OBJ file is represented by 1 outer geometry with several nested small geometry in it. Total number of geometry to represent that tank would be 5-7.

I want to simplify the tank mesh object above to be represented by 1 geometry instead of multiple geometries.

What tool and what programming language can I use to iterate all the meshes object, remove all internal geometry in .OBJ file?

Please ask if you need clarification.

Thank you.
This would not be perfect but should probably work well enough for your use case - you could render the objects from lots of different angles with a different solid color for each mesh component (without lighting) then remove any meshes that didn't appear in the final image by counting the pixel colours.
If the objects aren't split up into separate meshes then do this by repeatedly merging groups of triangles which share a vertex into the same group, starting with one group per triangle or polygon.