Calculating inner walls for a hollow solid shape.

I’m looking for some sample code, or an algorithm, or a free function library, or a well-written blog post, that can take a mesh that defines an enclosed solid and calculate the vertices for an “inner” mesh to make that solid hollow while retaining a specific relatively uniform wall thickness.

The input mesh would be 2-manifold, and the output mesh would need to be as well.

If it’s not obvious from the description, this would be for 3D printing. :slight_smile:

My geometry is all surfaces of rotation right now, think a vertical cylinder with varying radii along the Y axis, but it would be nice if the algorithm can handle any kind of mesh.

I’m using OpenGL-ES 2.0.

How about this:

  • Duplicate the vertices and offset them along their normals. Offset distance being equal to desired shell thickness.
  • Build the new inner (or outer) shell faces by replicating the original topology
  • Reverse the normals for new vertices/faces

The problem actually has nothing to do with OpenGL. If your mesh is not generative you can use any 3d modeling application (e.g. Blender) and just extrude the mesh.

[QUOTE=nenad*;1257580]How about this:

  • Duplicate the vertices and offset them along their normals. Offset distance being equal to desired shell thickness.
  • Build the new inner (or outer) shell faces by replicating the original topology
  • Reverse the normals for new vertices/faces[/QUOTE]

I tried that, and it creates numerous gaps and intersections- the model needs to be manifold.

No, the problem does have to do with OpenGL- that’s why I asked the question here.
My program generates the models- it is the 3D modeling application.

How come if the original, from your description, is a closed 2-manifold mesh shell? Should work fine if you displace along averaged vertex normals.

OpenGL is rendering API. Your problem is with mesh data generation, if I understood it correctly.

sometimes a visual description helps:

(the forum won’t let me post URLs (including images)… sorry for the inconvenience)