def getTrianglesCoordinates(self):
"""
A method to retrieve triplet of coordinates representing the triangles
in lon,lat,height.
"""
triangles = []
self._computeVerticesCoordinates()
indices = iter(self.indices)
for i in xrange(0, len(self.indices) - 1, 3):
vi1 = next(indices)
vi2 = next(indices)
vi3 = next(indices)
triangle = (
(self._longs[vi1],
self._lats[vi1],
self._heights[vi1]),
(self._longs[vi2],
self._lats[vi2],
self._heights[vi2]),
(self._longs[vi3],
self._lats[vi3],
self._heights[vi3])
)
triangles.append(triangle)
if len(list(indices)) > 0:
raise Exception('Corrupted tile')
return triangles
评论列表
文章目录