PDA

View Full Version : Calculating inner walls for a hollow solid shape.

Utopian
01-30-2014, 07:03 PM
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. :)

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.

02-01-2014, 06:06 AM

- 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.

Utopian
02-01-2014, 07:00 AM

- 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

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

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.

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.

02-01-2014, 08:37 AM
I tried that, and it creates numerous gaps and intersections

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.

No, the problem does have to do with OpenGL- that's why I asked the question here.

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

Tcll5850
02-15-2014, 08:59 AM
I tried that, and it creates numerous gaps and intersections- the model needs to be manifold.

sometimes a visual description helps:
http://lh3.ggpht.com/-W3QlL2uQQOY/Uv-bpA2D9QI/AAAAAAAAF_A/ybRl7HfNIjo/s400/shelling.png
(the forum won't let me post URLs (including images)... sorry for the inconvenience)