rounded off the intersections of ears and headbands
This commit is contained in:
parent
4c8b71a4f0
commit
5c27b0651d
3 changed files with 26 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
// extrusion takes a list of polygons (list of points in 3d space) and connects these into one big polyeder
|
||||
|
||||
module extrusion(points){
|
||||
//points[0] must have its points ordered clockwise
|
||||
n = len(points);
|
||||
|
|
@ -9,6 +10,12 @@ module extrusion(points){
|
|||
polyhedron(points = points_new, faces = faces, convexity = 10);
|
||||
}
|
||||
|
||||
//angl_to_ctrl converts a start point, outgoing angle, end point and ingoing angle to control points for a bezier extrusion. to use angl_to_ctrl this file needs to be included, not just used
|
||||
|
||||
function angl_to_ctrl (p0, a0, p1, a1, mod = 1) =
|
||||
let (dist = norm(p1-p0))
|
||||
[p0,p0+2/3*mod*dist*[cos(a0),sin(a0)],p1+2/3*mod*dist*[cos(a1),sin(a1)],p1];
|
||||
|
||||
//ctrl is a list containing 4 control points of the bezier curve. shape is polygon in the 2d plane which is being extruded. mod is a function [0,1] -> |R scaling the shape, mod_x in the x-direction (of the shape), mod_y in the y-direction. if partial is true, then the polyeder is rendered in slices with length given by merlon and gap size given by gap, section defines the number of sections the bezier curve is broken into
|
||||
module bezier_extrude(ctrl, shape, mod = function (t) 1, mod_x = function(t) 1, mod_y = function (t) 1, partial = false, merlon = 1, gap = 1, sections = 128){
|
||||
B_0 = ctrl[0];
|
||||
|
|
@ -36,8 +43,8 @@ module bezier_extrude(ctrl, shape, mod = function (t) 1, mod_x = function(t) 1,
|
|||
}
|
||||
|
||||
//some thing to play around with
|
||||
shape = [[0,0.5],[0.8,0],[0.5,-1],[-0.5,-1],[-0.8,0]];
|
||||
/*shape = [[0,0.5],[0.8,0],[0.5,-1],[-0.5,-1],[-0.8,0]];
|
||||
ctrl = [[0,0],[0,20],[20,20],[20,0]];
|
||||
wave1 = function (x) 0.75+0.25*cos(8*360*x);
|
||||
wave2 = function (x) 0.75+0.25*sin(8*360*x);
|
||||
bezier_extrude(ctrl = ctrl, shape = shape, mod_x = wave1, mod_y = wave2, partial = true, merlon = 3, gap = 1, sections = 128);
|
||||
bezier_extrude(ctrl = angl_to_ctrl([-10,0],90,[10,0],90), shape = shape, mod_x = wave1, mod_y = wave2, partial = true, merlon = 3, gap = 1, sections = 128);*/
|
||||
|
|
@ -1,9 +1,26 @@
|
|||
use <hinge.scad>;
|
||||
include <bezier_extrusion.scad>;
|
||||
|
||||
//these values were mostly determined by manually finetuning them
|
||||
t = 5;
|
||||
a = 41.186; //arctan(7/8)
|
||||
mod = function (t) 12*t^2*(1-t)^2+1;
|
||||
ctrl_0 = angl_to_ctrl([-30.5,0]+t*[1,0], 180, [-30.5,0]+t*[-cos(a-25),-sin(a-25)], a-25, mod = 0.5);
|
||||
ctrl_1 = angl_to_ctrl([-23.6,7]+t*[1,0], 180, [-23.6,7]+t*[-cos(a+180), -sin(a+180)], a+180);
|
||||
ctrl_2 = angl_to_ctrl([-8,37]+t*[1,0], 180, [-8.5,37]+t*[0,-1], 75, mod = 0.5);
|
||||
ctrl_3 = angl_to_ctrl([-7.3,44]+t*[1,0], 180, [-7.3,44]+t*[0,1], 270, mod = 0.5);
|
||||
rectangle_r = [[1.5,0],[1.5,6],[0,6],[0,0]];
|
||||
rectangle_l = [[0,0],[0,6],[-1.5,6],[-1.5,0]];
|
||||
|
||||
//a1, a2, a3, a4 are the four angles of the pairs of hinges on the ear from bottom to tip
|
||||
module dogearAllOptions(a1, a2, a3, a4){
|
||||
translate([25,0,0]){
|
||||
union(){
|
||||
bezier_extrude(ctrl = ctrl_0, shape = rectangle_r, sections = 8);
|
||||
bezier_extrude(ctrl = ctrl_1, shape = rectangle_l, mod_x = mod, sections = 8);
|
||||
bezier_extrude(ctrl = ctrl_2, shape = rectangle_r, mod_x = mod, sections = 8);
|
||||
bezier_extrude(ctrl = ctrl_3, shape = rectangle_l, mod_x = mod, sections = 8);
|
||||
//translate([-8,37,0]) cube([10,10,20]);
|
||||
linear_extrude(height = 6, center = false, convexity = 10){
|
||||
polygon(points = [[-33,0],[-25,0],[-25,7]]);
|
||||
}
|
||||
|
|
|
|||
BIN
stl/dogears.stl
BIN
stl/dogears.stl
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue