I'm hardly trying to extract data o polygons from Blender to PostGIS via Python. For the beginning I'm trying all this stuff with a simple cube. At all I want to get a pure POLYGON - GEOMETRY-Type in PostGIS which looks like POLYGON((x1 y1 z1, x2 y2 z2,.....)) I can read information from Blender in this way:
The vectors:
verts=[
<Vector (1.0000, 1.0000, -1.0000)> ,
<Vector (1.0000, -1.0000, -1.0000)> ,
<Vector (-1.0000, -1.0000, -1.0000)> ,
<Vector (-1.0000, 1.0000, -1.0000)> ,
<Vector (1.0000, 1.0000, 1.0000)> ,
<Vector (1.0000, -1.0000, 1.0000)> ,
<Vector (-1.0000, -1.0000, 1.0000)> ,
<Vector (-1.0000, 1.0000, 1.0000)> ,
]
and the faces (the numbers are the vertices which form a polygon):
faces = [
(0, 1, 2, 3)
(4, 7, 6, 5)
(0, 4, 5, 1)
(1, 5, 6, 2)
(2, 6, 7, 3)
(4, 0, 3, 7)
]
Now I don't know how to get this information into a POLYGON-GEOMETRY-structure to store it in PostgreSQL/PostGIS.
In the end I want a POLYGON((...)) for each face of the cube. And I want to do this for more complex 3D-models out of Blender. With POLYGON- or TIN-GEOMETRY.... But at first I need to know how to interact with the geometries with Python.
I hope you can get me a little further. I'm thankful for any hint. Thanks! J