# Generating a watertight mesh for a “thickened wireframe”

Given the ongoing improvements in 3D mesh generation (currently using 11.3), I'm trying to find a robust means for producing a "thickened wireframe" of a given mesh, where the faces are ignored and the edges are thickened into struts. My primary interest is doing this for the models in PolyhedronData, i.e., for small inputs, with the goal of producing a high quality, watertight mesh.

A quick and dirty method is to render a GraphicsComplex of the edges using a Tube of fixed radius for each edge, then applying DiscretizeGraphics to the result. This results in overlapping faces when multiple Tubes meet at a vertex, and when two edges cross or come sufficiently close to each other. But most slicing software can deal with the STL it produces, so it's workable for FDM printing.

Here is an only slightly more intricate method that works nicely for inputs that have just a few edges: Place a (solid) Ball at each vertex, and a (solid) Cylinder at each edge. Apply RegionUnion to the list of balls and cylinders, Discretize the result, and finally, take the RegionBoundary.

For instance:

v = PolyhedronData["TetrahedronFiveCompound", "Vertices"];
e = PolyhedronData["TetrahedronFiveCompound", "Edges"];
mesh = MeshRegion[10 v, Line[e]]


(Note that I multiplied v by 10 to increase the scale of the object.)

With[{radius = .4},
balls = Ball[#, radius] & /@ MeshCoordinates[mesh];
cylinders =
MeshPrimitives[mesh, 1] /. Line[pts_] :> Cylinder[pts, radius];
]


Then discretize and extract the boundary surface:

RegionBoundary[
DiscretizeRegion[RegionUnion @@ Join[cylinders, balls],
MaxCellMeasure -> {"Length" -> .3}]]


In an effort to produce a high-res discretization, I've had the most luck by using the MaxCellMeasure option, keeping the length small. But too small results in a failure of DiscretizeRegion. I'm seeking a resolution that's slightly better than the output above.

I wrote a program a few years ago (before RegionUnion could handle 3D objects) that would replace each face in a GraphicsComplex with a bunch of triangles to frame in the struts explicitly. It used VertexNormals to determine the axis for the depth dimension, so the struts between adjacent faces would fit together nicely. It works fine, and I'm happy to share the code if anyone is interested. But I'm wondering now if a simpler process, like that laid out above, can be refined to do something similar.

• Are you looking for something like Minkowski addition? – anderstood May 10 '18 at 15:01
• I don't think so. Just a 3D-printable mesh that represents the (thickened) edges in a given mesh. – Bruce T May 10 '18 at 15:12
• Couldn't that be the Minkowski addition of the given mesh and a sphere (of chosen radius)? I'm asking because this is a technique used in collision detection to "convexify" meshes; it makes collision detection simpler, and possibly 3D printing too. Thickening is not a clearly defined operation. – anderstood May 10 '18 at 15:18
• See this answer maybe. – anderstood May 10 '18 at 15:19
• Yes, I see. The Minkowski sum of a small sphere centered at the origin with 1-skeleton is the solid version of the object I seek. – Bruce T May 10 '18 at 16:10