Skip to content

Commit

Permalink
Update to v0.35
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenhouser committed Sep 8, 2019
1 parent 89b1553 commit 6367c54
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 57 deletions.
7 changes: 6 additions & 1 deletion Change_Log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,9 @@ Version 0.33:

Version 0.34:
- Fixed "float() argument must be a string or number error" for some SVG files.
- Now respects display='none' for vecor engrav/cut items in svg files.
- Now respects display='none' for vector engrave/cut items in SVG files.

Version 0.35:
- Fixed arrow button, center and corner button functions when using rotary settings. (These functions where broken in a previous version.)
- Changed vector engrave function so that it does not try to cut inside first. This greatly speeds up processing for complex designs.

Binary file modified emblem.icns
Binary file not shown.
100 changes: 56 additions & 44 deletions k40_whisperer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
version = '0.34'
version = '0.35'
title_text = "K40 Whisperer V"+version

import sys
Expand Down Expand Up @@ -2606,11 +2606,12 @@ def Send_Rapid_Move(self,dxmils,dymils):
def slow_jog(self,dxmils,dymils):
if int(dxmils)==0 and int(dymils)==0:
return
self.stop[0]=False
Rapid_data=[]
Rapid_inst = egv(target=lambda s:Rapid_data.append(s))
Rapid_inst.make_egv_rapid(dxmils,dymils,Feed=float(self.rapid_feed.get()),board_name=self.board_name.get())
self.send_egv_data(Rapid_data, 1, None)
self.stop[0]=True

def update_gui(self, message=None, bgcolor='white'):
if message!=None:
Expand Down Expand Up @@ -2871,7 +2872,7 @@ def point_inside_polygon(self,x,y,poly):

return inside

def optimize_paths(self,ecoords):
def optimize_paths(self,ecoords,inside_check=True):
order_out = self.Sort_Paths(ecoords)
lastx=-999
lasty=-999
Expand Down Expand Up @@ -2905,46 +2906,57 @@ def optimize_paths(self,ecoords):
lastx = x1
lasty = y1
loop_old = loop
#####################################################
# For each loop determine if other loops are inside #
#####################################################
Nloops=len(cuts)
self.LoopTree=[]
for iloop in range(Nloops):
self.LoopTree.append([])
## CUR_PCT=float(iloop)/Nloops*100.0
## if (not self.batch.get()):
## self.statusMessage.set('Determining Which Side of Loop to Cut: %d of %d' %(iloop+1,Nloops))
## self.master.update()
ipoly = cuts[iloop]
## Check points in other loops (could just check one) ##
if ipoly != []:
for jloop in range(Nloops):
if jloop != iloop:
inside = 0
inside = inside + self.point_inside_polygon(cuts[jloop][0][0],cuts[jloop][0][1],ipoly)
if inside > 0:
self.LoopTree[iloop].append(jloop)
#####################################################
for i in range(Nloops):
lns=[]
lns.append(i)
self.remove_self_references(lns,self.LoopTree[i])

self.order=[]
self.loops = list(range(Nloops))
for i in range(Nloops):
if self.LoopTree[i]!=[]:
self.addlist(self.LoopTree[i])
self.LoopTree[i]=[]
if self.loops[i]!=[]:
self.order.append(self.loops[i])
self.loops[i]=[]
ecoords_out = []
for i in self.order:
line = cuts[i]
for coord in line:
ecoords_out.append([coord[0],coord[1],i])

if inside_check:
#####################################################
# For each loop determine if other loops are inside #
#####################################################
Nloops=len(cuts)
self.LoopTree=[]
for iloop in range(Nloops):
self.LoopTree.append([])
## CUR_PCT=float(iloop)/Nloops*100.0
## if (not self.batch.get()):
## self.statusMessage.set('Determining Which Side of Loop to Cut: %d of %d' %(iloop+1,Nloops))
## self.master.update()
ipoly = cuts[iloop]
## Check points in other loops (could just check one) ##
if ipoly != []:
for jloop in range(Nloops):
if jloop != iloop:
inside = 0
inside = inside + self.point_inside_polygon(cuts[jloop][0][0],cuts[jloop][0][1],ipoly)
if inside > 0:
self.LoopTree[iloop].append(jloop)
#####################################################
for i in range(Nloops):
lns=[]
lns.append(i)
self.remove_self_references(lns,self.LoopTree[i])

self.order=[]
self.loops = list(range(Nloops))
for i in range(Nloops):
if self.LoopTree[i]!=[]:
self.addlist(self.LoopTree[i])
self.LoopTree[i]=[]
if self.loops[i]!=[]:
self.order.append(self.loops[i])
self.loops[i]=[]
#END inside_check
ecoords_out = []
for i in self.order:
line = cuts[i]
for coord in line:
ecoords_out.append([coord[0],coord[1],i])
#END inside_check
else:
ecoords_out = []
for i in range(len(cuts)):
line = cuts[i]
for coord in line:
ecoords_out.append([coord[0],coord[1],i])

