-
Notifications
You must be signed in to change notification settings - Fork 2
/
raster2laser_gcode.inx
169 lines (132 loc) · 9.26 KB
/
raster2laser_gcode.inx
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
44
45
46
47
48
49
50
51
52
53
54
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
<?xml version="1.0" encoding="UTF-8"?>
<!-- Comment -->
<!-- -->
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<!-- Nome con cui compare l'estensione nel menù, fa casino con gli underscore _ -->
<name>K40 Raster 2 Laser GCode generator</name>
<!-- il campo ID deve essere univoco -->
<id>com.305engineering.raster2laser_gcode</id>
<!-- Dipendenze, basta solo lo script python principale -->
<dependency type="executable" location="extensions">raster2laser_gcode.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
<!-- Parametri di input per lo script python che vengono visualizzati nel widget creato da inkscape-->
<!-- vengono generati in ordine di come vengono scritti -->
<param name="tab" type="notebook">
<page name="page_1" gui-text="PAGE 1">
<!-- Titolo e descrizione -->
<param name="Title" type="description">K40 Raster 2 Laser GCode generator</param>
<param name="Description" type="description">created by 305 Engin. and modified By Awesome.tech</param>
<!-- Opzioni di esportazione dell'immagine -->
<param name="directory" type="string" gui-text="Export directory">C:/temp</param>
<param name="filename" type="string" gui-text="File Name">rasterfile.gcode</param>
<param name="add-numeric-suffix-to-filename" type="boolean" gui-text="Add numeric suffix to filename">true</param>
<param name="bg_color" type="enum" gui-text="Replace transparency with">
<_item value="#ffffff">White</_item>
<_item value="#000000">Black</_item>
</param>
<param name="resolution" type="enum" gui-text="Resolution">
<_item value="1">1 pixel/mm - 25 dpi</_item>
<_item value="2">2 pixel/mm - 50 dpi</_item>
<_item value="5">5 pixel/mm - 75 dpi</_item>
<_item value="10">10 pixel/mm - 254 dpi</_item>
<_item value="15">15 pixel/mm - 382 dpi</_item>
</param>
<!-- Come convertire in scala di grigi -->
<param name="grayscale_type" type="enum" gui-text="Color to Grayscale conversion">
<_item value="1">0.21R + 0.71G + 0.07B</_item>
<_item value="2">(R+G+B)/3</_item>
<_item value="3">R</_item>
<_item value="4">G</_item>
<_item value="5">B</_item>
<_item value="6">Max Color</_item>
<_item value="7">Min Color</_item>
</param>
<!-- Modalità di conversione in Bianco e Nero -->
<param name="conversion_type" type="enum" gui-text="B/W conversion algorithm ">
<_item value="1">B/W fixed threshold</_item>
<_item value="2">B/W random threshold</_item>
<_item value="3">Halftone</_item>
<_item value="4">Halftone row</_item>
<_item value="5">Halftone column</_item>
<_item value="6">Grayscale</_item>
</param>
<!-- Opzioni modalita -->
<param name="BW_threshold" type="int" min="1" max="254" gui-text="B/W threshold (not gray scale option)">128</param>
<param name="BWBlackvalue" type="int" min="1" max="254" gui-text="B/W max black value (not gray scale option)">254</param>
<param name="grayscale_resolution" type="enum" gui-text="Grayscale resolution ">
<_item value="1">256</_item>
<_item value="2">128</_item> <!-- 256/2 -->
<_item value="4">64</_item> <!-- 256/4 -->
<_item value="8">32</_item> <!-- 256/8 -->
<_item value="16">16</_item> <!-- 256/16 -->
<_item value="32">8</_item> <!-- 256/32 -->
</param>
<param name="Grey_offset" type="int" min="-50" max="30" gui-text="Grey Offset (gray scale option)">0</param>
<param name="Grey_multiplier" type="float" min="0.5" max="1.8" gui-text="Compression/expansion (gray scale option)">1.0</param>
<!-- Velocità Nero e spostamento -->
<param name="speed_ON" type="int" min="1" max="3000" appearance="full" gui-text="Engraving speed">1000</param>
<!-- $30 Value DRG -->
<param name="change30" type="boolean" gui-text="Modify $30 Value?">false</param>
<param name="30warn" type="description">Sends a $30=xxxx command at start of job. CAUTION - Becomes permanant in EEPROM after 10,000 times
USE ONLY WHEN NECESSARY</param-->
<param name="30_Value" type="int" min="1" max="3000" appearance="full" gui-text="$30 Value">1000</param>
</page>
<page name="page_2" gui-text="PAGE 2">
<!-- FLIP = coordinate Cartesiane (False) Coordinate "informatiche" (True) -->
<param name="flip_y" type="boolean" gui-text="Flip Y-Axis">true</param>
<!-- Homing -->
<param name="homing" type="enum" gui-text="Homing ?">
<_item value="1">Yes - $H </_item>
<_item value="2">Yes - G0</_item>
<_item value="3">No Homing</_item>
</param>
<!-- G54-G59 workspace coordinates -->
<param name="g54_value" type="enum" gui-text="Workspace Coordinates ">
<_item value="0">No G54-G59 (Work position X0 Y0)</_item>
<_item value="1">Use G55 (Work position 1)</_item>
<_item value="2">Use G56 (Work position 2)</_item>
<_item value="3">Use G57 (Work position 3)</_item>
<_item value="4">Use G58 (Work position 4)</_item>
<_item value="5">Use G59 (Work position 5)</_item>
</param>
<param name="g54_msg" type="description">Uses values you set for G55-G59 as workspace coordinates at start of engraving. Returns to the position you set for G54 at end of job.</param-->
<param name="offset" type="boolean" gui-text="G0 XY Offsets from true home.">false</param>
<param name="offsetd" type="description">Offsets from current position to the right by X-Offset and down by Y-Offset at start of engraving. Gives a left and top margin and can help to center work on the target canvas.</param-->
<param name="xoffset" type="float" precision="2" min="0" max="100" _gui-text="G0 X-Offset from left home position in milimeters:">0.00</param>
<param name="yoffset" type="float" precision="2" min="0" max="100" _gui-text="G0 Y-Offset from top home position in milimeters:">0.00</param-->
</page>
<page name="page_3" gui-text="PAGE 3">
<param name="speedup" type="int" min="1000" max="10000" appearance="full" gui-text="Whitespace acceleration">3000</param>
<param name="speedupmsg" type="description">Additional speed for accelerating over whitespace</param-->
<param name="minPWM" type="int" min="30" max="100" appearance="full" gui-text="Minimum PWM">70</param>
<param name="minPWMmsg" type="description">PWM less than this will be changed to S0 since it is too light to be visible - 70 is the default</param-->
<param name="laseron" type="string" gui-text="Laser ON Command">M4</param>
<param name="laseroff" type="string" gui-text="Laser OFF Command">M5</param>
<!-- Anteprima = Solo immagine BN -->
<!--param name="preview_only" type="boolean" gui-text="Preview only">false</param-->
<!--param name="p_only" type="description">If checked the gcode file will not be generated.</param-->
<!--param name="stream" type="boolean" gui-text="Stream it">false</param-->
<!--param name="s_only" type="description">If checked the file will be streamed to Gerbil.</param-->
<param name="streaming" type="optiongroup" _gui-text="Select Gcode output option: ">
<option value="1">Preview only output</option>
<option value="2">File output</option>
<option value="3">Stream output</option>
</param>
</page>
</param>
<!-- Per togliere la casella Antepima diretta bisogna sostituire <effect> con <effect needs-live-preview="false"> -->
<!-- <effect> -->
<!-- <effect needs-live-preview="false"> -->
<effect needs-live-preview="false">
<object-type>all</object-type>
<!-- internal extensions menu -->
<!-- " Extension => 305 Engineering => prova_estensione " -->
<effects-menu>
<submenu name="K40 Generate Laser Raster Gcode"/>
</effects-menu>
</effect>
<!-- Script python da eseguire -->
<script>
<command reldir="extensions" interpreter="python">raster2laser_gcode.py</command>
</script>
</inkscape-extension>