I am trying to create a Multipatch Shapefile in the shape of a cube. I am using pyshp library and could create one face as a 3D Polygon as described in the wiki of pyshp (Creating 3D Polygons). However, I am not able to create a multipatch geometry, probably because I do not use the right order of coordinates or something like that. Here is my Code using the coordinate order described by esri (Link, doc Page 35):
w = shapefile.Writer(shapeType=shapefile.MULTIPATCH)
w.poly(parts=[[[0,0,0] , [0,0,1] , [0,1,1] , [0,0,0]] , [[0,0,0] , [1,0,0] , [1,1,0] , [0,0,0]],
[[0,1,0] , [0,1,1] , [0,0,0] , [0,1,0]] , [[0,0,0] , [0,1,1] , [0,0,1] ,[0,0,0]],
[[1,1,0] , [0,1,1] , [0,1,0] ,[1,1,0]], [[1,1,0] , [1,1,1] , [0,1,1]] ,
[[1,0,0] , [1,1,1] , [1,1,0] ,[1,0,0]], [[1,0,0] , [1,0,1] , [1,1,1]] ,
[[0,0,0] , [0,0,1] , [1,0,0] ,[0,0,0]], [[1,0,0] , [0,0,1] , [1,0,1]] ,
[[0,0,1] , [0,1,1] , [1,1,1] ,[0,0,1]], [[0,0,1] , [1,1,1] , [1,0,1]]], shapeType=31)
w.field("NAME")
w.record("PolyZTest")
w.save("shapefiles/test/MyPolyS")
What am I doing wrong? Is the usage of poly()
wrong?