Skip to content

Commit 8555b0c

Browse files
committed
Small bevel added
- small bevel for side edges - added script to generate sample files - preview updated
1 parent 67144ae commit 8555b0c

File tree

5 files changed

+126
-13
lines changed

5 files changed

+126
-13
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.*.swp
2+
*.stl

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ four groups of settings that can be adjusted.
6969
This sets the mimimum wall thickness in multiples of extrustion width
7070
for thin walls, e.g. between the magnet and battery cell and the "tip"
7171
between the cell cutouts.
72-
- **Bevel large** \
73-
Both objects are beveled at certain edges. This is the bevel size in
74-
millimeters.
75-
76-
72+
- **Bevel Large** \
73+
Both objects are beveled at certain edges. This is the larger bevel
74+
size in millimeters.
75+
- **Bevel Small** \
76+
Both objects are beveled at certain edges. This is the small bevel
77+
size in millimeters.

images/preview.png

522 KB
Loading

make_samples.sh

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/bin/bash
2+
#
3+
# Generate example STL files for common lithium battery cells.
4+
#
5+
# Usage: ./make_samples.sh [cell type or all]
6+
#
7+
8+
SCADFILE=spotweldhelper.scad
9+
10+
if [ -z "$OPENSCAD" ]; then
11+
OPENSCAD=/usr/bin/openscad
12+
fi
13+
14+
if [ ! -x "$OPENSCAD" ]; then
15+
echo "Cannot find OpenSCAD"
16+
exit 1
17+
fi
18+
19+
CELL_TYPE=$1
20+
21+
if [ -z "$CELL_TYPE" ]; then
22+
CELL_TYPE="all"
23+
fi
24+
25+
if [ "$CELL_TYPE" == "18650" -o "$CELL_TYPE" == "all" ]; then
26+
echo "Generating samples for 18650 cells"
27+
outfile=spotweldhelper_sample_5x18650_axis-8mm_int-magnets.stl
28+
$OPENSCAD -q \
29+
-D Cell_Diameter=18.3 \
30+
-D Cell_Height=65 \
31+
-D Cell_Spacing=18.5 \
32+
-D Integrate_Magnets=1 \
33+
-D Number_of_Cells=5 \
34+
--export-format stl -o $outfile \
35+
$SCADFILE
36+
echo -e "\tSample saved to $outfile"
37+
38+
outfile=spotweldhelper_sample_5x18650_axis-8mm_ext-magnets.stl
39+
$OPENSCAD -q \
40+
-D Cell_Diameter=18.3 \
41+
-D Cell_Height=65 \
42+
-D Cell_Spacing=18.5 \
43+
-D Integrate_Magnets=0 \
44+
-D Number_of_Cells=5 \
45+
--export-format stl -o $outfile \
46+
$SCADFILE
47+
echo -e "\tSample saved to $outfile"
48+
fi
49+
50+
if [ "$CELL_TYPE" == "21700" -o "$CELL_TYPE" == "all" ]; then
51+
echo "Generating samples for 21700 cells"
52+
outfile=spotweldhelper_sample_5x21700_axis-8mm_int-magnets.stl
53+
$OPENSCAD -q \
54+
-D Cell_Diameter=21.3 \
55+
-D Cell_Height=70 \
56+
-D Cell_Spacing=21.5 \
57+
-D Integrate_Magnets=true \
58+
-D Number_of_Cells=5 \
59+
--export-format stl -o $outfile \
60+
$SCADFILE
61+
echo -e "\tSample saved to $outfile"
62+
63+
outfile=spotweldhelper_sample_5x21700_axis-8mm_ext-magnets.stl
64+
$OPENSCAD -q \
65+
-D Cell_Diameter=21.3 \
66+
-D Cell_Height=70 \
67+
-D Cell_Spacing=21.5 \
68+
-D Integrate_Magnets=false \
69+
-D Number_of_Cells=5 \
70+
--export-format stl -o $outfile \
71+
$SCADFILE
72+
echo -e "\tSample saved to $outfile"
73+
fi
74+
75+
if [ "$CELL_TYPE" == "26650" -o "$CELL_TYPE" == "all" ]; then
76+
echo "Generating samples for 26650 cells"
77+
outfile=spotweldhelper_sample_5x26650_axis-8mm_int-magnets.stl
78+
$OPENSCAD -q \
79+
-D Cell_Diameter=26.3 \
80+
-D Cell_Height=65 \
81+
-D Cell_Spacing=26.5 \
82+
-D Integrate_Magnets=true \
83+
-D Number_of_Cells=5 \
84+
--export-format stl -o $outfile \
85+
$SCADFILE
86+
echo -e "\tSample saved to $outfile"
87+
88+
outfile=spotweldhelper_sample_5x26650_axis-8mm_ext-magnets.stl
89+
$OPENSCAD -q \
90+
-D Cell_Diameter=26.3 \
91+
-D Cell_Height=65 \
92+
-D Cell_Spacing=26.5 \
93+
-D Integrate_Magnets=false \
94+
-D Number_of_Cells=5 \
95+
--export-format stl -o $outfile \
96+
$SCADFILE
97+
echo -e "\tSample saved to $outfile"
98+
fi

