-1

I have 2d building footprints as polygonz geometries and building heights as attribute. I want to extrude them according to height values and generate building surfaces and polyhedral building records.

For this purpose in python I copy vertices of footprints and increase z values of coordinates according to heights then add these new vertices to my vertice list. So finally I achieve 8 points that represents corners of block shaped building as you can see in the picture. generation od building surfaces from points Here is my question: how can I triangulate using these points and create triangles that represent surfaces of building using python? I want to create two lists which stores data, faces (triangles list) and index list (which vertices belong to these triangles). Thus, I can write these geometries to files such as CityGML or ESRI multipatch shapefile. Shortly I want to create polygon meshes that represent buildings from points which have x,y,z values

blackSwan
  • 39
  • 1
  • 6

1 Answers1

0

First, make sure that the 2d polygons are triangulated:

enter image description here

Then iterate through all outer edges and add the extruded copies:

enter image description here

After adding new edge, in order to keep everything triangulated we only need to add two new triangles to the list of triangles:

enter image description here

When we finish, we have the following result: enter image description here

It only remains to copy the triangulation of the initial polygon to the top surface:

enter image description here

Radek
  • 846
  • 4
  • 17