forked from l0b0/paths2openscad
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpaths2openscad.inx
executable file
·77 lines (67 loc) · 3.03 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
<?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="header" type="description" xml:space="preserve">
The height parameter specifies how high in millimeters to
extrude the polygons.
The smoothing parameter describes how smoothly to render
curves. Use smaller values for smoother curves.
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_NNN_mm or
name_NNN_NNN_mm format, the NNN_(NNN_)mm part of
the name is translated into height in milimeters.
If the polygon's description contains line like
height: XXX mm
where XXX is any decimal number (use . as separator),
the height is set to XXX milimeters.
Note that the description has preference over ID.
Otherwise, the height parameter is used
</_param>
<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="smoothness" type="float" min="0.0001" max="5" _gui-text="Smoothing">0.2</param>
<param name="autoheight" type="boolean" _gui-text="Auto Height">false</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.
v0.11
Dan Newman (dan newman @ mtbaldy us)
Josef Skladanka (jskladan @ redhat com)
</_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>