The workflow for the proposed repair methodology is outlined in the figure below. The automatic repair process is done through a repair loop. This chapter focuses on geometric repairs and the use of Val3dity for validating and identifying errors. The repairs are organized per primitive level, as outlined in sections below. Each approach preserves semantics and materials where possible.
Geometries should meet specific standards at the ring level. Below are repair strategies for common errors detected by Val3dity:
When a ring has only one line (a curve with two points), deletion is the only option.
If two consecutive points are the same, one is kept. This repair ensures that the ring doesn't become invalid afterward.
Since this error is not applicable to CityJSON or OBJ formats, it is out of scope. However, it may be addressed in GML or JSON-FG formats by closing the ring.
When a ring self-intersects, the repair involves deleting or applying a convex hull to restore a valid structure.
Polygons are simple, planar surfaces that must adhere to certain rules:
Boolean operations are used to repair intersections between rings in a polygon.
Preferably, only the first of the duplicate rings is kept.
This repair either triangulates the polygon or projects outlier points onto a new plane.
When a "fold" exists in the polygon, the affected triangles are projected onto a new plane.
If the polygon's interior is disconnected, it is split into multiple polygons.
If an inner ring is outside the exterior ring, it is either deleted or converted into a new polygon.
Nested inner rings are either deleted or reversed and added as new polygons.
The orientation of the exterior and interior rings must be opposite. Inner rings are reversed if needed.
Shells are defined by closed polygon sets and must meet specific validity standards.
If no local repair is possible, a global method like alpha wrap is applied to generate a valid triangulation.
A shell must have at least four polygons. Local methods like hole filling are attempted first, followed by alpha wrapping if needed.
Holes and gaps are reconstructed using naked edge detection or alpha wrapping.
In this case, connected components are split along overused edges or vertices.
Disconnected parts are either deleted or converted into MultiSurface or MultiSolid, based on user requirements.
Intersecting faces are deleted, and holes are patched. Alpha wrapping is used as a fallback.
Wrongly oriented polygons are flipped to restore a valid shell.
Solids are defined by one or more shells, and common errors include:
Boolean operations are used to resolve shell intersections.
Duplicate shells are removed, preserving the first one.
Inner shells that lie outside the exterior are either deleted or converted into new solids.
Disconnected interiors are split into multiple solids.
If shell polygons are wrongly oriented, the shell is flipped to restore validity.
Composite solids are defined by two or more solids that must be connected but not overlapping.
Boolean operations handle overlapping solids.
Disconnected solids are either added as separate entities or converted into MultiSolid geometries.
BuildingParts must not overlap, and Val3dity can validate them based on overlap tolerance.
Overlapping BuildingParts are repaired using Boolean operations, with semantics and materials preserved.
If the local repair methods fail to resolve issues, a global repair approach is triggered, which consists of four stages:
- Alpha wrap on polygons (report as code 1000)
- Alpha wrap on vertices (report as code 1001)
- Convex hull of geometry (report as code 1002)
- Oriented bounding box (report as code 1003)