Added my libtriangles, plus the "examples" folder

This commit is contained in:
traverseda 2013-02-15 17:02:36 -04:00
parent 8930770b3a
commit 3aa8ba99be
3 changed files with 308 additions and 0 deletions

View file

@ -0,0 +1,10 @@
use <../libtriangles.scad>;
//all of these follow the (X,Y,Z) syntax
translate(v = [0, 0, 0])eqlpyramid(10,20,30);
translate(v = [20, 0, 0]) rightpyramid(10,20,30);
translate(v = [40, 0, 0]) cornerpyramid(10,20,30);
translate(v = [60, 0, 0]) rightprism(10,20,30);
translate(v = [80, 0, 0]) eqlprism(10,20,30);

240
examples/example.stl Normal file
View file

@ -0,0 +1,240 @@
solid OpenSCAD_Model
facet normal -0.986394 0 0.164399
outer loop
vertex 0 20 0
vertex 0 0 0
vertex 5 10 30
endloop
endfacet
facet normal 0 -0.948683 0.316228
outer loop
vertex 5 10 30
vertex 0 0 0
vertex 10 0 0
endloop
endfacet
facet normal -0 -0 -1
outer loop
vertex 0 0 0
vertex 0 20 0
vertex 10 0 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 10 0 0
vertex 0 20 0
vertex 10 20 0
endloop
endfacet
facet normal -0 0.948683 0.316228
outer loop
vertex 10 20 0
vertex 0 20 0
vertex 5 10 30
endloop
endfacet
facet normal 0.986394 -0 0.164399
outer loop
vertex 10 20 0
vertex 5 10 30
vertex 10 0 0
endloop
endfacet
facet normal -0.986394 0 0.164399
outer loop
vertex 20 20 0
vertex 20 0 0
vertex 25 20 30
endloop
endfacet
facet normal 0 -0.83205 0.5547
outer loop
vertex 25 20 30
vertex 20 0 0
vertex 30 0 0
endloop
endfacet
facet normal -0 -0 -1
outer loop
vertex 20 0 0
vertex 20 20 0
vertex 30 0 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 30 0 0
vertex 20 20 0
vertex 30 20 0
endloop
endfacet
facet normal -0 1 0
outer loop
vertex 30 20 0
vertex 20 20 0
vertex 25 20 30
endloop
endfacet
facet normal 0.986394 -0 0.164399
outer loop
vertex 30 20 0
vertex 25 20 30
vertex 30 0 0
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 40 20 0
vertex 40 0 0
vertex 40 20 30
endloop
endfacet
facet normal 0 -0.83205 0.5547
outer loop
vertex 40 20 30
vertex 40 0 0
vertex 50 0 0
endloop
endfacet
facet normal -0 -0 -1
outer loop
vertex 40 0 0
vertex 40 20 0
vertex 50 0 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 50 0 0
vertex 40 20 0
vertex 50 20 0
endloop
endfacet
facet normal -0 1 0
outer loop
vertex 50 20 0
vertex 40 20 0
vertex 40 20 30
endloop
endfacet
facet normal 0.948683 -0 0.316228
outer loop
vertex 50 20 0
vertex 40 20 30
vertex 50 0 0
endloop
endfacet
facet normal -1 -0 -0
outer loop
vertex 60 0 0
vertex 60 0 30
vertex 60 20 0
endloop
endfacet
facet normal -1 0 0
outer loop
vertex 60 20 0
vertex 60 0 30
vertex 60 20 30
endloop
endfacet
facet normal 0 -1 0
outer loop
vertex 60 0 30
vertex 60 0 0
vertex 70 0 0
endloop
endfacet
facet normal -0 -0 -1
outer loop
vertex 60 0 0
vertex 60 20 0
vertex 70 0 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 70 0 0
vertex 60 20 0
vertex 70 20 0
endloop
endfacet
facet normal -0 1 0
outer loop
vertex 70 20 0
vertex 60 20 0
vertex 60 20 30
endloop
endfacet
facet normal 0.948683 -0 0.316228
outer loop
vertex 60 20 30
vertex 60 0 30
vertex 70 0 0
endloop
endfacet
facet normal 0.948683 -0 0.316228
outer loop
vertex 70 20 0
vertex 60 20 30
vertex 70 0 0
endloop
endfacet
facet normal -0.986394 0 0.164399
outer loop
vertex 80 0 0
vertex 85 0 30
vertex 80 20 0
endloop
endfacet
facet normal -0.986394 0 0.164399
outer loop
vertex 80 20 0
vertex 85 0 30
vertex 85 20 30
endloop
endfacet
facet normal 0 -1 0
outer loop
vertex 85 0 30
vertex 80 0 0
vertex 90 0 0
endloop
endfacet
facet normal -0 -0 -1
outer loop
vertex 80 0 0
vertex 80 20 0
vertex 90 0 0
endloop
endfacet
facet normal 0 0 -1
outer loop
vertex 90 0 0
vertex 80 20 0
vertex 90 20 0
endloop
endfacet
facet normal -0 1 0
outer loop
vertex 90 20 0
vertex 80 20 0
vertex 85 20 30
endloop
endfacet
facet normal 0.986394 -0 0.164399
outer loop
vertex 85 20 30
vertex 85 0 30
vertex 90 0 0
endloop
endfacet
facet normal 0.986394 -0 0.164399
outer loop
vertex 90 20 0
vertex 85 20 30
vertex 90 0 0
endloop
endfacet
endsolid OpenSCAD_Model

