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
meerk40t/extra/pathoptimize.py
DELETED
@@ -1,249 +0,0 @@
|
|
1
|
-
from ..core.cutplan import is_inside
|
2
|
-
from ..svgelements import Move, Path, Point
|
3
|
-
|
4
|
-
|
5
|
-
def plugin(kernel, lifecycle):
|
6
|
-
if lifecycle == "register":
|
7
|
-
_ = kernel.translation
|
8
|
-
context = kernel.root
|
9
|
-
|
10
|
-
@context.console_command("optimize", help=_("optimize <type>"))
|
11
|
-
def optimize(command, channel, _, args=tuple(), **kwargs):
|
12
|
-
elements = context.elements
|
13
|
-
if not elements.has_emphasis():
|
14
|
-
channel(_("No selected elements."))
|
15
|
-
return
|
16
|
-
elif len(args) == 0:
|
17
|
-
channel(_("Optimizations: cut_inner, travel, cut_travel"))
|
18
|
-
return
|
19
|
-
elif args[0] == "cut_inner":
|
20
|
-
for node in elements.elems(emphasized=True):
|
21
|
-
try:
|
22
|
-
path = node.path
|
23
|
-
except AttributeError:
|
24
|
-
continue
|
25
|
-
e = optimize_cut_inside(path)
|
26
|
-
path.clear()
|
27
|
-
path += e
|
28
|
-
node.altered()
|
29
|
-
elif args[0] == "travel":
|
30
|
-
channel(
|
31
|
-
_("Travel Optimizing: {length}").format(
|
32
|
-
length=length_travel(elements.elems(emphasized=True))
|
33
|
-
)
|
34
|
-
)
|
35
|
-
for node in elements.elems(emphasized=True):
|
36
|
-
try:
|
37
|
-
path = node.path
|
38
|
-
except AttributeError:
|
39
|
-
continue
|
40
|
-
e = optimize_travel(path)
|
41
|
-
path.clear()
|
42
|
-
path.path += e
|
43
|
-
node.altered()
|
44
|
-
channel(
|
45
|
-
_("Optimized: {length}").format(
|
46
|
-
length=length_travel(elements.elems(emphasized=True))
|
47
|
-
)
|
48
|
-
)
|
49
|
-
elif args[0] == "cut_travel":
|
50
|
-
channel(
|
51
|
-
_("Cut Travel Initial: {length}").format(
|
52
|
-
length=length_travel(elements.elems(emphasized=True))
|
53
|
-
)
|
54
|
-
)
|
55
|
-
for node in elements.elems(emphasized=True):
|
56
|
-
try:
|
57
|
-
path = node.path
|
58
|
-
except AttributeError:
|
59
|
-
continue
|
60
|
-
e = optimize_general(path)
|
61
|
-
path.clear()
|
62
|
-
path += e
|
63
|
-
node.altered()
|
64
|
-
channel(
|
65
|
-
_("Cut Travel Optimized: {length}").format(
|
66
|
-
length=length_travel(elements.elems(emphasized=True))
|
67
|
-
)
|
68
|
-
)
|
69
|
-
else:
|
70
|
-
channel(_("Optimization not found."))
|
71
|
-
return
|
72
|
-
|
73
|
-
|
74
|
-
def optimize_cut_inside(paths):
|
75
|
-
optimized = Path()
|
76
|
-
if isinstance(paths, Path):
|
77
|
-
paths = [paths]
|
78
|
-
subpaths = []
|
79
|
-
for path in paths:
|
80
|
-
subpaths.extend([abs(Path(s)) for s in path.as_subpaths()])
|
81
|
-
for j in range(len(subpaths)):
|
82
|
-
for k in range(j + 1, len(subpaths)):
|
83
|
-
if is_inside(subpaths[k], subpaths[j]):
|
84
|
-
t = subpaths[j]
|
85
|
-
subpaths[j] = subpaths[k]
|
86
|
-
subpaths[k] = t
|
87
|
-
for p in subpaths:
|
88
|
-
optimized += p
|
89
|
-
try:
|
90
|
-
del p.vm
|
91
|
-
except AttributeError:
|
92
|
-
pass
|
93
|
-
try:
|
94
|
-
del p.bounding_box
|
95
|
-
except AttributeError:
|
96
|
-
pass
|
97
|
-
return optimized
|
98
|
-
|
99
|
-
|
100
|
-
def length_travel(paths):
|
101
|
-
distance = 0.0
|
102
|
-
for p in paths:
|
103
|
-
if not isinstance(p, Path):
|
104
|
-
continue
|
105
|
-
for s in p:
|
106
|
-
if isinstance(s, Move):
|
107
|
-
if s.start is not None:
|
108
|
-
distance += Point.distance(s.start, s.end)
|
109
|
-
return distance
|
110
|
-
|
111
|
-
|
112
|
-
def optimize_travel(paths):
|
113
|
-
optimized = Path()
|
114
|
-
if isinstance(paths, Path):
|
115
|
-
paths = [paths]
|
116
|
-
subpaths = []
|
117
|
-
for path in paths:
|
118
|
-
if not isinstance(path, Path):
|
119
|
-
continue
|
120
|
-
subpaths.extend([abs(Path(s)) for s in path.as_subpaths()])
|
121
|
-
improved = True
|
122
|
-
while improved:
|
123
|
-
improved = False
|
124
|
-
for j in range(len(subpaths)):
|
125
|
-
for k in range(j + 1, len(subpaths)):
|
126
|
-
new_cut = delta_distance(subpaths, j, k)
|
127
|
-
if new_cut < 0:
|
128
|
-
cross(subpaths, j, k)
|
129
|
-
improved = True
|
130
|
-
for p in subpaths:
|
131
|
-
optimized += p
|
132
|
-
return optimized
|
133
|
-
|
134
|
-
|
135
|
-
def cross(subpaths, j, k):
|
136
|
-
"""
|
137
|
-
Reverses subpaths flipping the individual elements from position j inclusive to
|
138
|
-
k exclusive.
|
139
|
-
@param subpaths:
|
140
|
-
@param j:
|
141
|
-
@param k:
|
142
|
-
@return:
|
143
|
-
"""
|
144
|
-
for q in range(j, k):
|
145
|
-
subpaths[q].direct_close()
|
146
|
-
subpaths[q].reverse()
|
147
|
-
subpaths[j:k] = subpaths[j:k][::-1]
|
148
|
-
|
149
|
-
|
150
|
-
def delta_distance(subpaths, j, k):
|
151
|
-
distance = 0.0
|
152
|
-
k -= 1
|
153
|
-
a1 = subpaths[j][0].end
|
154
|
-
b0 = subpaths[k][-1].end
|
155
|
-
if k < len(subpaths) - 1:
|
156
|
-
b1 = subpaths[k + 1][0].end
|
157
|
-
d = Point.distance(b0, b1)
|
158
|
-
distance -= d
|
159
|
-
d = Point.distance(a1, b1)
|
160
|
-
distance += d
|
161
|
-
if j > 0:
|
162
|
-
a0 = subpaths[j - 1][-1].end
|
163
|
-
d = Point.distance(a0, a1)
|
164
|
-
distance -= d
|
165
|
-
d = Point.distance(a0, b0)
|
166
|
-
distance += d
|
167
|
-
return distance
|
168
|
-
|
169
|
-
|
170
|
-
def distance_path(subpaths):
|
171
|
-
distance = 0.0
|
172
|
-
for s in range(len(subpaths) - 1):
|
173
|
-
j = subpaths[s]
|
174
|
-
k = subpaths[s + 1]
|
175
|
-
d = Point.distance(j[-1].end, k[0].end)
|
176
|
-
distance += d
|
177
|
-
return distance
|
178
|
-
|
179
|
-
|
180
|
-
def is_order_constrained(paths, constraints, j, k):
|
181
|
-
"""Is the order of the sequences between j and k constrained. Such that reversing this order will violate
|
182
|
-
the constraints."""
|
183
|
-
for q in range(j, k):
|
184
|
-
# search between j and k.
|
185
|
-
first_path = paths[q]
|
186
|
-
for constraint in constraints:
|
187
|
-
if first_path is not constraint[0]:
|
188
|
-
# Constraint does not apply to the value at q.
|
189
|
-
continue
|
190
|
-
for m in range(q + 1, k):
|
191
|
-
second_path = paths[m]
|
192
|
-
if second_path is constraint[1]:
|
193
|
-
# Constraint demands the order must be first_path then second_path.
|
194
|
-
return True
|
195
|
-
return False
|
196
|
-
|
197
|
-
|
198
|
-
def optimize_general(paths):
|
199
|
-
optimized = Path()
|
200
|
-
if isinstance(paths, Path):
|
201
|
-
paths = [paths]
|
202
|
-
subpaths = []
|
203
|
-
for path in paths:
|
204
|
-
subpaths.extend([abs(Path(s)) for s in path.as_subpaths()])
|
205
|
-
constraints = []
|
206
|
-
for j in range(len(subpaths)):
|
207
|
-
for k in range(j + 1, len(subpaths)):
|
208
|
-
if is_inside(subpaths[k], subpaths[j]):
|
209
|
-
constraints.append((subpaths[k], subpaths[j]))
|
210
|
-
elif is_inside(subpaths[j], subpaths[k]):
|
211
|
-
constraints.append((subpaths[j], subpaths[k]))
|
212
|
-
for j in range(len(subpaths)):
|
213
|
-
for k in range(j + 1, len(subpaths)):
|
214
|
-
if is_inside(subpaths[k], subpaths[j]):
|
215
|
-
t = subpaths[j]
|
216
|
-
subpaths[j] = subpaths[k]
|
217
|
-
subpaths[k] = t
|
218
|
-
# for constraint in constraints:
|
219
|
-
# success = False
|
220
|
-
# for q in range(len(subpaths)):
|
221
|
-
# first_path = subpaths[q]
|
222
|
-
# if first_path is constraint[0]:
|
223
|
-
# for m in range(q, len(subpaths)):
|
224
|
-
# second_path = subpaths[m]
|
225
|
-
# if second_path is constraint[1]:
|
226
|
-
# success = True
|
227
|
-
improved = True
|
228
|
-
while improved:
|
229
|
-
improved = False
|
230
|
-
for j in range(len(subpaths)):
|
231
|
-
for k in range(j + 1, len(subpaths)):
|
232
|
-
new_cut = delta_distance(subpaths, j, k)
|
233
|
-
if new_cut < 0:
|
234
|
-
if is_order_constrained(subpaths, constraints, j, k):
|
235
|
-
# Our order is constrained. Performing 2-opt cross is disallowed.
|
236
|
-
continue
|
237
|
-
cross(subpaths, j, k)
|
238
|
-
improved = True
|
239
|
-
for p in subpaths:
|
240
|
-
optimized += p
|
241
|
-
try:
|
242
|
-
del p.vm
|
243
|
-
except AttributeError:
|
244
|
-
pass
|
245
|
-
try:
|
246
|
-
del p.bounding_box
|
247
|
-
except AttributeError:
|
248
|
-
pass
|
249
|
-
return optimized
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|