-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmodel.py
31 lines (24 loc) · 929 Bytes
/
model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from src import gui_utils, gcode
class MainModel:
def __init__(self):
self.current_slider_value = None
self.opened_stl = ""
self.gcode = None
self.opened_gcode = ""
self.splanes = []
self.planesActors = []
def load_gcode(self, filename):
self.current_slider_value = None
self.opened_gcode = filename
self.gcode = gcode.readGCode(filename)
return self.gcode
def add_splane(self):
if len(self.splanes) == 0:
self.splanes.append(gui_utils.Plane(-60, 0, [10, 10, 10]))
else:
path = [self.splanes[-1].x, self.splanes[-1].y, self.splanes[-1].z + 10]
self.splanes.append(gui_utils.Plane(0, 0, path))
def add_cone(self):
self.splanes.append(gui_utils.Cone(60, (0, 0, 10), 0, 100))
def add_cylinder(self):
self.splanes.append(gui_utils.Cylinder(10, 10, 250))