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.
Files changed (187) hide show
  1. meerk40t/balormk/balor_params.py +1 -43
  2. meerk40t/balormk/controller.py +1 -41
  3. meerk40t/balormk/device.py +16 -22
  4. meerk40t/balormk/driver.py +4 -4
  5. meerk40t/balormk/gui/balorconfig.py +2 -2
  6. meerk40t/balormk/gui/balorcontroller.py +13 -5
  7. meerk40t/balormk/gui/baloroperationproperties.py +0 -46
  8. meerk40t/balormk/gui/gui.py +17 -17
  9. meerk40t/camera/gui/camerapanel.py +18 -11
  10. meerk40t/core/cutcode/rastercut.py +3 -1
  11. meerk40t/core/cutplan.py +145 -14
  12. meerk40t/core/elements/clipboard.py +18 -9
  13. meerk40t/core/elements/element_treeops.py +320 -180
  14. meerk40t/core/elements/element_types.py +7 -2
  15. meerk40t/core/elements/elements.py +53 -27
  16. meerk40t/core/elements/geometry.py +8 -0
  17. meerk40t/core/elements/offset_clpr.py +129 -4
  18. meerk40t/core/elements/offset_mk.py +3 -1
  19. meerk40t/core/elements/shapes.py +28 -25
  20. meerk40t/core/laserjob.py +7 -0
  21. meerk40t/core/node/bootstrap.py +4 -0
  22. meerk40t/core/node/effect_hatch.py +85 -96
  23. meerk40t/core/node/effect_wobble.py +309 -0
  24. meerk40t/core/node/elem_image.py +49 -19
  25. meerk40t/core/node/elem_line.py +60 -0
  26. meerk40t/core/node/elem_rect.py +5 -3
  27. meerk40t/core/node/image_processed.py +766 -0
  28. meerk40t/core/node/image_raster.py +113 -0
  29. meerk40t/core/node/node.py +120 -1
  30. meerk40t/core/node/op_cut.py +2 -8
  31. meerk40t/core/node/op_dots.py +0 -8
  32. meerk40t/core/node/op_engrave.py +2 -18
  33. meerk40t/core/node/op_image.py +22 -35
  34. meerk40t/core/node/op_raster.py +0 -9
  35. meerk40t/core/planner.py +32 -2
  36. meerk40t/core/svg_io.py +699 -461
  37. meerk40t/core/treeop.py +191 -0
  38. meerk40t/core/undos.py +15 -1
  39. meerk40t/core/units.py +14 -4
  40. meerk40t/device/dummydevice.py +3 -2
  41. meerk40t/device/gui/defaultactions.py +43 -55
  42. meerk40t/device/gui/formatterpanel.py +58 -49
  43. meerk40t/device/gui/warningpanel.py +12 -12
  44. meerk40t/device/mixins.py +13 -0
  45. meerk40t/dxf/dxf_io.py +9 -5
  46. meerk40t/extra/ezd.py +28 -26
  47. meerk40t/extra/imageactions.py +300 -308
  48. meerk40t/extra/lbrn.py +19 -2
  49. meerk40t/fill/fills.py +6 -6
  50. meerk40t/fill/patternfill.py +1061 -1061
  51. meerk40t/fill/patterns.py +2 -6
  52. meerk40t/grbl/controller.py +168 -52
  53. meerk40t/grbl/device.py +23 -18
  54. meerk40t/grbl/driver.py +39 -0
  55. meerk40t/grbl/emulator.py +79 -19
  56. meerk40t/grbl/gcodejob.py +10 -0
  57. meerk40t/grbl/gui/grblconfiguration.py +2 -2
  58. meerk40t/grbl/gui/grblcontroller.py +24 -8
  59. meerk40t/grbl/gui/grblhardwareconfig.py +153 -0
  60. meerk40t/grbl/gui/gui.py +17 -14
  61. meerk40t/grbl/mock_connection.py +15 -34
  62. meerk40t/grbl/plugin.py +0 -4
  63. meerk40t/grbl/serial_connection.py +2 -1
  64. meerk40t/gui/about.py +8 -5
  65. meerk40t/gui/alignment.py +10 -6
  66. meerk40t/gui/basicops.py +27 -17
  67. meerk40t/gui/bufferview.py +2 -2
  68. meerk40t/gui/choicepropertypanel.py +101 -13
  69. meerk40t/gui/consolepanel.py +12 -9
  70. meerk40t/gui/devicepanel.py +38 -25
  71. meerk40t/gui/executejob.py +6 -4
  72. meerk40t/gui/help_assets/help_assets.py +13 -10
  73. meerk40t/gui/hersheymanager.py +8 -6
  74. meerk40t/gui/icons.py +1951 -3065
  75. meerk40t/gui/imagesplitter.py +14 -7
  76. meerk40t/gui/keymap.py +3 -3
  77. meerk40t/gui/laserpanel.py +151 -84
  78. meerk40t/gui/laserrender.py +61 -70
  79. meerk40t/gui/lasertoolpanel.py +8 -7
  80. meerk40t/gui/materialtest.py +3 -3
  81. meerk40t/gui/mkdebug.py +254 -1
  82. meerk40t/gui/navigationpanels.py +321 -180
  83. meerk40t/gui/notes.py +3 -3
  84. meerk40t/gui/opassignment.py +12 -12
  85. meerk40t/gui/operation_info.py +13 -13
  86. meerk40t/gui/plugin.py +5 -0
  87. meerk40t/gui/position.py +20 -18
  88. meerk40t/gui/preferences.py +21 -6
  89. meerk40t/gui/propertypanels/attributes.py +70 -22
  90. meerk40t/gui/propertypanels/blobproperty.py +2 -2
  91. meerk40t/gui/propertypanels/consoleproperty.py +2 -2
  92. meerk40t/gui/propertypanels/groupproperties.py +3 -3
  93. meerk40t/gui/propertypanels/hatchproperty.py +11 -18
  94. meerk40t/gui/propertypanels/imageproperty.py +4 -3
  95. meerk40t/gui/propertypanels/opbranchproperties.py +1 -1
  96. meerk40t/gui/propertypanels/pathproperty.py +2 -2
  97. meerk40t/gui/propertypanels/pointproperty.py +2 -2
  98. meerk40t/gui/propertypanels/propertywindow.py +4 -4
  99. meerk40t/gui/propertypanels/textproperty.py +3 -3
  100. meerk40t/gui/propertypanels/wobbleproperty.py +204 -0
  101. meerk40t/gui/ribbon.py +367 -259
  102. meerk40t/gui/scene/scene.py +31 -5
  103. meerk40t/gui/scenewidgets/elementswidget.py +12 -4
  104. meerk40t/gui/scenewidgets/gridwidget.py +2 -2
  105. meerk40t/gui/scenewidgets/laserpathwidget.py +7 -2
  106. meerk40t/gui/scenewidgets/machineoriginwidget.py +6 -2
  107. meerk40t/gui/scenewidgets/relocatewidget.py +1 -1
  108. meerk40t/gui/scenewidgets/reticlewidget.py +9 -0
  109. meerk40t/gui/scenewidgets/selectionwidget.py +12 -7
  110. meerk40t/gui/simpleui.py +95 -8
  111. meerk40t/gui/simulation.py +44 -36
  112. meerk40t/gui/spoolerpanel.py +124 -26
  113. meerk40t/gui/statusbarwidgets/defaultoperations.py +18 -6
  114. meerk40t/gui/statusbarwidgets/infowidget.py +2 -2
  115. meerk40t/gui/statusbarwidgets/opassignwidget.py +12 -12
  116. meerk40t/gui/statusbarwidgets/shapepropwidget.py +45 -18
  117. meerk40t/gui/statusbarwidgets/statusbar.py +11 -4
  118. meerk40t/gui/themes.py +78 -0
  119. meerk40t/gui/toolwidgets/toolcircle.py +2 -1
  120. meerk40t/gui/toolwidgets/toolellipse.py +2 -1
  121. meerk40t/gui/toolwidgets/toolimagecut.py +132 -0
  122. meerk40t/gui/toolwidgets/toolline.py +144 -0
  123. meerk40t/gui/toolwidgets/toolnodeedit.py +72 -145
  124. meerk40t/gui/toolwidgets/toolpoint.py +1 -1
  125. meerk40t/gui/toolwidgets/toolpolygon.py +8 -55
  126. meerk40t/gui/toolwidgets/toolrect.py +2 -1
  127. meerk40t/gui/usbconnect.py +2 -2
  128. meerk40t/gui/utilitywidgets/cyclocycloidwidget.py +2 -2
  129. meerk40t/gui/utilitywidgets/harmonograph.py +7 -7
  130. meerk40t/gui/utilitywidgets/scalewidget.py +1 -1
  131. meerk40t/gui/wordlisteditor.py +33 -18
  132. meerk40t/gui/wxmeerk40t.py +166 -66
  133. meerk40t/gui/wxmmain.py +236 -157
  134. meerk40t/gui/wxmribbon.py +49 -25
  135. meerk40t/gui/wxmscene.py +49 -38
  136. meerk40t/gui/wxmtree.py +216 -85
  137. meerk40t/gui/wxutils.py +62 -4
  138. meerk40t/image/imagetools.py +443 -15
  139. meerk40t/internal_plugins.py +2 -10
  140. meerk40t/kernel/kernel.py +12 -4
  141. meerk40t/lihuiyu/controller.py +7 -7
  142. meerk40t/lihuiyu/device.py +3 -1
  143. meerk40t/lihuiyu/driver.py +3 -0
  144. meerk40t/lihuiyu/gui/gui.py +8 -8
  145. meerk40t/lihuiyu/gui/lhyaccelgui.py +2 -2
  146. meerk40t/lihuiyu/gui/lhycontrollergui.py +73 -27
  147. meerk40t/lihuiyu/gui/lhydrivergui.py +2 -2
  148. meerk40t/lihuiyu/gui/tcpcontroller.py +22 -9
  149. meerk40t/main.py +6 -1
  150. meerk40t/moshi/controller.py +5 -5
  151. meerk40t/moshi/device.py +5 -2
  152. meerk40t/moshi/driver.py +4 -0
  153. meerk40t/moshi/gui/gui.py +8 -8
  154. meerk40t/moshi/gui/moshicontrollergui.py +24 -8
  155. meerk40t/moshi/gui/moshidrivergui.py +2 -2
  156. meerk40t/newly/controller.py +2 -0
  157. meerk40t/newly/device.py +9 -2
  158. meerk40t/newly/driver.py +4 -0
  159. meerk40t/newly/gui/gui.py +16 -17
  160. meerk40t/newly/gui/newlyconfig.py +2 -2
  161. meerk40t/newly/gui/newlycontroller.py +13 -5
  162. meerk40t/rotary/gui/gui.py +2 -2
  163. meerk40t/rotary/gui/rotarysettings.py +2 -2
  164. meerk40t/ruida/device.py +3 -0
  165. meerk40t/ruida/driver.py +4 -0
  166. meerk40t/ruida/gui/gui.py +6 -6
  167. meerk40t/ruida/gui/ruidaconfig.py +2 -2
  168. meerk40t/ruida/gui/ruidacontroller.py +13 -5
  169. meerk40t/svgelements.py +9 -9
  170. meerk40t/tools/geomstr.py +849 -153
  171. meerk40t/tools/kerftest.py +8 -4
  172. meerk40t/tools/livinghinges.py +15 -8
  173. {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/METADATA +21 -16
  174. {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/RECORD +185 -177
  175. {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/entry_points.txt +0 -1
  176. test/test_core_elements.py +8 -24
  177. test/test_file_svg.py +88 -0
  178. test/test_fill.py +9 -9
  179. test/test_geomstr.py +258 -8
  180. test/test_kernel.py +4 -0
  181. test/test_tools_rasterplotter.py +29 -0
  182. meerk40t/extra/embroider.py +0 -56
  183. meerk40t/extra/pathoptimize.py +0 -249
  184. {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/LICENSE +0 -0
  185. {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/WHEEL +0 -0
  186. {meerk40t-0.9.2000.dist-info → meerk40t-0.9.3001.dist-info}/top_level.txt +0 -0
  187. {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
- icons8_diagonal_20,
7
- icons8_direction_20,
8
- icons8_file_20,
9
- icons8_group_objects_20,
10
- icons8_home_20,
11
- icons8_home_location_20,
12
- icons8_image_20,
13
- icons8_image_50,
14
- icons8_input_20,
15
- icons8_laser_beam_20,
16
- icons8_output_20,
17
- icons8_oval_50,
18
- icons8_polyline_50,
19
- icons8_rectangular_50,
20
- icons8_return_20,
21
- icons8_scatter_plot_20,
22
- icons8_small_beam_20,
23
- icons8_system_task_20,
24
- icons8_text_50,
25
- icons8_timer_20,
26
- icons8_vector_50,
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": icons8_timer_20,
47
- "util home": icons8_home_20,
48
- "util goto": icons8_return_20,
49
- "util output": icons8_output_20,
50
- "util input": icons8_input_20,
51
- "util console": icons8_system_task_20,
52
- "op engrave": icons8_small_beam_20,
53
- "op cut": icons8_laser_beam_20,
54
- "op image": icons8_image_20,
55
- "op raster": icons8_direction_20,
56
- "op dots": icons8_scatter_plot_20,
57
- "effect hatch": icons8_diagonal_20,
58
- "file": icons8_file_20,
59
- "group": icons8_group_objects_20,
60
- "elem point": icons8_scatter_plot_20,
61
- "elem ellipse": icons8_oval_50,
62
- "elem image": icons8_image_50,
63
- "elem path": icons8_vector_50,
64
- "elem polyline": icons8_polyline_50,
65
- "elem rect": icons8_rectangular_50,
66
- "elem line": icons8_polyline_50,
67
- "elem text": icons8_text_50,
68
- "place current": icons8_home_location_20,
69
- "place point": icons8_home_location_20,
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(resize=imgsize, noadjustment=True)
118
+ image = images[node].GetBitmap(
119
+ resize=imgsize, buffer=2, noadjustment=True
120
+ )
116
121
  else:
117
- image = wx.Bitmap(8, imgsize, imgsize)
118
- if node in elem_group_nodes:
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
- icons8_diagonal_20,
5
- icons8_direction_20,
6
- icons8_image_20,
7
- icons8_laser_beam_20,
8
- icons8_scatter_plot_20,
9
- icons8_small_beam_20,
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": icons8_laser_beam_20,
32
- "engrave": icons8_small_beam_20,
33
- "raster": icons8_direction_20,
34
- "image": icons8_image_20,
35
- "dots": icons8_scatter_plot_20,
36
- "hatch": icons8_diagonal_20,
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
- try:
156
- entity.transform_to_wcs(entity.ocs())
157
- except AttributeError:
158
- pass
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("<I", file.read(4))[0]
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("<I", b)
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("<I", data[index])
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("<I", file.read(4)) # 0
243
- v1 = struct.unpack("<I", file.read(4)) # 2001
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("<I", file.read(4))[0]
260
- self._locations["v1"] = struct.unpack("<I", file.read(4))[0]
261
- self._locations["pens"] = struct.unpack("<I", file.read(4))[0]
262
- self._locations["font"] = struct.unpack("<I", file.read(4))[0]
263
- self._locations["v4"] = struct.unpack("<I", file.read(4))[0]
264
- self._locations["vectors"] = struct.unpack("<I", file.read(4))[0]
265
- self._locations["prevectors"] = struct.unpack("<I", file.read(4))[0]
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("<I", file.read(4))[0]
328
- width = struct.unpack("<I", file.read(4))[0]
329
- height = struct.unpack("<I", file.read(4))[0]
330
- v3 = struct.unpack("<3I", file.read(12))
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("<I", file.read(4))[0]
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("<I", file.read(4))[0]
368
- seek = struct.unpack("<I", file.read(4))[0]
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("<I", file.read(4))
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("<I", file.read(4))
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("<I", file.read(4))
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("<I", file.read(4))
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("<I", image_length)
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("<I", file.read(4))
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("<I", file.read(4))[0] # 0
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)