The mesh file
The APM Preprocessor supports mesh files in .stl format. The .stl file is a commonly used mesh file format which represents bodies with triangular elements. If a body is represented only with triangular elements its mesh is said to be unstructured. Conversely if a body is represented only with quadrilateral elements its mesh is said to be structured. The images below show an unstructured mesh of a fixed-wing UAV and a structured mesh of a NACA0015 wing.
Unstructured mesh of a fixed-wing UAV
Structured mesh of a NACA0015 wing

The .stl mesh file format can only store unstructured meshes. However the APM Preprocessor supports a non-standard .stl mesh file format which can store structured meshes. A typical structure of a .stl mesh file is show below:
solid "name"
facet normal nx ny nz
outer loop
vertex x y z
vertex x y z
vertex x y z
endloop
endfacet
facet normal nx ny nz
outer loop
vertex x y z
vertex x y z
vertex x y z
endloop
endfacet
...
...
...
endsolid
Each mesh element is defined by the facet keyword. The normal keyword and the nx, ny, nz variables specify the unit normal vector of the element.The vertex keyword and the x, y, z variables specify a vertex of the element. Since each element has 3 vertices the vertex keyword and the x, y, z variables are repeated three times.
For structured meshes a fourth vertex is added to each element.
An .stl file with four vertices per element is non-standard and is specific to the APM Preprocessor.
Copy link
On this page
File formats
.stl