[nverts, xyzverts, color] = \ slice3 (m3, fslice, nv, xyzv [, fcolor [, flg 1 ]] [, value = <val>] [, node = flg 2 ])
fslice can be a function, a vector of 4 reals, or an integer number. If fslice is a function, it should be of the form:
def fslice (m3, chunk) or, in the case of an isosurface slice, def fslice (m3, chunk, iso_index, _value) or for a plane slice, def fslice (m3, chunk, normal, projection)
and should return a list of function values on the specified chunk of the mesh m3. Module slice3
offers plane and isosurface slicers (for descriptions, see page
). If you wish to write your own slice
routine, you should bear in mind that the format of chunk depends on the type
of m3 mesh, so you should use only the appropriate mesh functions xyz3 and
getv3 which take that type of m3 and chunk as arguments. The return value of
fslice should have the same dimensions as the return value of getv3; the
return value of xyz3 has an additional first dimension of length 3.
If fslice is a list of 4 reals, it is taken as a slicing plane as returned by plane3.
If fslice is a single integer, the slice will be an isosurface for the fslice th function associated with the mesh m3. In this case, the keyword value must also be present, representing the value of that function on the isosurface.
If fcolor is omitted or has value None, then slice3 returns None as the value of color.. If you want to color the polygons in a manner that depends only on their vertex coordinates (e. g., by a 3D shading calculation), use this mode.
fcolor can be a function or a single integer. If fcolor is a function, it should be of the form: def fcolor (m3, cells, l, u, fsl, fsu, ihist) and should return a list of function values on the specified cells of the mesh m3. If the optional argument flg 1 after fcolor is not missing or None and is non-zero, then the fcolor function is called with only two arguments:
def fcolor (m3, cells)The cells argument will be the list of cell indices in m3 at which values are to be returned. l, u, fsl, fsu, and ihist are interpolation coefficients which can be used to interpolate from vertex centered values to the required cell centered values, ignoring the cells argument. See getc3 source code. The return values should always have the same size and shape as cells.
If fcolor is a single integer, then the slice will be an isosurface for the fcolor th variable associated with the mesh m3.