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, a structured mesh of a NACA0015 wing, and a hybrid (mixed) mesh of a fixed-wing UAV.



File formats
.stl
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 shown 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.
.ucd
The .ucd mesh file format can only store unstructured and structured meshes. A typical structure of a .ucd mesh file is shown below:
# <comment 1>
.
.
.
# <comment n>
<num_nodes> <num_cells> <num_ndata> <num_cdata> <num_mdata>
<node_id 1> <x> <y> <z>
<node_id 2> <x> <y> <z>
<node_id num_nodes> <x> <y> <z>
<cell_id 1> <mat_id> <cell_type> <cell_vert 1> ... <cell_vert n>
<cell_id 2> <mat_id> <cell_type> <cell_vert 1> ... <cell_vert n>
<cell_id num_cells> <mat_id> <cell_type> <cell_vert 1> ...<cell_vert n>
.wrl
The .wrl mesh file format can only store unstructured and structured meshes. A typical structure of a .wrl mesh file is shown below:
Shape {
geometry IndexedFaceSet {
coord Coordinate {
point [
<x> <y> <z>
<x> <y> <z>
<x> <y> <z>
...
]
}
coordIndex [
<cell_vert 1> ... <cell_vert n>
<cell_vert 1> ... <cell_vert n>
<cell_vert 1> ... <cell_vert n>
...
]
}
}
Last updated
Was this helpful?