Skip to content
Browse files

Added a general ngon and improved some api docs

  • Loading branch information...
1 parent d21103e commit 868730fec75d5f3871eb02644f1b489d0cae026f @elmom committed
Showing with 17 additions and 2 deletions.
  1. +17 −2 shapes.scad
View
19 shapes.scad
@@ -9,6 +9,7 @@
// 2D Shapes
//ellipse(width, height);
//egg_outline(width=5, length=7);
+//ngon(sides, radius, center=false);
// 3D Shapes
//box(width, height, depth);
@@ -16,8 +17,9 @@
//cone(height, radius);
//ellipticalCylinder(width, height, depth);
//ellipsoid(width, height);
-//tube(height, radius, wall);
-//ovalTube(width, height, depth, wall);
+//tube(height, radius, wall, center = false);
+//tube2(height, ID, OD, center = false);
+//ovalTube(width, height, depth, wall, center = false);
//hexagon(height, depth);
//octagon(height, depth);
//dodecagon(height, depth);
@@ -79,6 +81,14 @@ module tube(height, radius, wall, center = false) {
}
// wall is wall thickness
+module tube2(height, ID, OD, center = false) {
+ difference() {
+ cylinder(h=height, r=OD/2, center=center);
+ cylinder(h=height, r=ID/2, center=center);
+ }
+}
+
+// wall is wall thickness
module ovalTube(height, rx, ry, wall, center = false) {
difference() {
scale([1, ry/rx, 1]) cylinder(h=height, r=rx, center=center);
@@ -86,6 +96,11 @@ 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;

0 comments on commit 868730f

Please sign in to comment.
Something went wrong with that request. Please try again.