return ecoords_out

def remove_self_references(self,loop_numbers,loops):
Expand Down Expand Up @@ -3084,7 +3096,7 @@ def send_data(self,operation_type=None, output_filename=None):
self.statusMessage.set("Vector Engrave: Determining Cut Order....")
self.master.update()
if not self.VengData.sorted and self.inside_first.get():
self.VengData.set_ecoords(self.optimize_paths(self.VengData.ecoords),data_sorted=True)
self.VengData.set_ecoords(self.optimize_paths(self.VengData.ecoords,inside_check=False),data_sorted=True)
self.statusMessage.set("Generating EGV data...")
self.master.update()

Expand Down
22 changes: 11 additions & 11 deletions macOS.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- K40_Whisperer-0.34_src/k40_whisperer.py 2019-08-10 23:33:58.000000000 -0400
+++ k40_whisperer.py 2019-08-13 13:54:37.000000000 -0400
--- K40_Whisperer-0.35_src/k40_whisperer.py 2019-08-25 22:01:44.000000000 -0400
+++ k40_whisperer.py 2019-09-08 12:38:21.000000000 -0400
@@ -93,8 +93,33 @@

QUIET = False
Expand Down Expand Up @@ -51,7 +51,7 @@
###########################################################################
# End Left Column #

@@ -3372,7 +3405,10 @@
@@ -3384,7 +3417,10 @@
U_display))

self.statusbar.configure( bg = 'white' )
Expand All @@ -63,7 +63,7 @@
def menu_Mode_Change_Callback(self, varName, index, mode):
self.menu_View_Refresh()

@@ -4161,7 +4197,8 @@
@@ -4173,7 +4209,8 @@
xd_label_L = 12

w_label=150
Expand All @@ -73,7 +73,7 @@
w_units=45
xd_entry_L=xd_label_L+w_label+10
xd_units_L=xd_entry_L+w_entry+5
@@ -4303,6 +4340,9 @@
@@ -4315,6 +4352,9 @@
self.GEN_Close.place(x=Xbut, y=Ybut, width=130, height=30, anchor="center")
self.GEN_Close.bind("<ButtonRelease-1>", self.Close_Current_Window_Click)

Expand All @@ -83,7 +83,7 @@

################################################################################
# Raster Settings Window #
@@ -4574,7 +4614,8 @@
@@ -4586,7 +4626,8 @@
xd_label_L = 12

w_label=150
Expand All @@ -93,7 +93,7 @@
w_units=35
xd_entry_L=xd_label_L+w_label+10
xd_units_L=xd_entry_L+w_entry+5
@@ -4620,6 +4661,9 @@
@@ -4632,6 +4673,9 @@

self.EGV_Send = Button(egv_send,text="Send EGV Data",command=Close_and_Send_Click)
self.EGV_Send.place(x=Xbut, y=Ybut, width=130, height=30, anchor="w")
Expand All @@ -103,7 +103,7 @@
################################################################################


@@ -4717,6 +4761,8 @@
@@ -4729,6 +4773,8 @@

def apply(self):
self.result = self.uom.get()
Expand All @@ -112,16 +112,16 @@
return


@@ -5018,4 +5064,7 @@
@@ -5030,4 +5076,7 @@
message_box("K40 Whisperer",LOAD_MSG)
debug_message("Debuging is turned on.")

+# macOS Patch - Stephen Houser ([email protected])
+macOS_button_fix_enabled = True
+macOS_button_fix(root)
root.mainloop()
--- K40_Whisperer-0.34_src/nano_library.py 2019-06-11 21:50:06.000000000 -0400
+++ nano_library.py 2019-08-13 13:47:38.000000000 -0400
--- K40_Whisperer-0.35_src/nano_library.py 2019-06-11 21:50:06.000000000 -0400
+++ nano_library.py 2019-09-08 12:38:21.000000000 -0400
@@ -281,10 +281,10 @@
FINISHED = True
break
Expand Down
2 changes: 1 addition & 1 deletion py2app_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from setuptools import setup

app_name = 'K40 Whisperer'
app_version = "0.34"
app_version = "0.35"
app_copyright = u'Copyright © 2017-2019, Scorch Works, GNU General Public License'
main_script = 'k40_whisperer.py'
url = 'https://github.com/stephenhouser/k40-whisperer'
Expand Down

0 comments on commit 6367c54

Please sign in to comment.