#DataSurface
!!! This addon is out-of-date since big change of Blender 2.80. The new version for 2.80 above has been rewrote into https://github.com/niasw/import_mesh_CSV_CoordSurface !!!
===== DataSurface is a Blender Addon to create Object using Data Files.
wiki http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Add_Mesh/Data_Surface
Copyleft (*) 2014 Sun Sibai (niasw) niasw@pku.edu.cn, Pontiac
("create_mesh_and_object" and "makeFaces" methods are from Blender addon: add extra objects -> 'create_mesh_object' method. Inferred from author declarations in scripts there, it might be from Pontiac. If I made a mistake here, please tell me.)
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
In engineering and science, numerical data sometimes are more common than analytical expressions. Analytical expressions are accurate and easy to accept, but for numerical algorithms (such as self-adapting optimizing) and real experiments (such as measurements with instruments), numerical data are more suitable and more convenient.
If you want to transfer data from numerical algorithms or real experiments into Blender to visualize them, this addon may be your proper choice. In the example I will show below, I turned text data of x,y and z coordinates into a mesh surface.
If you are seeking for addons for analytical expressions, please go to the addon 3D Function Surface.
To install this addon, please copy all the scripts and data files to the addon path.
- Download the source file from here and extract to a folder
add_mesh_DataSurface
- or use
git clone https://github.com/niasw/add_mesh_DataSurface
.
Then copy directory add_mesh_DataSurface
to Blender addon path. If you don't know where is the addon path, please open your Blender, and run scripts below in the Python Console:
import addon_utils
print(addon_utils.paths())
To enable this addon, please open your Blender.
There are two modules in this addon:
-
Text Data Surface
can create all mesh surface in 3D space. But it needs 3 matrices data:x=x(u,v) y=y(u,v) z=z(u,v)
where x,y,z are coordinates in space and u,v are column and row indices.
-
Z Data Surface
can create a subset mesh surface of above. It is convenient for only 1 table data needed:z=f(x,y)
where x,y data are in form of vector and z data are in form of matrix.
To show how to use this addon, I will give examples.
- In the
3D View
block, pressShift+A
>Mesh
>Data Surface
>Text Data Surface
.
Then a twisted ribbon-like mesh shows.
The coordinates of vertices are from data files Xdata.txt
, Ydata.txt
and Zdata.txt
.
These data can be generated from Octave/Matlab script example.m
.
To change the data files, clicking the browsing buttons.
As for the loop
and flip
checkbox, try them to know what they represent.
- After clicking
loop
, you should see the figure closed in each Z slice. Yes, the ribbon becomes a tube. - After clicking
flip
, you should see the light effect changed a little. Yes, the normal direction flipped.
![]() |
![]() |
![]() |
---|---|---|
![]() |
![]() |
![]() |
- In the
3D View
block, pressShift+A
>Mesh
>Data Surface
>Z(X,Y) Table Surface
.
Then a floating ribbon-like mesh shows.
The coordinates of vertices are from table data file csvdata.csv
.
To change the data files, clicking the browsing button.
Plain text table is also OK.
The .csv file can be exported from spreadsheet programs such as Excel and LibreOffice Calc.
The structure of the table in .csv file is shown below:
There are 3 boolean options in Z Data Surface. loop
and flip
are like those in Text Data Surface.
![]() |
![]() |
![]() |
---|---|---|
![]() |
![]() |
![]() |
The tran
option is to switch x axis with y axis. It is the same with transposing the whole data table. By combining tran
function and loop
function, we can close the surface mesh either in x direction or y direction.
![]() |
![]() |
---|---|
![]() |
![]() |
![]() |
![]() |
If you have further requirements, you can fork the source codes and develop your own one. To know how this addon works, please go to page Text Data Surface and Z Data Surface.
This addon has been tested on Ubuntu 12.04, Blender 2.71a, Python 3.2 (bundled), 32-bit.
It may also work with Blender versions < 2.71, but not tested yet.
- "Add-on does not appear on the list."
Check if you have installed this addon. Make sure the ".py" files are in the addon path properly. Make sure you have enabled this addon in User Preferences
.
- "Error combining coordinate data: Traceback (most recent call last):"
- " ... "
- "FileNotFoundError: [Errno 2] No such file or directory: '.../add_mesh_Surface/Xdata.txt' "
or
- "Fail to find example data files:"
- "I have searched in following paths:"
- " .../add_mesh_DataSurface/Xdata.txt"
These messages mean Blender did not find the data files. When you downloaded it as a zip file, did you extract the folder as add_mesh_DataSurface
instead of the default add_mesh_DataSurface-master
? If not, please rename this folder under addon path as add_mesh_DataSurface
.
- "Browser Button fails to work ... "
Reset it: Delete the current object and re-add it please.
To raise a bug report, you may issue it on here(github-issues), or here(developer.blender.org-task).
To contact with me, please write an email to niasw@pku.edu.cn.
"create_mesh_and_object" and "makeFaces" methods in add_mesh_text_data_surface.py
and add_mesh_z_data_surface.py
were from Blender addon add_mesh_extra_objects. Thank Pontiac.
Thank Noel Stoutenburg for suggestions about .csv files and Z Data Surface.
Thank @squarednob for issue reporting and testing.
And thank you.
Best regards,
Sun Sibai