forked from l0b0/paths2openscad
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathpaths2openscad.inx
executable file
·150 lines (124 loc) · 8.38 KB
/
paths2openscad.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
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
<_name>Paths to OpenSCAD</_name>
<id>command.extrude.openscad</id>
<dependency type="extension">org.inkscape.output.svg.inkscape</dependency>
<param name="tab" type="notebook">
<page name="splash" gui-text="Paths to OpenSCAD">
<param name="fname" type="path" gui-text="Output file" mode="file_new" filetypes="scad">{NAME}.scad</param>
<_param name="fname_help" type="description">Use '{NAME}.scad' here to use the name from svg.</_param>
<param name="zsize" type="float" min="0" max="1000" precision="2" gui-text="Depth (Z) [mm]">5.0</param>
<_param name="zsize_help" type="description">Default 3D extrude depth (when no zsize is parsed from an svg object).</_param>
<param name="parsedesc" type="boolean" gui-text="Description parsing">true</param>
<_param name="parsedesc_help" type="description">Read the extruded zsize, zoffset, scale per svg object from its description or ID. See the Extrusion Syntax tab for details.</_param>
<_param name="spacer" type="description"><!-- --></_param>
<param name="scadview" type="boolean" gui-text="View in OpenSCAD">false</param>
<_param name="scadview_help" type="description">Start OpenSCAD to view the 3D-model.</_param>
<_param name="spacer" type="description"><!-- --></_param>
<param name="scad2stl" type="boolean" gui-text="Convert to STL">false</param>
<_param name="scad2stl_help" type="description">Also save an .stl file next to the specified output file.</_param>
<_param name="spacer" type="description"><!-- --></_param>
<param name="stlpost" type="boolean" gui-text="STL postprocessing">false</param>
<_param name="stlpost_help" type="description">Start e.g. a slicer after converting to STL. See the Commands tab for details.</_param>
<param name="stlmodule" type="boolean" gui-text="Only create a module">false</param>
<_param name="spacer" type="description"><!-- --></_param>
</page>
<page name="tuning" gui-text="Tuning">
<param name="smoothness" type="float" min="0.0001" max="5" precision="4" gui-text="Smoothing">0.2</param>
<_param name="smoothness_help" type="description">Used when rendering curves. Smaller values are smoother. Range: 0.0001 to 5
</_param>
<param type="float" name="chamfer" min="0.0" gui-text="Add chamfer radius [mm]" xml:lang="de">0</param>
<param name="chamfer_fn" type="optiongroup" appearance="minimal" gui-text="Chamfer precision ($fn)">
<option value="4">4: Rough (fast)</option>
<option value="12">12: Medium (slow)</option>
<option value="16">16: Fine (slower)</option>
<option value="32">32: Perfect (slowest)</option>
</param>
<_param name="outline_header" type="description" appearance="header">Outline Mode</_param>
<_param name="outline_help" type="description">Objects are extruded into 3D either in normal mode, or in outline mode. Normally filled areas are extruded, ignoring the line width. Objects with no fill are rendered in outline mode.
Note: the 'Scale: XX %' instruction has no effect in outline mode.</_param>
<param name="min_line_width" type="float" min="0.1" max="10" gui-text="Minimum line width [mm]">1.0</param>
<param type="float" name="line_width_scale_perc" min="1" max="10000" gui-text="Scale line width [%]">100.0</param>
<param name="line_fn" type="optiongroup" appearance="minimal" gui-text="Line width precision ($fn)">
<option value="4">4: Rough (fast)</option>
<option value="8">8: Medium (slow)</option>
<option value="16">16: Fine (slower)</option>
<option value="32">32: Perfect (slowest)</option>
</param>
<param name="force_line" type="boolean" gui-text="Force outline mode, ignore fill">False</param>
<_param name="spacer" type="description"><!-- --></_param>
</page>
<page name="commands" gui-text="Commands">
<_param name="commands_help" type="description">Placeholders: You can use '{NAME}.scad' for the OpenSCAD file to read as specified as 'Output file' in the main tab. You can use '{NAME}.stl' for an STL file to write.
</_param>
<_param name="commands_help_warn" type="description">
Beware, Windows and Mac users: The shipped defaults are for Linux.</_param>
<_param name="commands_help_mac" type="description">
Mac: /Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD</_param>
<_param name="spacer" type="description"><!-- --></_param>
<!-- CAUTION: keep this command in sync with the default INX_SCADVIEW in paths2openscad.py -->
<param name="scadviewcmd" type="string" gui-text="View in OpenSCAD: ">openscad '{NAME}.scad'</param>
<_param name="scadviewcmd_help" type="description">Is only started, if no command of the same name is running. Always started non-blocking. A running OpenSCAD automatically picks up changed file contents. Defaults:</_param>
<_param name="scadviewcmd_default_linux" type="description">Linux: openscad '{NAME}.scad'</_param>
<_param name="spacer" type="description"><!-- --></_param>
<!-- CAUTION: keep this command in sync with the default INX_SCAD2STL in paths2openscad.py -->
<param name="scad2stlcmd" type="string" gui-text="Convert to STL: ">openscad '{NAME}.scad' -o '{NAME}.stl'</param>
<_param name="stlpostcmd_help" type="description">Automatically run, when STL postprocessing is requested.</_param>
<_param name="spacer" type="description"><!-- --></_param>
<!-- CAUTION: keep this command in sync with the default INX_STL_POSTPROCESSING in paths2openscad.py -->
<param name="stlpostcmd" type="string" gui-text="STL postprocessing: ">cura '{NAME}.stl' &</param>
<_param name="stlpostcmd_help" type="description">Append an '&' for non-blocking.</_param>
<_param name="spacer" type="description"><!-- --></_param>
</page>
<page name="extrusion" gui-text="Extrusion Syntax">
<_param name="extrusion_1" type="description" xml:space="preserve">The depth (Z-Axis) and other parameters can be defined through an svg object's description. The menu 'Object->Object Properties ...' (Shift-Ctrl-O) shows details of one selected object.
If an object's ID is in either name_XXX_mm or name_XXXmm
format, then XXX is translated into zsize in millimeters.
Use . or _ as separator for a decimal number.
Note that any whitespace or comma is saved as '_' in the ID.
</_param>
<_param name="extrusion_2" type="description" appearance="header">Syntax for the object property description</_param>
<_param name="extrusion_3" type="description" xml:space="preserve">Depth: 10 mm
Linear extrusion length (or Z-Size) of the object.
If the length is prefixed with "a", the object is "antimatter"
and is part of the difference set, which is cut away from all
other objects.
Offset: 4.5 mm
Move an object upwards to create a balcony (or window).
Taper: 90 % or Taper: 120,60 %
Scale the object along its Z-axis. The bottom surface always
is as drawn, but the top surface is scaled to this value.
If two values are given (separated by commas), different
scaling applies along X- and Y-axis.
Parameters in the objects take precedence over groups.</_param>
</page>
<page name="info" gui-text="About ...">
<_param name="aboutpage" type="description" xml:space="preserve">
This extension converts Inkscape paths to
extruded polygons in OpenSCAD. Before
using, some objects must first be converted to paths
with the "Path > Object to Path" menu item.
Inkscape's units of pixels are converted
to millimeters using the SVG standard's
definition of 96 px = 1 inch = 25.4 mm.
(Before Inkscape 0.92 the standard was 90 px per inch,
Adobe products often use 75 px per inch)
v0.27
Dan Newman (dan newman @ mtbaldy us)
Josef Skladanka (jskladan @ redhat com)
Juergen Weigert (juergen @ fabmail org)
Find updates at https://github.com/fablabnbg/inkscape-paths2openscad/releases
<!-- keep the version number in sync with paths2openscad.py header comments and translated copies -->
</_param>
</page>
</param>
<effect needs-live-preview="false">
<object-type>all</object-type>
<effects-menu>
<submenu _name="Generate from Path"/>
</effects-menu>
</effect>
<script>
<command reldir="extensions" interpreter="python">paths2openscad.py</command>
</script>
</inkscape-extension>