I am looking for a way to calculate the area for a big set of 3D-surfaces.
I know, that some of those surfaces are slightly non-planar, which means that the coordinates got somehow "rounded" at any point of the toolchain, which made them non-planar polygons. (One of the coordinates is slightly off the plane of the surface, so ST_isPlanar says false)
I do not have influence on those earlier points in the toolchain and must now deal with the non-planar surfaces.
I tried to disassemble the polygons into triangles with ST_DelaunayTriangles, but somehow the function only returns one polygon(triangle), which is then non-planar, but missing one of the original points. Most of the surfaces have 4 edges, so when one point is missing, the area calculation will return only the half compare to the real surface area.
My first example is the surface 1 which is planar as reference, and surface 2 which has one coordinate slightly off (+ 0.1 at one coordinate).
Surface 1:
POLYGON Z ((
9 6 17,
2 6 17,
2 6 4,
9 6 4,
9 6 17))
Surface 2:
POLYGON 2 Z ((
9 6 17,
2 6 17,
2 6 4,
9 6.1 4,
9 6 17))
ST_DelaunayTriangles() applied on Surface 2 returns only:
GEOMETRYCOLLECTION Z
(POLYGON Z ((
2 6 17,
9 6 17,
9 6.1 4,
2 6 17
)))
ST_3dArea is only computing planar surfaces, so I somehow have to get rid of this non-planarity.
Does anyone have an idea how to calculate those surface areas of slightly non-planar surfaces?
My goal is to calculate the area of both by achieving more or less the same value of surface area.