Idea for an algorithm to reliably repair the worst of non-manifold errors

Not sure if this is the right subforum, but I couldn’t find another suitable subforum.

I’ve been trying to export and slice a particular model for 3D printing. Some mesh errors…just can’t be fixed autonomously–in this case, self-intersections that neither Netfabb or Meshlab would touch. The model, however, has a very obvious inside and outside, so theoretically it’s not too hard to fix.

Rather irritated, I wrote up an outline for an algorithm to identify what parts of a mesh are on the outside of the object–without using the definition of a manifold–and remove sections (of faces, or whole faces) without an outside face.

In fact, many Blender tools (booleans, normals>recalculate outside, etc) fail to function properly because they can’t identify the outside of a mesh reliably via a manifold approach. As best I can tell, there doesn’t exist a contemporary solution to the problem.

Here an outline of how the algorithm would function

I lack experience with Python, and I haven’t taken the maths classes required to deal with mesh processing and ray-tracing (a small amount of ray-tracing is used). I’ve read a fair bit about the maths and understand them in principle but lack the training to implement them.

If anyone wants to take the idea and run with it, have at it.

If anyone wants to work with myself and others on either a Blender script or a standalone mesh-repair program, that’d be excellent too. I’d help out with procedural stuff, if not the code itself–although I learn quickly enough that I may be able to help there too.