spotweldhelper.scad

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ Bevel_Small = 1.0; // 0.1
100100

101101
// ************ INTERNAL VARIABLES ************
102102
module __Customizer_Limit__ () {}
103-
$fa=1;
104-
$fs=0.1;
103+
$fn=96;
105104

106105

107106
// calculated variables
@@ -198,12 +197,14 @@ module base_holder()
198197
polygon([
199198
[0, 0],
200199
[full_base_width, 0],
201-
[full_base_width, 2*Axis_Diameter],
200+
[full_base_width, 2*Axis_Diameter - Bevel_Small],
201+
[full_base_width - Bevel_Small, 2*Axis_Diameter],
202202
[base_width+base_diff/2, 2*Axis_Diameter],
203-
[base_width+base_diff/2-Bevel_Large, 2*Axis_Diameter-Bevel_Large],
204-
[base_diff/2+Bevel_Large, 2*Axis_Diameter-Bevel_Large],
203+
[base_width+base_diff/2 - Bevel_Large, 2*Axis_Diameter - Bevel_Large],
204+
[base_diff/2 + Bevel_Large, 2*Axis_Diameter - Bevel_Large],
205205
[base_diff/2, 2*Axis_Diameter],
206-
[0, 2*Axis_Diameter]
206+
[Bevel_Small, 2*Axis_Diameter],
207+
[0, 2*Axis_Diameter - Bevel_Small]
207208
]);
208209
}
209210

@@ -224,6 +225,7 @@ module base_slider()
224225
translate([0, base_offset_y, 0])
225226
difference()
226227
{
228+
// the vertical base object and foot
227229
translate([-base_offset_x, 0, 0])
228230
union()
229231
{
@@ -237,10 +239,20 @@ module base_slider()
237239
[0, slider_depth - Bevel_Large]
238240
]);
239241

240-
translate([-base_diff/2, 0, 0])
241-
cube([full_base_width, slider_depth-Bevel_Large, 2*Axis_Diameter]);
242+
translate([-base_diff/2, slider_depth-Bevel_Large, 0])
243+
rotate([90, 0, 0])
244+
linear_extrude(height=slider_depth-Bevel_Large)
245+
polygon([
246+
[0, 0],
247+
[full_base_width, 0],
248+
[full_base_width, 2*Axis_Diameter - Bevel_Small],
249+
[full_base_width - Bevel_Small, 2*Axis_Diameter],
250+
[Bevel_Small, 2*Axis_Diameter],
251+
[0, 2*Axis_Diameter - Bevel_Small]
252+
]);
242253
}
243254

255+
// the cell cutouts
244256
union()
245257
{
246258
translate([0, -base_offset_y, 0])

0 commit comments

Comments
 (0)