# From Data to Objects That Can Be Worn

265

3

2

Posted

## Introduction: From Data to Objects That Can Be Worn

We live in the era of big data and thanks to the Internet of Things we can now get data on a number of phenomena that up to "yesterday" we were able to characterize only qualitatively. In the picture, there is a tangible 3D object that materializes the correlation that exists between life expectancy and income.

There are now thousands of tools to visualize and analyze data, and awesome websites to grasp the insights hidden in the data. One of my favorite is gapminder.

The idea of this project is simply to materialize data into 3D objects - that can be possibly worn - in three simple steps:

1. Get the data you are interested in
2. Code a simple program capable to turn the data into an object
3. Print the object

## Step 1: Get the Data

There are now thousands of data sources. In this project we use the ones provided by gapminder, but a similar approach can be easily applied to other sources.

In particular, we consider the data to correlate income with life expectancy. A fantastic 2D representation is available on gapminder using the bubble chart.

First we download the necessary files from gapminder, namely Life expectancy (years), income and population

Then we merge such data to obtain a file with three columns life expectancy, income and population and a row for each country.

## Step 2: Code a Simple Program to Turn the Data Into an Object

The first two rows of the file generated in the previous step look like the ones below

[53.8,1417.76034564701,32526562],
[78,7343.22564871925,2896679],
...

Focusing on the first row 53.8 is the life expectancy, 1417.76034564701 is the income and 32526562 the population of Afghanistan in 2015, while the second row shows similar data for Albania.

Now it is time to turn such data into a 3D object and for this purpose we use OpenSCAD . It is a "3D-compiler that reads in a script file that describes the object and renders the 3D model from this script file".

In the following, a sketch of the script (the whole script is in attachment) we used to generate the object in the picture (we omit some details for the sake of simplicity)

```<p>// read the data file row by row</p><p>for ( coordinates = [[53.8,1417.76034564701,32526562], [78,7343.22564871925,2896679], .. ])
{
// normalize the data
l_expect = coordinates[0]/Mr1*max_size_y;
income = coordinates[1]/Mr2*max_size_x;
population = coordinates[2]/Mr3;</p><p>    // generate the shapes - i.e cylinders - forming the final object
translate([income,l_expect, 0])
{
cylinder(h = (1-population)*max_height+20, r1 = population*50+10, r2 = population*50, center = false);
}
}</p><p>// arbitrary basement</p><p>import("testone.stl", convexity=3);</p>```

The script reads row by row the data file and generates a cylinder, the size, and height of which are proportional to the population size, in a position that is a function of the income and the life expectancy. The mapping of the data into the shapes forming the object is "an artistic process", so it up to your imagination. In this case, it is a one-to-one mapping except for the basement (i.e. testone.stl") necessary to support the shapes.

Once you are satisfied of the mapping you can finally export the STL model that can be printed.

## Step 3: Print the Object

Before printing, I suggest importing the STL code of your object into a program such as Slic3r. It is "the tool you need to convert a 3D model into printing instructions for your 3D printer. It cuts the model into horizontal slices (layers), generates toolpaths to fill them and calculates the amount of material to be extruded". This allows you to have a good idea of the final outcome and make some adjustments if necessary (e.g. scaling). Notice that in some cases you can lose some details in the printing process, so it's up to you whether to accept this lost or try a different mapping. Finally, you can print your object and you can finally wear an object with a meaning!

Hope you like the idea and If you'll experiment with this concept it would be nice to have your feedback. Looking forward!

## Recommendations

• ### 3D Printing With Circuits Class

4,070 Enrolled

• ### Trash to Treasure

We have a be nice policy.