mphwritestl
Export plot data as an STL file.
Syntax
mphwritestl(filename, pd)
mphwritestl(filename, pd, '-binary')
Description
mphwritestl(filename, pd) exports data in the plot data structure pd as the STL file filename.
mphwritestl(filename, pd, '-binary') exports data in the plot data structure pd as the STL file filename using the binary file format.
pd is a structure with fields pd and t.
The field p contains node point coordinate information.
The field t contains the indices to columns in p of a simplex mesh, each column in t representing a simplex.
Other fields in the plot data structure are not considered to generate the surface mesh.
Example
.Generate a surface mesh from solution plot:
model = mphopen('vacuum_flask_llmatlab')
pd = mphplot(model, 'pg1')
pd2stl = pd{2}{1};
mphwritestl('vacuum_flask.stl', pd2stl)
Generate a surface mesh from a volume mesh
model = mphopen('model_tutorial_llmatlab');
model.component('comp1').mesh('mesh1').run;
[s,d] = mphmeshstats(model, 'mesh1');
idx = strcmp(s.types, 'tri');
pdmesh.p = d.vertex;
pdmesh.t = d.elem{idx};
mphwritestl('mesh2geom.stl', pdmesh);
See also
mphquad2tri, mphreadstl, mphsurf