Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2017-08-21 11:24:53 +0300
committerGhostkeeper <rubend@tutanota.com>2017-08-21 11:24:53 +0300
commit25c5c5a88836f30ceb71c1d333ba76f939aafe2e (patch)
tree2981bb544a9921ea0c88b8721d2324ae1aefe8ad /cura/BuildVolume.py
parent3b93a9d309e0eefb4501c164349f84f119f6b4c3 (diff)
Add minor grid cells for circular build plates
Same technique as the major grid cells. Contributes to issue CURA-4150.
Diffstat (limited to 'cura/BuildVolume.py')
-rwxr-xr-xcura/BuildVolume.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py
index 8298d6de0c..2757a37609 100755
--- a/cura/BuildVolume.py
+++ b/cura/BuildVolume.py
@@ -367,6 +367,20 @@ class BuildVolume(SceneNode):
mb.addLine(Vector(min_w * length_factor, min_h, y), Vector(max_w * length_factor, min_h, y), color = self._grid_color)
mb.addLine(Vector(min_w * length_factor, min_h, -y), Vector(max_w * length_factor, min_h, -y), color = self._grid_color)
+ #More fine grained grid.
+ 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
+ length_factor = math.cos(math.asin(x / max_w))
+ mb.addLine(Vector(x, min_h, min_d * length_factor), Vector(x, min_h, max_d * length_factor), color = self._grid_minor_color)
+ mb.addLine(Vector(-x, min_h, min_d * length_factor), Vector(-x, min_h, max_d * length_factor), 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
+ length_factor = math.sin(math.acos(y / max_d))
+ mb.addLine(Vector(min_w * length_factor, min_h, y), Vector(max_w * length_factor, min_h, y), color = self._grid_minor_color)
+ mb.addLine(Vector(min_w * length_factor, min_h, -y), Vector(max_w * length_factor, min_h, -y), color = self._grid_minor_color)
+
self._grid_mesh = mb.build()
# Indication of the machine origin