Skip to content

Commit 6079e6d

Browse files
committed
Merge pull request #13 from traverseda/master
Mergining libtrianlges
2 parents 5f4dd16 + 0356f2f commit 6079e6d

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

libtriangles.scad

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//Copyright (C) 2013 Alex Davies
2+
//License: LGPL 2.1 or later
3+
//todo, make library work with negative lengths by adding triangles to the inside of every surface. basicaly copy and paste the current triangles set and reverse the first and last digit of every triangle. In 4 character traingles switcht the middle ones around as well. Not sure if that' actually useful though.
4+
5+
module rightpyramid(rightpyramidx, rightpyramidy, rightpyramidz) {
6+
polyhedron ( points = [[0,0,0],
7+
[rightpyramidx, 0, 0],
8+
[0, rightpyramidy, 0],
9+
[rightpyramidx, rightpyramidy, 0],
10+
[rightpyramidx/2, rightpyramidy, rightpyramidz]],
11+
12+
triangles = [[0,1,2],[2,1,3],[4,1,0],[3,1,4],[2,3,4],[0,2,4]]);
13+
14+
}
15+
16+
module cornerpyramid(cornerpyramidx, cornerpyramidy, cornerpyramidz) {
17+
polyhedron ( points = [[0,0,0],
18+
[cornerpyramidx, 0, 0],
19+
[0, cornerpyramidy, 0],
20+
[cornerpyramidx, cornerpyramidy, 0],
21+
[0, cornerpyramidy, cornerpyramidz]],
22+
23+
triangles = [[0,1,2],[2,1,3],[4,1,0],[3,1,4],[2,3,4],[0,2,4]]);
24+
25+
}
26+
27+
module eqlpyramid(eqlpyramidx, eqlpyramidy, eqlpyramidz) {
28+
polyhedron ( points = [[0,0,0],
29+
[eqlpyramidx, 0, 0],
30+
[0, eqlpyramidy, 0],
31+
[eqlpyramidx, eqlpyramidy, 0],
32+
[eqlpyramidx/2, eqlpyramidy/2, eqlpyramidz]],
33+
34+
triangles = [[0,1,2],[2,1,3],[4,1,0],[3,1,4],[2,3,4],[0,2,4]]);
35+
36+
}
37+
38+
39+
module rightprism(rightprismx,rightprismy,rightprismz){
40+
polyhedron ( points = [[0,0,0],
41+
[rightprismx,0,0],
42+
[rightprismx,rightprismy,0],
43+
[0,rightprismy,0],
44+
[0,rightprismy,rightprismz],
45+
[0,0,rightprismz]],
46+
triangles = [[0,1,2,3],[5,1,0],[5,4,2,1],[4,3,2],[0,3,4,5]]);
47+
}
48+
49+
50+
51+
module eqlprism(rightprismx,rightprismy,rightprismz){
52+
polyhedron ( points = [[0,0,0],
53+
[rightprismx,0,0],
54+
[rightprismx,rightprismy,0],
55+
[0,rightprismy,0],
56+
[rightprismx/2,rightprismy,rightprismz],
57+
[rightprismx/2,0,rightprismz]],
58+
triangles = [[0,1,2,3],[5,1,0],[5,4,2,1],[4,3,2],[0,3,4,5]]);
59+
}
60+

0 commit comments

Comments
 (0)