diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 1089a0a806..f03ea91e36 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -45,6 +45,7 @@ class BuildVolume(SceneNode): self._disallowed_area_color = None self._error_area_color = None self._grid_color = None + self._grid_minor_color = None self._width = 0 self._height = 0 @@ -250,6 +251,7 @@ class BuildVolume(SceneNode): self._disallowed_area_color = Color(*theme.getColor("disallowed_area").getRgb()) self._error_area_color = Color(*theme.getColor("error_area").getRgb()) self._grid_color = Color(*theme.getColor("buildplate_grid").getRgb()) + self._grid_minor_color = Color(*theme.getColor("buildplate_grid_minor").getRgb()) min_w = -self._width / 2 max_w = self._width / 2 @@ -306,6 +308,24 @@ class BuildVolume(SceneNode): for y in range(0, int(math.floor(min_d)), -major_grid_size): mb.addLine(Vector(min_w, min_h, y), Vector(max_w, min_h, y), color = self._grid_color) + minor_grid_size = 1 + for x in range(0, int(math.ceil(max_w)), minor_grid_size): + if x % major_grid_size == 0: #Don't overlap with the major grid. + pass + mb.addLine(Vector(x, min_h, min_d), Vector(x, min_h, max_d), color = self._grid_minor_color) + for x in range(0, int(math.floor(min_w)), -minor_grid_size): + if x % major_grid_size == 0: + pass + mb.addLine(Vector(x, min_h, min_d), Vector(x, min_h, max_d), color = self._grid_minor_color) + for y in range(0, int(math.ceil(max_d)), minor_grid_size): + if y % major_grid_size == 0: + pass + mb.addLine(Vector(min_w, min_h, y), Vector(max_w, min_h, y), color = self._grid_minor_color) + for y in range(0, int(math.floor(min_d)), -minor_grid_size): + if y % major_grid_size == 0: + pass + mb.addLine(Vector(min_w, min_h, y), Vector(max_w, min_h, y), color = self._grid_minor_color) + self._grid_mesh = mb.build() else: diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 5a6179bb83..7e5f6ae199 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -222,6 +222,7 @@ "buildplate": [244, 244, 244, 255], "buildplate_alt": [204, 204, 204, 255], "buildplate_grid": [129, 131, 134, 255], + "buildplate_grid_minor": [129, 131, 134, 31], "convex_hull": [35, 35, 35, 127], "disallowed_area": [0, 0, 0, 40],