meerk40t 0.9.7030__py2.py3-none-any.whl → 0.9.7050__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- meerk40t/balormk/clone_loader.py +3 -2
- meerk40t/balormk/controller.py +38 -13
- meerk40t/balormk/cylindermod.py +1 -0
- meerk40t/balormk/device.py +13 -9
- meerk40t/balormk/driver.py +9 -2
- meerk40t/balormk/galvo_commands.py +3 -1
- meerk40t/balormk/gui/gui.py +6 -0
- meerk40t/balormk/livelightjob.py +338 -321
- meerk40t/balormk/mock_connection.py +4 -3
- meerk40t/balormk/usb_connection.py +11 -2
- meerk40t/camera/camera.py +19 -14
- meerk40t/camera/gui/camerapanel.py +6 -0
- meerk40t/core/cutplan.py +101 -78
- meerk40t/core/elements/element_treeops.py +435 -140
- meerk40t/core/elements/elements.py +100 -9
- meerk40t/core/elements/shapes.py +259 -72
- meerk40t/core/elements/tree_commands.py +10 -5
- meerk40t/core/node/blobnode.py +19 -4
- meerk40t/core/node/elem_ellipse.py +18 -8
- meerk40t/core/node/elem_image.py +51 -19
- meerk40t/core/node/elem_line.py +18 -8
- meerk40t/core/node/elem_path.py +18 -8
- meerk40t/core/node/elem_point.py +10 -4
- meerk40t/core/node/elem_polyline.py +19 -11
- meerk40t/core/node/elem_rect.py +18 -8
- meerk40t/core/node/elem_text.py +11 -5
- meerk40t/core/node/filenode.py +2 -8
- meerk40t/core/node/groupnode.py +11 -11
- meerk40t/core/node/image_processed.py +11 -5
- meerk40t/core/node/image_raster.py +11 -5
- meerk40t/core/node/node.py +64 -16
- meerk40t/core/node/refnode.py +2 -1
- meerk40t/core/planner.py +25 -11
- meerk40t/core/svg_io.py +91 -34
- meerk40t/device/dummydevice.py +7 -1
- meerk40t/extra/vtracer.py +222 -0
- meerk40t/grbl/device.py +96 -9
- meerk40t/grbl/driver.py +15 -5
- meerk40t/gui/about.py +20 -0
- meerk40t/gui/devicepanel.py +20 -16
- meerk40t/gui/gui_mixins.py +4 -0
- meerk40t/gui/icons.py +330 -253
- meerk40t/gui/laserpanel.py +27 -3
- meerk40t/gui/laserrender.py +41 -21
- meerk40t/gui/magnetoptions.py +158 -65
- meerk40t/gui/materialtest.py +569 -310
- meerk40t/gui/navigationpanels.py +229 -24
- meerk40t/gui/propertypanels/hatchproperty.py +2 -0
- meerk40t/gui/propertypanels/imageproperty.py +160 -106
- meerk40t/gui/propertypanels/wobbleproperty.py +6 -2
- meerk40t/gui/ribbon.py +6 -1
- meerk40t/gui/scenewidgets/gridwidget.py +29 -32
- meerk40t/gui/scenewidgets/rectselectwidget.py +190 -192
- meerk40t/gui/simulation.py +75 -77
- meerk40t/gui/spoolerpanel.py +27 -7
- meerk40t/gui/statusbarwidgets/defaultoperations.py +84 -48
- meerk40t/gui/statusbarwidgets/infowidget.py +2 -2
- meerk40t/gui/tips.py +15 -1
- meerk40t/gui/toolwidgets/toolpointmove.py +3 -1
- meerk40t/gui/wxmmain.py +242 -114
- meerk40t/gui/wxmscene.py +107 -24
- meerk40t/gui/wxmtree.py +4 -2
- meerk40t/gui/wxutils.py +286 -15
- meerk40t/image/imagetools.py +129 -65
- meerk40t/internal_plugins.py +4 -0
- meerk40t/kernel/kernel.py +67 -18
- meerk40t/kernel/settings.py +28 -9
- meerk40t/lihuiyu/device.py +24 -12
- meerk40t/main.py +14 -9
- meerk40t/moshi/device.py +20 -6
- meerk40t/network/console_server.py +22 -6
- meerk40t/newly/device.py +10 -3
- meerk40t/newly/gui/gui.py +10 -0
- meerk40t/ruida/device.py +22 -2
- meerk40t/ruida/loader.py +9 -4
- meerk40t/ruida/rdjob.py +48 -8
- meerk40t/tools/geomstr.py +240 -123
- meerk40t/tools/rasterplotter.py +185 -94
- {meerk40t-0.9.7030.dist-info → meerk40t-0.9.7050.dist-info}/METADATA +1 -1
- {meerk40t-0.9.7030.dist-info → meerk40t-0.9.7050.dist-info}/RECORD +85 -84
- {meerk40t-0.9.7030.dist-info → meerk40t-0.9.7050.dist-info}/LICENSE +0 -0
- {meerk40t-0.9.7030.dist-info → meerk40t-0.9.7050.dist-info}/WHEEL +0 -0
- {meerk40t-0.9.7030.dist-info → meerk40t-0.9.7050.dist-info}/entry_points.txt +0 -0
- {meerk40t-0.9.7030.dist-info → meerk40t-0.9.7050.dist-info}/top_level.txt +0 -0
- {meerk40t-0.9.7030.dist-info → meerk40t-0.9.7050.dist-info}/zip-safe +0 -0
@@ -219,7 +219,7 @@ def plugin(kernel, lifecycle=None):
|
|
219
219
|
"type": bool,
|
220
220
|
"label": _("Track changes and allow undo"),
|
221
221
|
"tip": _(
|
222
|
-
"MK will save intermediate states to undo/redo changes") + "\n" +
|
222
|
+
"MK will save intermediate states to undo/redo changes") + "\n" +
|
223
223
|
_("This may consume a significant amount of memory"),
|
224
224
|
"page": "Start",
|
225
225
|
"section": "_60_Undo",
|
@@ -311,6 +311,22 @@ def plugin(kernel, lifecycle=None):
|
|
311
311
|
"page": "Classification",
|
312
312
|
"section": "_10_Assignment-Logic",
|
313
313
|
},
|
314
|
+
{
|
315
|
+
"attr": "classify_fill",
|
316
|
+
"object": elements,
|
317
|
+
"default": False,
|
318
|
+
"type": bool,
|
319
|
+
"label": _("Classify elements on fill"),
|
320
|
+
"tip": _(
|
321
|
+
"Usually MK will use the fill attribute as an indicator for a raster and will not distinguish between individual colors."
|
322
|
+
)
|
323
|
+
+ "\n"
|
324
|
+
+ _(
|
325
|
+
"If you want to distinguish between different raster types then activate this option."
|
326
|
+
),
|
327
|
+
"page": "Classification",
|
328
|
+
"section": "_10_Assignment-Logic",
|
329
|
+
},
|
314
330
|
{
|
315
331
|
"attr": "classify_default",
|
316
332
|
"object": elements,
|
@@ -648,6 +664,7 @@ class Elemental(Service):
|
|
648
664
|
self.setting(bool, "classify_inherit_fill", False)
|
649
665
|
self.setting(bool, "classify_inherit_exclusive", True)
|
650
666
|
self.setting(bool, "update_statusbar_on_material_load", True)
|
667
|
+
self.setting(bool, "classify_fill", False)
|
651
668
|
# self.setting(bool, "classify_auto_inherit", False)
|
652
669
|
self.setting(bool, "classify_default", True)
|
653
670
|
self.setting(bool, "op_show_default", False)
|
@@ -2695,6 +2712,31 @@ class Elemental(Service):
|
|
2695
2712
|
def emptydebug(value):
|
2696
2713
|
return
|
2697
2714
|
|
2715
|
+
def _get_next_auto_raster_count(operations):
|
2716
|
+
auto_raster_count = 0
|
2717
|
+
for op in operations:
|
2718
|
+
if op.type == "op raster" and op.id is not None and op.id.startswith("AR#"):
|
2719
|
+
try:
|
2720
|
+
used_id = int(op.id[3:])
|
2721
|
+
auto_raster_count = max(auto_raster_count, used_id)
|
2722
|
+
except (IndexError, ValueError):
|
2723
|
+
pass
|
2724
|
+
return auto_raster_count + 1
|
2725
|
+
|
2726
|
+
def _select_raster_candidate(operations, node, fuzzydistance):
|
2727
|
+
candidate = None
|
2728
|
+
candidate_dist = float("inf")
|
2729
|
+
for cand_op in operations:
|
2730
|
+
if cand_op.type != "op raster":
|
2731
|
+
continue
|
2732
|
+
col_d = Color.distance(cand_op.color, abs(node.fill))
|
2733
|
+
if col_d > fuzzydistance:
|
2734
|
+
continue
|
2735
|
+
if candidate is None or col_d < candidate_dist:
|
2736
|
+
candidate = cand_op
|
2737
|
+
candidate_dist = col_d
|
2738
|
+
return candidate
|
2739
|
+
|
2698
2740
|
# I am tired of changing the code all the time, so let's do it properly
|
2699
2741
|
debug = self.kernel.channel("classify", timestamp=True)
|
2700
2742
|
|
@@ -2807,17 +2849,58 @@ class Elemental(Service):
|
|
2807
2849
|
debug(
|
2808
2850
|
f"For {op.type}.{op.id}: black={is_black}, perform={perform_classification}, flag={self.classify_black_as_raster}"
|
2809
2851
|
)
|
2810
|
-
if hasattr(op, "classify") and perform_classification:
|
2852
|
+
if not (hasattr(op, "classify") and perform_classification):
|
2853
|
+
continue
|
2854
|
+
classified = False
|
2855
|
+
classifying_op = None
|
2856
|
+
if (
|
2857
|
+
self.classify_fill and
|
2858
|
+
op.type=="op raster" and
|
2859
|
+
hasattr(node, "fill") and node.fill is not None
|
2860
|
+
):
|
2861
|
+
# This is a special use case:
|
2862
|
+
# Usually we don't distinguish a fill color - all non-transparent objects
|
2863
|
+
# are assigned to a single raster operation.
|
2864
|
+
# If the classify_fill flag is set, then we will use the fill attribute
|
2865
|
+
# to look for / create a matching raster operation
|
2866
|
+
raster_candidate = _select_raster_candidate(operations, node, fuzzydistance)
|
2867
|
+
if raster_candidate is None and self.classify_autogenerate:
|
2868
|
+
# We need to create one...
|
2869
|
+
auto_raster_count = _get_next_auto_raster_count(operations)
|
2870
|
+
raster_candidate = RasterOpNode(
|
2871
|
+
id = f"AR#{auto_raster_count}",
|
2872
|
+
label = f"Auto-Raster #{auto_raster_count}",
|
2873
|
+
color = abs(node.fill),
|
2874
|
+
output = True,
|
2875
|
+
)
|
2876
|
+
add_op_function(raster_candidate)
|
2877
|
+
new_operations_added = True
|
2878
|
+
|
2879
|
+
classified, should_break, feedback = raster_candidate.classify(
|
2880
|
+
node,
|
2881
|
+
fuzzy=tempfuzzy,
|
2882
|
+
fuzzydistance=fuzzydistance,
|
2883
|
+
usedefault=False,
|
2884
|
+
)
|
2885
|
+
if classified:
|
2886
|
+
classifying_op = raster_candidate
|
2887
|
+
should_break = True
|
2888
|
+
if debug:
|
2889
|
+
debug(
|
2890
|
+
f"{node_desc} was color-raster-classified: {sstroke} {sfill} matching operation: {type(classifying_op).__name__}, break={should_break}"
|
2891
|
+
)
|
2892
|
+
|
2893
|
+
if not classified:
|
2811
2894
|
classified, should_break, feedback = op.classify(
|
2812
2895
|
node,
|
2813
2896
|
fuzzy=tempfuzzy,
|
2814
2897
|
fuzzydistance=fuzzydistance,
|
2815
2898
|
usedefault=False,
|
2816
2899
|
)
|
2817
|
-
|
2818
|
-
|
2900
|
+
if classified:
|
2901
|
+
classifying_op = op
|
2819
2902
|
if classified:
|
2820
|
-
update_debug_set(debug_set,
|
2903
|
+
update_debug_set(debug_set, classifying_op)
|
2821
2904
|
if feedback is not None and "stroke" in feedback:
|
2822
2905
|
classif_info[0] = True
|
2823
2906
|
if feedback is not None and "fill" in feedback:
|
@@ -2833,7 +2916,7 @@ class Elemental(Service):
|
|
2833
2916
|
sfill = ""
|
2834
2917
|
if debug:
|
2835
2918
|
debug(
|
2836
|
-
f"{node_desc} was classified: {sstroke} {sfill} matching operation: {type(
|
2919
|
+
f"{node_desc} was classified: {sstroke} {sfill} matching operation: {type(classifying_op).__name__}, break={should_break}"
|
2837
2920
|
)
|
2838
2921
|
if should_break:
|
2839
2922
|
break
|
@@ -2889,8 +2972,8 @@ class Elemental(Service):
|
|
2889
2972
|
default_candidates = []
|
2890
2973
|
for op in operations:
|
2891
2974
|
if (
|
2892
|
-
hasattr(op, "classify") and
|
2893
|
-
getattr(op, "default", False) and
|
2975
|
+
hasattr(op, "classify") and
|
2976
|
+
getattr(op, "default", False) and
|
2894
2977
|
hasattr(op, "valid_node_for_reference") and
|
2895
2978
|
op.valid_node_for_reference(node)
|
2896
2979
|
):
|
@@ -3132,7 +3215,15 @@ class Elemental(Service):
|
|
3132
3215
|
and node.fill is not None
|
3133
3216
|
and node.fill.argb is not None
|
3134
3217
|
):
|
3135
|
-
|
3218
|
+
default_color = abs(node.fill) if self.classify_fill else Color("black")
|
3219
|
+
default_id = "AR#1" if self.classify_fill else "R1"
|
3220
|
+
default_label = "Auto-Raster #1" if self.classify_fill else "Standard-Raster"
|
3221
|
+
op = RasterOpNode(
|
3222
|
+
id=default_id,
|
3223
|
+
label=default_label,
|
3224
|
+
color=default_color,
|
3225
|
+
output = True,
|
3226
|
+
)
|
3136
3227
|
stdops.append(op)
|
3137
3228
|
if debug:
|
3138
3229
|
debug("add an op raster due to fill")
|