79. plugins.isosurface — Isosurface: surface reconstruction algorithms

This module contains

79.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.

  • tet (int) – If zero (default), a marching cubes algiorithm is used. If nonzero, a marching tetrahedrons algorithm is used. The latter is slower and produces a lot more triangles, but results in a smoother surface. The tetraeders algorithm is currently only available in the compiled pyFormex library.

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).

Notes

Currently only a marching cubes algorithm is used. Marching tetraeders is not implemented yet.

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).