It is used to verify whether 3D primitives are geometrically valid according to the international standard ISO 19107:2003.
Its main aim is thus the 3D primitives of GML (Solids, CompositeSurfaces, or MultiSurfaces), but it can be used to validate any 3D primitives. It accepts as input any GML files (or one of the formats built upon it, such as CityGML), OBJ, OFF, and POLY. It simply scans the file looking for the 3D primitives and validates these according to the rules in ISO19107 (all the rest is ignored).
For Solids, the validation is performed hierarchically, ie first every polygon (embedded in 3D) is validated (by projecting it to a 2D plane and using GEOS), then every shell is validated (must be watertight, no self-intersections, orientation of the normals must be consistent and pointing outwards, etc), and finally the interactions between the shells are analysed. This means that if a polygon of your solid is not valid, the validator will report that error but will not continue the validation (to avoid “cascading” errors).
For MultiSurfaces, only the validation of the polygons is performed, ie are they valid according to the 2D rules, and are they planar?
For CompositeSurfaces, the surface formed by the polygons must be a 2-manifold.
More details are available in this blog post about 3D solids in GIS.
These errors can be reported.
The source code of the validator is publicly available. The version used online is always the latest commit in master branch.
If you use val3dity for research-purposes and publish, please cite that scientific article (which contains all the details):