From b38c05b76618b809fb968242ff7ddd9478ed1ae0 Mon Sep 17 00:00:00 2001 From: bigshum Date: Tue, 19 Aug 2014 14:42:08 +0100 Subject: [PATCH 1/2] Added definition for creation of a pointed ellipse (vesica piscis) --- regular_shapes.scad | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/regular_shapes.scad b/regular_shapes.scad index acba0bc0..4e278a1c 100644 --- a/regular_shapes.scad +++ b/regular_shapes.scad @@ -87,6 +87,21 @@ module ellipse(width, height) { scale([1, height/width, 1]) circle(r=width/2); } +module pointed_ellipse(width, height) { + width_ratio = (width/2)/width; + original_height = (width*2) * sqrt(3); + height_ratio = height/original_height; + + translate([-(width/2),0,0]) + scale([width_ratio,height_ratio,1]) { + intersection() { + cylinder(r=width*2,h=1,center=true); + translate([width*2,0,0]) + cylinder(r=width*2,h=1,center=true); + } + } +} + // The ratio of lenght and width is about 1.39 for a real egg module egg_outline(width, length){ translate([0, width/2, 0]) union(){ From 511ec9762e702f04cdd5692020082a57d951d090 Mon Sep 17 00:00:00 2001 From: bigshum Date: Tue, 19 Aug 2014 14:50:10 +0100 Subject: [PATCH 2/2] Moved from 2D shapes to 3D shapes. Added a height parameter. --- regular_shapes.scad | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/regular_shapes.scad b/regular_shapes.scad index 4e278a1c..90147b9b 100644 --- a/regular_shapes.scad +++ b/regular_shapes.scad @@ -87,17 +87,17 @@ module ellipse(width, height) { scale([1, height/width, 1]) circle(r=width/2); } -module pointed_ellipse(width, height) { +module pointed_ellipse(width, length, height) { width_ratio = (width/2)/width; - original_height = (width*2) * sqrt(3); - height_ratio = height/original_height; + original_length = (width*2) * sqrt(3); + length_ratio = length/original_length; translate([-(width/2),0,0]) - scale([width_ratio,height_ratio,1]) { + scale([width_ratio,length_ratio,1]) { intersection() { - cylinder(r=width*2,h=1,center=true); + cylinder(r=width*2,h=height,center=true); translate([width*2,0,0]) - cylinder(r=width*2,h=1,center=true); + cylinder(r=width*2,h=height,center=true); } } }