Older
100644 61 lines (45 sloc) 1.86 KB
 3671d21 Added licensing stuff. traverseda authored Feb 16, 2013 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. 3aa8ba9 Added my libtriangles, plus the "examples" folder traverseda authored Feb 15, 2013 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
Something went wrong with that request. Please try again.