reformated plater.py
parent
b631c3ba85
commit
95aaa81b3b
17
plater.py
17
plater.py
|
@ -1,9 +1,13 @@
|
|||
#!/usr/bin/env python
|
||||
import wx,time,random,threading,os,math
|
||||
import stltool
|
||||
|
||||
import wx
|
||||
import time
|
||||
import random
|
||||
import threading
|
||||
import os
|
||||
import math
|
||||
import sys
|
||||
|
||||
import stltool
|
||||
|
||||
glview = False
|
||||
if "-nogl" not in sys.argv:
|
||||
|
@ -17,6 +21,7 @@ if "-nogl" not in sys.argv:
|
|||
def evalme(s):
|
||||
return eval(s[s.find("(") + 1:s.find(")")])
|
||||
|
||||
|
||||
class stlwrap:
|
||||
def __init__(self, obj, name=None):
|
||||
self.obj = obj
|
||||
|
@ -63,7 +68,6 @@ class showstl(wx.Window):
|
|||
dc.SelectObject(wx.NullBitmap)
|
||||
m.bitmap.SetMask(wx.Mask(m.bitmap, wx.Colour(0, 0, 0, 255)))
|
||||
|
||||
|
||||
def move_shape(self, delta):
|
||||
"""moves shape (selected in l, which is list ListBox of shapes)
|
||||
by an offset specified in tuple delta.
|
||||
|
@ -213,6 +217,7 @@ class showstl(wx.Window):
|
|||
#print time.time()-t
|
||||
#s.export()
|
||||
|
||||
|
||||
class stlwin(wx.Frame):
|
||||
def __init__(self, size=(800, 580), callback=None, parent=None):
|
||||
wx.Frame.__init__(self, parent, title="Plate building tool", size=size)
|
||||
|
@ -295,7 +300,6 @@ class stlwin(wx.Frame):
|
|||
self.models[i].offsets[1] += centreoffset[1]
|
||||
self.Refresh()
|
||||
|
||||
|
||||
def clear(self, event):
|
||||
result = wx.MessageBox('Are you sure you want to clear the grid? All unsaved changes will be lost.', 'Clear the grid?',
|
||||
wx.YES_NO | wx.ICON_QUESTION)
|
||||
|
@ -328,7 +332,6 @@ class stlwin(wx.Frame):
|
|||
self.Refresh()
|
||||
|
||||
def done(self, event, cb):
|
||||
import os,time
|
||||
try:
|
||||
os.mkdir("tempstl")
|
||||
except:
|
||||
|
@ -339,7 +342,6 @@ class stlwin(wx.Frame):
|
|||
cb(name)
|
||||
self.Destroy()
|
||||
|
||||
|
||||
def export(self, event):
|
||||
dlg = wx.FileDialog(self, "Pick file to save to", self.basedir, style=wx.FD_SAVE)
|
||||
dlg.SetWildcard("STL files (;*.stl;)")
|
||||
|
@ -462,4 +464,3 @@ if __name__ == '__main__':
|
|||
main = stlwin()
|
||||
main.Show()
|
||||
app.MainLoop()
|
||||
|
||||
|
|
Loading…
Reference in New Issue