# Can I import data points into Blender?

I have a number of relatively straightforward line charts, such as this:

It would be great if I could somehow import the data points into Blender, perhaps to define a curve, to allow me to produce some cool looking data visualisations.

Apologies if I've not been clear in my question, any help is appreciated!

Thanks,

Alex.

• what is the data format? excel file? – Tak Feb 22 '17 at 11:55
• It's currently in Excel, but I could export it to any required format, or add it to a Python array. – Alex Cole Feb 22 '17 at 12:02
• check this answer blender.stackexchange.com/a/71466/2517 – Tak Feb 22 '17 at 12:14

You can use the 'from_pydata(...)' function to create a mesh. This function accepts a list of vertices, a list of edges, and a list of faces.

The vertices should be formatted as a list of X,Y,Z triplets (defining each coordinate in space) while the 'edges' and 'faces' define which of those vertices are linked (by specifying the index in the list of vertices (with 0 being the first in the list, 1 the second, etc.)). Edges can be empty if you are defining just the Faces and similarly Faces can be empty if you are defining just the Edges).

To illustrate, the following example will create a new object (a skewed pyramid) with 4 vertices and 4 faces :

    import bpy