# Edges disappear and faces appear in STL export

I will create a 3D printable model of a kagome lattice on a torus.

My solution:

c[p_, m_, n_, v_] := Join @@ CoordinateBoundingBoxArray[{p, p + {m, n} v}, v];
tor[u_, v_, m_, n_] := {(m + n Cos[v]) Cos[u], (m + n Cos[v]) Sin[u], n Sin[v]};
f[x_, m_, n_] := Rescale[x, {m, n}, {0, 2 Pi}];
torp[m_, n_, a_, b_] := With[{pts = CirclePoints[{##}, 1, 6] & @@@ Join @@ (c[#, m, n, {2, 2 Sqrt[3]}] & /@ {{0, 0}, {1, Sqrt[3]}})}, Map[tor[f[#[[1]], -1, 2 m + 2 - 1], f[#[[2]], -Sqrt[3]/2, (4 n + 3) Sqrt[3]/2], a, b] &, pts, {2}]];
gv[m_?IntegerQ, n_?IntegerQ] :=
Module[{lst, cylinders, spheres, cyR = 0.1, sphR = 0.3},
lst = torp[m, n, (2 m + 3)/(2 Pi), (4 n + 3) Pi/(4 Pi)];
cylinders =
Table[Cylinder[{lst[[i, j]], lst[[i, If[j < 6, j + 1, 1]]]}, cyR], {i, Length@lst}, {j, 6}];
spheres = Sphere[#, sphR] & /@ lst;
Graphics3D[{Black, spheres, cylinders}]
];
output = gv[30, 3];
Print[output];

Old question:

I've used some code of this question.

c[p_, m_, n_, v_] := Join @@ CoordinateBoundingBoxArray[{p, p + {m, n} v}, v]
tor[u_, v_, m_, n_] := {(m + n Cos[v]) Cos[u], (m + n Cos[v]) Sin[u], n Sin[v]}
f[x_, m_, n_] := Rescale[x, {m, n}, {0, 2 Pi}]
torp[m_, n_, a_, b_] := With[{pts = CirclePoints[{##}, 1, 6] & @@@ Join @@ (c[#, m, n, {2, 2 Sqrt[3]}] & /@ {{0, 0}, {1, Sqrt[3]}})}, Map[tor[f[#[[1]], -1, 2 m + 2], f[#[[2]], -Sqrt[3]/2, (4 n + 3) Sqrt[3]/2], a, b] &, pts, {2}]]
gv[m_, n_] := Graphics3D[{EdgeForm[{Thick}], FaceForm[None], Polygon /@ torp[m, n, (2 m + 3)/(2 Pi), (4 n + 3) Pi/(4 Pi)], Point /@ torp[m, n, (2 m + 3)/(2 Pi), (4 n + 3) Pi/(4 Pi)]}]
output = Show[gv[30, 3]]
Export["Kagome3DModell.stl", output];

In the Mathematica script it shows only edges as I want.

After exporting it to a STL file, we can only see the faces.

How can I produce a STL file only showing the edges like in the Mathematica Show-command?

Thank you very much for help.

• The way you construct the lattice is based on polygons. You then "hide" the faces of these polygons with FaceForm -> None, which only modifies the way they are displayed, but doesn't make them disappear. You could try constructing your structure using e.g. Line elements instead. Jun 11, 2018 at 16:09
• I believe STL can't show color. It can only save triangles. Jun 11, 2018 at 16:13
• It's very easy to do it with Blender 3D.1.Import model. 2.Add Modifer-Wireframe-> Apply. 3 And export to STL. Jun 11, 2018 at 16:27