Geodan / pg2b3dm

Tool for creating 3D Tiles from PostGIS geometries
MIT License
349 stars 65 forks source link

Question: Postgres vs FME Triangulation #57

Closed enersis-pst closed 3 years ago

enersis-pst commented 3 years ago

Hey, if i search for postgres triangulation, i find different functions like ST_DelaunayTriangles, ST_ConstrainedDelaunayTriangles, ST_Tesselate. Does someone know if this could also be used instead of the triangulation function of FME? Or why this was used?

bertt commented 3 years ago

This tool needs a triangulated PolyhedralSurfaceZ as input.

There are several ways to generate these geometries. In FME you can use Triangulator (see https://github.com/Geodan/pg2b3dm/blob/master/dataprocessing/dataprocessing_citygml.md). In PostGIS you can use functions like ST_DelaunayTriangle to generate the triangulated PolyhedralSurfaceZ.

enersis-pst commented 3 years ago

@bertt thanks, may i can ask a further question,... what are the differents between the format for cesium and mapbox? there is a -f property for bertt/tesselate_building

bertt commented 3 years ago

yes, in that tool the input data is 4326. The tool converts to 3857 in case of -f mapbox and to 4978 in case of -f cesium.

pg2b3dm does not do this, so the input data must be already in correct format for the used client.

enersis-pst commented 3 years ago

For me ST_DelaunayTriangledoesnt work for walls. Here it returns empty. Looks like triangulate only works for xy. But ST_Tesselatedid the job. Im only a bit afraid of the orientation of the vertex of the polygons. For now it looks like that cityGml have the right orientation, but not shure.

bertt commented 3 years ago

ok good to know ST_Tesselate works better. About the orientations: it shouldn't give a problem in glTF's (because material is double sided). Only thing to watch out for is innerpolygons in the cityGML.