-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmixing.cfg
43 lines (39 loc) · 1.92 KB
/
mixing.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
[gcode_macro MIX]
gcode:
{% set A = params.A|default(0.25)|float %}
{% set B = params.B|default(0.25)|float %}
{% set C = params.C|default(0.25)|float %}
{% set D = params.D|default(0.25)|float %}
{% set rot = 7.71 %}
SYNC_EXTRUDER_MOTION EXTRUDER=extruder MOTION_QUEUE=extruder
SYNC_EXTRUDER_MOTION EXTRUDER=extruder_1 MOTION_QUEUE=extruder
SYNC_EXTRUDER_MOTION EXTRUDER=extruder_2 MOTION_QUEUE=extruder
SYNC_EXTRUDER_MOTION EXTRUDER=extruder_3 MOTION_QUEUE=extruder
SET_EXTRUDER_ROTATION_DISTANCE EXTRUDER=extruder DISTANCE={rot/(A+0.0001)}
SET_EXTRUDER_ROTATION_DISTANCE EXTRUDER=extruder_1 DISTANCE={rot/(B+0.0001)}
SET_EXTRUDER_ROTATION_DISTANCE EXTRUDER=extruder_2 DISTANCE={rot/(C+0.0001)}
SET_EXTRUDER_ROTATION_DISTANCE EXTRUDER=extruder_3 DISTANCE={rot/(D+0.0001)}
[gcode_macro RANDOM_MIX]
gcode:
{% set randomvalue = range(0 | int, 100 | int) | random %}
{% set randomvalue2 = range(0 | int, 100-randomvalue | int) | random %}
{% set randomvalue3 = range(0 | int, 100-randomvalue-randomvalue2 | int) | random %}
{% set remainder = 100-randomvalue-randomvalue2-randomvalue3 %}
MIX A={randomvalue/100} B={randomvalue2/100} C={randomvalue3/100} D={remainder/100}
[gcode_macro _COUNT_LAYERS]
variable_layer_count = 0
gcode:
SET_GCODE_VARIABLE MACRO=COUNT_LAYERS VARIABLE=layer_count VALUE={printer["gcode_macro, count_layers"].layer_count+1}
[gcode_macro _LAYERED_RANDOM]
variable_layers = 5
gcode:
{% set layers = prams.H|default(printer["gcode_macro, layered_random"].layers)|int %}
SET_GCODE_VARIABLE MACRO=layered_random VARIABLE=layers VALUE={layers}
{% if printer["gcode_macro, count_layers"].layer_count == printer["gcode_macro, layered_random"].layers %}
RANDOM_MIX
SET_GCODE_VARIABLE MACRO=COUNT_LAYERS VARIABLE=layer_count VALUE=0
{% endif %}
[gcode_macro LAYERED_RANDOM_MIX]
gcode:
{% set H = prams.H|default(printer["gcode_macro, layered_random"].layers)|int %}
_LAYERED_RANDOM H={H}