Clean up whitespace and dead code
This commit is contained in:
parent
77a821cae0
commit
5e92c691a8
|
|
@ -13,13 +13,13 @@ class GridVertexGenerator():
|
||||||
self.grid_size_x = grid_size_x
|
self.grid_size_x = grid_size_x
|
||||||
self.grid_size_y = grid_size_y
|
self.grid_size_y = grid_size_y
|
||||||
self.dem_array = dem_array
|
self.dem_array = dem_array
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return self.grid_size_x * self.grid_size_y
|
return self.grid_size_x * self.grid_size_y
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return self._generator()
|
return self._generator()
|
||||||
|
|
||||||
def _generator(self):
|
def _generator(self):
|
||||||
for j in range(self.grid_size_y):
|
for j in range(self.grid_size_y):
|
||||||
for i in range(self.grid_size_x):
|
for i in range(self.grid_size_x):
|
||||||
|
|
@ -36,14 +36,13 @@ class GridTriangleGenerator():
|
||||||
self.cell_size_y = cell_size_x
|
self.cell_size_y = cell_size_x
|
||||||
self.grid_size_x = grid_size_x
|
self.grid_size_x = grid_size_x
|
||||||
self.grid_size_y = grid_size_y
|
self.grid_size_y = grid_size_y
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
#return (self.grid_size_x - 1) * (self.grid_size_y - 1) * 2
|
|
||||||
return (self.grid_size_x - 1) * (self.grid_size_y - 1)
|
return (self.grid_size_x - 1) * (self.grid_size_y - 1)
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return self._generator()
|
return self._generator()
|
||||||
|
|
||||||
def _generator(self):
|
def _generator(self):
|
||||||
for i in range(self.grid_size_x - 1):
|
for i in range(self.grid_size_x - 1):
|
||||||
for j in range(self.grid_size_y - 1):
|
for j in range(self.grid_size_y - 1):
|
||||||
|
|
@ -52,9 +51,7 @@ class GridTriangleGenerator():
|
||||||
v10 = j * self.grid_size_x + i + 1
|
v10 = j * self.grid_size_x + i + 1
|
||||||
v11 = (j + 1) * self.grid_size_x + i + 1
|
v11 = (j + 1) * self.grid_size_x + i + 1
|
||||||
yield (v00, v10, v11, v01)
|
yield (v00, v10, v11, v01)
|
||||||
#yield (v00, v10, v01)
|
|
||||||
#yield (v01, v10, v11)
|
|
||||||
|
|
||||||
|
|
||||||
class CreateMeshFromGeotiffOperator(bpy.types.Operator, ImportHelper):
|
class CreateMeshFromGeotiffOperator(bpy.types.Operator, ImportHelper):
|
||||||
"""Create a new object from a GeoTIFF"""
|
"""Create a new object from a GeoTIFF"""
|
||||||
|
|
@ -89,15 +86,11 @@ class CreateMeshFromGeotiffOperator(bpy.types.Operator, ImportHelper):
|
||||||
print("Done.")
|
print("Done.")
|
||||||
mesh.validate(verbose=True)
|
mesh.validate(verbose=True)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
def construct_mesh(self, grid_size_x, grid_size_y, cell_size_x, cell_size_y, dem_array):
|
def construct_mesh(self, grid_size_x, grid_size_y, cell_size_x, cell_size_y, dem_array):
|
||||||
#grid_size_x = 10
|
return (GridVertexGenerator(grid_size_x, grid_size_y, cell_size_x, cell_size_y, dem_array),
|
||||||
#grid_size_y = 15
|
[],
|
||||||
#cell_size_x = 0.75
|
GridTriangleGenerator(grid_size_x, grid_size_y, cell_size_x, cell_size_y))
|
||||||
#cell_size_y = 0.5
|
|
||||||
return (GridVertexGenerator(grid_size_x, grid_size_y, cell_size_x, cell_size_y, dem_array),
|
|
||||||
[],
|
|
||||||
GridTriangleGenerator(grid_size_x, grid_size_y, cell_size_x, cell_size_y))
|
|
||||||
|
|
||||||
def menu_func(self, context):
|
def menu_func(self, context):
|
||||||
self.layout.operator(CreateMeshFromGeotiffOperator.bl_idname,
|
self.layout.operator(CreateMeshFromGeotiffOperator.bl_idname,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue