meerk40t 0.9.3001__py2.py3-none-any.whl → 0.9.7010__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/__init__.py +1 -1
- meerk40t/balormk/balor_params.py +167 -167
- meerk40t/balormk/clone_loader.py +457 -457
- meerk40t/balormk/controller.py +1566 -1512
- meerk40t/balormk/cylindermod.py +64 -0
- meerk40t/balormk/device.py +966 -1959
- meerk40t/balormk/driver.py +778 -591
- meerk40t/balormk/galvo_commands.py +1195 -0
- meerk40t/balormk/gui/balorconfig.py +237 -111
- meerk40t/balormk/gui/balorcontroller.py +191 -184
- meerk40t/balormk/gui/baloroperationproperties.py +116 -115
- meerk40t/balormk/gui/corscene.py +845 -0
- meerk40t/balormk/gui/gui.py +179 -147
- meerk40t/balormk/livelightjob.py +466 -382
- meerk40t/balormk/mock_connection.py +131 -109
- meerk40t/balormk/plugin.py +133 -135
- meerk40t/balormk/usb_connection.py +306 -301
- meerk40t/camera/__init__.py +1 -1
- meerk40t/camera/camera.py +514 -397
- meerk40t/camera/gui/camerapanel.py +1241 -1095
- meerk40t/camera/gui/gui.py +58 -58
- meerk40t/camera/plugin.py +441 -399
- meerk40t/ch341/__init__.py +27 -27
- meerk40t/ch341/ch341device.py +628 -628
- meerk40t/ch341/libusb.py +595 -589
- meerk40t/ch341/mock.py +171 -171
- meerk40t/ch341/windriver.py +157 -157
- meerk40t/constants.py +13 -0
- meerk40t/core/__init__.py +1 -1
- meerk40t/core/bindalias.py +550 -539
- meerk40t/core/core.py +47 -47
- meerk40t/core/cutcode/cubiccut.py +73 -73
- meerk40t/core/cutcode/cutcode.py +315 -312
- meerk40t/core/cutcode/cutgroup.py +141 -137
- meerk40t/core/cutcode/cutobject.py +192 -185
- meerk40t/core/cutcode/dwellcut.py +37 -37
- meerk40t/core/cutcode/gotocut.py +29 -29
- meerk40t/core/cutcode/homecut.py +29 -29
- meerk40t/core/cutcode/inputcut.py +34 -34
- meerk40t/core/cutcode/linecut.py +33 -33
- meerk40t/core/cutcode/outputcut.py +34 -34
- meerk40t/core/cutcode/plotcut.py +335 -335
- meerk40t/core/cutcode/quadcut.py +61 -61
- meerk40t/core/cutcode/rastercut.py +168 -148
- meerk40t/core/cutcode/waitcut.py +34 -34
- meerk40t/core/cutplan.py +1843 -1316
- meerk40t/core/drivers.py +330 -329
- meerk40t/core/elements/align.py +801 -669
- meerk40t/core/elements/branches.py +1844 -1507
- meerk40t/core/elements/clipboard.py +229 -219
- meerk40t/core/elements/element_treeops.py +4561 -2837
- meerk40t/core/elements/element_types.py +125 -105
- meerk40t/core/elements/elements.py +4329 -3617
- meerk40t/core/elements/files.py +117 -64
- meerk40t/core/elements/geometry.py +473 -224
- meerk40t/core/elements/grid.py +467 -316
- meerk40t/core/elements/materials.py +158 -94
- meerk40t/core/elements/notes.py +50 -38
- meerk40t/core/elements/offset_clpr.py +933 -912
- meerk40t/core/elements/offset_mk.py +963 -955
- meerk40t/core/elements/penbox.py +339 -267
- meerk40t/core/elements/placements.py +300 -83
- meerk40t/core/elements/render.py +785 -687
- meerk40t/core/elements/shapes.py +2618 -2092
- meerk40t/core/elements/trace.py +651 -563
- meerk40t/core/elements/tree_commands.py +415 -409
- meerk40t/core/elements/undo_redo.py +116 -58
- meerk40t/core/elements/wordlist.py +319 -200
- meerk40t/core/exceptions.py +9 -9
- meerk40t/core/laserjob.py +220 -220
- meerk40t/core/logging.py +63 -63
- meerk40t/core/node/blobnode.py +83 -86
- meerk40t/core/node/bootstrap.py +105 -103
- meerk40t/core/node/branch_elems.py +40 -31
- meerk40t/core/node/branch_ops.py +45 -38
- meerk40t/core/node/branch_regmark.py +48 -41
- meerk40t/core/node/cutnode.py +29 -32
- meerk40t/core/node/effect_hatch.py +375 -257
- meerk40t/core/node/effect_warp.py +398 -0
- meerk40t/core/node/effect_wobble.py +441 -309
- meerk40t/core/node/elem_ellipse.py +404 -309
- meerk40t/core/node/elem_image.py +1082 -801
- meerk40t/core/node/elem_line.py +358 -292
- meerk40t/core/node/elem_path.py +259 -201
- meerk40t/core/node/elem_point.py +129 -102
- meerk40t/core/node/elem_polyline.py +310 -246
- meerk40t/core/node/elem_rect.py +376 -286
- meerk40t/core/node/elem_text.py +445 -418
- meerk40t/core/node/filenode.py +59 -40
- meerk40t/core/node/groupnode.py +138 -74
- meerk40t/core/node/image_processed.py +777 -766
- meerk40t/core/node/image_raster.py +156 -113
- meerk40t/core/node/layernode.py +31 -31
- meerk40t/core/node/mixins.py +135 -107
- meerk40t/core/node/node.py +1427 -1304
- meerk40t/core/node/nutils.py +117 -114
- meerk40t/core/node/op_cut.py +462 -335
- meerk40t/core/node/op_dots.py +296 -251
- meerk40t/core/node/op_engrave.py +414 -311
- meerk40t/core/node/op_image.py +755 -369
- meerk40t/core/node/op_raster.py +787 -522
- meerk40t/core/node/place_current.py +37 -40
- meerk40t/core/node/place_point.py +329 -126
- meerk40t/core/node/refnode.py +58 -47
- meerk40t/core/node/rootnode.py +225 -219
- meerk40t/core/node/util_console.py +48 -48
- meerk40t/core/node/util_goto.py +84 -65
- meerk40t/core/node/util_home.py +61 -61
- meerk40t/core/node/util_input.py +102 -102
- meerk40t/core/node/util_output.py +102 -102
- meerk40t/core/node/util_wait.py +65 -65
- meerk40t/core/parameters.py +709 -707
- meerk40t/core/planner.py +875 -785
- meerk40t/core/plotplanner.py +656 -652
- meerk40t/core/space.py +120 -113
- meerk40t/core/spoolers.py +706 -705
- meerk40t/core/svg_io.py +1836 -1549
- meerk40t/core/treeop.py +534 -445
- meerk40t/core/undos.py +278 -124
- meerk40t/core/units.py +784 -680
- meerk40t/core/view.py +393 -322
- meerk40t/core/webhelp.py +62 -62
- meerk40t/core/wordlist.py +513 -504
- meerk40t/cylinder/cylinder.py +247 -0
- meerk40t/cylinder/gui/cylindersettings.py +41 -0
- meerk40t/cylinder/gui/gui.py +24 -0
- meerk40t/device/__init__.py +1 -1
- meerk40t/device/basedevice.py +322 -123
- meerk40t/device/devicechoices.py +50 -0
- meerk40t/device/dummydevice.py +163 -128
- meerk40t/device/gui/defaultactions.py +618 -602
- meerk40t/device/gui/effectspanel.py +114 -0
- meerk40t/device/gui/formatterpanel.py +253 -290
- meerk40t/device/gui/warningpanel.py +337 -260
- meerk40t/device/mixins.py +13 -13
- meerk40t/dxf/__init__.py +1 -1
- meerk40t/dxf/dxf_io.py +766 -554
- meerk40t/dxf/plugin.py +47 -35
- meerk40t/external_plugins.py +79 -79
- meerk40t/external_plugins_build.py +28 -28
- meerk40t/extra/cag.py +112 -116
- meerk40t/extra/coolant.py +403 -0
- meerk40t/extra/encode_detect.py +198 -0
- meerk40t/extra/ezd.py +1165 -1165
- meerk40t/extra/hershey.py +835 -340
- meerk40t/extra/imageactions.py +322 -316
- meerk40t/extra/inkscape.py +630 -622
- meerk40t/extra/lbrn.py +424 -424
- meerk40t/extra/outerworld.py +284 -0
- meerk40t/extra/param_functions.py +1542 -1556
- meerk40t/extra/potrace.py +257 -253
- meerk40t/extra/serial_exchange.py +118 -0
- meerk40t/extra/updater.py +602 -453
- meerk40t/extra/vectrace.py +147 -146
- meerk40t/extra/winsleep.py +83 -83
- meerk40t/extra/xcs_reader.py +597 -0
- meerk40t/fill/fills.py +781 -335
- meerk40t/fill/patternfill.py +1061 -1061
- meerk40t/fill/patterns.py +614 -567
- meerk40t/grbl/control.py +87 -87
- meerk40t/grbl/controller.py +990 -903
- meerk40t/grbl/device.py +1081 -768
- meerk40t/grbl/driver.py +989 -771
- meerk40t/grbl/emulator.py +532 -497
- meerk40t/grbl/gcodejob.py +783 -767
- meerk40t/grbl/gui/grblconfiguration.py +373 -298
- meerk40t/grbl/gui/grblcontroller.py +485 -271
- meerk40t/grbl/gui/grblhardwareconfig.py +269 -153
- meerk40t/grbl/gui/grbloperationconfig.py +105 -0
- meerk40t/grbl/gui/gui.py +147 -116
- meerk40t/grbl/interpreter.py +44 -44
- meerk40t/grbl/loader.py +22 -22
- meerk40t/grbl/mock_connection.py +56 -56
- meerk40t/grbl/plugin.py +294 -264
- meerk40t/grbl/serial_connection.py +93 -88
- meerk40t/grbl/tcp_connection.py +81 -79
- meerk40t/grbl/ws_connection.py +112 -0
- meerk40t/gui/__init__.py +1 -1
- meerk40t/gui/about.py +2042 -296
- meerk40t/gui/alignment.py +1644 -1608
- meerk40t/gui/autoexec.py +199 -0
- meerk40t/gui/basicops.py +791 -670
- meerk40t/gui/bufferview.py +77 -71
- meerk40t/gui/busy.py +170 -133
- meerk40t/gui/choicepropertypanel.py +1673 -1469
- meerk40t/gui/consolepanel.py +706 -542
- meerk40t/gui/devicepanel.py +687 -581
- meerk40t/gui/dialogoptions.py +110 -107
- meerk40t/gui/executejob.py +316 -306
- meerk40t/gui/fonts.py +90 -90
- meerk40t/gui/functionwrapper.py +252 -0
- meerk40t/gui/gui_mixins.py +729 -0
- meerk40t/gui/guicolors.py +205 -182
- meerk40t/gui/help_assets/help_assets.py +218 -201
- meerk40t/gui/helper.py +154 -0
- meerk40t/gui/hersheymanager.py +1430 -846
- meerk40t/gui/icons.py +3422 -2747
- meerk40t/gui/imagesplitter.py +555 -508
- meerk40t/gui/keymap.py +354 -344
- meerk40t/gui/laserpanel.py +892 -806
- meerk40t/gui/laserrender.py +1470 -1232
- meerk40t/gui/lasertoolpanel.py +805 -793
- meerk40t/gui/magnetoptions.py +436 -0
- meerk40t/gui/materialmanager.py +2917 -0
- meerk40t/gui/materialtest.py +1722 -1694
- meerk40t/gui/mkdebug.py +646 -359
- meerk40t/gui/mwindow.py +163 -140
- meerk40t/gui/navigationpanels.py +2605 -2467
- meerk40t/gui/notes.py +143 -142
- meerk40t/gui/opassignment.py +414 -410
- meerk40t/gui/operation_info.py +310 -299
- meerk40t/gui/plugin.py +494 -328
- meerk40t/gui/position.py +714 -669
- meerk40t/gui/preferences.py +901 -650
- meerk40t/gui/propertypanels/attributes.py +1461 -1131
- meerk40t/gui/propertypanels/blobproperty.py +117 -114
- meerk40t/gui/propertypanels/consoleproperty.py +83 -80
- meerk40t/gui/propertypanels/gotoproperty.py +77 -0
- meerk40t/gui/propertypanels/groupproperties.py +223 -217
- meerk40t/gui/propertypanels/hatchproperty.py +489 -469
- meerk40t/gui/propertypanels/imageproperty.py +2244 -1384
- meerk40t/gui/propertypanels/inputproperty.py +59 -58
- meerk40t/gui/propertypanels/opbranchproperties.py +82 -80
- meerk40t/gui/propertypanels/operationpropertymain.py +1890 -1638
- meerk40t/gui/propertypanels/outputproperty.py +59 -58
- meerk40t/gui/propertypanels/pathproperty.py +389 -380
- meerk40t/gui/propertypanels/placementproperty.py +1214 -383
- meerk40t/gui/propertypanels/pointproperty.py +140 -136
- meerk40t/gui/propertypanels/propertywindow.py +313 -181
- meerk40t/gui/propertypanels/rasterwizardpanels.py +996 -912
- meerk40t/gui/propertypanels/regbranchproperties.py +76 -0
- meerk40t/gui/propertypanels/textproperty.py +770 -755
- meerk40t/gui/propertypanels/waitproperty.py +56 -55
- meerk40t/gui/propertypanels/warpproperty.py +121 -0
- meerk40t/gui/propertypanels/wobbleproperty.py +255 -204
- meerk40t/gui/ribbon.py +2468 -2210
- meerk40t/gui/scene/scene.py +1100 -1051
- meerk40t/gui/scene/sceneconst.py +22 -22
- meerk40t/gui/scene/scenepanel.py +439 -349
- meerk40t/gui/scene/scenespacewidget.py +365 -365
- meerk40t/gui/scene/widget.py +518 -505
- meerk40t/gui/scenewidgets/affinemover.py +215 -215
- meerk40t/gui/scenewidgets/attractionwidget.py +315 -309
- meerk40t/gui/scenewidgets/bedwidget.py +120 -97
- meerk40t/gui/scenewidgets/elementswidget.py +137 -107
- meerk40t/gui/scenewidgets/gridwidget.py +785 -745
- meerk40t/gui/scenewidgets/guidewidget.py +765 -765
- meerk40t/gui/scenewidgets/laserpathwidget.py +66 -66
- meerk40t/gui/scenewidgets/machineoriginwidget.py +86 -86
- meerk40t/gui/scenewidgets/nodeselector.py +28 -28
- meerk40t/gui/scenewidgets/rectselectwidget.py +589 -346
- meerk40t/gui/scenewidgets/relocatewidget.py +33 -33
- meerk40t/gui/scenewidgets/reticlewidget.py +83 -83
- meerk40t/gui/scenewidgets/selectionwidget.py +2952 -2756
- meerk40t/gui/simpleui.py +357 -333
- meerk40t/gui/simulation.py +2431 -2094
- meerk40t/gui/snapoptions.py +208 -203
- meerk40t/gui/spoolerpanel.py +1227 -1180
- meerk40t/gui/statusbarwidgets/defaultoperations.py +480 -353
- meerk40t/gui/statusbarwidgets/infowidget.py +520 -483
- meerk40t/gui/statusbarwidgets/opassignwidget.py +356 -355
- meerk40t/gui/statusbarwidgets/selectionwidget.py +172 -171
- meerk40t/gui/statusbarwidgets/shapepropwidget.py +754 -236
- meerk40t/gui/statusbarwidgets/statusbar.py +272 -260
- meerk40t/gui/statusbarwidgets/statusbarwidget.py +268 -270
- meerk40t/gui/statusbarwidgets/strokewidget.py +267 -251
- meerk40t/gui/themes.py +200 -78
- meerk40t/gui/tips.py +591 -0
- meerk40t/gui/toolwidgets/circlebrush.py +35 -35
- meerk40t/gui/toolwidgets/toolcircle.py +248 -242
- meerk40t/gui/toolwidgets/toolcontainer.py +82 -77
- meerk40t/gui/toolwidgets/tooldraw.py +97 -90
- meerk40t/gui/toolwidgets/toolellipse.py +219 -212
- meerk40t/gui/toolwidgets/toolimagecut.py +25 -132
- meerk40t/gui/toolwidgets/toolline.py +39 -144
- meerk40t/gui/toolwidgets/toollinetext.py +79 -236
- meerk40t/gui/toolwidgets/toollinetext_inline.py +296 -0
- meerk40t/gui/toolwidgets/toolmeasure.py +160 -216
- meerk40t/gui/toolwidgets/toolnodeedit.py +2088 -2074
- meerk40t/gui/toolwidgets/toolnodemove.py +92 -94
- meerk40t/gui/toolwidgets/toolparameter.py +754 -668
- meerk40t/gui/toolwidgets/toolplacement.py +108 -108
- meerk40t/gui/toolwidgets/toolpoint.py +68 -59
- meerk40t/gui/toolwidgets/toolpointlistbuilder.py +294 -0
- meerk40t/gui/toolwidgets/toolpointmove.py +183 -0
- meerk40t/gui/toolwidgets/toolpolygon.py +288 -403
- meerk40t/gui/toolwidgets/toolpolyline.py +38 -196
- meerk40t/gui/toolwidgets/toolrect.py +211 -207
- meerk40t/gui/toolwidgets/toolrelocate.py +72 -72
- meerk40t/gui/toolwidgets/toolribbon.py +598 -113
- meerk40t/gui/toolwidgets/tooltabedit.py +546 -0
- meerk40t/gui/toolwidgets/tooltext.py +98 -89
- meerk40t/gui/toolwidgets/toolvector.py +213 -204
- meerk40t/gui/toolwidgets/toolwidget.py +39 -39
- meerk40t/gui/usbconnect.py +98 -91
- meerk40t/gui/utilitywidgets/buttonwidget.py +18 -18
- meerk40t/gui/utilitywidgets/checkboxwidget.py +90 -90
- meerk40t/gui/utilitywidgets/controlwidget.py +14 -14
- meerk40t/gui/utilitywidgets/cyclocycloidwidget.py +343 -340
- meerk40t/gui/utilitywidgets/debugwidgets.py +148 -0
- meerk40t/gui/utilitywidgets/handlewidget.py +27 -27
- meerk40t/gui/utilitywidgets/harmonograph.py +450 -447
- meerk40t/gui/utilitywidgets/openclosewidget.py +40 -40
- meerk40t/gui/utilitywidgets/rotationwidget.py +54 -54
- meerk40t/gui/utilitywidgets/scalewidget.py +75 -75
- meerk40t/gui/utilitywidgets/seekbarwidget.py +183 -183
- meerk40t/gui/utilitywidgets/togglewidget.py +142 -142
- meerk40t/gui/utilitywidgets/toolbarwidget.py +8 -8
- meerk40t/gui/wordlisteditor.py +985 -931
- meerk40t/gui/wxmeerk40t.py +1444 -1169
- meerk40t/gui/wxmmain.py +5578 -4112
- meerk40t/gui/wxmribbon.py +1591 -1076
- meerk40t/gui/wxmscene.py +1635 -1453
- meerk40t/gui/wxmtree.py +2410 -2089
- meerk40t/gui/wxutils.py +1769 -1099
- meerk40t/gui/zmatrix.py +102 -102
- meerk40t/image/__init__.py +1 -1
- meerk40t/image/dither.py +429 -0
- meerk40t/image/imagetools.py +2778 -2269
- meerk40t/internal_plugins.py +150 -130
- meerk40t/kernel/__init__.py +63 -12
- meerk40t/kernel/channel.py +259 -212
- meerk40t/kernel/context.py +538 -538
- meerk40t/kernel/exceptions.py +41 -41
- meerk40t/kernel/functions.py +463 -414
- meerk40t/kernel/jobs.py +100 -100
- meerk40t/kernel/kernel.py +3809 -3571
- meerk40t/kernel/lifecycles.py +71 -71
- meerk40t/kernel/module.py +49 -49
- meerk40t/kernel/service.py +147 -147
- meerk40t/kernel/settings.py +383 -343
- meerk40t/lihuiyu/controller.py +883 -876
- meerk40t/lihuiyu/device.py +1181 -1069
- meerk40t/lihuiyu/driver.py +1466 -1372
- meerk40t/lihuiyu/gui/gui.py +127 -106
- meerk40t/lihuiyu/gui/lhyaccelgui.py +377 -363
- meerk40t/lihuiyu/gui/lhycontrollergui.py +741 -651
- meerk40t/lihuiyu/gui/lhydrivergui.py +470 -446
- meerk40t/lihuiyu/gui/lhyoperationproperties.py +238 -237
- meerk40t/lihuiyu/gui/tcpcontroller.py +226 -190
- meerk40t/lihuiyu/interpreter.py +53 -53
- meerk40t/lihuiyu/laserspeed.py +450 -450
- meerk40t/lihuiyu/loader.py +90 -90
- meerk40t/lihuiyu/parser.py +404 -404
- meerk40t/lihuiyu/plugin.py +101 -102
- meerk40t/lihuiyu/tcp_connection.py +111 -109
- meerk40t/main.py +231 -165
- meerk40t/moshi/builder.py +788 -781
- meerk40t/moshi/controller.py +505 -499
- meerk40t/moshi/device.py +495 -442
- meerk40t/moshi/driver.py +862 -696
- meerk40t/moshi/gui/gui.py +78 -76
- meerk40t/moshi/gui/moshicontrollergui.py +538 -522
- meerk40t/moshi/gui/moshidrivergui.py +87 -75
- meerk40t/moshi/plugin.py +43 -43
- meerk40t/network/console_server.py +102 -57
- meerk40t/network/kernelserver.py +10 -9
- meerk40t/network/tcp_server.py +142 -140
- meerk40t/network/udp_server.py +103 -77
- meerk40t/network/web_server.py +390 -0
- meerk40t/newly/controller.py +1158 -1144
- meerk40t/newly/device.py +874 -732
- meerk40t/newly/driver.py +540 -412
- meerk40t/newly/gui/gui.py +219 -188
- meerk40t/newly/gui/newlyconfig.py +116 -101
- meerk40t/newly/gui/newlycontroller.py +193 -186
- meerk40t/newly/gui/operationproperties.py +51 -51
- meerk40t/newly/mock_connection.py +82 -82
- meerk40t/newly/newly_params.py +56 -56
- meerk40t/newly/plugin.py +1214 -1246
- meerk40t/newly/usb_connection.py +322 -322
- meerk40t/rotary/gui/gui.py +52 -46
- meerk40t/rotary/gui/rotarysettings.py +240 -232
- meerk40t/rotary/rotary.py +202 -98
- meerk40t/ruida/control.py +291 -91
- meerk40t/ruida/controller.py +138 -1088
- meerk40t/ruida/device.py +672 -231
- meerk40t/ruida/driver.py +534 -472
- meerk40t/ruida/emulator.py +1494 -1491
- meerk40t/ruida/exceptions.py +4 -4
- meerk40t/ruida/gui/gui.py +71 -76
- meerk40t/ruida/gui/ruidaconfig.py +239 -72
- meerk40t/ruida/gui/ruidacontroller.py +187 -184
- meerk40t/ruida/gui/ruidaoperationproperties.py +48 -47
- meerk40t/ruida/loader.py +54 -52
- meerk40t/ruida/mock_connection.py +57 -109
- meerk40t/ruida/plugin.py +124 -87
- meerk40t/ruida/rdjob.py +2084 -945
- meerk40t/ruida/serial_connection.py +116 -0
- meerk40t/ruida/tcp_connection.py +146 -0
- meerk40t/ruida/udp_connection.py +73 -0
- meerk40t/svgelements.py +9671 -9669
- meerk40t/tools/driver_to_path.py +584 -579
- meerk40t/tools/geomstr.py +5583 -4680
- meerk40t/tools/jhfparser.py +357 -292
- meerk40t/tools/kerftest.py +904 -890
- meerk40t/tools/livinghinges.py +1168 -1033
- meerk40t/tools/pathtools.py +987 -949
- meerk40t/tools/pmatrix.py +234 -0
- meerk40t/tools/pointfinder.py +942 -942
- meerk40t/tools/polybool.py +940 -940
- meerk40t/tools/rasterplotter.py +1660 -547
- meerk40t/tools/shxparser.py +989 -901
- meerk40t/tools/ttfparser.py +726 -446
- meerk40t/tools/zinglplotter.py +595 -593
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/LICENSE +21 -21
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/METADATA +150 -139
- meerk40t-0.9.7010.dist-info/RECORD +445 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/WHEEL +1 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/top_level.txt +0 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/zip-safe +1 -1
- meerk40t/balormk/elementlightjob.py +0 -159
- meerk40t-0.9.3001.dist-info/RECORD +0 -437
- test/bootstrap.py +0 -63
- test/test_cli.py +0 -12
- test/test_core_cutcode.py +0 -418
- test/test_core_elements.py +0 -144
- test/test_core_plotplanner.py +0 -397
- test/test_core_viewports.py +0 -312
- test/test_drivers_grbl.py +0 -108
- test/test_drivers_lihuiyu.py +0 -443
- test/test_drivers_newly.py +0 -113
- test/test_element_degenerate_points.py +0 -43
- test/test_elements_classify.py +0 -97
- test/test_elements_penbox.py +0 -22
- test/test_file_svg.py +0 -176
- test/test_fill.py +0 -155
- test/test_geomstr.py +0 -1523
- test/test_geomstr_nodes.py +0 -18
- test/test_imagetools_actualize.py +0 -306
- test/test_imagetools_wizard.py +0 -258
- test/test_kernel.py +0 -200
- test/test_laser_speeds.py +0 -3303
- test/test_length.py +0 -57
- test/test_lifecycle.py +0 -66
- test/test_operations.py +0 -251
- test/test_operations_hatch.py +0 -57
- test/test_ruida.py +0 -19
- test/test_spooler.py +0 -22
- test/test_tools_rasterplotter.py +0 -29
- test/test_wobble.py +0 -133
- test/test_zingl.py +0 -124
- {test → meerk40t/cylinder}/__init__.py +0 -0
- /meerk40t/{core/element_commands.py → cylinder/gui/__init__.py} +0 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7010.dist-info}/entry_points.txt +0 -0
meerk40t/core/plotplanner.py
CHANGED
@@ -1,652 +1,656 @@
|
|
1
|
-
import random
|
2
|
-
|
3
|
-
from meerk40t.tools.zinglplotter import ZinglPlotter
|
4
|
-
|
5
|
-
from ..device.basedevice import (
|
6
|
-
PLOT_AXIS,
|
7
|
-
PLOT_DIRECTION,
|
8
|
-
PLOT_FINISH,
|
9
|
-
PLOT_JOG,
|
10
|
-
PLOT_LEFT_UPPER,
|
11
|
-
PLOT_RAPID,
|
12
|
-
PLOT_RIGHT_LOWER,
|
13
|
-
PLOT_SETTING,
|
14
|
-
PLOT_START,
|
15
|
-
)
|
16
|
-
from .parameters import Parameters
|
17
|
-
|
18
|
-
"""
|
19
|
-
The PlotPlanner simplifies the plotting and pulsing modifications routines. These are buffered with plottable elements.
|
20
|
-
These can be submitted as destination graphics commands, or by submitting a plot routine. Which may yield either 2 or
|
21
|
-
3 value coordinates. These are x, y, and on. Where on is a number between 0 and 1 which designates the on-value. In the
|
22
|
-
graphics commands the move is given a 0 and all other plots are given a 1. All graphics commands take an optional
|
23
|
-
on-value. If PPI is enabled, fractional on values are made non-fractional by carrying forward the value of on as a
|
24
|
-
factor applied of the total value.
|
25
|
-
|
26
|
-
All plots are queued and processed in order. This queueing scheme is threadsafe, and should permit one thread reading
|
27
|
-
the plot values while another thread adds additional items to the queue. If the queue completely empties any processes
|
28
|
-
being applied to the plot stream are flushed prior to terminating the iterator.
|
29
|
-
|
30
|
-
Provided positions can be gapped or single, with adjacent or distant values. The on value is expected to denote whether
|
31
|
-
the transition from the current position to the new position should be drawn or not. Values that have an initial value
|
32
|
-
of zero will remain zero.
|
33
|
-
|
34
|
-
* Singles converts input into single positional shifts. This must be done to process the plot stream.
|
35
|
-
* PPI does pulses per inch carry forward with the given value.
|
36
|
-
* Dot Length requires any train of on-values must be of at least the proscribed length.
|
37
|
-
* Shift moves isolated single-on values to be adjacent to other on-values.
|
38
|
-
* Groups manipulates the output as max-length changeless orthogonal/diagonal positions.
|
39
|
-
"""
|
40
|
-
|
41
|
-
|
42
|
-
class PlotPlanner(Parameters):
|
43
|
-
def __init__(
|
44
|
-
self,
|
45
|
-
settings,
|
46
|
-
single=True,
|
47
|
-
ppi=True,
|
48
|
-
shift=True,
|
49
|
-
group=True,
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
self.
|
57
|
-
self.
|
58
|
-
self.
|
59
|
-
self.
|
60
|
-
|
61
|
-
self.
|
62
|
-
|
63
|
-
self.
|
64
|
-
|
65
|
-
self.
|
66
|
-
self.
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
if
|
71
|
-
self.
|
72
|
-
if
|
73
|
-
self.
|
74
|
-
if
|
75
|
-
self.
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
self.
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
* Send
|
107
|
-
* Send
|
108
|
-
* Send
|
109
|
-
* Send
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
jog
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
yield cut.
|
194
|
-
yield cut.
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
if self.
|
234
|
-
plot =
|
235
|
-
if self.
|
236
|
-
plot = self.
|
237
|
-
if self.
|
238
|
-
plot =
|
239
|
-
if self.
|
240
|
-
plot = self.
|
241
|
-
if self.
|
242
|
-
plot =
|
243
|
-
if self.
|
244
|
-
plot = self.
|
245
|
-
if self.
|
246
|
-
plot =
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
"""
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
if self.
|
269
|
-
self.
|
270
|
-
if self.
|
271
|
-
self.
|
272
|
-
if self.
|
273
|
-
self.
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
if self.
|
279
|
-
self.
|
280
|
-
if self.
|
281
|
-
self.
|
282
|
-
if self.
|
283
|
-
self.
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
self.
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
def
|
317
|
-
""
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
if
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
def
|
369
|
-
self.
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
self.
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
def
|
388
|
-
""
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
#
|
407
|
-
self.
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
self.
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
py
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
def
|
448
|
-
""
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
self.shift_pixels
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
def
|
497
|
-
self.
|
498
|
-
|
499
|
-
def
|
500
|
-
self.
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
self.
|
512
|
-
self.
|
513
|
-
|
514
|
-
|
515
|
-
self.
|
516
|
-
self.
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
def
|
522
|
-
return (
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
if
|
545
|
-
|
546
|
-
|
547
|
-
py
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
self.
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
self.
|
571
|
-
|
572
|
-
#
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
)
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
self.
|
600
|
-
self.
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
self.
|
609
|
-
self.
|
610
|
-
self.
|
611
|
-
|
612
|
-
|
613
|
-
self.
|
614
|
-
|
615
|
-
|
616
|
-
self.
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
1
|
+
import random
|
2
|
+
|
3
|
+
from meerk40t.tools.zinglplotter import ZinglPlotter
|
4
|
+
|
5
|
+
from ..device.basedevice import (
|
6
|
+
PLOT_AXIS,
|
7
|
+
PLOT_DIRECTION,
|
8
|
+
PLOT_FINISH,
|
9
|
+
PLOT_JOG,
|
10
|
+
PLOT_LEFT_UPPER,
|
11
|
+
PLOT_RAPID,
|
12
|
+
PLOT_RIGHT_LOWER,
|
13
|
+
PLOT_SETTING,
|
14
|
+
PLOT_START,
|
15
|
+
)
|
16
|
+
from .parameters import Parameters
|
17
|
+
|
18
|
+
"""
|
19
|
+
The PlotPlanner simplifies the plotting and pulsing modifications routines. These are buffered with plottable elements.
|
20
|
+
These can be submitted as destination graphics commands, or by submitting a plot routine. Which may yield either 2 or
|
21
|
+
3 value coordinates. These are x, y, and on. Where on is a number between 0 and 1 which designates the on-value. In the
|
22
|
+
graphics commands the move is given a 0 and all other plots are given a 1. All graphics commands take an optional
|
23
|
+
on-value. If PPI is enabled, fractional on values are made non-fractional by carrying forward the value of on as a
|
24
|
+
factor applied of the total value.
|
25
|
+
|
26
|
+
All plots are queued and processed in order. This queueing scheme is threadsafe, and should permit one thread reading
|
27
|
+
the plot values while another thread adds additional items to the queue. If the queue completely empties any processes
|
28
|
+
being applied to the plot stream are flushed prior to terminating the iterator.
|
29
|
+
|
30
|
+
Provided positions can be gapped or single, with adjacent or distant values. The on value is expected to denote whether
|
31
|
+
the transition from the current position to the new position should be drawn or not. Values that have an initial value
|
32
|
+
of zero will remain zero.
|
33
|
+
|
34
|
+
* Singles converts input into single positional shifts. This must be done to process the plot stream.
|
35
|
+
* PPI does pulses per inch carry forward with the given value.
|
36
|
+
* Dot Length requires any train of on-values must be of at least the proscribed length.
|
37
|
+
* Shift moves isolated single-on values to be adjacent to other on-values.
|
38
|
+
* Groups manipulates the output as max-length changeless orthogonal/diagonal positions.
|
39
|
+
"""
|
40
|
+
|
41
|
+
|
42
|
+
class PlotPlanner(Parameters):
|
43
|
+
def __init__(
|
44
|
+
self,
|
45
|
+
settings,
|
46
|
+
single=True,
|
47
|
+
ppi=True,
|
48
|
+
shift=True,
|
49
|
+
group=True,
|
50
|
+
require_uniform_movement = True,
|
51
|
+
**kwargs,
|
52
|
+
):
|
53
|
+
super().__init__(settings, **kwargs)
|
54
|
+
self.debug = False
|
55
|
+
|
56
|
+
self.abort = False
|
57
|
+
self.force_shift = False
|
58
|
+
self.group_enabled = True # Grouped Output Required for Lhymicro-gl.
|
59
|
+
self.phase_type = 0 # Sequential, random, progressive, static.
|
60
|
+
self.phase_value = 0
|
61
|
+
self.require_uniform_movement = require_uniform_movement
|
62
|
+
|
63
|
+
self.queue = []
|
64
|
+
|
65
|
+
self.single = None
|
66
|
+
self.ppi = None
|
67
|
+
self.shift = None
|
68
|
+
self.group = None
|
69
|
+
|
70
|
+
if single:
|
71
|
+
self.single = Single(self)
|
72
|
+
if ppi:
|
73
|
+
self.ppi = PPI(self)
|
74
|
+
if shift:
|
75
|
+
self.shift = Shift(self)
|
76
|
+
if group:
|
77
|
+
self.group = Group(self)
|
78
|
+
|
79
|
+
self.pos_x = None
|
80
|
+
self.pos_y = None
|
81
|
+
self.settings_then_jog = False
|
82
|
+
|
83
|
+
def push(self, plot):
|
84
|
+
self.abort = False
|
85
|
+
self.queue.append(plot)
|
86
|
+
|
87
|
+
def clear(self):
|
88
|
+
self.queue.clear()
|
89
|
+
self.abort = True
|
90
|
+
|
91
|
+
def gen(self):
|
92
|
+
"""
|
93
|
+
Main method of generating the plot stream.
|
94
|
+
|
95
|
+
The plotplanner emits a series of 3 item values. These are x, y and on. For most plotting
|
96
|
+
the values for on is 0 or 1 for off and on respectively. Values for on greater than 0 give
|
97
|
+
additional information. This includes an initial jog. Settings change. Major axis. Plot direction.
|
98
|
+
left_upper position and right_lower position.
|
99
|
+
|
100
|
+
* If new position is not coincident with previous position
|
101
|
+
* If new position is close
|
102
|
+
* Plot line if close within current settings
|
103
|
+
* Flush steps from planner if going to new location or using new settings.
|
104
|
+
* If new position is far
|
105
|
+
* Send jog if too far away.
|
106
|
+
* Send PLOT_SETTING: None, None - if settings have changed.
|
107
|
+
* Send PLOT_AXIS: major_axis, None - Major axis is horizontal vs. vertical raster
|
108
|
+
* Send PLOT_DIRECTION: x_dir(), y_dir() - Direction X, Direction Y for initial cut.
|
109
|
+
* Send PLOT_LEFT_UPPER: left point, upper point - Point at upper left
|
110
|
+
* Send PLOT_RIGHT_LOWER: right point, left point - Point at lower right
|
111
|
+
* Send all X, Y points for cut.
|
112
|
+
|
113
|
+
If the next position is too far away and jogging is allowed we jog to the position. This
|
114
|
+
jog is sent after the previous data is flushed out of the planner.
|
115
|
+
|
116
|
+
cut.settings can be the same object between different cut.
|
117
|
+
|
118
|
+
@return:
|
119
|
+
"""
|
120
|
+
self.pos_x = None
|
121
|
+
self.pos_y = None
|
122
|
+
while len(self.queue):
|
123
|
+
cut = self.queue.pop(0)
|
124
|
+
start = cut.start
|
125
|
+
new_start_x = start[0]
|
126
|
+
new_start_y = start[1]
|
127
|
+
assert isinstance(new_start_x, int)
|
128
|
+
assert isinstance(new_start_y, int)
|
129
|
+
flush = False
|
130
|
+
jog = 0
|
131
|
+
if self.pos_x != new_start_x or self.pos_y != new_start_y:
|
132
|
+
# This location is disjointed. We must flush and jog.
|
133
|
+
# Jog is executed in current settings.
|
134
|
+
if (
|
135
|
+
self.pos_x is None
|
136
|
+
or self.raster_step_x != 0
|
137
|
+
or self.raster_step_y != 0
|
138
|
+
):
|
139
|
+
# First movement or raster_step exists we must rapid_jog.
|
140
|
+
# Request rapid move new location
|
141
|
+
flush = True
|
142
|
+
jog |= PLOT_RAPID
|
143
|
+
else:
|
144
|
+
# Slow Jog to position.
|
145
|
+
distance = self.jog_distance
|
146
|
+
if (
|
147
|
+
abs(self.pos_x - new_start_x) < distance
|
148
|
+
and abs(self.pos_y - new_start_y) < distance
|
149
|
+
) or not self.jog_enable:
|
150
|
+
# Jog distance smaller than threshold. Or jog isn't allowed
|
151
|
+
def walk():
|
152
|
+
for event in ZinglPlotter.plot_line(
|
153
|
+
self.pos_x, self.pos_y, new_start_x, new_start_y
|
154
|
+
):
|
155
|
+
yield event[0], event[1], 0
|
156
|
+
|
157
|
+
yield from self.process_plots(walk())
|
158
|
+
else:
|
159
|
+
# Request standard jog new location required.
|
160
|
+
flush = True
|
161
|
+
jog |= PLOT_JOG
|
162
|
+
|
163
|
+
# Laser Setting has changed, we must flush the buffer.
|
164
|
+
if cut.settings is not self.settings:
|
165
|
+
flush = True
|
166
|
+
|
167
|
+
# Flush executed in current settings.
|
168
|
+
if flush: # Flush if needed.
|
169
|
+
yield from self.flush()
|
170
|
+
self.pos_x = self.single.single_x
|
171
|
+
self.pos_y = self.single.single_y
|
172
|
+
|
173
|
+
# Jog was needed.
|
174
|
+
if self.settings_then_jog:
|
175
|
+
if cut.settings is not self.settings:
|
176
|
+
self.settings = cut.settings
|
177
|
+
yield None, None, PLOT_SETTING
|
178
|
+
|
179
|
+
if jog:
|
180
|
+
yield new_start_x, new_start_y, jog
|
181
|
+
self.warp(new_start_x, new_start_y)
|
182
|
+
else:
|
183
|
+
if jog:
|
184
|
+
yield new_start_x, new_start_y, jog
|
185
|
+
self.warp(new_start_x, new_start_y)
|
186
|
+
|
187
|
+
if cut.settings is not self.settings:
|
188
|
+
self.settings = cut.settings
|
189
|
+
yield None, None, PLOT_SETTING
|
190
|
+
|
191
|
+
if jog or self.raster_step_x != 0 or self.raster_step_y != 0:
|
192
|
+
# set the directions. Post Jog, Post Settings.
|
193
|
+
yield cut.major_axis(), None, PLOT_AXIS
|
194
|
+
yield cut.x_dir(), cut.y_dir(), PLOT_DIRECTION
|
195
|
+
yield cut.left(), cut.upper(), PLOT_LEFT_UPPER
|
196
|
+
yield cut.right(), cut.lower(), PLOT_RIGHT_LOWER
|
197
|
+
|
198
|
+
# Plot the current.
|
199
|
+
# Current is executed in cut settings.
|
200
|
+
yield None, None, PLOT_START
|
201
|
+
yield from self.process_plots(cut.generator())
|
202
|
+
self.pos_x = self.single.single_x
|
203
|
+
self.pos_y = self.single.single_y
|
204
|
+
|
205
|
+
if not self.abort:
|
206
|
+
# If we were not aborted, flush and finish the last positions.
|
207
|
+
yield from self.flush()
|
208
|
+
self.pos_x = self.single.single_x
|
209
|
+
self.pos_y = self.single.single_y
|
210
|
+
|
211
|
+
self.reset()
|
212
|
+
self.abort = False
|
213
|
+
yield None, None, PLOT_FINISH
|
214
|
+
|
215
|
+
def process_plots(self, plot):
|
216
|
+
"""
|
217
|
+
Converts a series of inputs into a series of outputs. There is not a 1:1 input to output conversion.
|
218
|
+
Processes can buffer data and return None. Processes are required to surrender any buffer they have if the
|
219
|
+
given sequence ends with, or is None. This flushes out any data.
|
220
|
+
|
221
|
+
If an input sequence still lacks an on-value then the single_default value will be utilized.
|
222
|
+
Output sequences are iterables of x, y, on positions.
|
223
|
+
|
224
|
+
@param plot: plottable element that should be wrapped
|
225
|
+
@return: generator to produce plottable elements.
|
226
|
+
"""
|
227
|
+
|
228
|
+
def debug(plot, manipulator):
|
229
|
+
for q in plot:
|
230
|
+
print(f"Manipulator: {str(q)}, {str(manipulator)}")
|
231
|
+
yield q
|
232
|
+
|
233
|
+
if self.single is not None:
|
234
|
+
plot = self.single.process(plot)
|
235
|
+
if self.debug:
|
236
|
+
plot = debug(plot, self.single)
|
237
|
+
if self.ppi is not None:
|
238
|
+
plot = self.ppi.process(plot)
|
239
|
+
if self.debug:
|
240
|
+
plot = debug(plot, self.ppi)
|
241
|
+
if self.shift is not None:
|
242
|
+
plot = self.shift.process(plot)
|
243
|
+
if self.debug:
|
244
|
+
plot = debug(plot, self.shift)
|
245
|
+
if self.group is not None:
|
246
|
+
plot = self.group.process(plot)
|
247
|
+
if self.debug:
|
248
|
+
plot = debug(plot, self.group)
|
249
|
+
return plot
|
250
|
+
|
251
|
+
def step_move(self, x0, y0, x1, y1):
|
252
|
+
"""
|
253
|
+
Step move walks a line from a point to another point.
|
254
|
+
"""
|
255
|
+
for event in ZinglPlotter.plot_line(x0, y0, x1, y1):
|
256
|
+
yield event[0], event[1], 0
|
257
|
+
self.pos_x = x1
|
258
|
+
self.pos_y = y1
|
259
|
+
|
260
|
+
def flush(self):
|
261
|
+
if self.debug:
|
262
|
+
print("Flushing PlotPlanner")
|
263
|
+
yield from self.process_plots(None)
|
264
|
+
|
265
|
+
def warp(self, x, y):
|
266
|
+
self.pos_x = x
|
267
|
+
self.pos_y = y
|
268
|
+
if self.single:
|
269
|
+
self.single.warp(x, y)
|
270
|
+
if self.ppi:
|
271
|
+
self.ppi.warp(x, y)
|
272
|
+
if self.shift:
|
273
|
+
self.shift.warp(x, y)
|
274
|
+
if self.group:
|
275
|
+
self.group.warp(x, y)
|
276
|
+
|
277
|
+
def reset(self):
|
278
|
+
if self.single:
|
279
|
+
self.single.clear()
|
280
|
+
if self.shift:
|
281
|
+
self.shift.clear()
|
282
|
+
if self.ppi:
|
283
|
+
self.ppi.clear()
|
284
|
+
if self.group:
|
285
|
+
self.group.clear()
|
286
|
+
|
287
|
+
|
288
|
+
class PlotManipulation:
|
289
|
+
def __init__(self, planner: PlotPlanner):
|
290
|
+
self.planner = planner
|
291
|
+
|
292
|
+
def process(self, plot):
|
293
|
+
pass
|
294
|
+
|
295
|
+
def flush(self):
|
296
|
+
pass
|
297
|
+
|
298
|
+
def warp(self, x, y):
|
299
|
+
pass
|
300
|
+
|
301
|
+
def clear(self):
|
302
|
+
pass
|
303
|
+
|
304
|
+
def flushed(self):
|
305
|
+
return True
|
306
|
+
|
307
|
+
|
308
|
+
class Single(PlotManipulation):
|
309
|
+
def __init__(self, planner: PlotPlanner):
|
310
|
+
super().__init__(planner)
|
311
|
+
self.planner = planner
|
312
|
+
self.single_default = 1
|
313
|
+
self.single_x = None
|
314
|
+
self.single_y = None
|
315
|
+
|
316
|
+
def __str__(self):
|
317
|
+
return f"{self.__class__.__name__}({str(self.single_x)},{str(self.single_y)})"
|
318
|
+
|
319
|
+
def process(self, plot):
|
320
|
+
"""
|
321
|
+
Convert a sequence set of positions into single unit plotted sequences.
|
322
|
+
|
323
|
+
This accepts 3 (X,Y,On) or 2 (X,Y) item events
|
324
|
+
|
325
|
+
single_default sets the default for any unmarked processes.
|
326
|
+
single_x sets the last known x position this routine has encountered.
|
327
|
+
single_y sets the last known y position this routine has encountered.
|
328
|
+
|
329
|
+
@param plot: plot generator
|
330
|
+
@return:
|
331
|
+
"""
|
332
|
+
if plot is None:
|
333
|
+
# None calls for a flush routine.
|
334
|
+
yield from self.flush()
|
335
|
+
return
|
336
|
+
for event in plot:
|
337
|
+
x = event[0]
|
338
|
+
y = event[1]
|
339
|
+
if self.single_x is None or self.single_y is None:
|
340
|
+
# Our single_x or single_y position is not established.
|
341
|
+
self.single_x = x
|
342
|
+
self.single_y = y
|
343
|
+
on = event[2] if len(event) >= 3 else self.single_default
|
344
|
+
|
345
|
+
total_dx = x - self.single_x
|
346
|
+
total_dy = y - self.single_y
|
347
|
+
if total_dx == 0 and total_dy == 0:
|
348
|
+
continue
|
349
|
+
dx = 1 if total_dx > 0 else 0 if total_dx == 0 else -1
|
350
|
+
dy = 1 if total_dy > 0 else 0 if total_dy == 0 else -1
|
351
|
+
|
352
|
+
if total_dy * dx != total_dx * dy and self.planner.require_uniform_movement:
|
353
|
+
# Check for cross-equality.
|
354
|
+
raise ValueError(
|
355
|
+
f"Must be uniformly diagonal or orthogonal: ({total_dx}, {total_dy}) is not."
|
356
|
+
)
|
357
|
+
cx = self.single_x
|
358
|
+
cy = self.single_y
|
359
|
+
for i in range(1, max(abs(total_dx), abs(total_dy)) + 1):
|
360
|
+
if self.planner.abort:
|
361
|
+
self.single_x = None
|
362
|
+
self.single_y = None
|
363
|
+
return
|
364
|
+
self.single_x = cx + (i * dx)
|
365
|
+
self.single_y = cy + (i * dy)
|
366
|
+
yield self.single_x, self.single_y, on
|
367
|
+
|
368
|
+
def flush(self):
|
369
|
+
yield None, None, self.single_default
|
370
|
+
|
371
|
+
def warp(self, x, y):
|
372
|
+
self.single_x = x
|
373
|
+
self.single_y = y
|
374
|
+
|
375
|
+
def clear(self):
|
376
|
+
self.single_x = None
|
377
|
+
self.single_y = None
|
378
|
+
|
379
|
+
|
380
|
+
class PPI(PlotManipulation):
|
381
|
+
def __init__(self, planner: PlotPlanner):
|
382
|
+
super().__init__(planner)
|
383
|
+
self.ppi_total = 0
|
384
|
+
self.dot_left = 0
|
385
|
+
self._phase_set = 0
|
386
|
+
|
387
|
+
def __str__(self):
|
388
|
+
return f"{self.__class__.__name__}({str(self.ppi_total)},{str(self.dot_left)})"
|
389
|
+
|
390
|
+
def process(self, plot):
|
391
|
+
"""
|
392
|
+
Converts single stepped plots, to apply PPI.
|
393
|
+
|
394
|
+
Implements PPI power modulation.
|
395
|
+
|
396
|
+
@param plot: generator of single stepped plots, with PPI.
|
397
|
+
@return:
|
398
|
+
"""
|
399
|
+
px = None
|
400
|
+
py = None
|
401
|
+
for x, y, on in plot:
|
402
|
+
if x is None or y is None:
|
403
|
+
yield x, y, on
|
404
|
+
# Sequential, random, progressive, static.
|
405
|
+
if self.planner.phase_type == 1:
|
406
|
+
# Random.
|
407
|
+
self.ppi_total = random.randint(0, 1000)
|
408
|
+
elif self.planner.phase_type == 2:
|
409
|
+
# progressive
|
410
|
+
self._phase_set += self.planner.phase_value
|
411
|
+
self._phase_set %= 1000
|
412
|
+
self.ppi_total = self._phase_set
|
413
|
+
elif self.planner.phase_type == 3:
|
414
|
+
# static
|
415
|
+
self._phase_set = self.planner.phase_value
|
416
|
+
self.ppi_total = self._phase_set
|
417
|
+
continue
|
418
|
+
if px is not None and py is not None:
|
419
|
+
assert abs(px - x) <= 1 or abs(py - y) <= 1
|
420
|
+
px = x
|
421
|
+
py = y
|
422
|
+
# PPI is always on.
|
423
|
+
self.ppi_total += self.planner.power * on
|
424
|
+
if on and self.dot_left > 0:
|
425
|
+
# Process remaining dot_length, must be on or partially on.
|
426
|
+
self.dot_left -= 1
|
427
|
+
on = 1
|
428
|
+
else:
|
429
|
+
# No dot length.
|
430
|
+
if self.ppi_total >= 1000.0:
|
431
|
+
# PPI >= 1000: triggers on.
|
432
|
+
on = 1
|
433
|
+
self.ppi_total -= 1000.0 * self.planner.implicit_dotlength
|
434
|
+
self.dot_left = self.planner.implicit_dotlength - 1
|
435
|
+
else:
|
436
|
+
# PPI < 1000: triggers off.
|
437
|
+
on = 0
|
438
|
+
yield x, y, on
|
439
|
+
|
440
|
+
|
441
|
+
class Shift(PlotManipulation):
|
442
|
+
def __init__(self, planner: PlotPlanner):
|
443
|
+
super().__init__(planner)
|
444
|
+
self.shift_buffer = []
|
445
|
+
self.shift_pixels = 0
|
446
|
+
|
447
|
+
def __str__(self):
|
448
|
+
return f"{self.__class__.__name__}({str(self.shift_buffer)},{bin(self.shift_pixels)})"
|
449
|
+
|
450
|
+
def process(self, plot):
|
451
|
+
"""
|
452
|
+
Tweaks on-values to simplify them into more coherent subsections.
|
453
|
+
|
454
|
+
This code requires a buffer of 4 path plots.
|
455
|
+
|
456
|
+
@param plot: generator of single stepped plots
|
457
|
+
@return:
|
458
|
+
"""
|
459
|
+
for x, y, on in plot:
|
460
|
+
if (x is None or y is None) or (
|
461
|
+
not self.planner.force_shift and not self.planner.shift_enabled
|
462
|
+
):
|
463
|
+
# If we have an established buffer, flush the buffer.
|
464
|
+
yield from self.flush()
|
465
|
+
# Yield the current event.
|
466
|
+
yield x, y, on
|
467
|
+
continue
|
468
|
+
|
469
|
+
# Shift() is on.
|
470
|
+
self.shift_pixels <<= 1
|
471
|
+
if on:
|
472
|
+
self.shift_pixels |= 1
|
473
|
+
self.shift_pixels &= 0b1111
|
474
|
+
|
475
|
+
self.shift_buffer.insert(0, (x, y))
|
476
|
+
if self.shift_pixels == 0b0101:
|
477
|
+
self.shift_pixels = 0b0011
|
478
|
+
elif self.shift_pixels == 0b1010:
|
479
|
+
self.shift_pixels = 0b1100
|
480
|
+
|
481
|
+
if len(self.shift_buffer) >= 4:
|
482
|
+
# When buffer is full start popping off values.
|
483
|
+
bx, by = self.shift_buffer.pop()
|
484
|
+
bon = (self.shift_pixels >> 3) & 1
|
485
|
+
yield bx, by, bon
|
486
|
+
# There are no more plots.
|
487
|
+
|
488
|
+
def flush(self):
|
489
|
+
while len(self.shift_buffer) > 0:
|
490
|
+
self.shift_pixels <<= 1
|
491
|
+
bx, by = self.shift_buffer.pop()
|
492
|
+
bon = (self.shift_pixels >> 3) & 1
|
493
|
+
yield bx, by, bon
|
494
|
+
self.clear()
|
495
|
+
|
496
|
+
def flushed(self):
|
497
|
+
return not len(self.shift_buffer)
|
498
|
+
|
499
|
+
def warp(self, x, y):
|
500
|
+
self.clear()
|
501
|
+
|
502
|
+
def clear(self):
|
503
|
+
self.shift_pixels = 0
|
504
|
+
self.shift_buffer.clear()
|
505
|
+
|
506
|
+
|
507
|
+
class Group(PlotManipulation):
|
508
|
+
def __init__(self, planner: PlotPlanner):
|
509
|
+
super().__init__(planner)
|
510
|
+
self.last_x = None
|
511
|
+
self.last_y = None
|
512
|
+
self.last_on = None
|
513
|
+
|
514
|
+
self.group_x = None
|
515
|
+
self.group_y = None
|
516
|
+
self.group_on = None
|
517
|
+
|
518
|
+
self.group_dx = 0
|
519
|
+
self.group_dy = 0
|
520
|
+
|
521
|
+
def __str__(self):
|
522
|
+
return f"{self.__class__.__name__}({str(self.group_x)},{str(self.group_y)},{str(self.group_dx)},{str(self.group_dy)})"
|
523
|
+
|
524
|
+
def flushed(self):
|
525
|
+
return (
|
526
|
+
self.last_x == self.group_x
|
527
|
+
and self.last_y == self.group_y
|
528
|
+
and self.last_on == self.group_on
|
529
|
+
)
|
530
|
+
|
531
|
+
def process(self, plot):
|
532
|
+
"""
|
533
|
+
Converts a generated series of single stepped plots into grouped orthogonal/diagonal plots.
|
534
|
+
|
535
|
+
group_x, group_y: is the last known inputted. This is not necessarily the current position given by the planner.
|
536
|
+
If group_dx and group_dy are not zero, then we have buffered a move.
|
537
|
+
|
538
|
+
@param plot: single stepped plots to be grouped into orth/diag sequences.
|
539
|
+
@return:
|
540
|
+
"""
|
541
|
+
px = None
|
542
|
+
py = None
|
543
|
+
for x, y, on in plot:
|
544
|
+
if x is None or y is None:
|
545
|
+
yield from self.flush()
|
546
|
+
continue
|
547
|
+
if px is not None and py is not None:
|
548
|
+
assert abs(px - x) <= 1 or abs(py - y) <= 1
|
549
|
+
px = x
|
550
|
+
py = y
|
551
|
+
if not self.planner.group_enabled:
|
552
|
+
yield from self.flush()
|
553
|
+
# Yield the current event.
|
554
|
+
self.last_x = x
|
555
|
+
self.last_y = y
|
556
|
+
self.last_on = on
|
557
|
+
yield x, y, on
|
558
|
+
continue
|
559
|
+
# Group() is enabled
|
560
|
+
if self.group_x is None:
|
561
|
+
self.group_x = x
|
562
|
+
if self.group_y is None:
|
563
|
+
self.group_y = y
|
564
|
+
if self.group_on is None:
|
565
|
+
self.group_on = on
|
566
|
+
if self.group_dx != 0 or self.group_dy != 0:
|
567
|
+
if (
|
568
|
+
x == self.group_x + self.group_dx
|
569
|
+
and y == self.group_y + self.group_dy
|
570
|
+
and on == self.group_on
|
571
|
+
):
|
572
|
+
# This is an orthogonal/diagonal step along the same path.
|
573
|
+
self.group_x = x
|
574
|
+
self.group_y = y
|
575
|
+
# Mark the latest position and continue.
|
576
|
+
continue
|
577
|
+
# This is non orth-diag point. Must drop a point.
|
578
|
+
self.last_x = self.group_x
|
579
|
+
self.last_y = self.group_y
|
580
|
+
self.last_on = self.group_on
|
581
|
+
yield self.group_x, self.group_y, self.group_on
|
582
|
+
# If we do not have a defined direction, set our current direction.
|
583
|
+
self.group_dx = x - self.group_x
|
584
|
+
self.group_dy = y - self.group_y
|
585
|
+
if abs(self.group_dx) > 1 or abs(self.group_dy) > 1:
|
586
|
+
# The last step was not valid. Group() requires single step values.
|
587
|
+
raise ValueError(
|
588
|
+
f"dx({self.group_dx}) or dy({self.group_dy}) exceeds 1"
|
589
|
+
)
|
590
|
+
# Save our buffered position.
|
591
|
+
self.group_x = x
|
592
|
+
self.group_y = y
|
593
|
+
self.group_on = on
|
594
|
+
# There are no more plots.
|
595
|
+
|
596
|
+
def flush(self):
|
597
|
+
if not self.flushed():
|
598
|
+
# If we have an established buffer, flush the buffer.
|
599
|
+
self.group_dx = 0
|
600
|
+
self.group_dy = 0
|
601
|
+
self.last_x = self.group_x
|
602
|
+
self.last_y = self.group_y
|
603
|
+
self.last_on = self.group_on
|
604
|
+
if self.group_x is not None and self.group_y is not None:
|
605
|
+
yield self.group_x, self.group_y, self.group_on
|
606
|
+
|
607
|
+
def warp(self, x, y):
|
608
|
+
self.group_x = x
|
609
|
+
self.group_y = y
|
610
|
+
self.group_dx = 0
|
611
|
+
self.group_dy = 0
|
612
|
+
self.last_x = x
|
613
|
+
self.last_y = y
|
614
|
+
|
615
|
+
def clear(self):
|
616
|
+
self.group_x = None
|
617
|
+
self.group_y = None
|
618
|
+
self.group_dx = 0
|
619
|
+
self.group_dy = 0
|
620
|
+
|
621
|
+
|
622
|
+
def grouped(plot):
|
623
|
+
"""
|
624
|
+
Converts a generated series of single stepped plots into grouped orthogonal/diagonal plots.
|
625
|
+
|
626
|
+
@param plot: single stepped plots to be grouped into orth/diag sequences.
|
627
|
+
@return:
|
628
|
+
"""
|
629
|
+
group_x = None
|
630
|
+
group_y = None
|
631
|
+
group_dx = 0
|
632
|
+
group_dy = 0
|
633
|
+
|
634
|
+
for x, y in plot:
|
635
|
+
if group_x is None:
|
636
|
+
group_x = x
|
637
|
+
if group_y is None:
|
638
|
+
group_y = y
|
639
|
+
if x == group_x + group_dx and y == group_y + group_dy:
|
640
|
+
# This is an orthogonal/diagonal step along the same path.
|
641
|
+
group_x = x
|
642
|
+
group_y = y
|
643
|
+
continue
|
644
|
+
# This is non orth-diag point. Must drop a point.
|
645
|
+
yield group_x, group_y
|
646
|
+
# If we do not have a defined direction, set our current direction.
|
647
|
+
group_dx = x - group_x
|
648
|
+
group_dy = y - group_y
|
649
|
+
if abs(group_dx) > 1 or abs(group_dy) > 1:
|
650
|
+
# The last step was not valid.
|
651
|
+
raise ValueError(f"dx({group_dx}) or dy({group_dy}) exceeds 1")
|
652
|
+
group_x = x
|
653
|
+
group_y = y
|
654
|
+
# There are no more plots.
|
655
|
+
yield group_x, group_y
|
656
|
+
|