0
$\begingroup$

I made these two Regular skew apeirohedra using Graphics3D.

The flow of my code is like this :

(1) calculate all vertexcoordinates and faceindices

(in "mucube", but in "muoctahedron" I just used PolyhderonData and constructed parallel transport using for-loop)

(2) connect all coordinates and indices using Polyhedron

muoctahedron = {};
muoctahedronindex = 0;
For[x1 = 0, x1 < 3, x1++, 
  For[x2 = 0, x2 < 3, x2++, 
   For[x3 = 0, x3 < 3, x3++, 
    muoctahedronindex = muoctahedronindex + 1; 
    AppendTo[muoctahedron, 1]; basiccoordsmove1 = {}; 
    For[i = 1, i < 25, i++, 
     ahah = basiccoords[[i]] + x1 {-2, 2, 0} + x2 {2, 2, 0} + 
       x3 {0, 0, 2 Sqrt[2]}; AppendTo[basiccoordsmove1, ahah]]; 
    muoctahedron[[muoctahedronindex]] = 
     Polyhedron[basiccoordsmove1, basicindices]]]];
Graphics3D[muoctahedron]

(3) this code is working really well. It made the muoctahedron successfully (the pic is below there).

My question is how can I make these Graphics3D files to stl form??

I've already tried this, but didn't work on my one.

mucube muoctahedron

Edit * basiccoords and basicindices are below here * enter image description here

Edit the code of mucube is like this

ycoordinate = {};
xcoordinate = {};
zcoordinate = {};
cubeminindex = {2, 4, 7, 9, 11, 14, 16, 19, 21, 23, 26, 28};
generalindex = {};
For[g = 1, g < 5, g++, 
 For[i = 0, i < 6, i++, 
  For[j = 0, j < 6, j++, AppendTo[ycoordinate, {j, g, i}]]]];
For[g = 1, g < 5, g++, 
 For[i = 0, i < 6, i++, 
  For[j = 0, j < 6, j++, AppendTo[zcoordinate, {j, i, g}]]]]; 
For[g = 1, g < 5, g++, 
 For[i = 0, i < 6, i++, 
  For[j = 0, j < 6, j++, AppendTo[xcoordinate, {g, j, i}]]]];
For[g = 0, g < 4, g++, 
 For[i = 1, i < 13, i++, 
  index1 = {cubeminindex[[i]], cubeminindex[[i]] + 1, 
   cubeminindex[[i]] + 7, cubeminindex[[i]] + 6} + 36*{g, g, g, g}; AppendTo[generalindex, index1]]];
tmpz = Polyhedron[zcoordinate, generalindex];
tmpx = Polyhedron[xcoordinate, generalindex];
tmpy = Polyhedron[ycoordinate, generalindex];
mucube = {tmpx, tmpy, tmpz};
$\endgroup$
7
  • $\begingroup$ Maybe with DiscretizeGraphics to turn it into a MeshRegion and then simply with Export applied to the resulting MeshRegion. $\endgroup$ Commented Apr 11, 2020 at 6:08
  • $\begingroup$ @HenrikSchumacher already tried it, but didn't work :( $\endgroup$ Commented Apr 12, 2020 at 11:40
  • $\begingroup$ Unfortunately, I cannot hep you any further because you did not provide the definitions of basiccoords and basicindices. $\endgroup$ Commented Apr 12, 2020 at 11:43
  • $\begingroup$ @HenrikSchumacher I just uploaded the definitions. Maybe thickness is the problem...? $\endgroup$ Commented Apr 13, 2020 at 3:29
  • $\begingroup$ Export["test.stl",BoundaryDiscretizeGraphics/@muoctahedron//RegionUnion] $\endgroup$
    – chyanog
    Commented Apr 13, 2020 at 3:56

1 Answer 1

1
$\begingroup$

A simple workaround, replace Polyhedron with Polygon in your code, then you can export it to STL format directly

Export["muoctahedron.stl", Graphics3D[muoctahedron]]
Export["mucube.stl", Graphics3D[mucube]]
$\endgroup$
2
  • $\begingroup$ I started it from the very first and made it! thanks:) $\endgroup$ Commented Apr 13, 2020 at 12:01
  • $\begingroup$ @dodo_nuna_2nd You're welcome:) $\endgroup$
    – chyanog
    Commented Apr 13, 2020 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.