From f69ddaa05b8299373a4b8a4d2576b90186d9ec8f Mon Sep 17 00:00:00 2001 From: Kurt Hutten Date: Mon, 7 Jun 2021 17:06:02 +1000 Subject: [PATCH] Fix beamChain example and add negative polyRoundExtrude example --- examples/beamChain-1.scad | 1 - examples/negative-polyRoundExtrude.scad | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 examples/negative-polyRoundExtrude.scad diff --git a/examples/beamChain-1.scad b/examples/beamChain-1.scad index 57d2f07..e4f8e6f 100644 --- a/examples/beamChain-1.scad +++ b/examples/beamChain-1.scad @@ -16,7 +16,6 @@ linear_extrude(1){ // Add some radii to the line transitions translate([0,-7,0]){ radiiPoints=beamPoints(2,1); - for(i=[0: len(beamPoints(2,1))]){color("red")translate([radiiPoints[i].x,radiiPoints[i].y,0])cylinder(d=0.2, h=1);} polygon(polyRound(beamChain(radiiPoints,offset1=0.02, offset2=-0.02),20)); } diff --git a/examples/negative-polyRoundExtrude.scad b/examples/negative-polyRoundExtrude.scad new file mode 100644 index 0000000..365f1d2 --- /dev/null +++ b/examples/negative-polyRoundExtrude.scad @@ -0,0 +1,24 @@ +// negative polyRoundExtrude example + +include + +extrudeRadius = 0.8; +extrudeHeight = 2; +tiny = 0.005; // tiny value is used to stop artifacts from planes lining up perfectly + +radiiPoints=[ + [-7, -3, 0 ], + [7, -3, 0 ], + [0, 6, 1 ] // top of the triagle is rounded +]; +negativeRadiiPoints=[ + [-3, -1, 0 ], + [3, -1, 0 ], + [0, 3, 1 ] // top of the triagle is rounded +]; + +difference() { + polyRoundExtrude(radiiPoints,extrudeHeight, extrudeRadius, extrudeRadius,fn=20); + translate([0,0,-tiny]) + polyRoundExtrude(negativeRadiiPoints,extrudeHeight+2*tiny, -extrudeRadius, -extrudeRadius,fn=20); +}