77. plugins.isosurface
— Isosurface: surface reconstruction algorithms¶
This module contains the marching cube algorithm.
Some of the code is based on the example by Paul Bourke from http://paulbourke.net/geometry/polygonise/
77.1. Functions defined in module plugins.isosurface¶
-
plugins.isosurface.
isosurface
(data, level, nproc=- 1, tet=0)[source]¶ Create an isosurface through data at given level.
- Parameters
data (array_like) – An (nx,ny,nz) shaped float array of data values at points with coordinates equal to their indices. This defines a 3D volume [0,nx-1], [0,ny-1], [0,nz-1].
level (float) – The data value for which the isosurface is to be constructed.
nproc (int) – The number of parallel processes to use. On multiprocessor machines this may be used to speed up the processing. If <= 0 , the number of processes will be set equal to the number of available processors, to achieve a maximal speedup.
- Returns
array – An (ntr,3,3) float array defining the triangles of the isosurface. The result may be empty (if level is outside the data range).
-
plugins.isosurface.
isoline
(data, level, nproc=- 1)[source]¶ Create an isocontour through data at given level.
- Parameters
data (array_like) – An (nx,ny) shaped array of data values at points with coordinates equal to their indices. This defines a 2D area [0,nx-1], [0,ny-1].
level (float) – The data value for which the isocontour is to be constructed.
nproc (int) – The number of parallel processes to use. On multiprocessor machines this may be used to speed up the processing. If <= 0 , the number of processes will be set equal to the number of available processors, to achieve a maximal speedup.
- Returns
array – An (nseg,2,2) float array defining the 2D coordinates of the segments of the isocontour. The result may be empty (if level is outside the data range).