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

<pre><code>// 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);
</code></pre>

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

<p><a href="https://i.sstatic.net/kje3Z.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kje3Z.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2018-04-27T15:07:33.843Z
I think the trick is to ensure that your CAD tool creates a mesh connecting the desired data points (and not connecting where you don't want it to).  Can you eleaborate on this?
Carl Witthoft
CC BY-SA 3.0
2018-04-27T15:14:14.097Z
that all depends on the desired output. As per attached example, I can see a series of cones. Playing with the cylinder will allow to connect -disconnect points and finally generated object can be intersected with cube.
profesor79
CC BY-SA 3.0
2018-04-30T02:03:08.880Z
OpenSCAD has a surface function that does this, no need to re-implement!
esoterik
CC BY-SA 3.0
2018-04-30T06:48:34.757Z
As per OP I was thinking about graph - so no harm here @esoterik
profesor79
CC BY-SA 3.0
2018-04-27T14:28:24.430Z
2018-04-27T14:28:24.430Z
profesor79
<p>I was able to solve this using the openSCAD using the surface command. </p>

<p>From the <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Surface" rel="nofollow noreferrer">openSCAD documentation</a>:  </p>

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

<p>And creating a space separated data file:</p>

<pre><code>#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
</code></pre>

<p>Then a STL can be exported of the data in openSCAD.</p>

CC BY-SA 3.0
2018-04-27T17:09:40.053Z
2018-04-27T17:09:40.053Z
Eric Johnson
<p>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?
<a href="https://i.sstatic.net/xvJhX.jpg" rel="noreferrer"><img src="https://i.sstatic.net/xvJhX.jpg" alt="enter image description here"></a></p>

CC BY-SA 3.0
2018-04-27T01:49:45.690Z
Are you wanting to print the negative object (clear space below) or the part above?"

Do you have a sample of data that you used to generate it?
Aaron Havens
CC BY-SA 3.0
2018-04-27T16:22:21.733Z
I want a print that looks like the graph.  I have the data used in creating the graph.
Eric Johnson
<3d-models><stl>
How do I create a STL file from a 2 dimensional grid of data
Eric Johnson
# How do I create a STL file from a 2 dimensional grid of data

(Asked by: username_0 on 2018-04-26)

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](https://i.sstatic.net/xvJhX.jpg)](https://i.sstatic.net/xvJhX.jpg)

**Tags:** 3d-models, stl

> **Comments:**
> **username_1**: Are you wanting to print the negative object (clear space below) or the part above?"  Do you have a sample of data that you used to generate it?  
> **username_0**: I want a print that looks like the graph.  I have the data used in creating the graph.  

---

## 2 answers

### Answer by username_2 on 2018-04-27. Score: 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](https://i.sstatic.net/kje3Z.png)](https://i.sstatic.net/kje3Z.png)

> **Comments:**
> **username_3**: I think the trick is to ensure that your CAD tool creates a mesh connecting the desired data points (and not connecting where you don't want it to).  Can you eleaborate on this?  
> **username_2**: that all depends on the desired output. As per attached example, I can see a series of cones. Playing with the cylinder will allow to connect -disconnect points and finally generated object can be intersected with cube.  
> **username_4**: OpenSCAD has a surface function that does this, no need to re-implement!  
> **username_2**: As per OP I was thinking about graph - so no harm here @username_4  

---

### Answer by username_0 on 2018-04-27. Score: 1

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

From the [openSCAD documentation](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#Surface):

```
//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.


---

