From 662f853f10dd5132949f0594768325299856c98e Mon Sep 17 00:00:00 2001 From: Timothy Schmidt Date: Sun, 30 Oct 2011 10:37:41 -0400 Subject: [PATCH 1/9] fixed license and typo for teardrop.scad --- teardrop.scad | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/teardrop.scad b/teardrop.scad index 7a3b0fe..a0578e2 100644 --- a/teardrop.scad +++ b/teardrop.scad @@ -1,8 +1,22 @@ -// From http://www.thingiverse.com/thing:3457 -// © 2010 whosawhatsis +/* From http://www.thingiverse.com/thing:3457 + © 2010 whosawhatsis + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +*/ /* -This script generates a teardrop shape at the appropriate angle to prevent overhangs greater than 45 degrees. The angle is in degrees, and is a rotation around the Y axis. You can then rotate around Z to point it in any direction. Rotation around Y or Z will cause the angle to be wrong. +This script generates a teardrop shape at the appropriate angle to prevent overhangs greater than 45 degrees. The angle is in degrees, and is a rotation around the Y axis. You can then rotate around Z to point it in any direction. Rotation around X or Y will cause the angle to be wrong. */ module teardrop(radius, length, angle) { From c90db2a644921733b24ca9c245bff8f9c05bf453 Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 1 Aug 2012 19:45:02 -0500 Subject: [PATCH 2/9] clarify that you cannot use wildcards in OpenSCAD use/include statements --- README.markdown | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.markdown b/README.markdown index b83c415..7cea10b 100644 --- a/README.markdown +++ b/README.markdown @@ -10,13 +10,15 @@ See http://creativecommons.org/licenses/LGPL/2.1/ or the included file, lgpl-2.1 ## Usage ## -You can import these files in your scripts with `use `, but some -files include useful constants which will be available with `include `, -which should be safe to use on all included files (ie. no top level code should -create geometry). (There is a bug/feature that prevents including constants from -files that "include" other files - see the openscad mailing list archives for more -details. Since the maintainers aren't very responsive, may have to work around this -somehow) +You can import these files in your scripts with `use `, +where 'filename' is one of the files listed below like 'motors' or +'servos'. Some files include useful constants which will be available +with `include `, which should be safe to use on all +included files (ie. no top level code should create geometry). (There is +a bug/feature that prevents including constants from files that +"include" other files - see the openscad mailing list archives for more +details. Since the maintainers aren't very responsive, may have to work +around this somehow) If you host your project in git, you can do `git submodule add URL PATH` in your repo to import this library as a git submodule for easy usage. Then you need to do From e8151cf0610781dc863daa8effddd87bb1ec4949 Mon Sep 17 00:00:00 2001 From: Justin Bull Date: Mon, 5 Nov 2012 20:38:56 -0500 Subject: [PATCH 3/9] auger() actually builds augers with all params radii is used instead of diameters, has a taper parameter that will change how much the blade tapers at the end --- screw.scad | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/screw.scad b/screw.scad index cd4ce2b..eb444ec 100644 --- a/screw.scad +++ b/screw.scad @@ -23,15 +23,15 @@ module helix(pitch, length, slices=500){ child(0); } -module auger(pitch, length, outside_diameter, inner_diameter) { +module auger(pitch, length, outside_radius, inner_radius, taper_ratio = 0.25) { union(){ helix(pitch, length) - polygon(points=[[10,10],[100,1],[100,-1],[10,-10]], paths=[[0,1,2,3]]); - cylinder(h=length, r=20); + polygon(points=[[0,inner_radius],[outside_radius,(inner_radius * taper_ratio)],[outside_radius,(inner_radius * -1 * taper_ratio)],[0,(-1 * inner_radius)]], paths=[[0,1,2,3]]); + cylinder(h=length, r=inner_radius); } } -module test_auger(){translate([300, 0, 0]) auger(100, 300);} +module test_auger(){translate([50, 0, 0]) auger(40, 80, 25, 5);} module ball_groove(pitch, length, diameter, ball_radius=10) { From 26b29ba83fd2c8041b0fe1e435cc218fa956435d Mon Sep 17 00:00:00 2001 From: peteruithoven Date: Thu, 22 Nov 2012 02:14:36 +0100 Subject: [PATCH 4/9] Added layout and 2D shapes modules --- 2Dshapes.scad | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++ layouts.scad | 44 ++++++++++++++ shapes.scad | 5 -- 3 files changed, 207 insertions(+), 5 deletions(-) create mode 100644 2Dshapes.scad create mode 100644 layouts.scad diff --git a/2Dshapes.scad b/2Dshapes.scad new file mode 100644 index 0000000..2d10577 --- /dev/null +++ b/2Dshapes.scad @@ -0,0 +1,163 @@ +/* + * OpenSCAD 2D Shapes Library (www.openscad.org) + * Copyright (C) 2012 Peter Uithoven + * + * License: LGPL 2.1 or later +*/ + +// 2D Shapes +//ngon(sides, radius, center=false); +//complexRoundSquare(size,rads1=[0,0], rads2=[0,0], rads3=[0,0], rads4=[0,0], center=true) +//roundedSquare(pos=[10,10],r=2) +//ellipsePart(width,height,numQuarters) +//donutSlice(innerSize,outerSize, start_angle, end_angle) +//pieSlice(size, start_angle, end_angle) //size in radius(es) +//ellipse(width, height) { + +// Examples +/*use ; +grid(105,105,true,4) +{ + // ellipse + ellipse(50,75); + + // part of ellipse (a number of quarters) + ellipsePart(50,75,3); + ellipsePart(50,75,2); + ellipsePart(50,75,1); + + // complexRoundSquare examples + complexRoundSquare([75,100],[20,10],[20,10],[20,10],[20,10]); + complexRoundSquare([75,100],[0,0],[0,0],[30,50],[20,10]); + complexRoundSquare([50,50],[10,20],[10,20],[10,20],[10,20],false); + complexRoundSquare([100,100]); + complexRoundSquare([100,100],rads1=[20,20],rads3=[20,20]); + + // pie slice + pieSlice(50,0,10); + pieSlice(50,45,190); + pieSlice([50,20],180,270); + + // donut slice + donutSlice(20,50,0,350); + donutSlice(30,50,190,270); + donutSlice([40,22],[50,30],180,270); + donutSlice([50,20],50,180,270); + donutSlice([20,30],[50,40],0,270); +}*/ +//---------------------- + +// size, top left radius, top right radius, bottom right radius, bottom left radius, center +module complexRoundSquare(size,rads1=[0,0], rads2=[0,0], rads3=[0,0], rads4=[0,0], center=true) +{ + width = size[0]; + height = size[1]; + //%square(size=[width, height],center=true); + x1 = 0-width/2+rads1[0]; + y1 = 0-height/2+rads1[1]; + x2 = width/2-rads2[0]; + y2 = 0-height/2+rads2[1]; + x3 = width/2-rads3[0]; + y3 = height/2-rads3[1]; + x4 = 0-width/2+rads4[0]; + y4 = height/2-rads4[1]; + + scs = 0.1; //straight corner size + + x = (center)? 0: width/2; + y = (center)? 0: height/2; + + translate([x,y,0]) + { + hull() { + // top left + if(rads1[0] > 0 && rads1[1] > 0) + translate([x1,y1]) mirror([1,0]) ellipsePart(rads1[0]*2,rads1[1]*2,1); + else + translate([x1,y1]) square(size=[scs, scs]); + + // top right + if(rads2[0] > 0 && rads2[1] > 0) + translate([x2,y2]) ellipsePart(rads2[0]*2,rads2[1]*2,1); + else + translate([width/2-scs,0-height/2]) square(size=[scs, scs]); + + // bottom right + if(rads3[0] > 0 && rads3[1] > 0) + translate([x3,y3]) mirror([0,1]) ellipsePart(rads3[0]*2,rads3[1]*2,1); + else + translate([width/2-scs,height/2-scs]) square(size=[scs, scs]); + + // bottom left + if(rads4[0] > 0 && rads4[1] > 0) + translate([x4,y4]) rotate([0,0,-180]) ellipsePart(rads4[0]*2,rads4[1]*2,1); + else + #translate([x4,height/2-scs]) square(size=[scs, scs]); + } + } +} +module roundedSquare(pos=[10,10],r=2) { + minkowski() { + square([pos[0]-r*2,pos[1]-r*2],center=true); + circle(r=r); + } +} +// round shapes +// The orientation might change with the implementation of circle... +module ngon(sides, radius, center=false){ + rotate([0, 0, 360/sides/2]) circle(r=radius, $fn=sides, center=center); +} +module ellipsePart(width,height,numQuarters) +{ + o = 1; //slight overlap to fix a bug + difference() + { + ellipse(width,height); + if(numQuarters <= 3) + translate([0-width/2-o,0-height/2-o,0]) square([width/2+o,height/2+o]); + if(numQuarters <= 2) + translate([0-width/2-o,-o,0]) square([width/2+o,height/2+o*2]); + if(numQuarters < 2) + translate([-o,0,0]) square([width/2+o*2,height/2+o]); + } +} +module donutSlice(innerSize,outerSize, start_angle, end_angle) +{ + difference() + { + pieSlice(outerSize, start_angle, end_angle); + if(len(innerSize) > 1) ellipse(innerSize[0]*2,innerSize[1]*2); + else circle(innerSize); + } +} +module pieSlice(size, start_angle, end_angle) //size in radius(es) +{ + rx = ((len(size) > 1)? size[0] : size); + ry = ((len(size) > 1)? size[1] : size); + trx = rx* sqrt(2) + 1; + try = ry* sqrt(2) + 1; + a0 = (4 * start_angle + 0 * end_angle) / 4; + a1 = (3 * start_angle + 1 * end_angle) / 4; + a2 = (2 * start_angle + 2 * end_angle) / 4; + a3 = (1 * start_angle + 3 * end_angle) / 4; + a4 = (0 * start_angle + 4 * end_angle) / 4; + if(end_angle > start_angle) + intersection() { + if(len(size) > 1) + ellipse(rx*2,ry*2); + else + circle(rx); + polygon([ + [0,0], + [trx * cos(a0), try * sin(a0)], + [trx * cos(a1), try * sin(a1)], + [trx * cos(a2), try * sin(a2)], + [trx * cos(a3), try * sin(a3)], + [trx * cos(a4), try * sin(a4)], + [0,0] + ]); + } +} +module ellipse(width, height) { + scale([1, height/width, 1]) circle(r=width/2); +} \ No newline at end of file diff --git a/layouts.scad b/layouts.scad new file mode 100644 index 0000000..bec8de7 --- /dev/null +++ b/layouts.scad @@ -0,0 +1,44 @@ + /* + * OpenSCAD Layout Library (www.openscad.org) + * Copyright (C) 2012 Peter Uithoven + * + * License: LGPL 2.1 or later +*/ + +//list(iHeight); +//grid(iWidth,iHeight,inYDir = true,limit=3) + +// Examples: +/*list(15) +{ + square([25,10]); + square([25,10]); + square([25,10]); + square([25,10]); + square([25,10]); +}*/ +/*grid(30,15,false,2) +{ + square([25,10]); + square([25,10]); + square([25,10]); + square([25,10]); + square([25,10]); +}*/ + +//---------------------- + +module list(iHeight) +{ + for (i = [0 : $children-1]) + translate([0,i*iHeight]) child(i); +} +module grid(iWidth,iHeight,inYDir = true,limit=3) +{ + for (i = [0 : $children-1]) + { + translate([(inYDir)? (iWidth)*(i%limit) : (iWidth)*floor(i/limit), + (inYDir)? (iHeight)*floor(i/limit) : (iHeight)*(i%limit)]) + child(i); + } +} \ No newline at end of file diff --git a/shapes.scad b/shapes.scad index a4540bb..84b1810 100644 --- a/shapes.scad +++ b/shapes.scad @@ -80,11 +80,6 @@ module ovalTube(height, rx, ry, wall, center = false) { } } -// The orientation might change with the implementation of circle... -module ngon(sides, radius, center=false){ - rotate([0, 0, 360/sides/2]) circle(r=radius, $fn=sides, center=center); -} - // size is the XY plane size, height in Z module hexagon(size, height) { boxWidth = size/1.75; From 3aa8ba99be7f23ccabd490c8d633f311df5b7a94 Mon Sep 17 00:00:00 2001 From: traverseda Date: Fri, 15 Feb 2013 17:02:36 -0400 Subject: [PATCH 5/9] Added my libtriangles, plus the "examples" folder --- examples/example.libtriangles.scad | 10 ++ examples/example.stl | 240 +++++++++++++++++++++++++++++ libtriangles.scad | 58 +++++++ 3 files changed, 308 insertions(+) create mode 100644 examples/example.libtriangles.scad create mode 100644 examples/example.stl create mode 100644 libtriangles.scad diff --git a/examples/example.libtriangles.scad b/examples/example.libtriangles.scad new file mode 100644 index 0000000..05390ec --- /dev/null +++ b/examples/example.libtriangles.scad @@ -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); + diff --git a/examples/example.stl b/examples/example.stl new file mode 100644 index 0000000..f3adc29 --- /dev/null +++ b/examples/example.stl @@ -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 diff --git a/libtriangles.scad b/libtriangles.scad new file mode 100644 index 0000000..40e4876 --- /dev/null +++ b/libtriangles.scad @@ -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]]); +} + From 913733d22b65bc8ea0170cce3b22523a2fe303cb Mon Sep 17 00:00:00 2001 From: traverseda Date: Fri, 15 Feb 2013 17:03:59 -0400 Subject: [PATCH 6/9] Cleaned up the examples folder --- examples/example.stl | 240 ------------------------------------------- 1 file changed, 240 deletions(-) delete mode 100644 examples/example.stl diff --git a/examples/example.stl b/examples/example.stl deleted file mode 100644 index f3adc29..0000000 --- a/examples/example.stl +++ /dev/null @@ -1,240 +0,0 @@ -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 From bdee716f59ce432a4b91bba5e47e0fd04604135a Mon Sep 17 00:00:00 2001 From: traverseda Date: Sat, 16 Feb 2013 13:27:27 -0400 Subject: [PATCH 7/9] Changes examples/example.libtriangles.scad to test_libtriangles.scad --- examples/example.libtriangles.scad => test_libtriangles.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename examples/example.libtriangles.scad => test_libtriangles.scad (91%) diff --git a/examples/example.libtriangles.scad b/test_libtriangles.scad similarity index 91% rename from examples/example.libtriangles.scad rename to test_libtriangles.scad index 05390ec..b58ce56 100644 --- a/examples/example.libtriangles.scad +++ b/test_libtriangles.scad @@ -1,4 +1,4 @@ -use <../libtriangles.scad>; +use ; //all of these follow the (X,Y,Z) syntax From 3671d2139a5ea3bacae4f276aebf0d9e64ddb89e Mon Sep 17 00:00:00 2001 From: traverseda Date: Sat, 16 Feb 2013 13:36:56 -0400 Subject: [PATCH 8/9] Added licensing stuff. --- libtriangles.scad | 4 +++- test_libtriangles.scad | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libtriangles.scad b/libtriangles.scad index 40e4876..d5f207e 100644 --- a/libtriangles.scad +++ b/libtriangles.scad @@ -1,4 +1,6 @@ -//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. +//Copyright (C) 2013 Alex Davies +//License: LGPL 2.1 or later +//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. module rightpyramid(rightpyramidx, rightpyramidy, rightpyramidz) { polyhedron ( points = [[0,0,0], diff --git a/test_libtriangles.scad b/test_libtriangles.scad index b58ce56..21b123c 100644 --- a/test_libtriangles.scad +++ b/test_libtriangles.scad @@ -1,3 +1,5 @@ +//Copyright (C) 2013 Alex Davies +//License: LGPL 2.1 or later use ; //all of these follow the (X,Y,Z) syntax From 0356f2f2d4e2655ac7d2456d46c55e63de671787 Mon Sep 17 00:00:00 2001 From: traverseda Date: Sat, 16 Feb 2013 15:12:12 -0400 Subject: [PATCH 9/9] Removed test_libtriangles. I was under the mistaken impression is provided a set of examples, so you could see at a glance the result of the code. This doesn't really need a test function. --- test_libtriangles.scad | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 test_libtriangles.scad diff --git a/test_libtriangles.scad b/test_libtriangles.scad deleted file mode 100644 index 21b123c..0000000 --- a/test_libtriangles.scad +++ /dev/null @@ -1,12 +0,0 @@ -//Copyright (C) 2013 Alex Davies -//License: LGPL 2.1 or later -use ; - -//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); -