Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pointed ellipse #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Moved from 2D shapes to 3D shapes. Added a height parameter.
  • Loading branch information
bigshum committed Aug 19, 2014
commit 511ec9762e702f04cdd5692020082a57d951d090
12 changes: 6 additions & 6 deletions regular_shapes.scad
Original file line number Diff line number Diff line change
@@ -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);
}
}
}