3
3
4
4
PRELIM = """// OpenSCAD file automatically generated by svg2cookiercutter.py
5
5
wallHeight = 10;
6
- wallBaseWidth = 3;
7
- wallBaseThickness = 1.5;
8
- minWallThickness = 1;
9
- maxWallThickness = 3;
10
- insideWallBaseWidth = 2;
11
- insideWallBaseThickness = 1.5;
12
- minInsideWallThickness = 1;
13
- maxInsideWallThickness = 3;
6
+ wallFlareWidth = 3;
7
+ wallFlareThickness = 1.5;
8
+ minWallWidth = 1;
9
+ maxWallWidth = 3;
10
+ insideWallFlareWidth = 2;
11
+ insideWallFlareThickness = 1.5;
12
+ minInsideWallWidth = 1;
13
+ maxInsideWallWidth = 3;
14
14
featureHeight = 6;
15
15
minFeatureThickness = 0.8;
16
16
maxFeatureThickness = 3;
17
- featureHolderThickness = 1;
17
+ connectorThickness = 1;
18
18
size = $OVERALL_SIZE$;
19
19
20
20
module dummy() {}
@@ -53,19 +53,19 @@ def toCode(self, pathCount):
53
53
if not self .base :
54
54
code .append ('render(convexity=10) linear_extrude(height=(' + self .height + ')) ribbon(' + path + ',thickness=' + self .width + ');' )
55
55
if self .wall :
56
- baseRibbon = 'render(convexity=10) linear_extrude(height=wallBaseThickness ) ribbon(' + path + ',thickness=wallBaseWidth );'
56
+ baseRibbon = 'render(convexity=10) linear_extrude(height=wallFlareThickness ) ribbon(' + path + ',thickness=wallFlareWidth );'
57
57
code .append ('difference() {' )
58
58
code .append (' ' + baseRibbon );
59
- code .append (' translate([0,0,-0.01]) linear_extrude(height=wallBaseThickness +0.02) polygon(points=' + path + ');' )
59
+ code .append (' translate([0,0,-0.01]) linear_extrude(height=wallFlareThickness +0.02) polygon(points=' + path + ');' )
60
60
code .append ('}' )
61
61
elif self .insideWall :
62
- baseRibbon = 'render(convexity=10) linear_extrude(height=insideWallBaseThickness ) ribbon(' + path + ',thickness=insideWallBaseWidth );'
62
+ baseRibbon = 'render(convexity=10) linear_extrude(height=insideWallFlareThickness ) ribbon(' + path + ',thickness=insideWallFlareWidth );'
63
63
code .append ('intersection() {' )
64
64
code .append (' ' + baseRibbon );
65
- code .append (' translate([0,0,-0.01]) linear_extrude(height=insideWallBaseThickness +0.02) polygon(points=' + path + ');' )
65
+ code .append (' translate([0,0,-0.01]) linear_extrude(height=insideWallFlareThickness +0.02) polygon(points=' + path + ');' )
66
66
code .append ('}' )
67
67
else :
68
- code .append ('render(convexity=10) linear_extrude(height=featureHolderThickness ) polygon(points=' + path + ');' )
68
+ code .append ('render(convexity=10) linear_extrude(height=connectorThickness ) polygon(points=' + path + ');' )
69
69
return code
70
70
71
71
def isRed (rgb ):
@@ -89,11 +89,11 @@ def svgToCookieCutter(filename, tolerance=0.1, strokeAll = False):
89
89
elif strokeAll or path .svgState .stroke is not None :
90
90
line .base = False
91
91
if isRed (path .svgState .stroke ):
92
- line .width = "min(maxWallThickness ,max(%.3f,minWallThickness ))" % path .svgState .strokeWidth
92
+ line .width = "min(maxWallWidth ,max(%.3f,minWallWidth ))" % path .svgState .strokeWidth
93
93
line .height = "wallHeight"
94
94
line .wall = True
95
95
elif isGreen (path .svgState .stroke ):
96
- line .width = "min(maxInsideWallThickness ,max(%.3f,minInsideWallThickness ))" % path .svgState .strokeWidth
96
+ line .width = "min(maxInsideWallWidth ,max(%.3f,minInsideWallWidth ))" % path .svgState .strokeWidth
97
97
line .height = "wallHeight"
98
98
line .insideWall = True
99
99
else :
0 commit comments