Commit 82ab169b authored by Karol Actun's avatar Karol Actun
Browse files

svg generation fix

parent d3f7a980
......@@ -576,9 +576,9 @@ class Visualization:
return
if path[0].endswith(".svg"):
create_svg(self._world, path[0]+".svg")
else:
create_svg(self._world, path[0])
else:
create_svg(self._world, path[0]+".svg")
else:
show_msg("Not implemented yet.\nWorks only with Triangular Grid for now!\nSorry!", 2)
......
......@@ -172,11 +172,14 @@ def create_svg(world, filename):
location_coordinates_in_image = []
particle_coordinates_in_image = []
for coordinates in tile_coordinates:
tile_coordinates_in_image.append((int(coordinates[0] - x_offset), int(- coordinates[1] + y_offset)))
tile_coordinates_in_image.append((int(coordinates[0] - x_offset + (0 if coordinates[1] % 2 == 0 else 1)),
int(- coordinates[1] + y_offset)))
for coordinates in location_coordinates:
location_coordinates_in_image.append((int(coordinates[0] - x_offset), int(- coordinates[1] + y_offset)))
location_coordinates_in_image.append((int(coordinates[0] - x_offset + (0 if coordinates[1] % 2 == 0 else 1)),
int(- coordinates[1] + y_offset)))
for coordinates in particle_coordinates:
particle_coordinates_in_image.append((int(coordinates[0] - x_offset), int(- coordinates[1] + y_offset)))
particle_coordinates_in_image.append((int(coordinates[0] - x_offset + (0 if coordinates[1] % 2 == 0 else 1)),
int(- coordinates[1] + y_offset)))
draw_world(
tiles=tile_coordinates_in_image,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment