mphquad2tri
Convert plot data quad mesh into simplex mesh.
Syntax
pdout = mphquad2tri(pdin)
Description
pdout = mphquad2tri(pdin) converts the plot data stored in the structure pdin into the structure pdout using a simplex mesh.
The input and output structures, respectively pdin and pdout, are structures with fields p, d, t, rgb and expr.
The field p is a 2xN array containing the vertex coordinates.
The field t is an array containing the indices to columns in p of a quad mesh for pdin and of a simplex mesh for pdout, each column in t representing respectively a quad and a simplex.
The field rgb is a Nx3 array containing the color model data as RGB values. This field is optional.
The field expr is a string containing the description of the data. This field is optional.
Example
Generate 3D surf data
[x,y] = meshgrid(-0.1:0.2:1.1,-0.4:0.2:0.4);
z = cumsum(0.1*randn(size(x)));
Create plotdata in a quad mesh:
pd = mphsurf(x,y,z);
Convert the plot data into triangle mesh:
pd = mphquad2tri(pd);
mphplot(pd)
See also
mphsurf, mphreadstl, mphwritestl