-
Notifications
You must be signed in to change notification settings - Fork 2
/
magnet_bars.scad
43 lines (37 loc) · 1.31 KB
/
magnet_bars.scad
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
//
// CADLibrary Copyright Bruno Adelé 2024
// blog.jesuislibre.org
//
// This file is part of CADLibrary.
//
// CADLibrary is free software: you can redistribute it and/or modify it under the terms of the
// GNU General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// CADLibrary is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with CADLibrary.
// If not, see <https://www.gnu.org/licenses/>.
//
include <NopSCADlib/utils/core/core.scad>
include <../vitamins/magnet_bars.scad>
module magnet_bars()
{
depth = mth_depth(magnetbars[0]);
posx1 = mth_width(magnetbars[0]) / 2;
posx2 = mth_width(magnetbars[0]) + 10 + mth_width(magnetbars[1] / 2);
posx3 = mth_width(magnetbars[2]) / 2;
posxyz = [[posx1, 2 * depth + 10, 0], [posx2, 2 * depth + 10, 0], [posx3, depth, 0]];
for (i = [0:len(magnetbars) - 1])
{
translate(posxyz[i])
{
magnet_bar(magnetbars[i]);
}
}
}
if ($preview)
magnet_bars();