meerk40t 0.9.2000__py2.py3-none-any.whl → 0.9.3001__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- meerk40t/balormk/balor_params.py +1 -43
- meerk40t/balormk/controller.py +1 -41
- meerk40t/balormk/device.py +16 -22
- meerk40t/balormk/driver.py +4 -4
- meerk40t/balormk/gui/balorconfig.py +2 -2
- meerk40t/balormk/gui/balorcontroller.py +13 -5
- meerk40t/balormk/gui/baloroperationproperties.py +0 -46
- meerk40t/balormk/gui/gui.py +17 -17
- meerk40t/camera/gui/camerapanel.py +18 -11
- meerk40t/core/cutcode/rastercut.py +3 -1
- meerk40t/core/cutplan.py +145 -14
- meerk40t/core/elements/clipboard.py +18 -9
- meerk40t/core/elements/element_treeops.py +320 -180
- meerk40t/core/elements/element_types.py +7 -2
- meerk40t/core/elements/elements.py +53 -27
- meerk40t/core/elements/geometry.py +8 -0
- meerk40t/core/elements/offset_clpr.py +129 -4
- meerk40t/core/elements/offset_mk.py +3 -1
- meerk40t/core/elements/shapes.py +28 -25
- meerk40t/core/laserjob.py +7 -0
- meerk40t/core/node/bootstrap.py +4 -0
- meerk40t/core/node/effect_hatch.py +85 -96
- meerk40t/core/node/effect_wobble.py +309 -0
- meerk40t/core/node/elem_image.py +49 -19
- meerk40t/core/node/elem_line.py +60 -0
- meerk40t/core/node/elem_rect.py +5 -3
- meerk40t/core/node/image_processed.py +766 -0
- meerk40t/core/node/image_raster.py +113 -0
- meerk40t/core/node/node.py +120 -1
- meerk40t/core/node/op_cut.py +2 -8
- meerk40t/core/node/op_dots.py +0 -8
- meerk40t/core/node/op_engrave.py +2 -18
- meerk40t/core/node/op_image.py +22 -35
- meerk40t/core/node/op_raster.py +0 -9
- meerk40t/core/planner.py +32 -2
- meerk40t/core/svg_io.py +699 -461
- meerk40t/core/treeop.py +191 -0
- meerk40t/core/undos.py +15 -1
- meerk40t/core/units.py +14 -4
- meerk40t/device/dummydevice.py +3 -2
- meerk40t/device/gui/defaultactions.py +43 -55
- meerk40t/device/gui/formatterpanel.py +58 -49
- meerk40t/device/gui/warningpanel.py +12 -12
- meerk40t/device/mixins.py +13 -0
- meerk40t/dxf/dxf_io.py +9 -5
- meerk40t/extra/ezd.py +28 -26
- meerk40t/extra/imageactions.py +300 -308
- meerk40t/extra/lbrn.py +19 -2
- meerk40t/fill/fills.py +6 -6
- meerk40t/fill/patternfill.py +1061 -1061
- meerk40t/fill/patterns.py +2 -6
- meerk40t/grbl/controller.py +168 -52
- meerk40t/grbl/device.py +23 -18
- meerk40t/grbl/driver.py +39 -0
- meerk40t/grbl/emulator.py +79 -19
- meerk40t/grbl/gcodejob.py +10 -0
- meerk40t/grbl/gui/grblconfiguration.py +2 -2
- meerk40t/grbl/gui/grblcontroller.py +24 -8
- meerk40t/grbl/gui/grblhardwareconfig.py +153 -0
- meerk40t/grbl/gui/gui.py +17 -14
- meerk40t/grbl/mock_connection.py +15 -34
- meerk40t/grbl/plugin.py +0 -4
- meerk40t/grbl/serial_connection.py +2 -1
- meerk40t/gui/about.py +8 -5
- meerk40t/gui/alignment.py +10 -6
- meerk40t/gui/basicops.py +27 -17
- meerk40t/gui/bufferview.py +2 -2
- meerk40t/gui/choicepropertypanel.py +101 -13
- meerk40t/gui/consolepanel.py +12 -9
- meerk40t/gui/devicepanel.py +38 -25
- meerk40t/gui/executejob.py +6 -4
- meerk40t/gui/help_assets/help_assets.py +13 -10
- meerk40t/gui/hersheymanager.py +8 -6
- meerk40t/gui/icons.py +1951 -3065
- meerk40t/gui/imagesplitter.py +14 -7
- meerk40t/gui/keymap.py +3 -3
- meerk40t/gui/laserpanel.py +151 -84
- meerk40t/gui/laserrender.py +61 -70
- meerk40t/gui/lasertoolpanel.py +8 -7
- meerk40t/gui/materialtest.py +3 -3
- meerk40t/gui/mkdebug.py +254 -1
- meerk40t/gui/navigationpanels.py +321 -180
- meerk40t/gui/notes.py +3 -3
- meerk40t/gui/opassignment.py +12 -12
- meerk40t/gui/operation_info.py +13 -13
- meerk40t/gui/plugin.py +5 -0
- meerk40t/gui/position.py +20 -18
- meerk40t/gui/preferences.py +21 -6
- meerk40t/gui/propertypanels/attributes.py +70 -22
- meerk40t/gui/propertypanels/blobproperty.py +2 -2
- meerk40t/gui/propertypanels/consoleproperty.py +2 -2
- meerk40t/gui/propertypanels/groupproperties.py +3 -3
- meerk40t/gui/propertypanels/hatchproperty.py +11 -18
- meerk40t/gui/propertypanels/imageproperty.py +4 -3
- meerk40t/gui/propertypanels/opbranchproperties.py +1 -1
- meerk40t/gui/propertypanels/pathproperty.py +2 -2
- meerk40t/gui/propertypanels/pointproperty.py +2 -2
- meerk40t/gui/propertypanels/propertywindow.py +4 -4
- meerk40t/gui/propertypanels/textproperty.py +3 -3
- meerk40t/gui/propertypanels/wobbleproperty.py +204 -0
- meerk40t/gui/ribbon.py +367 -259
- meerk40t/gui/scene/scene.py +31 -5
- meerk40t/gui/scenewidgets/elementswidget.py +12 -4
- meerk40t/gui/scenewidgets/gridwidget.py +2 -2
- meerk40t/gui/scenewidgets/laserpathwidget.py +7 -2
- meerk40t/gui/scenewidgets/machineoriginwidget.py +6 -2
- meerk40t/gui/scenewidgets/relocatewidget.py +1 -1
- meerk40t/gui/scenewidgets/reticlewidget.py +9 -0
- meerk40t/gui/scenewidgets/selectionwidget.py +12 -7
- meerk40t/gui/simpleui.py +95 -8
- meerk40t/gui/simulation.py +44 -36
- meerk40t/gui/spoolerpanel.py +124 -26
- meerk40t/gui/statusbarwidgets/defaultoperations.py +18 -6
- meerk40t/gui/statusbarwidgets/infowidget.py +2 -2
- meerk40t/gui/statusbarwidgets/opassignwidget.py +12 -12
- meerk40t/gui/statusbarwidgets/shapepropwidget.py +45 -18
- meerk40t/gui/statusbarwidgets/statusbar.py +11 -4
- meerk40t/gui/themes.py +78 -0
- meerk40t/gui/toolwidgets/toolcircle.py +2 -1
- meerk40t/gui/toolwidgets/toolellipse.py +2 -1
- meerk40t/gui/toolwidgets/toolimagecut.py +132 -0
- meerk40t/gui/toolwidgets/toolline.py +144 -0
- meerk40t/gui/toolwidgets/toolnodeedit.py +72 -145
- meerk40t/gui/toolwidgets/toolpoint.py +1 -1
- meerk40t/gui/toolwidgets/toolpolygon.py +8 -55
- meerk40t/gui/toolwidgets/toolrect.py +2 -1
- meerk40t/gui/usbconnect.py +2 -2
- meerk40t/gui/utilitywidgets/cyclocycloidwidget.py +2 -2
- meerk40t/gui/utilitywidgets/harmonograph.py +7 -7
- meerk40t/gui/utilitywidgets/scalewidget.py +1 -1
- meerk40t/gui/wordlisteditor.py +33 -18
- meerk40t/gui/wxmeerk40t.py +166 -66
- meerk40t/gui/wxmmain.py +236 -157
- meerk40t/gui/wxmribbon.py +49 -25
- meerk40t/gui/wxmscene.py +49 -38
- meerk40t/gui/wxmtree.py +216 -85
- meerk40t/gui/wxutils.py +62 -4
- meerk40t/image/imagetools.py +443 -15
- meerk40t/internal_plugins.py +2 -10
- meerk40t/kernel/kernel.py +12 -4
- meerk40t/lihuiyu/controller.py +7 -7
- meerk40t/lihuiyu/device.py +3 -1
- meerk40t/lihuiyu/driver.py +3 -0
- meerk40t/lihuiyu/gui/gui.py +8 -8
- meerk40t/lihuiyu/gui/lhyaccelgui.py +2 -2
- meerk40t/lihuiyu/gui/lhycontrollergui.py +73 -27
- meerk40t/lihuiyu/gui/lhydrivergui.py +2 -2
- meerk40t/lihuiyu/gui/tcpcontroller.py +22 -9
- meerk40t/main.py +6 -1
- meerk40t/moshi/controller.py +5 -5
- meerk40t/moshi/device.py +5 -2
- meerk40t/moshi/driver.py +4 -0
- meerk40t/moshi/gui/gui.py +8 -8
- meerk40t/moshi/gui/moshicontrollergui.py +24 -8
- meerk40t/moshi/gui/moshidrivergui.py +2 -2
- meerk40t/newly/controller.py +2 -0
- meerk40t/newly/device.py +9 -2
- meerk40t/newly/driver.py +4 -0
- meerk40t/newly/gui/gui.py +16 -17
- meerk40t/newly/gui/newlyconfig.py +2 -2
- meerk40t/newly/gui/newlycontroller.py +13 -5
- meerk40t/rotary/gui/gui.py +2 -2
- meerk40t/rotary/gui/rotarysettings.py +2 -2
- meerk40t/ruida/device.py +3 -0
- meerk40t/ruida/driver.py +4 -0
- meerk40t/ruida/gui/gui.py +6 -6
- meerk40t/ruida/gui/ruidaconfig.py +2 -2
- meerk40t/ruida/gui/ruidacontroller.py +13 -5
- meerk40t/svgelements.py +9 -9
- meerk40t/tools/geomstr.py +849 -153
- meerk40t/tools/kerftest.py +8 -4
- meerk40t/tools/livinghinges.py +15 -8
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/METADATA +21 -16
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/RECORD +185 -177
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/entry_points.txt +0 -1
- test/test_core_elements.py +8 -24
- test/test_file_svg.py +88 -0
- test/test_fill.py +9 -9
- test/test_geomstr.py +258 -8
- test/test_kernel.py +4 -0
- test/test_tools_rasterplotter.py +29 -0
- meerk40t/extra/embroider.py +0 -56
- meerk40t/extra/pathoptimize.py +0 -249
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/LICENSE +0 -0
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/WHEEL +0 -0
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/top_level.txt +0 -0
- {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/zip-safe +0 -0
@@ -3,28 +3,29 @@ import wx
|
|
3
3
|
from meerk40t.core.elements.element_types import elem_group_nodes, op_nodes
|
4
4
|
from meerk40t.gui.choicepropertypanel import ChoicePropertyPanel
|
5
5
|
from meerk40t.gui.icons import (
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
6
|
+
EmptyIcon,
|
7
|
+
icon_console,
|
8
|
+
icon_effect_hatch,
|
9
|
+
icon_effect_wobble,
|
10
|
+
icon_external,
|
11
|
+
icon_internal,
|
12
|
+
icon_mk_ellipse,
|
13
|
+
icon_mk_polyline,
|
14
|
+
icon_mk_rectangular,
|
15
|
+
icon_points,
|
16
|
+
icon_return,
|
17
|
+
icon_timer,
|
18
|
+
icons8_direction,
|
19
|
+
icons8_file,
|
20
|
+
icons8_group_objects,
|
21
|
+
icons8_home_filled,
|
22
|
+
icons8_image,
|
23
|
+
icons8_laser_beam,
|
24
|
+
icons8_laserbeam_weak,
|
25
|
+
icons8_text,
|
26
|
+
icons8_vector,
|
27
27
|
)
|
28
|
+
from meerk40t.gui.wxutils import dip_size
|
28
29
|
|
29
30
|
_ = wx.GetTranslation
|
30
31
|
|
@@ -43,30 +44,31 @@ class FormatterPanel(wx.Panel):
|
|
43
44
|
self.context = context
|
44
45
|
self.data = {}
|
45
46
|
images = {
|
46
|
-
"util wait":
|
47
|
-
"util home":
|
48
|
-
"util goto":
|
49
|
-
"util output":
|
50
|
-
"util input":
|
51
|
-
"util console":
|
52
|
-
"op engrave":
|
53
|
-
"op cut":
|
54
|
-
"op image":
|
55
|
-
"op raster":
|
56
|
-
"op dots":
|
57
|
-
"effect hatch":
|
58
|
-
"
|
59
|
-
"
|
60
|
-
"
|
61
|
-
"elem
|
62
|
-
"elem
|
63
|
-
"elem
|
64
|
-
"elem
|
65
|
-
"elem
|
66
|
-
"elem
|
67
|
-
"elem
|
68
|
-
"
|
69
|
-
"place
|
47
|
+
"util wait": icon_timer,
|
48
|
+
"util home": icons8_home_filled,
|
49
|
+
"util goto": icon_return,
|
50
|
+
"util output": icon_external,
|
51
|
+
"util input": icon_internal,
|
52
|
+
"util console": icon_console,
|
53
|
+
"op engrave": icons8_laserbeam_weak,
|
54
|
+
"op cut": icons8_laser_beam,
|
55
|
+
"op image": icons8_image,
|
56
|
+
"op raster": icons8_direction,
|
57
|
+
"op dots": icon_points,
|
58
|
+
"effect hatch": icon_effect_hatch,
|
59
|
+
"effect wobble": icon_effect_wobble,
|
60
|
+
"file": icons8_file,
|
61
|
+
"group": icons8_group_objects,
|
62
|
+
"elem point": icon_points,
|
63
|
+
"elem ellipse": icon_mk_ellipse,
|
64
|
+
"elem image": icons8_image,
|
65
|
+
"elem path": icons8_vector,
|
66
|
+
"elem polyline": icon_mk_polyline,
|
67
|
+
"elem rect": icon_mk_rectangular,
|
68
|
+
"elem line": icon_mk_polyline,
|
69
|
+
"elem text": icons8_text,
|
70
|
+
"place current": icons8_home_filled,
|
71
|
+
"place point": icons8_home_filled,
|
70
72
|
}
|
71
73
|
omit = ("elem line",)
|
72
74
|
self.node_list = list(elem_group_nodes + op_nodes)
|
@@ -109,13 +111,20 @@ class FormatterPanel(wx.Panel):
|
|
109
111
|
"signals": ("rebuild_tree", "speed_min"),
|
110
112
|
},
|
111
113
|
]
|
114
|
+
testsize = dip_size(self, 20, 20)
|
115
|
+
imgsize = testsize[1]
|
112
116
|
for node in self.node_list:
|
113
|
-
imgsize = 20
|
114
117
|
if node in images:
|
115
|
-
image = images[node].GetBitmap(
|
118
|
+
image = images[node].GetBitmap(
|
119
|
+
resize=imgsize, buffer=2, noadjustment=True
|
120
|
+
)
|
116
121
|
else:
|
117
|
-
|
118
|
-
|
122
|
+
# print (f"Did not find {node}")
|
123
|
+
continue
|
124
|
+
# image = EmptyIcon(size=imgsize, color=None, msg="??").GetBitmap()
|
125
|
+
if node.startswith("effect"):
|
126
|
+
sectname = "Elements (Effects)"
|
127
|
+
elif node in elem_group_nodes:
|
119
128
|
sectname = "Elements"
|
120
129
|
elif node in elem_group_nodes:
|
121
130
|
sectname = "Grouping + Files"
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import wx
|
2
2
|
|
3
3
|
from meerk40t.gui.icons import (
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
icon_effect_hatch,
|
5
|
+
icon_points,
|
6
|
+
icons8_direction,
|
7
|
+
icons8_image,
|
8
|
+
icons8_laser_beam,
|
9
|
+
icons8_laserbeam_weak,
|
10
10
|
)
|
11
11
|
from meerk40t.gui.wxutils import TextCtrl, dip_size
|
12
12
|
|
@@ -28,12 +28,12 @@ class WarningPanel(wx.Panel):
|
|
28
28
|
self.data = {}
|
29
29
|
|
30
30
|
self.images = {
|
31
|
-
"cut":
|
32
|
-
"engrave":
|
33
|
-
"raster":
|
34
|
-
"image":
|
35
|
-
"dots":
|
36
|
-
"hatch":
|
31
|
+
"cut": icons8_laser_beam,
|
32
|
+
"engrave": icons8_laserbeam_weak,
|
33
|
+
"raster": icons8_direction,
|
34
|
+
"image": icons8_image,
|
35
|
+
"dots": icon_points,
|
36
|
+
"hatch": icon_effect_hatch,
|
37
37
|
}
|
38
38
|
self.checkboxes = []
|
39
39
|
self.limits = []
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class Status:
|
2
|
+
def __init__(self):
|
3
|
+
self._laser_status = "idle"
|
4
|
+
|
5
|
+
@property
|
6
|
+
def laser_status(self):
|
7
|
+
return self._laser_status
|
8
|
+
|
9
|
+
@laser_status.setter
|
10
|
+
def laser_status(self, new_value):
|
11
|
+
self._laser_status = new_value
|
12
|
+
flag = bool(new_value == "active")
|
13
|
+
self.signal("pipe;running", flag)
|
meerk40t/dxf/dxf_io.py
CHANGED
@@ -152,10 +152,11 @@ class DXFProcessor:
|
|
152
152
|
node.stroke = color
|
153
153
|
|
154
154
|
def parse(self, entity, context_node, e_list):
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
155
|
+
if hasattr(entity, "transform_to_wcs"):
|
156
|
+
try:
|
157
|
+
entity.transform_to_wcs(entity.ocs())
|
158
|
+
except AttributeError as e:
|
159
|
+
pass
|
159
160
|
if entity.dxftype() == "CIRCLE":
|
160
161
|
m = Matrix()
|
161
162
|
m.post_scale(self.scale, -self.scale)
|
@@ -192,7 +193,7 @@ class DXFProcessor:
|
|
192
193
|
if len(path) != 0:
|
193
194
|
if not isinstance(path[0], Move):
|
194
195
|
path = Move(path.first_point) + path
|
195
|
-
|
196
|
+
path.approximate_arcs_with_cubics()
|
196
197
|
node = context_node.add(path=path, type="elem path")
|
197
198
|
self.check_for_attributes(node, entity)
|
198
199
|
e_list.append(node)
|
@@ -296,6 +297,7 @@ class DXFProcessor:
|
|
296
297
|
if len(path) != 0:
|
297
298
|
if not isinstance(path[0], Move):
|
298
299
|
path = Move(path.first_point) + path
|
300
|
+
path.approximate_arcs_with_cubics()
|
299
301
|
node = context_node.add(path=path, type="elem path")
|
300
302
|
self.check_for_attributes(node, entity)
|
301
303
|
e_list.append(node)
|
@@ -346,6 +348,7 @@ class DXFProcessor:
|
|
346
348
|
if len(path) != 0:
|
347
349
|
if not isinstance(path[0], Move):
|
348
350
|
path = Move(path.first_point) + path
|
351
|
+
path.approximate_arcs_with_cubics()
|
349
352
|
node = context_node.add(path=path, type="elem path")
|
350
353
|
self.check_for_attributes(node, entity)
|
351
354
|
e_list.append(node)
|
@@ -407,6 +410,7 @@ class DXFProcessor:
|
|
407
410
|
if len(path) != 0:
|
408
411
|
if not isinstance(path[0], Move):
|
409
412
|
path = Move(path.first_point) + path
|
413
|
+
path.approximate_arcs_with_cubics()
|
410
414
|
node = context_node.add(path=path, type="elem path")
|
411
415
|
self.check_for_attributes(node, entity)
|
412
416
|
e_list.append(node)
|
meerk40t/extra/ezd.py
CHANGED
@@ -37,12 +37,14 @@ def _parse_struct(file):
|
|
37
37
|
@return:
|
38
38
|
"""
|
39
39
|
p = list()
|
40
|
-
count = struct.unpack("<
|
40
|
+
count = struct.unpack("<i", file.read(4))[0]
|
41
41
|
for i in range(count):
|
42
42
|
b = file.read(4)
|
43
43
|
if len(b) != 4:
|
44
44
|
return p
|
45
|
-
(length,) = struct.unpack("<
|
45
|
+
(length,) = struct.unpack("<i", b)
|
46
|
+
if length == -1:
|
47
|
+
return p
|
46
48
|
b = file.read(length)
|
47
49
|
if len(b) != length:
|
48
50
|
return p
|
@@ -68,7 +70,7 @@ def _interpret(data, index, type):
|
|
68
70
|
elif type == "short":
|
69
71
|
(data[index],) = struct.unpack("<H", data[index])
|
70
72
|
elif type == int:
|
71
|
-
(data[index],) = struct.unpack("<
|
73
|
+
(data[index],) = struct.unpack("<i", data[index])
|
72
74
|
elif type == float:
|
73
75
|
(data[index],) = struct.unpack("d", data[index])
|
74
76
|
elif type == "matrix":
|
@@ -239,8 +241,8 @@ class EZCFile:
|
|
239
241
|
header = magic_number.decode("utf_16")
|
240
242
|
if header != "EZCADUNI":
|
241
243
|
return False
|
242
|
-
v0 = struct.unpack("<
|
243
|
-
v1 = struct.unpack("<
|
244
|
+
v0 = struct.unpack("<i", file.read(4)) # 0
|
245
|
+
v1 = struct.unpack("<i", file.read(4)) # 2001
|
244
246
|
s1 = file.read(60)
|
245
247
|
s1 = s1.decode("utf-16")
|
246
248
|
s2 = file.read(60)
|
@@ -256,13 +258,13 @@ class EZCFile:
|
|
256
258
|
@param file:
|
257
259
|
@return:
|
258
260
|
"""
|
259
|
-
self._locations["preview"] = struct.unpack("<
|
260
|
-
self._locations["v1"] = struct.unpack("<
|
261
|
-
self._locations["pens"] = struct.unpack("<
|
262
|
-
self._locations["font"] = struct.unpack("<
|
263
|
-
self._locations["v4"] = struct.unpack("<
|
264
|
-
self._locations["vectors"] = struct.unpack("<
|
265
|
-
self._locations["prevectors"] = struct.unpack("<
|
261
|
+
self._locations["preview"] = struct.unpack("<i", file.read(4))[0]
|
262
|
+
self._locations["v1"] = struct.unpack("<i", file.read(4))[0]
|
263
|
+
self._locations["pens"] = struct.unpack("<i", file.read(4))[0]
|
264
|
+
self._locations["font"] = struct.unpack("<i", file.read(4))[0]
|
265
|
+
self._locations["v4"] = struct.unpack("<i", file.read(4))[0]
|
266
|
+
self._locations["vectors"] = struct.unpack("<i", file.read(4))[0]
|
267
|
+
self._locations["prevectors"] = struct.unpack("<i", file.read(4))[0]
|
266
268
|
|
267
269
|
def parse_unknown_nontable(self, file):
|
268
270
|
"""
|
@@ -324,10 +326,10 @@ class EZCFile:
|
|
324
326
|
if seek == 0:
|
325
327
|
return
|
326
328
|
file.seek(seek, 0)
|
327
|
-
unknown = struct.unpack("<
|
328
|
-
width = struct.unpack("<
|
329
|
-
height = struct.unpack("<
|
330
|
-
v3 = struct.unpack("<
|
329
|
+
unknown = struct.unpack("<i", file.read(4))[0]
|
330
|
+
width = struct.unpack("<i", file.read(4))[0]
|
331
|
+
height = struct.unpack("<i", file.read(4))[0]
|
332
|
+
v3 = struct.unpack("<3i", file.read(12))
|
331
333
|
# 800, 0x200002
|
332
334
|
|
333
335
|
# RGB0
|
@@ -346,7 +348,7 @@ class EZCFile:
|
|
346
348
|
if seek == 0:
|
347
349
|
return
|
348
350
|
file.seek(seek, 0)
|
349
|
-
font_count = struct.unpack("<
|
351
|
+
font_count = struct.unpack("<i", file.read(4))[0]
|
350
352
|
|
351
353
|
for i in range(font_count):
|
352
354
|
f = file.read(100)
|
@@ -364,8 +366,8 @@ class EZCFile:
|
|
364
366
|
return
|
365
367
|
file.seek(seek, 0)
|
366
368
|
|
367
|
-
parameter_count = struct.unpack("<
|
368
|
-
seek = struct.unpack("<
|
369
|
+
parameter_count = struct.unpack("<i", file.read(4))[0]
|
370
|
+
seek = struct.unpack("<i", file.read(4))[0]
|
369
371
|
file.seek(seek, 0)
|
370
372
|
for c in range(parameter_count):
|
371
373
|
self.pens.append(Pen(file))
|
@@ -445,7 +447,7 @@ class EZObject:
|
|
445
447
|
self.position = header[13]
|
446
448
|
self.z_pos = header[14]
|
447
449
|
if isinstance(self, list):
|
448
|
-
(count,) = struct.unpack("<
|
450
|
+
(count,) = struct.unpack("<i", file.read(4))
|
449
451
|
for c in range(count):
|
450
452
|
parse_object(file, self)
|
451
453
|
|
@@ -502,7 +504,7 @@ class EZCurve(EZObject):
|
|
502
504
|
d = struct.unpack(f"<5d", file.read(40))
|
503
505
|
# print(d)
|
504
506
|
continue
|
505
|
-
(pt_count,) = struct.unpack("<
|
507
|
+
(pt_count,) = struct.unpack("<i", file.read(4))
|
506
508
|
# print(unk1, curve_type, unk2, unk2, pt_count)
|
507
509
|
pts.append(
|
508
510
|
(
|
@@ -718,7 +720,7 @@ class EZText(EZObject):
|
|
718
720
|
self.circle_text_button_flags = args[
|
719
721
|
85
|
720
722
|
] # 2 is first button, 1 is right to left.
|
721
|
-
(count,) = struct.unpack("<
|
723
|
+
(count,) = struct.unpack("<i", file.read(4))
|
722
724
|
for i in range(count):
|
723
725
|
(type,) = struct.unpack("<H", file.read(2))
|
724
726
|
# type, 7 file. 1 Text. 2 Serial
|
@@ -726,7 +728,7 @@ class EZText(EZObject):
|
|
726
728
|
_construct(extradata)
|
727
729
|
extradata2 = _parse_struct(file)
|
728
730
|
_construct(extradata2)
|
729
|
-
(unk,) = struct.unpack("<
|
731
|
+
(unk,) = struct.unpack("<i", file.read(4))
|
730
732
|
|
731
733
|
|
732
734
|
class EZImage(EZObject):
|
@@ -741,7 +743,7 @@ class EZImage(EZObject):
|
|
741
743
|
|
742
744
|
image_bytes = bytearray(file.read(2)) # BM
|
743
745
|
image_length = file.read(4) # int32le
|
744
|
-
(size,) = struct.unpack("<
|
746
|
+
(size,) = struct.unpack("<i", image_length)
|
745
747
|
image_bytes += image_length
|
746
748
|
image_bytes += file.read(size - 6)
|
747
749
|
|
@@ -831,7 +833,7 @@ class EZHatch(list, EZObject):
|
|
831
833
|
self.hatch3_loop_distance = args[37]
|
832
834
|
self.hatch3_angle_inc = args[28]
|
833
835
|
tell = file.tell()
|
834
|
-
(check,) = struct.unpack("<
|
836
|
+
(check,) = struct.unpack("<i", file.read(4))
|
835
837
|
file.seek(tell, 0)
|
836
838
|
if check == 15:
|
837
839
|
self.group = EZGroup(file)
|
@@ -861,7 +863,7 @@ object_map = {
|
|
861
863
|
|
862
864
|
|
863
865
|
def parse_object(file, objects):
|
864
|
-
object_type = struct.unpack("<
|
866
|
+
object_type = struct.unpack("<i", file.read(4))[0] # 0
|
865
867
|
if object_type == 0:
|
866
868
|
return False
|
867
869
|
ez_class = object_map.get(object_type)
|