5

Given a large set of data, I was able to create a 3D graph in Microsoft Excel. How can I create a STL file similar to this graph to create a physical model of this graph? enter image description here

Eric Johnson
  • 2,326
  • 1
  • 20
  • 39

2 Answers2

1

for that you can use openSCAD. Data can be represented as a multi-array and we can iterate on it via for loop

// data structure is x,y,z where z is value 
arrayOfData=[[0,10,4],[0,21,9],[0,13,8],[0,41,2],[1,0,4],[2,0,180],[7,0,90]];    

for(a=[0:1:6])  translate([arrayOfData[a][0], arrayOfData[a][1],0])  cylinder(arrayOfData[a][2],2,.5,false);

And where you get the model it can be intersected with a cube to get the desired shape.

enter image description here

profesor79
  • 2,002
  • 1
  • 11
  • 24
1

I was able to solve this using the openSCAD using the surface command.

From the openSCAD documentation:

//surface.scad
surface(file = "surface.dat", center = true, convexity = 5);
%translate([0, 0,5])cube([10,10,10], center =true);

And creating a space separated data file:

#surface.dat
10 9 8 7 6 5 5 5 5 5 
9 8 7 6 6 4 3 2 1 0 
8 7 6 6 4 3 2 1 0 0
7 6 6 4 3 2 1 0 0 0
6 6 4 3 2 1 1 0 0 0
6 6 3 2 1 1 1 0 0 0
6 6 2 1 1 1 1 0 0 0
6 6 1 0 0 0 0 0 0 0
3 1 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0 0

Then a STL can be exported of the data in openSCAD.

Eric Johnson
  • 2,326
  • 1
  • 20
  • 39