58
libtriangles.scad Normal file
View file

@ -0,0 +1,58 @@
//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.
module rightpyramid(rightpyramidx, rightpyramidy, rightpyramidz) {
polyhedron ( points = [[0,0,0],
[rightpyramidx, 0, 0],
[0, rightpyramidy, 0],
[rightpyramidx, rightpyramidy, 0],
[rightpyramidx/2, rightpyramidy, rightpyramidz]],
triangles = [[0,1,2],[2,1,3],[4,1,0],[3,1,4],[2,3,4],[0,2,4]]);
}
module cornerpyramid(cornerpyramidx, cornerpyramidy, cornerpyramidz) {
polyhedron ( points = [[0,0,0],
[cornerpyramidx, 0, 0],
[0, cornerpyramidy, 0],
[cornerpyramidx, cornerpyramidy, 0],
[0, cornerpyramidy, cornerpyramidz]],
triangles = [[0,1,2],[2,1,3],[4,1,0],[3,1,4],[2,3,4],[0,2,4]]);
}
module eqlpyramid(eqlpyramidx, eqlpyramidy, eqlpyramidz) {
polyhedron ( points = [[0,0,0],
[eqlpyramidx, 0, 0],
[0, eqlpyramidy, 0],
[eqlpyramidx, eqlpyramidy, 0],
[eqlpyramidx/2, eqlpyramidy/2, eqlpyramidz]],
triangles = [[0,1,2],[2,1,3],[4,1,0],[3,1,4],[2,3,4],[0,2,4]]);
}
module rightprism(rightprismx,rightprismy,rightprismz){
polyhedron ( points = [[0,0,0],
[rightprismx,0,0],
[rightprismx,rightprismy,0],
[0,rightprismy,0],
[0,rightprismy,rightprismz],
[0,0,rightprismz]],
triangles = [[0,1,2,3],[5,1,0],[5,4,2,1],[4,3,2],[0,3,4,5]]);
}
module eqlprism(rightprismx,rightprismy,rightprismz){
polyhedron ( points = [[0,0,0],
[rightprismx,0,0],
[rightprismx,rightprismy,0],
[0,rightprismy,0],
[rightprismx/2,rightprismy,rightprismz],
[rightprismx/2,0,rightprismz]],
triangles = [[0,1,2,3],[5,1,0],[5,4,2,1],[4,3,2],[0,3,4,5]]);
}