-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_samples.sh
More file actions
executable file
·98 lines (87 loc) · 2.7 KB
/
make_samples.sh
File metadata and controls
executable file
·98 lines (87 loc) · 2.7 KB
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
#!/bin/bash
#
# Generate example STL files for common lithium battery cells.
#
# Usage: ./make_samples.sh [cell type or all]
#
SCADFILE=spotweldhelper.scad
if [ -z "$OPENSCAD" ]; then
OPENSCAD=/usr/bin/openscad
fi
if [ ! -x "$OPENSCAD" ]; then
echo "Cannot find OpenSCAD"
exit 1
fi
CELL_TYPE=$1
if [ -z "$CELL_TYPE" ]; then
CELL_TYPE="all"
fi
if [ "$CELL_TYPE" == "18650" -o "$CELL_TYPE" == "all" ]; then
echo "Generating samples for 18650 cells"
outfile=spotweldhelper_sample_5x18650_axis-8mm_int-magnets.stl
$OPENSCAD -q \
-D Cell_Diameter=18.3 \
-D Cell_Height=65 \
-D Cell_Spacing=18.5 \
-D Integrate_Magnets=1 \
-D Number_of_Cells=5 \
--export-format stl -o $outfile \
$SCADFILE
echo -e "\tSample saved to $outfile"
outfile=spotweldhelper_sample_5x18650_axis-8mm_ext-magnets.stl
$OPENSCAD -q \
-D Cell_Diameter=18.3 \
-D Cell_Height=65 \
-D Cell_Spacing=18.5 \
-D Integrate_Magnets=0 \
-D Number_of_Cells=5 \
--export-format stl -o $outfile \
$SCADFILE
echo -e "\tSample saved to $outfile"
fi
if [ "$CELL_TYPE" == "21700" -o "$CELL_TYPE" == "all" ]; then
echo "Generating samples for 21700 cells"
outfile=spotweldhelper_sample_5x21700_axis-8mm_int-magnets.stl
$OPENSCAD -q \
-D Cell_Diameter=21.3 \
-D Cell_Height=70 \
-D Cell_Spacing=21.5 \
-D Integrate_Magnets=true \
-D Number_of_Cells=5 \
--export-format stl -o $outfile \
$SCADFILE
echo -e "\tSample saved to $outfile"
outfile=spotweldhelper_sample_5x21700_axis-8mm_ext-magnets.stl
$OPENSCAD -q \
-D Cell_Diameter=21.3 \
-D Cell_Height=70 \
-D Cell_Spacing=21.5 \
-D Integrate_Magnets=false \
-D Number_of_Cells=5 \
--export-format stl -o $outfile \
$SCADFILE
echo -e "\tSample saved to $outfile"
fi
if [ "$CELL_TYPE" == "26650" -o "$CELL_TYPE" == "all" ]; then
echo "Generating samples for 26650 cells"
outfile=spotweldhelper_sample_5x26650_axis-8mm_int-magnets.stl
$OPENSCAD -q \
-D Cell_Diameter=26.3 \
-D Cell_Height=65 \
-D Cell_Spacing=26.5 \
-D Integrate_Magnets=true \
-D Number_of_Cells=5 \
--export-format stl -o $outfile \
$SCADFILE
echo -e "\tSample saved to $outfile"
outfile=spotweldhelper_sample_5x26650_axis-8mm_ext-magnets.stl
$OPENSCAD -q \
-D Cell_Diameter=26.3 \
-D Cell_Height=65 \
-D Cell_Spacing=26.5 \
-D Integrate_Magnets=false \
-D Number_of_Cells=5 \
--export-format stl -o $outfile \
$SCADFILE
echo -e "\tSample saved to $outfile"
fi