diff --git a/flatland/utils/graphics_pil.py b/flatland/utils/graphics_pil.py index e14e42b7235fb7c0655253d74968cd74ac24b1dd..498392879da271a9ed481054d5ad5de23db49dd6 100644 --- a/flatland/utils/graphics_pil.py +++ b/flatland/utils/graphics_pil.py @@ -83,12 +83,15 @@ class PILGL(GraphicsLayer): self.background_grid = np.zeros(shape=(self.width, self.height)) for x in range(self.width): for y in range(self.height): - distance = int(np.floor(np.sqrt(self.width * 2.0 + self.height))) + distance = None for rc in dTargets: r = rc[1] c = rc[0] d = int(np.floor(np.sqrt((x - r) ** 2 + (y - c) ** 2))) - distance = min(d, distance) + if distance is None: + distance = d + else: + distance = min(d, distance) self.background_grid[x][y] = distance def rgb_s2i(self, sRGB): @@ -309,11 +312,11 @@ class PILSVG(PILGL): "Scenery/Nadelbaume_A.svg", "Scenery/Nadelbaume_B.svg", "Scenery/Bergwelt_B.svg", - "Scenery/Bergwelt_C_Teil_1_links.svg", - "Scenery/Bergwelt_C_Teil_2_rechts.svg", - "Scenery/Bergwelt_A_Teil_1_links.svg", - "Scenery/Bergwelt_A_Teil_2_mitte.svg", - "Scenery/Bergwelt_A_Teil_3_rechts.svg", + # "Scenery/Bergwelt_C_Teil_1_links.svg", + # "Scenery/Bergwelt_C_Teil_2_rechts.svg", + # "Scenery/Bergwelt_A_Teil_1_links.svg", + # "Scenery/Bergwelt_A_Teil_2_mitte.svg", + # "Scenery/Bergwelt_A_Teil_3_rechts.svg", ] imgBg = self.pilFromSvgFile('svg', "Background_Light_green.svg") @@ -430,7 +433,7 @@ class PILSVG(PILGL): if self.background_grid[col][row] < 4: a = int(self.background_grid[col][row]) a = a % len(self.dBuildings) - if (col + row) % 10 > 2: + if (col + row) % 10 > 7: pilTrack = self.dScenery[0] else: if (col + row + col * row) % 2 == 0: diff --git a/notebooks/Scene_Editor.ipynb b/notebooks/Scene_Editor.ipynb index db23e0e04ef6baa421f8b1449c519eefc54e5243..551aedda042214fb797dcba6d3b12db6ec9dab64 100644 --- a/notebooks/Scene_Editor.ipynb +++ b/notebooks/Scene_Editor.ipynb @@ -100,7 +100,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "387832d242b44d69a1712a42d9547c05", + "model_id": "c96cefa474204cb1992da3eb286fb659", "version_major": 2, "version_minor": 0 }, @@ -134,7 +134,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.5" + "version": "3.6.8" }, "latex_envs": { "LaTeX_envs_menu_present": true,