forked from 305engineering/Inkscape
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raster2laser_gcode.inx
116 lines (99 loc) · 5.15 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
<?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>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 -->
<!-- Titolo e descrizione -->
<param name="Title" type="description">Raster 2 Laser GCode generator</param>
<param name="Description" type="description">created by 305 Engineering</param>
<param name="tabs" type="notebook">
<page name="main" gui_text="Main">
<!-- Opzioni di esportazione dell'immagine -->
<param name="directory" type="string" gui-text="Export directory"></param>
<param name="filename" type="string" gui-text="File Name"></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</_item>
<_item value="2">2 pixel/mm</_item>
<_item value="5">5 pixel/mm</_item>
<_item value="10">10 pixel/mm</_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">128</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>
<!-- Velocità Nero e spostamento -->
<param name="speed_ON" type="int" min="1" max="5000" gui-text="Engraving speed">200</param>
<!-- FLIP = coordinate Cartesiane (False) Coordinate "informatiche" (True) -->
<param name="flip_y" type="boolean" gui-text="Flip Y">false</param>
<!-- Anteprima = Solo immagine BN -->
<param name="preview_only" type="boolean" gui-text="Preview only">false</param>
<param name="p_only" type="description">If "Preview only" is true the gcode file will not be generated.</param>
</page>
<page name="post" gui_text="Post config">
<param name="post_pre" type="string" gui-text="Preamble">G21{N}G90{N}</param>
<param name="post_on" type="string" gui-text="Laser on"></param>
<param name="post_detached_on" type="boolean" gui-text="Detached (new line) ON">true</param>
<param name="post_off" type="string" gui-text="Laser off"></param>
<param name="post_detached_off" type="boolean" gui-text="Detached (new line) OFF">true</param>
<param name="post_intens" type="string" gui-text="Intensity"></param>
<param name="post_detached_intens" type="boolean" gui-text="Detached (new line) intensity">true</param>
<param name="post_feed" type="string" gui-text="Feed move"></param>
<param name="post_rapid" type="string" gui-text="Rapid move"></param>
<param name="post_footer" type="string" gui-text="Footer">M05{N}M02{N}{N}</param>
<param name="post_suffix" type="string" gui-text="Filename suffix (extension)"></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>
<!-- Dove comparirà lo script all'interno del menù estensioni -->
<!-- " Estensioni => 305 Engineering => prova_estensione " -->
<effects-menu>
<submenu name="305 Engineering"/>
</effects-menu>
</effect>
<!-- Script python da eseguire -->
<script>
<command reldir="extensions" interpreter="python">raster2laser_gcode.py</command>
</script>
</inkscape-extension>