meerk40t 0.9.3001__py2.py3-none-any.whl → 0.9.7020__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 +1194 -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 +1858 -1507
- meerk40t/core/elements/clipboard.py +229 -219
- meerk40t/core/elements/element_treeops.py +4595 -2837
- meerk40t/core/elements/element_types.py +125 -105
- meerk40t/core/elements/elements.py +4315 -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 +934 -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/testcases.py +105 -0
- 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 +463 -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 +204 -0
- meerk40t/extra/ezd.py +1165 -1165
- meerk40t/extra/hershey.py +834 -340
- meerk40t/extra/imageactions.py +322 -316
- meerk40t/extra/inkscape.py +628 -622
- meerk40t/extra/lbrn.py +424 -424
- meerk40t/extra/outerworld.py +283 -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 +1084 -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 +232 -133
- meerk40t/gui/choicepropertypanel.py +1662 -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 +1440 -846
- meerk40t/gui/icons.py +3422 -2747
- meerk40t/gui/imagesplitter.py +555 -508
- meerk40t/gui/keymap.py +354 -344
- meerk40t/gui/laserpanel.py +897 -806
- meerk40t/gui/laserrender.py +1470 -1232
- meerk40t/gui/lasertoolpanel.py +805 -793
- meerk40t/gui/magnetoptions.py +436 -0
- meerk40t/gui/materialmanager.py +2944 -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 +500 -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 +2471 -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 +592 -346
- meerk40t/gui/scenewidgets/relocatewidget.py +33 -33
- meerk40t/gui/scenewidgets/reticlewidget.py +83 -83
- meerk40t/gui/scenewidgets/selectionwidget.py +2958 -2756
- meerk40t/gui/simpleui.py +362 -333
- meerk40t/gui/simulation.py +2451 -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 +590 -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 +163 -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 +1447 -1169
- meerk40t/gui/wxmmain.py +5644 -4112
- meerk40t/gui/wxmribbon.py +1591 -1076
- meerk40t/gui/wxmscene.py +1631 -1453
- meerk40t/gui/wxmtree.py +2416 -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 +2793 -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 +3828 -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 +140 -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 +404 -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 +676 -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 +941 -940
- meerk40t/tools/rasterplotter.py +1660 -547
- meerk40t/tools/shxparser.py +1047 -901
- meerk40t/tools/ttfparser.py +726 -446
- meerk40t/tools/zinglplotter.py +595 -593
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/LICENSE +21 -21
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/METADATA +150 -139
- meerk40t-0.9.7020.dist-info/RECORD +446 -0
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/WHEEL +1 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.dist-info}/top_level.txt +0 -1
- {meerk40t-0.9.3001.dist-info → meerk40t-0.9.7020.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.7020.dist-info}/entry_points.txt +0 -0
meerk40t/fill/fills.py
CHANGED
@@ -1,335 +1,781 @@
|
|
1
|
-
import math
|
2
|
-
|
3
|
-
from meerk40t.core.units import Angle, Length
|
4
|
-
from meerk40t.svgelements import Matrix, Point
|
5
|
-
from meerk40t.tools.pathtools import EulerianFill, VectorMontonizer
|
6
|
-
|
7
|
-
|
8
|
-
class Wobble:
|
9
|
-
def __init__(self, algorithm, radius=50, speed=50, interval=10):
|
10
|
-
self._total_count = 0
|
11
|
-
self._total_distance = 0
|
12
|
-
self.
|
13
|
-
self.
|
14
|
-
self.
|
15
|
-
self.
|
16
|
-
self.
|
17
|
-
self.
|
18
|
-
self.
|
19
|
-
self.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
self.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
def
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
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
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
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
|
-
|
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
|
-
|
194
|
-
|
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
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
yield
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
yield
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
1
|
+
import math
|
2
|
+
|
3
|
+
from meerk40t.core.units import Angle, Length, UNITS_PER_MM
|
4
|
+
from meerk40t.svgelements import Matrix, Point
|
5
|
+
from meerk40t.tools.pathtools import EulerianFill, VectorMontonizer
|
6
|
+
|
7
|
+
|
8
|
+
class Wobble:
|
9
|
+
def __init__(self, algorithm, radius=50, speed=50, interval=10):
|
10
|
+
self._total_count = 0
|
11
|
+
self._total_distance = 0
|
12
|
+
self.unit_factor = 1
|
13
|
+
self._remainder = 0
|
14
|
+
self.previous_angle = None
|
15
|
+
self.radius = radius
|
16
|
+
self.speed = speed
|
17
|
+
self.interval = interval
|
18
|
+
self.total_length = 0
|
19
|
+
self._last_x = None
|
20
|
+
self._last_y = None
|
21
|
+
self._algorithm = algorithm
|
22
|
+
self.flag = None
|
23
|
+
self.userdata = None
|
24
|
+
self.may_close_path = True
|
25
|
+
|
26
|
+
def __repr__(self):
|
27
|
+
return f"Wobble: r={self.radius}, s={self.speed}, i={self.interval}, alg={repr(self._algorithm)}"
|
28
|
+
|
29
|
+
def __call__(self, x0, y0, x1, y1):
|
30
|
+
yield from self._algorithm(self, x0, y0, x1, y1)
|
31
|
+
|
32
|
+
def wobble(self, x0, y0, x1, y1):
|
33
|
+
distance_change = abs(complex(x0, y0) - complex(x1, y1))
|
34
|
+
positions = 1 - self._remainder
|
35
|
+
# Circumvent a div by zero error
|
36
|
+
try:
|
37
|
+
intervals = distance_change / self.interval
|
38
|
+
except ZeroDivisionError:
|
39
|
+
intervals = 1
|
40
|
+
while positions <= intervals:
|
41
|
+
amount = positions / intervals
|
42
|
+
tx = amount * (x1 - x0) + x0
|
43
|
+
ty = amount * (y1 - y0) + y0
|
44
|
+
self._total_distance += self.interval
|
45
|
+
self._total_count += 1
|
46
|
+
yield tx, ty
|
47
|
+
self._last_x = tx
|
48
|
+
self._last_y = ty
|
49
|
+
positions += 1
|
50
|
+
self._remainder += intervals
|
51
|
+
self._remainder %= 1
|
52
|
+
|
53
|
+
|
54
|
+
def split(points):
|
55
|
+
pos = 0
|
56
|
+
for i, pts in enumerate(points):
|
57
|
+
if pts is None:
|
58
|
+
yield points[pos : i - 1]
|
59
|
+
pos = i + 1
|
60
|
+
if pos != len(points):
|
61
|
+
yield points[pos : len(points)]
|
62
|
+
|
63
|
+
|
64
|
+
def eulerian_fill(settings, outlines, matrix, limit=None):
|
65
|
+
"""
|
66
|
+
Applies optimized Eulerian fill
|
67
|
+
|
68
|
+
The Eulerian Fill performs creates a graph made out of edges and a series of horizontal rungs. It then solves for an
|
69
|
+
optimal walk that visits all the horizontal rungs and as many of the edge nodes as needed to perform this walk. This
|
70
|
+
should at most walk the entire edge plus 50% for scaffolding.
|
71
|
+
|
72
|
+
@return:
|
73
|
+
"""
|
74
|
+
if matrix is None:
|
75
|
+
matrix = Matrix()
|
76
|
+
|
77
|
+
settings = dict(settings)
|
78
|
+
h_dist = settings.get("hatch_distance", "1mm")
|
79
|
+
h_angle = settings.get("hatch_angle", "0deg")
|
80
|
+
distance_y = float(Length(h_dist))
|
81
|
+
if isinstance(h_angle, float):
|
82
|
+
angle = Angle(f"{h_angle}deg")
|
83
|
+
else:
|
84
|
+
angle = Angle(h_angle)
|
85
|
+
|
86
|
+
rotate = Matrix.rotate(angle)
|
87
|
+
counter_rotate = Matrix.rotate(-angle)
|
88
|
+
|
89
|
+
def mx_rotate(pt):
|
90
|
+
if pt is None:
|
91
|
+
return None
|
92
|
+
return (
|
93
|
+
pt.real * rotate.a + pt.imag * rotate.c + 1 * rotate.e,
|
94
|
+
pt.real * rotate.b + pt.imag * rotate.d + 1 * rotate.f,
|
95
|
+
)
|
96
|
+
|
97
|
+
def mx_counter(pt):
|
98
|
+
if pt is None:
|
99
|
+
return None
|
100
|
+
return (
|
101
|
+
pt[0] * counter_rotate.a + pt[1] * counter_rotate.c + 1 * counter_rotate.e,
|
102
|
+
pt[0] * counter_rotate.b + pt[1] * counter_rotate.d + 1 * counter_rotate.f,
|
103
|
+
)
|
104
|
+
|
105
|
+
def as_polylines():
|
106
|
+
pos = 0
|
107
|
+
for i in range(len(outlines)):
|
108
|
+
p = outlines[i]
|
109
|
+
if p is None:
|
110
|
+
yield outlines[pos:i]
|
111
|
+
pos = i + 1
|
112
|
+
continue
|
113
|
+
if pos != len(outlines):
|
114
|
+
yield outlines[pos:]
|
115
|
+
|
116
|
+
transformed_vector = matrix.transform_vector([0, distance_y])
|
117
|
+
distance = abs(complex(transformed_vector[0], transformed_vector[1]))
|
118
|
+
efill = EulerianFill(distance)
|
119
|
+
|
120
|
+
for poly in as_polylines():
|
121
|
+
sp = list(map(Point, map(mx_rotate, poly)))
|
122
|
+
efill += sp
|
123
|
+
if limit and efill.estimate() > limit:
|
124
|
+
return []
|
125
|
+
points = efill.get_fill()
|
126
|
+
|
127
|
+
points = list(map(mx_counter, points))
|
128
|
+
return points
|
129
|
+
|
130
|
+
|
131
|
+
def scanline_fill(settings, outlines, matrix, limit=None):
|
132
|
+
"""
|
133
|
+
Applies optimized scanline fill
|
134
|
+
@return:
|
135
|
+
"""
|
136
|
+
if matrix is None:
|
137
|
+
matrix = Matrix()
|
138
|
+
|
139
|
+
settings = dict(settings)
|
140
|
+
h_dist = settings.get("hatch_distance", "1mm")
|
141
|
+
h_angle = settings.get("hatch_angle", "0deg")
|
142
|
+
distance_y = float(Length(h_dist))
|
143
|
+
if isinstance(h_angle, float):
|
144
|
+
angle = Angle(f"{h_angle}deg")
|
145
|
+
else:
|
146
|
+
angle = Angle(h_angle)
|
147
|
+
|
148
|
+
rotate = Matrix.rotate(angle)
|
149
|
+
counter_rotate = Matrix.rotate(-angle)
|
150
|
+
|
151
|
+
def mx_rotate(pt):
|
152
|
+
if pt is None:
|
153
|
+
return None
|
154
|
+
return (
|
155
|
+
pt.real * rotate.a + pt.imag * rotate.c + 1 * rotate.e,
|
156
|
+
pt.real * rotate.b + pt.imag * rotate.d + 1 * rotate.f,
|
157
|
+
)
|
158
|
+
|
159
|
+
def mx_counter(pt):
|
160
|
+
if pt is None:
|
161
|
+
return None
|
162
|
+
return (
|
163
|
+
pt[0] * counter_rotate.a + pt[1] * counter_rotate.c + 1 * counter_rotate.e,
|
164
|
+
pt[0] * counter_rotate.b + pt[1] * counter_rotate.d + 1 * counter_rotate.f,
|
165
|
+
)
|
166
|
+
|
167
|
+
def as_polylines():
|
168
|
+
pos = 0
|
169
|
+
for idx in range(len(outlines)):
|
170
|
+
p = outlines[idx]
|
171
|
+
if p is None:
|
172
|
+
yield outlines[pos:idx]
|
173
|
+
pos = idx + 1
|
174
|
+
continue
|
175
|
+
if pos != len(outlines):
|
176
|
+
yield outlines[pos:]
|
177
|
+
|
178
|
+
transformed_vector = matrix.transform_vector([0, distance_y])
|
179
|
+
distance = abs(complex(transformed_vector[0], transformed_vector[1]))
|
180
|
+
|
181
|
+
vm = VectorMontonizer()
|
182
|
+
for poly in as_polylines():
|
183
|
+
pts = list(map(Point, map(mx_rotate, poly)))
|
184
|
+
vm.add_polyline(pts)
|
185
|
+
y_min, y_max = vm.event_range()
|
186
|
+
if y_min is None:
|
187
|
+
return []
|
188
|
+
height = y_max - y_min
|
189
|
+
try:
|
190
|
+
count = height / distance
|
191
|
+
except ZeroDivisionError:
|
192
|
+
return []
|
193
|
+
if limit and count > limit:
|
194
|
+
return []
|
195
|
+
vm.valid_low = y_min - distance
|
196
|
+
vm.valid_high = y_max + distance
|
197
|
+
vm.scanline_to(y_min - distance)
|
198
|
+
points = []
|
199
|
+
forward = True
|
200
|
+
while vm.current_is_valid_range():
|
201
|
+
vm.scanline_increment(distance)
|
202
|
+
y = vm.scanline
|
203
|
+
actives = vm.actives()
|
204
|
+
for i in (
|
205
|
+
range(1, len(actives), 2) if forward else range(len(actives) - 1, 0, -2)
|
206
|
+
):
|
207
|
+
left_segment = actives[i - 1]
|
208
|
+
right_segment = actives[i]
|
209
|
+
left_segment_x = vm.intercept(left_segment, y)
|
210
|
+
right_segment_x = vm.intercept(right_segment, y)
|
211
|
+
if forward:
|
212
|
+
points.append((left_segment_x, y))
|
213
|
+
points.append((right_segment_x, y))
|
214
|
+
else:
|
215
|
+
points.append((right_segment_x, y))
|
216
|
+
points.append((left_segment_x, y))
|
217
|
+
points.append(None)
|
218
|
+
forward = not forward
|
219
|
+
points = list(map(mx_counter, points))
|
220
|
+
return points
|
221
|
+
|
222
|
+
|
223
|
+
def circle(wobble, x0, y0, x1, y1):
|
224
|
+
if x1 is None or y1 is None:
|
225
|
+
yield x0, y0
|
226
|
+
return
|
227
|
+
rad = wobble.radius
|
228
|
+
if rad == 0:
|
229
|
+
rad = 1
|
230
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
231
|
+
t = wobble._total_distance / (math.tau * rad)
|
232
|
+
dx = wobble.radius * math.cos(t * wobble.speed)
|
233
|
+
dy = wobble.radius * math.sin(t * wobble.speed)
|
234
|
+
yield tx + dx, ty + dy
|
235
|
+
|
236
|
+
|
237
|
+
def circle_right(wobble, x0, y0, x1, y1):
|
238
|
+
if x1 is None or y1 is None:
|
239
|
+
yield x0, y0
|
240
|
+
return
|
241
|
+
rad = wobble.radius
|
242
|
+
if rad == 0:
|
243
|
+
rad = 1
|
244
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
245
|
+
angle = math.atan2(y1 - y0, x1 - x0) + math.tau / 4.0
|
246
|
+
dx = wobble.radius * math.cos(angle)
|
247
|
+
dy = wobble.radius * math.sin(angle)
|
248
|
+
t = wobble._total_distance / (math.tau * rad)
|
249
|
+
dx += wobble.radius * math.cos(t * wobble.speed)
|
250
|
+
dy += wobble.radius * math.sin(t * wobble.speed)
|
251
|
+
yield tx + dx, ty + dy
|
252
|
+
|
253
|
+
|
254
|
+
def circle_left(wobble, x0, y0, x1, y1):
|
255
|
+
if x1 is None or y1 is None:
|
256
|
+
yield x0, y0
|
257
|
+
return
|
258
|
+
rad = wobble.radius
|
259
|
+
if rad == 0:
|
260
|
+
rad = 1
|
261
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
262
|
+
angle = math.atan2(y1 - y0, x1 - x0) + math.tau / 4.0
|
263
|
+
dx = -wobble.radius * math.cos(angle)
|
264
|
+
dy = -wobble.radius * math.sin(angle)
|
265
|
+
t = wobble._total_distance / (math.tau * rad)
|
266
|
+
dx += wobble.radius * math.cos(t * wobble.speed)
|
267
|
+
dy += wobble.radius * math.sin(t * wobble.speed)
|
268
|
+
yield tx + dx, ty + dy
|
269
|
+
|
270
|
+
|
271
|
+
def sinewave(wobble, x0, y0, x1, y1):
|
272
|
+
if x1 is None or y1 is None:
|
273
|
+
yield x0, y0
|
274
|
+
return
|
275
|
+
spd = wobble.speed
|
276
|
+
if spd == 0:
|
277
|
+
spd = 1
|
278
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
279
|
+
angle = math.atan2(y1 - y0, x1 - x0) + math.tau / 4.0
|
280
|
+
d = math.sin(wobble._total_distance / spd)
|
281
|
+
dx = wobble.radius * d * math.cos(angle)
|
282
|
+
dy = wobble.radius * d * math.sin(angle)
|
283
|
+
yield tx + dx, ty + dy
|
284
|
+
|
285
|
+
|
286
|
+
def sawtooth(wobble, x0, y0, x1, y1):
|
287
|
+
if x1 is None or y1 is None:
|
288
|
+
yield x0, y0
|
289
|
+
return
|
290
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
291
|
+
angle = math.atan2(y1 - y0, x1 - x0) + math.tau / 4.0
|
292
|
+
d = -1 if wobble._total_count % 2 else 1
|
293
|
+
dx = wobble.radius * d * math.cos(angle)
|
294
|
+
dy = wobble.radius * d * math.sin(angle)
|
295
|
+
yield tx + dx, ty + dy
|
296
|
+
|
297
|
+
|
298
|
+
def jigsaw(wobble, x0, y0, x1, y1):
|
299
|
+
if x1 is None or y1 is None:
|
300
|
+
yield x0, y0
|
301
|
+
return
|
302
|
+
spd = wobble.speed
|
303
|
+
if spd == 0:
|
304
|
+
spd = 1
|
305
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
306
|
+
angle = math.atan2(y1 - y0, x1 - x0)
|
307
|
+
angle_perp = angle + math.tau / 4.0
|
308
|
+
d = math.sin(wobble._total_distance / spd)
|
309
|
+
dx = wobble.radius * d * math.cos(angle_perp)
|
310
|
+
dy = wobble.radius * d * math.sin(angle_perp)
|
311
|
+
|
312
|
+
d = -1 if wobble._total_count % 2 else 1
|
313
|
+
dx += wobble.radius * d * math.cos(angle)
|
314
|
+
dy += wobble.radius * d * math.sin(angle)
|
315
|
+
yield tx + dx, ty + dy
|
316
|
+
|
317
|
+
|
318
|
+
def gear(wobble, x0, y0, x1, y1):
|
319
|
+
if x1 is None or y1 is None:
|
320
|
+
yield x0, y0
|
321
|
+
return
|
322
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
323
|
+
angle = math.atan2(y1 - y0, x1 - x0) + math.tau / 4.0
|
324
|
+
d = -1 if (wobble._total_count // 2) % 2 else 1
|
325
|
+
dx = wobble.radius * d * math.cos(angle)
|
326
|
+
dy = wobble.radius * d * math.sin(angle)
|
327
|
+
yield tx + dx, ty + dy
|
328
|
+
|
329
|
+
|
330
|
+
def slowtooth(wobble, x0, y0, x1, y1):
|
331
|
+
if x1 is None or y1 is None:
|
332
|
+
yield x0, y0
|
333
|
+
return
|
334
|
+
spd = wobble.speed
|
335
|
+
if spd == 0:
|
336
|
+
spd = 1
|
337
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
338
|
+
angle = math.atan2(y1 - y0, x1 - x0) + math.tau / 4.0
|
339
|
+
if wobble.previous_angle is None:
|
340
|
+
wobble.previous_angle = angle
|
341
|
+
amount = 1.0 / spd
|
342
|
+
angle = amount * (angle - wobble.previous_angle) + wobble.previous_angle
|
343
|
+
d = -1 if wobble._total_count % 2 else 1
|
344
|
+
dx = wobble.radius * d * math.cos(angle)
|
345
|
+
dy = wobble.radius * d * math.sin(angle)
|
346
|
+
wobble.previous_angle = angle
|
347
|
+
yield tx + dx, ty + dy
|
348
|
+
|
349
|
+
|
350
|
+
def _meander(wobble, pattern, max_x, max_y, x0, y0, x1, y1):
|
351
|
+
if x1 is None or y1 is None:
|
352
|
+
yield x0, y0
|
353
|
+
return
|
354
|
+
|
355
|
+
factors = {
|
356
|
+
"l": (-1, 0),
|
357
|
+
"r": (1, 0),
|
358
|
+
"u": (0, -1),
|
359
|
+
"d": (0, 1),
|
360
|
+
}
|
361
|
+
|
362
|
+
if int(wobble.speed) % 10 == 1:
|
363
|
+
# position_x = "left"
|
364
|
+
offset_x = 0 * max_x
|
365
|
+
elif int(wobble.speed) % 10 == 2:
|
366
|
+
# position_x = "right"
|
367
|
+
offset_x = -1 * max_x
|
368
|
+
else:
|
369
|
+
# position_x = "center"
|
370
|
+
offset_x = -0.5 * max_x
|
371
|
+
|
372
|
+
if wobble.speed // 10 == 1:
|
373
|
+
# position_y = "top"
|
374
|
+
offset_y = 0 * max_y
|
375
|
+
elif wobble.speed // 10 == 2:
|
376
|
+
# position_y = "bottom"
|
377
|
+
offset_y = 1 * max_y
|
378
|
+
else:
|
379
|
+
# position_y = "center"
|
380
|
+
offset_y = 0.5 * max_y
|
381
|
+
|
382
|
+
step = wobble.radius / max_x
|
383
|
+
|
384
|
+
offset_x *= step
|
385
|
+
offset_y *= step
|
386
|
+
|
387
|
+
angle = 0
|
388
|
+
mat = Matrix()
|
389
|
+
if x1 is not None:
|
390
|
+
a_x = x1 - x0
|
391
|
+
a_y = y1 - y0
|
392
|
+
angle = math.atan2(a_y, a_x)
|
393
|
+
mat.post_rotate(angle)
|
394
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
395
|
+
dx = 0
|
396
|
+
dy = 0
|
397
|
+
pt = mat.point_in_matrix_space((dx + offset_x, dy + offset_y))
|
398
|
+
yield tx + pt.x, ty + pt.y
|
399
|
+
for p in pattern:
|
400
|
+
sx, sy = factors[p[0]]
|
401
|
+
stepsize = step * p[1]
|
402
|
+
dx += sx * stepsize
|
403
|
+
dy += sy * stepsize
|
404
|
+
pt = mat.point_in_matrix_space((dx + offset_x, dy + offset_y))
|
405
|
+
yield tx + pt.x, ty + pt.y
|
406
|
+
|
407
|
+
|
408
|
+
def meander_1(wobble, x0, y0, x1, y1):
|
409
|
+
pattern = (
|
410
|
+
(
|
411
|
+
"r",
|
412
|
+
6,
|
413
|
+
),
|
414
|
+
(
|
415
|
+
"u",
|
416
|
+
5,
|
417
|
+
),
|
418
|
+
(
|
419
|
+
"l",
|
420
|
+
4,
|
421
|
+
),
|
422
|
+
(
|
423
|
+
"d",
|
424
|
+
3,
|
425
|
+
),
|
426
|
+
(
|
427
|
+
"r",
|
428
|
+
2,
|
429
|
+
),
|
430
|
+
(
|
431
|
+
"u",
|
432
|
+
1,
|
433
|
+
),
|
434
|
+
# transition
|
435
|
+
("l", 1),
|
436
|
+
# reverse of upper part
|
437
|
+
(
|
438
|
+
"u",
|
439
|
+
1,
|
440
|
+
),
|
441
|
+
(
|
442
|
+
"r",
|
443
|
+
2,
|
444
|
+
),
|
445
|
+
(
|
446
|
+
"d",
|
447
|
+
3,
|
448
|
+
),
|
449
|
+
(
|
450
|
+
"l",
|
451
|
+
4,
|
452
|
+
),
|
453
|
+
(
|
454
|
+
"u",
|
455
|
+
5,
|
456
|
+
),
|
457
|
+
(
|
458
|
+
"r",
|
459
|
+
6,
|
460
|
+
),
|
461
|
+
# transition
|
462
|
+
("d", 6),
|
463
|
+
)
|
464
|
+
max_x = 0
|
465
|
+
for p in pattern:
|
466
|
+
max_x = max(max_x, p[1])
|
467
|
+
max_y = max_x
|
468
|
+
max_x += 1
|
469
|
+
yield from _meander(wobble, pattern, max_x, max_y, x0, y0, x1, y1)
|
470
|
+
|
471
|
+
|
472
|
+
def meander_2(wobble, x0, y0, x1, y1):
|
473
|
+
pattern = (
|
474
|
+
("u", 3),
|
475
|
+
("r", 3),
|
476
|
+
("d", 2),
|
477
|
+
("l", 1),
|
478
|
+
("u", 1),
|
479
|
+
("l", 1),
|
480
|
+
("d", 2),
|
481
|
+
("r", 5),
|
482
|
+
("u", 2),
|
483
|
+
("l", 1),
|
484
|
+
("d", 1),
|
485
|
+
("l", 1),
|
486
|
+
("u", 2),
|
487
|
+
("r", 3),
|
488
|
+
("d", 3),
|
489
|
+
)
|
490
|
+
max_x = 8
|
491
|
+
max_y = 3
|
492
|
+
|
493
|
+
yield from _meander(wobble, pattern, max_x, max_y, x0, y0, x1, y1)
|
494
|
+
|
495
|
+
|
496
|
+
def meander_3(wobble, x0, y0, x1, y1):
|
497
|
+
pattern = (
|
498
|
+
("u", 4),
|
499
|
+
("r", 3),
|
500
|
+
("d", 3),
|
501
|
+
("l", 2),
|
502
|
+
("u", 2),
|
503
|
+
("r", 1),
|
504
|
+
("d", 1),
|
505
|
+
# and now backwards...
|
506
|
+
# reverse of upper part
|
507
|
+
("u", 1),
|
508
|
+
("l", 1),
|
509
|
+
("d", 2),
|
510
|
+
("r", 2),
|
511
|
+
("u", 3),
|
512
|
+
("l", 3),
|
513
|
+
("d", 4),
|
514
|
+
# other side
|
515
|
+
("d", 4),
|
516
|
+
("r", 3),
|
517
|
+
("u", 3),
|
518
|
+
("l", 2),
|
519
|
+
("d", 2),
|
520
|
+
("r", 1),
|
521
|
+
("u", 1),
|
522
|
+
# and now backwards...
|
523
|
+
("d", 1),
|
524
|
+
("l", 1),
|
525
|
+
("u", 2),
|
526
|
+
("r", 2),
|
527
|
+
("d", 3),
|
528
|
+
("l", 3),
|
529
|
+
("u", 4),
|
530
|
+
# transition
|
531
|
+
("r", 4),
|
532
|
+
)
|
533
|
+
max_x = 0
|
534
|
+
for p in pattern:
|
535
|
+
max_x = max(max_x, p[1])
|
536
|
+
max_y = max_x
|
537
|
+
max_x += 1
|
538
|
+
yield from _meander(wobble, pattern, max_x, max_y, x0, y0, x1, y1)
|
539
|
+
|
540
|
+
|
541
|
+
def _tabbed(wobble, x0, y0, x1, y1):
|
542
|
+
if x1 is None or y1 is None:
|
543
|
+
yield x0, y0
|
544
|
+
return
|
545
|
+
# wobble has the following parameters:
|
546
|
+
# speed: Array of tab positions (percentage of overall pathlength)
|
547
|
+
# radius: Length of tab
|
548
|
+
# interval: internal resolution
|
549
|
+
wobble.may_close_path = False
|
550
|
+
if wobble.flag is None:
|
551
|
+
wobble.flag = True
|
552
|
+
if wobble.userdata is None:
|
553
|
+
tablen = wobble.radius * wobble.unit_factor
|
554
|
+
pattern_idx = 0
|
555
|
+
pattern = []
|
556
|
+
positions = []
|
557
|
+
if isinstance(wobble.speed, str):
|
558
|
+
# This is a string with comma and/or whitespace separated numbers
|
559
|
+
sub_comma = wobble.speed.split(",")
|
560
|
+
if wobble.speed.startswith("*"):
|
561
|
+
# Special case:
|
562
|
+
# '*4' means 4 tabs equidistant, all remaining parameters will be ignored
|
563
|
+
sub_spaces = sub_comma[0].split()
|
564
|
+
s = sub_spaces[0][1:]
|
565
|
+
try:
|
566
|
+
value = int(s)
|
567
|
+
if value > 0:
|
568
|
+
for i in range(value):
|
569
|
+
val = (i + 0.5) * 100 / value
|
570
|
+
positions.append( val )
|
571
|
+
except ValueError:
|
572
|
+
pass
|
573
|
+
else:
|
574
|
+
for entry in sub_comma:
|
575
|
+
sub_spaces = entry.split()
|
576
|
+
for s in sub_spaces:
|
577
|
+
try:
|
578
|
+
value = float(s)
|
579
|
+
if value < 0:
|
580
|
+
value = 0
|
581
|
+
elif value > 100:
|
582
|
+
value = 100
|
583
|
+
except ValueError:
|
584
|
+
continue
|
585
|
+
positions.append(value)
|
586
|
+
else:
|
587
|
+
try:
|
588
|
+
positions.append(float(wobble.speed))
|
589
|
+
except ValueError:
|
590
|
+
pass
|
591
|
+
# So now that we have the positions we calculate the start and end position
|
592
|
+
# Do we have a chance or are all gaps overlapping
|
593
|
+
def repr(info):
|
594
|
+
conc = []
|
595
|
+
for p in info:
|
596
|
+
conc.append(f"({p[0]}, {p[1]:.2f})")
|
597
|
+
s = ",".join(conc)
|
598
|
+
return "[" + s + "]"
|
599
|
+
|
600
|
+
if len(positions) * tablen < wobble.total_length:
|
601
|
+
positions.sort()
|
602
|
+
last_end = None
|
603
|
+
last_end_idx = None
|
604
|
+
gap_at_end = None
|
605
|
+
have_gap_at_start = False
|
606
|
+
for pos in positions:
|
607
|
+
spos = pos / 100.0 * wobble.total_length - 0.5 * tablen
|
608
|
+
epos = spos + tablen
|
609
|
+
# print (f"And now: {spos:.2f} - {epos:.2f} adding to {repr(pattern)}")
|
610
|
+
this_start = spos
|
611
|
+
if this_start < 0:
|
612
|
+
this_start = 0
|
613
|
+
# Is the new start <= previous end, if yes just extend the end
|
614
|
+
if last_end is not None and last_end >= this_start:
|
615
|
+
# print (f"Updating end {last_end:.2f}, ignoring start {this_start:.2f}")
|
616
|
+
pattern[last_end_idx][1] = epos
|
617
|
+
last_end = epos
|
618
|
+
continue
|
619
|
+
|
620
|
+
if spos < 0 and gap_at_end is None:
|
621
|
+
spos = spos + wobble.total_length
|
622
|
+
gap_at_end = spos
|
623
|
+
pattern.append([False, spos])
|
624
|
+
# print (f"Adding a gap at the at the end {spos:.2f}")
|
625
|
+
if this_start == 0:
|
626
|
+
if not have_gap_at_start:
|
627
|
+
# print("Set a start to zero")
|
628
|
+
pattern.append([False, 0.0])
|
629
|
+
have_gap_at_start = True
|
630
|
+
else:
|
631
|
+
# print("Ignore start as it was already at zero")
|
632
|
+
pass
|
633
|
+
else:
|
634
|
+
if last_end is not None and this_start <= last_end:
|
635
|
+
# print ("Unexpectedly this is still smaller...")
|
636
|
+
pattern[last_end_idx][1] = epos
|
637
|
+
last_end = epos
|
638
|
+
continue
|
639
|
+
# print (f"Adding a gap at {this_start:.2f}")
|
640
|
+
pattern.append([False, this_start])
|
641
|
+
# And finally the end
|
642
|
+
if gap_at_end is None or gap_at_end > epos:
|
643
|
+
# print (f"Closing the gap at {epos:.2f}")
|
644
|
+
pattern.append([True, epos])
|
645
|
+
last_end = epos
|
646
|
+
last_end_idx = len(pattern) - 1
|
647
|
+
else:
|
648
|
+
# print (f"Not closing the gap at {epos:.2f} as it would fall into the endgap {gap_at_end:.2f}")
|
649
|
+
pass
|
650
|
+
pattern.sort(key=lambda x: x[1])
|
651
|
+
# print ("Before", repr(pattern))
|
652
|
+
if len(pattern):
|
653
|
+
if pattern[0][1] > 0:
|
654
|
+
# Force a start
|
655
|
+
pattern.insert(0, [True, 0.0])
|
656
|
+
# Remove duplicate entries
|
657
|
+
idx = len(pattern) - 1
|
658
|
+
while idx > 0: # No need to look at the very first as there are no predecessors
|
659
|
+
if pattern[idx - 1] == pattern[idx]:
|
660
|
+
pattern.pop(idx)
|
661
|
+
idx -= 1
|
662
|
+
# print ("at end", repr(pattern))
|
663
|
+
# Now amend the sequence to indicate the next position
|
664
|
+
for idx, pat in enumerate(pattern):
|
665
|
+
if idx < len(pattern) - 1:
|
666
|
+
l = pattern[idx + 1][1]
|
667
|
+
else:
|
668
|
+
l = wobble.total_length + 10 * wobble.interval
|
669
|
+
pat[1] = l
|
670
|
+
# print (f"Start with {wobble.flag}: {pattern}")
|
671
|
+
wobble.userdata = [pattern_idx, pattern, -1.0]
|
672
|
+
pattern_idx = wobble.userdata[0]
|
673
|
+
pattern = wobble.userdata[1]
|
674
|
+
next_target = wobble.userdata[2]
|
675
|
+
|
676
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
677
|
+
if len(pattern) == 0:
|
678
|
+
yield (tx, ty)
|
679
|
+
continue
|
680
|
+
|
681
|
+
if next_target < wobble._total_distance:
|
682
|
+
if pattern_idx < len(pattern):
|
683
|
+
wobble.flag, next_target = pattern[pattern_idx]
|
684
|
+
pattern_idx += 1
|
685
|
+
else:
|
686
|
+
next_target = wobble.total_length * 1.25
|
687
|
+
wobble.flag = True
|
688
|
+
wobble.userdata[0] = pattern_idx
|
689
|
+
wobble.userdata[2] = next_target
|
690
|
+
# print (f"Changing state: {wobble.flag} at {wobble._total_distance:.2f} ({tx:.2f}, {ty:.2f}) - next target: {next_target:.2f}")
|
691
|
+
if wobble.flag:
|
692
|
+
yield tx, ty
|
693
|
+
else:
|
694
|
+
yield None, None
|
695
|
+
|
696
|
+
def _dashed(wobble, x0, y0, x1, y1):
|
697
|
+
if x1 is None or y1 is None:
|
698
|
+
yield x0, y0
|
699
|
+
return
|
700
|
+
# wobble has the following parameters:
|
701
|
+
# speed
|
702
|
+
# radius
|
703
|
+
# interval
|
704
|
+
if wobble.flag is None:
|
705
|
+
wobble.flag = False # Not visible but will immediately be swapped...
|
706
|
+
if wobble.userdata is None:
|
707
|
+
pattern_idx = 0
|
708
|
+
pattern = []
|
709
|
+
if isinstance(wobble.radius, str):
|
710
|
+
# This is a string with comma and/or whitespace separated numbers
|
711
|
+
sub_comma = wobble.radius.split(",")
|
712
|
+
for entry in sub_comma:
|
713
|
+
sub_spaces = entry.split()
|
714
|
+
for s in sub_spaces:
|
715
|
+
try:
|
716
|
+
value = float(s)
|
717
|
+
if value <= 0:
|
718
|
+
continue
|
719
|
+
except ValueError:
|
720
|
+
continue
|
721
|
+
pattern.append(value * UNITS_PER_MM * wobble.unit_factor)
|
722
|
+
elif isinstance(wobble.radius, (tuple, list)):
|
723
|
+
pattern.extend(r * UNITS_PER_MM * wobble.unit_factor for r in wobble.radius)
|
724
|
+
else:
|
725
|
+
pattern.append(wobble.radius * UNITS_PER_MM * wobble.unit_factor)
|
726
|
+
if len(pattern) % 2 == 1:
|
727
|
+
# Needs to be even
|
728
|
+
pattern.extend(pattern)
|
729
|
+
wobble.userdata = [pattern_idx, pattern, -1.0]
|
730
|
+
pattern_idx = wobble.userdata[0]
|
731
|
+
pattern = wobble.userdata[1]
|
732
|
+
next_target = wobble.userdata[2]
|
733
|
+
|
734
|
+
for tx, ty in wobble.wobble(x0, y0, x1, y1):
|
735
|
+
if len(pattern) == 0:
|
736
|
+
yield (tx, ty)
|
737
|
+
continue
|
738
|
+
|
739
|
+
if next_target < wobble._total_distance:
|
740
|
+
gap = pattern[pattern_idx]
|
741
|
+
pattern_idx += 1
|
742
|
+
if pattern_idx >= len(pattern):
|
743
|
+
pattern_idx = 0
|
744
|
+
next_target = wobble._total_distance + gap
|
745
|
+
wobble.flag = not wobble.flag
|
746
|
+
wobble.userdata[0] = pattern_idx
|
747
|
+
wobble.userdata[2] = next_target
|
748
|
+
# if wobble.flag and wobble._last_x:
|
749
|
+
# yield wobble._last_x, wobble._last_y
|
750
|
+
if wobble.flag:
|
751
|
+
yield tx, ty
|
752
|
+
else:
|
753
|
+
yield None, None
|
754
|
+
|
755
|
+
|
756
|
+
def dashed_line(wobble, x0, y0, x1, y1):
|
757
|
+
yield from _dashed(wobble, x0, y0, x1, y1)
|
758
|
+
|
759
|
+
def tabbed_path(wobble, x0, y0, x1, y1):
|
760
|
+
yield from _tabbed(wobble, x0, y0, x1, y1)
|
761
|
+
|
762
|
+
|
763
|
+
def plugin(kernel, lifecycle):
|
764
|
+
if lifecycle == "register":
|
765
|
+
_ = kernel.translation
|
766
|
+
context = kernel.root
|
767
|
+
context.register("hatch/scanline", scanline_fill)
|
768
|
+
context.register("hatch/eulerian", eulerian_fill)
|
769
|
+
context.register("wobble/circle", circle)
|
770
|
+
context.register("wobble/circle_right", circle_right)
|
771
|
+
context.register("wobble/circle_left", circle_left)
|
772
|
+
context.register("wobble/sinewave", sinewave)
|
773
|
+
context.register("wobble/sawtooth", sawtooth)
|
774
|
+
context.register("wobble/jigsaw", jigsaw)
|
775
|
+
context.register("wobble/gear", gear)
|
776
|
+
context.register("wobble/slowtooth", slowtooth)
|
777
|
+
context.register("wobble/meander_1", meander_1)
|
778
|
+
context.register("wobble/meander_2", meander_2)
|
779
|
+
context.register("wobble/meander_3", meander_3)
|
780
|
+
# context.register("wobble/dash", dashed_line)
|
781
|
+
# context.register("wobble/tabs", tabbed_path)
|