Start with 3D Printing
This commit is contained in:
parent
0b6069f8c5
commit
8478c6f5f0
29
JFSphoto.py
29
JFSphoto.py
@ -16,6 +16,10 @@ from matplotlib.figure import Figure
|
|||||||
from numpy import arange, sin, pi,cos
|
from numpy import arange, sin, pi,cos
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import time
|
import time
|
||||||
|
from matplotlib import cm
|
||||||
|
from matplotlib.ticker import LinearLocator, FormatStrFormatter
|
||||||
|
from mpl_toolkits.mplot3d import Axes3D
|
||||||
|
|
||||||
####################################### object
|
####################################### object
|
||||||
|
|
||||||
class Jfsphoto (object):
|
class Jfsphoto (object):
|
||||||
@ -309,8 +313,15 @@ class Jfsphoto (object):
|
|||||||
|
|
||||||
def do_math(self):
|
def do_math(self):
|
||||||
stati = [("Raw",1),("Raw + Baseline",2),("Transmission",4),("Absorbanz",3)]
|
stati = [("Raw",1),("Raw + Baseline",2),("Transmission",4),("Absorbanz",3)]
|
||||||
|
def toggle():
|
||||||
win = tk.Toplevel()
|
if self.kbtn.config('relief')[-1] == 'sunken':
|
||||||
|
self.kbtn.config(relief='raised')
|
||||||
|
self.do_2dprint()
|
||||||
|
else:
|
||||||
|
self.kbtn.config(relief='sunken')
|
||||||
|
self.do_3dprint()
|
||||||
|
|
||||||
|
win = tk.Toplevel()
|
||||||
self.center = tk.Frame(win, bg='gray2', width=800, height=400, padx=3, pady=3)
|
self.center = tk.Frame(win, bg='gray2', width=800, height=400, padx=3, pady=3)
|
||||||
self.center.grid_rowconfigure(0, weight=1)
|
self.center.grid_rowconfigure(0, weight=1)
|
||||||
self.center.grid_columnconfigure(1, weight=1)
|
self.center.grid_columnconfigure(1, weight=1)
|
||||||
@ -340,7 +351,9 @@ class Jfsphoto (object):
|
|||||||
self.kbtn.grid(row=15,column=0,sticky="w")
|
self.kbtn.grid(row=15,column=0,sticky="w")
|
||||||
self.kbtn = tk.Button(master=self.ctr_right,text="Save Kinetic / Data",command=self.save_kinetics,width=15)
|
self.kbtn = tk.Button(master=self.ctr_right,text="Save Kinetic / Data",command=self.save_kinetics,width=15)
|
||||||
self.kbtn.grid(row=16,column=0,sticky="w")
|
self.kbtn.grid(row=16,column=0,sticky="w")
|
||||||
|
self.kbtn = tk.Button(master=self.ctr_right,text="3 D Print",command=toggle,width=15,relief='raised')
|
||||||
|
self.kbtn.grid(row=17,column=0,sticky="w")
|
||||||
|
|
||||||
#self.scrollbar = tk.Scrollbar(master=self.ctr_right)
|
#self.scrollbar = tk.Scrollbar(master=self.ctr_right)
|
||||||
#self.listbox.config(yscrollcommand =self.scrollbar.set)
|
#self.listbox.config(yscrollcommand =self.scrollbar.set)
|
||||||
#self.scrollbar.config(command = self.listbox.yview)
|
#self.scrollbar.config(command = self.listbox.yview)
|
||||||
@ -358,6 +371,16 @@ class Jfsphoto (object):
|
|||||||
win.grab_set()
|
win.grab_set()
|
||||||
win.wait_window()
|
win.wait_window()
|
||||||
|
|
||||||
|
def do_2dprint(self):
|
||||||
|
self.ax1 = self.fig.add_subplot(111)
|
||||||
|
self.look()
|
||||||
|
|
||||||
|
def do_3dprint(self):
|
||||||
|
self.ax1 = self.fig.gca(projection='3d')
|
||||||
|
for xx in self.col_list:
|
||||||
|
self.df.plot(x = 'nmscale',y = xx, zs= int(xx), linewidth=0.6,ax=self.ax1)
|
||||||
|
self.canvas.draw()
|
||||||
|
|
||||||
def show_selected(self):
|
def show_selected(self):
|
||||||
self.col_list = [self.listbox.get(i) for i in self.listbox.curselection()]
|
self.col_list = [self.listbox.get(i) for i in self.listbox.curselection()]
|
||||||
self.look()
|
self.look()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user