This repository has been archived by the owner on May 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
/
paths2openscad.inx
executable file
·94 lines (81 loc) · 4.51 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
<?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>
<dependency type="executable" location="extensions">paths2openscad.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
<dependency type="executable" location="extensions">simpletransform.py</dependency>
<dependency type="executable" location="extensions">cubicsuperpath.py</dependency>
<dependency type="executable" location="extensions">cspsubdiv.py</dependency>
<dependency type="executable" location="extensions">bezmisc.py</dependency>
<param name="tab" type="notebook">
<page name="splash" _gui-text="Paths to OpenSCAD">
<param name="fname" type="string" _gui-text="Output file">~/inkscape.scad</param>
<param name="height" type="float" min="0" max="1000" precision="2" _gui-text="Height (mm)">5.0</param>
<_param name="height_help" type="description">Specify how high in millimeters to extrude the polygons.</_param>
<param name="smoothness" type="float" min="0.0001" max="5" _gui-text="Smoothing">0.2</param>
<_param name="smoothness_help" type="description">Define how smoothly to render curves. Use smaller values for smoother curves.</_param>
<param name="autoheight" type="boolean" _gui-text="Auto Height">false</param>
<_param name="autoheight_help" type="description">Set the extruded height for a specific polygon based on its description or ID. See the Auto Height tab.
</_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. Use '{SCAD}' for the openSCAD input and '{STL}' for the STL output in the following </_param>
<!-- CAUTION: keep this command in sync with the default INX_SCAD2STL in paths2openscad.py -->
<param name="scad2stlcmd" type="string" _gui-text=" command: ">openscad '{SCAD}' -o '{STL}'</param>
<param name="stlpost" type="boolean" _gui-text="STL postprocessing">false</param>
<_param name="stlpost_help" type="description">Start e.g. a slicer after running the command above. Use '{STL}' for the STL file with the following</_param>
<!-- CAUTION: keep this command in sync with the default INX_STL_POSTPROCESSING in paths2openscad.py -->
<param name="stlpostcmd" type="string" _gui-text=" command: ">cura '{STL}' &</param>
</page>
<page name="autoheight" _gui-text="Auto Height">
<_param name="autoheight" type="description" xml:space="preserve">
The auto height option sets the extruded height for
a specific polygon based on its description or ID.
If the polygon's ID is in either name_XXX_mm or name_XXXmm
format, then XXX is translated into height in millimeters.
Use . or _ as separator for a decimal number.
Note that all whitespace or comma are saved as '_' in ID.
If the polygon's description contains line like
height: XXX mm
where XXX is any decimal number (use . as separator),
then the height is set to XXX millimeters.
Note that the description has preference over ID.
Otherwise, the height parameter is used.
</_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, first convert objects to paths
with the "Path > Object to Path"
menu item.
Note that the paths must be polygonal.
Non-polygonal paths will not render well
in OpenSCAD. Thus, while you can convert
text to a path, letters with closed loops
will not appear as you expect in OpenSCAD
(e.g., the letter "o").
Inkscape's units of pixels are converted
to millimeters using the SVG Standard's
definition of 90 pixels = 1 inch -- since
inkscape 0.92: 96 pixels = 1 inch.
v0.12
Dan Newman (dan newman @ mtbaldy us)
Josef Skladanka (jskladan @ redhat com)
Juergen Weigert (juergen @ fabmail org)
<!-- keep the version numnber in sync with paths2openscad.py header comments -->
</_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>