# 48. `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/

## 48.1. Functions defined in module plugins.isosurface

`plugins.isosurface.``isosurface`(data, level, nproc=-1, tet=0)

  Create an isosurface through data at given level.

  - data: (nx,ny,nz) shaped 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: data value at which the isosurface is to be constructed
  - nproc: 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 processors, to achieve a maximal speedup.

  Returns an (ntr,3,3) 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)

  Create an isocontour through data at given level.

  - data: (nx,ny,nz) 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: data value at which the isocontour is to be constructed
  - nproc: 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 processors, to achieve a maximal speedup.

  Returns an (nseg,2,2) array defining the 2D coordinates of the segments of the isocontour. The result may be empty (if level is outside the data range).