From 4c4e1c79935bf536dfe9edbab4a1718517fc2834 Mon Sep 17 00:00:00 2001 From: Matthew Fallshaw Date: Sat, 9 Jan 2021 18:38:34 +1100 Subject: [PATCH] Compare cylinders, with and without `chamfer`s and `circum`. --- tests/test_shapes.scad | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/test_shapes.scad b/tests/test_shapes.scad index a952493..2fbcb83 100644 --- a/tests/test_shapes.scad +++ b/tests/test_shapes.scad @@ -39,5 +39,37 @@ module test_spheroid() { test_spheroid(); +module test_cyl() { + $fn=12; + shape_compare() { + cyl(r=50,l=10,circum=true,anchor=BOTTOM); + cylinder(r=50/cos(180/12),l=10); + } + shape_compare() { + cyl(r=50,l=10,circum=false,anchor=BOTTOM); + cylinder(r=50,l=10); + } + shape_compare() { + cyl(r=50,l=10,chamfer=1,circum=true,anchor=BOTTOM); + union() { + r=50/cos(180/12); + cylinder(r1=r-1,r2=r,l=1); + up(1) cylinder(r=r,l=8); + up(9) cylinder(r1=r,r2=r-1,l=1); + } + } + shape_compare() { + cyl(r=50,l=10,chamfer=1,circum=false,anchor=BOTTOM); + union() { + r=50; + cylinder(r1=r-1,r2=r,l=1); + up(1) cylinder(r=r,l=8); + up(9) cylinder(r1=r,r2=r-1,l=1); + } + } +} +test_cyl(); + + // vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap