Skip to content

Commit e256666

Browse files
committed
glcanon: add a way to prevent cone scaling with loaded G-code extents
Useful on larger machines (like routers or plasma tables), especially without traditional "tools" where the user does not want a giant cone for a large G-code file.
1 parent 015d202 commit e256666

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

docs/src/config/ini-config.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ Descriptions of the interfaces are in the Interfaces section of the User Manual.
250250
The example above will display only one decimal digit.
251251
Formatting follows Python practice: https://docs.python.org/2/library/string.html#format-specification-mini-language .
252252
An error will be raised if the format can not accept a floating-point value.
253-
* `CONE_BASESIZE = .25` - Override the default cone/tool base size of .5 in the graphics display.
253+
* `CONE_BASESIZE = .25` - Override the default cone/tool base size of .5 in the graphics display. Valid values are between 0.025 and 2.0.
254+
* `DISABLE_CONE_SCALING = TRUE` - Any non-empty value (including "0") will override the default behavior of scaling the cone/tool size using the extents of the currently loaded G-code program in the graphics display.
254255
* `MAX_FEED_OVERRIDE = 1.2` - The maximum feed override the user may select.
255256
1.2 means 120% of the programmed feed rate.
256257
* `MIN_SPINDLE_OVERRIDE = 0.5` - The minimum spindle override the user may select.

lib/python/rs274/glcanon.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ def __init__(self, s=None, lp=None, g=None):
517517
self.foam_w_height = 1.5
518518
self.foam_z_height = 0
519519
self.hide_icons = False
520+
self.disable_cone_scaling = False
520521

521522
try:
522523
system_memory_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
@@ -565,6 +566,8 @@ def __init__(self, s=None, lp=None, g=None):
565566
if not temp is None:
566567
self.max_file_size = int(temp) * 1024 * 1024
567568

569+
self.disable_cone_scaling = bool(self.inifile.find("DISPLAY", "DISABLE_CONE_SCALING"))
570+
568571
except:
569572
# Probably started in an editor so no INI
570573
pass
@@ -640,7 +643,7 @@ def select(self, x_view, y_view):
640643
if self.get_show_rapids():
641644
glCallList(self.dlist('select_rapids', gen=self.make_selection_list))
642645
glCallList(self.dlist('select_norapids', gen=self.make_selection_list))
643-
646+
644647
try:
645648
buffer = glRenderMode(GL_RENDER)
646649
except:
@@ -1494,7 +1497,7 @@ def redraw(self):
14941497

14951498
current_tool = self.get_current_tool()
14961499
if current_tool is None or current_tool.diameter == 0:
1497-
if self.canon:
1500+
if self.canon and not self.disable_cone_scaling:
14981501
g = self.canon
14991502

15001503
cone_scale = max(g.max_extents[X] - g.min_extents[X],

0 commit comments

Comments
 (0)