A Mesh component holds a fixed set of triangles. It is how OpenVSP brings in geometry from other tools -- STL, Cart3D and NASCART files -- and it is what several analyses leave behind: the intersected and trimmed outer mold line from CompGeom, the slices from Mass Properties and Planar Slice, a projected area. A mesh can be moved, turned, scaled, saved and used in further analyses, but its shape cannot be edited: it has no parameters of its own beyond how it is drawn.
| Topic | Tab |
|---|---|
| Quick Start | |
| Where a Mesh Comes From | |
| Importing a Mesh | |
| Tags | |
| Converting a Mesh | Other |
| Mesh and Slices | Other |
| Using a Mesh | |
| Scripting |
The Gen, XForm and Mass tabs are the ones every component has; see Gen, XForm and Mass. A Mesh has no Sub tab.
A mesh is made by an import, by an analysis, or from another component.
| Source | The mesh |
|---|---|
| File > Import | The file's triangles. |
| CompGeom | The outer mold line: every component intersected with every other, inside parts removed, negative volumes cut out. |
| Mass Properties | The components' triangles, and the slices the mass was integrated over. |
| Planar Slice | The components' triangles, and the cutting planes' cross sections. |
| Wave Drag | The components' triangles, and the slices at the Mach angle. |
| Projected Area | The projected area, flat, and its outline. |
| Geometry Analysis, Make MeshGeom | The triangles the analysis case worked on, and any slices. |
| DegenGeom, Make Mesh | The degenerate geometry as triangles: plates for bodies, camber surfaces for wings. |
| Point Cloud, Create Convex Hull Mesh | The convex hull of the points. |
| File > Export, the mesh formats | The triangles of the exported set. |
Mass Properties removes the mesh it made the previous time it ran, so only the latest is kept. The mesh exports (STL, Cart3D, OBJ and others) also build a mesh, and leave it in the model with every other component hidden. An export whose set already holds a mesh writes that mesh instead of building a new one, so a second export after the model has changed writes the old shape; delete the mesh before exporting again.
The importers read triangles and nothing else: no units, no names of parts and no surface curvature. OpenVSP's model has no units, so a mesh comes in at the numbers in the file; scale it to match the model (Scale on the XForm tab).
| Format | Notes |
|---|---|
| Stereolith (.stl) | ASCII or binary, told apart by the file's content. Several solids in one file make one mesh, in ASCII or as binary blocks, one per solid, as DATCOM writes them. A binary file whose size does not match its facet count, such as one cut short, is refused. The facet normals are read as given. |
| Cart3D (.tri) | Formatted or unformatted, single or double precision, told apart by the file's content. The component number of each triangle is kept as its tag. |
| NASCART (.dat) | Rotated as it is read, from NASCART's axes ( up) to OpenVSP's ( up): the file's becomes . |
| XSec (.hrm) | OpenVSP's cross section format. Each component's grid of points is split into triangles, two per quadrilateral, and all components go into one mesh. To keep the components apart as grids, import the same file as XSec as Wireframe instead (see Wireframe). |
A file that holds no triangles is not imported.
Each triangle of a mesh can carry tags: numbers that say which component and which sub-surfaces it came from. A CompGeom mesh is tagged by component and, when sub-surfaces are intersected, by sub-surface; a Cart3D file brings its own component numbers. With Sub on in the Geom Browser, the mesh is drawn one color per combination of tags, going round the color wheel. Start Color Degree on the Other tab sets where on the wheel the first color is: 0 is red, 120 green and 240 blue. It also colors the outlines a projected area draws.
The Other tab converts a mesh into two other components. Each is a new component; the mesh is left as it was.
A mesh from Mass Properties, Planar Slice or Wave Drag holds two sets of triangles: the components' mesh and the slices. Mesh and Slices on the Other tab choose which are drawn. They also choose what an STL export of the mesh writes and what a point cloud made from it holds, so turn Slices off to export the shape alone.
A mesh takes part wherever triangles are enough.
It is not a surface. It has no sub-surfaces, its degenerate geometry is empty, and it takes no part where a surface is needed: CFD Mesh, FEA Mesh, Fit Model, or as the boundary or direction of a projection. Its triangles cannot be edited in OpenVSP; change the geometry it came from and run the analysis again, or edit the file and import it again.
A mesh is made by importing a file or by running an analysis; each returns the new mesh's ID.
| Function | Use |
|---|---|
ImportFile( file, IMPORT_STL, "" ) |
Import a file as a mesh
(IMPORT_CART3D_TRI, IMPORT_NASCART,
IMPORT_XSEC_MESH for the other formats). |
ComputeCompGeom( set, half, types ) |
Run CompGeom and return the mesh's ID. |
CreatePtCloudGeom( mesh_id ) |
Convert to a point cloud, as the Convert to Point Cloud button. |
CreateNGonMeshGeom( mesh_id ) |
Convert to an NGon mesh, as the Convert to NGon Mesh button. |
The Other tab's toggles are the Parms MeshFlag,
SliceFlag and StartColorDegree in the group
Draw. The scale the mesh has been given in total is
Scale_From_Original in the group XForm.
import openvsp as vsp
mesh_id = vsp.ImportFile( "part.stl", vsp.IMPORT_STL, "" )
vsp.SetParmVal( mesh_id, "Scale", "XForm", 0.0254 ) # inches to meters
vsp.Update()