The functions slice2 and slice2x allow one to slice surfaces specified by slice3-type output. slice2 will return the portion on one side of the slicing plane; slice2x will return both portions.
[nverts, xyzverts, values] = slice2 (plane, nv, xyzv, vals) [nverts, xyzverts, values, nvertb, xyzvertb, valueb] = slice2x (plane, nv, xyzv, vals)
); nv is
an array of integers, the i th entry of which gives the number of vertices of the i-th polygonal cell; xyzv
are the vertices of the coordinates of the cells, with each consecutive nv [i] entries representing the
vertices of the i th cell; and vals being a set of values as explained below. These arguments are the same format as returned by slice3 and slice3mesh.
If plane is a plane3, then vals (if not None) is a cell-centered set of values expressing the color of each cell, and the outputs nverts, xyzverts, and values represent the polygons and their colors (if any) describing the portion of the sliced surface that is on the positive side of the plane. That's all you get with slice2. With slice2x, you get in addition nvertb, xyzvertb, and valueb, which describe the part of the surface on the negative side of the slicing plane. Warning: one of these specifications could be None, None, None if the entire surface lies on one side of the plane.
If plane is a scalar value, then vals must be present and must be node-centered. In this case, the outputs nverts, xyzverts, and values represent the polygons and their colors (if any) describing the portion of the sliced surface where vals on the vertices are greater than or equal to the scalar value plane. (This actually allows you to form an arbitrary two-dimensional slice of a surface.) With slice2x, you get in addition nvertb, xyzvertb, and valueb, which describe the part of the surface where vals on the vertices are less than the scalar value plane.