-
Notifications
You must be signed in to change notification settings - Fork 18
/
test-bsw-screw-tutorial.scad
157 lines (144 loc) · 4.56 KB
/
test-bsw-screw-tutorial.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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
* Copyright (c) 2019, Gilles Bouissac
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
*
* Description: BSW screw modelisation
* Author: Gilles Bouissac
*/
use <agentscad/lib-screw.scad>
use <agentscad/bsw-screw.scad>
// ----------------------------------------
//
// Showcase
//
// ----------------------------------------
module showcaseWalls( wh1, wh2, ww=200, wp=20 ) {
translate ( [0,wp/2,0] ) {
color( "LightSkyBlue" )
translate ( [0,0,+(wh2+wh1)/2] )
cube( [ww,wp,wh2], center=true );
color( "DodgerBlue" )
translate ( [0,0,0] )
cube( [ww,wp,wh1], center=true );
}
}
module showCase() {
translate ( [+100,0,0] ) {
// 1: Some walls
showcaseWalls (3,10,15);
}
translate ( [+80,0,0] ) {
// 2: Bolt passage
screw = BSW5_32(10,3);
difference() {
showcaseWalls (3,10,15);
bswBoltPassage (screw);
}
}
translate ( [+60,0,0] ) {
// 3: Allen bolt
screw = BSW5_32(10,3);
difference() {
showcaseWalls (3,10,15);
bswBoltPassage (screw);
}
%bswBoltAllen (screw);
}
translate ( [40,0,0] ) {
// 4: Hexagonal bolt
screw = BSW5_32(10,3);
difference() {
showcaseWalls (3,10,15);
bswBoltPassage (screw);
}
%bswBoltHexagonal (screw);
}
translate ( [+20,0,0] ) {
// 5: Tight passage allen
screw = BSW5_32(10,3);
difference() {
showcaseWalls (3,10,15);
bswBoltAllenPassage (screw);
}
%bswBoltAllen (screw);
}
translate ( [-0,0,0] ) {
// 6: Tight passage hexagonal
screw = BSW5_32(10,3);
difference() {
showcaseWalls (3,10,15);
bswBoltHexagonalPassage (screw);
}
%bswBoltHexagonal (screw);
}
translate ( [-20,0,0] ) {
// 7: Nut passage
screw = BSW5_32(10,3);
difference() {
showcaseWalls (3,10,15);
bswBoltHexagonalPassage (screw);
translate( [0,0,screwGetThreadL(screw)] )
bswNutPassage (screw);
}
%bswBoltHexagonal (bswClone(screw,12));
}
translate ( [-40,0,0] ) {
// 8: Hexagonal nut
screw = BSW5_32(10,3);
difference() {
showcaseWalls (3,10,15);
bswBoltHexagonalPassage (screw);
translate( [0,0,screwGetThreadL(screw)] )
bswNutPassage (screw);
}
%bswBoltHexagonal (bswClone(screw,12));
translate( [0,0,screwGetThreadL(screw)] )
%bswNutHexagonal (screw);
}
translate ( [-60,0,0] ) {
// 9: Square nut
screw = BSW5_32(10,3);
difference() {
showcaseWalls (3,10,15);
bswBoltHexagonalPassage (screw);
translate( [0,0,screwGetThreadL(screw)] )
bswNutPassage (screw);
}
%bswBoltHexagonal (bswClone(screw,12));
translate( [0,0,screwGetThreadL(screw)] )
%bswNutSquare (screw);
}
translate ( [-80,0,0] ) {
// 10: Hexagonal nut passage
screw = BSW5_32(10,3);
difference() {
showcaseWalls (3,10,15);
bswBoltHexagonalPassage (screw);
translate( [0,0,screwGetThreadL(screw)] )
bswNutHexagonalPassage (screw);
}
%bswBoltHexagonal (bswClone(screw,12));
translate( [0,0,screwGetThreadL(screw)] )
%bswNutHexagonal (screw);
}
translate ( [-100,0,0] ) {
// 11: Square nut passage
screw = BSW5_32(10,3);
difference() {
translate ( [0,-screwGetSquareToolSize(screw)/2,0] )
showcaseWalls (3,10,15);
bswBoltPassage (screw);
translate( [0,0,screwGetThreadL(screw)-4] )
bswNutSquarePassage (screw);
}
%bswBoltHexagonal (bswClone(screw,12));
translate( [0,0,screwGetThreadL(screw)-3.8] )
%bswNutSquare (screw);
}
}
rotate( [0,180,0] )
showCase( $fn=100 );