Eduardo Camacho
Eduardo Camacho

Reputation: 21

Need help building a STL file

I'm currently working on a project with voronoi cells and I would like to make the following figure into a STL file.

This Figure

Currently, I have been working on matlab and I have all the data collected but cannot make the file in Matlab. Tried doing it Mathematica, where is easiest to make an Stl but harder to make the figure, because you need to manually introduce all the cylinders. Do you have any recommendation? Or where would be better to work? This is the code I have writed in Mathematica

s = Import["C:\\Users\\L\\OneDrive\\Documents\\MATLAB\\3D_voronoi_cuboid_\
bounded\\Cylinders.xls"];

Te = Length[s[[1]]];

For[i = 1, i <= Cil, i = i + 1,
    CilinI[i] = s[[1, i, {1, 2, 3}]];
    CilinD[i] = s[[1, i, {4, 5, 6}]]]

a = Graphics3D[Cylinder[{CilinI[1], CilinD[1]}, 0.01]]; 
b = Graphics3D[Cylinder[{CilinI[2], CilinD[2]}, 0.01]]; 
c = Graphics3D[Cylinder[{CilinI[3], CilinD[3]}, 0.01]];  
d = Graphics3D[Cylinder[{CilinI[4], CilinD[4]}, 0.01]]; 

GGG = Show[a, b, c, d]

Export["file.stl", GGG] 

And here is how the Stl looks with mathematical code: mathematica code

Upvotes: 2

Views: 180

Answers (0)

Related Questions