From 8296c5e867a7029a7f309e022fa1a5309382fad6 Mon Sep 17 00:00:00 2001 From: tessaK9 Date: Fri, 13 Mar 2026 13:14:25 +0100 Subject: [PATCH] added modifier to partial extrusion to slightly change rake, slight changes to cat/dogears --- bezier_extrusion.scad | 6 +++--- catears.scad | 17 +++++++++-------- dogears.scad | 2 +- headband.scad | 26 +++++++++++++------------- 4 files changed, 26 insertions(+), 25 deletions(-) diff --git a/bezier_extrusion.scad b/bezier_extrusion.scad index dd65f21..9c125e6 100644 --- a/bezier_extrusion.scad +++ b/bezier_extrusion.scad @@ -15,7 +15,7 @@ module slice(points){ polyhedron(points = points_new, faces = faces, convexity = 10); } -module bezier_extrude_partial(ctrl, shape, gap = 1, mod = function (t) 1, mod_x = function(t) 1, mod_y = function (t) 1, sections = 128){ +module bezier_extrude_partial(ctrl, shape, merlon = 1, gap = 1, mod = function (t) 1, mod_x = function(t) 1, mod_y = function (t) 1, sections = 128){ B_0 = ctrl[0]; B_1 = 3*(-ctrl[0] + ctrl[1]); B_2 = 3*(ctrl[0] - 2*ctrl[1] + ctrl[2]); @@ -30,8 +30,8 @@ module bezier_extrude_partial(ctrl, shape, gap = 1, mod = function (t) 1, mod_x slices = [for (i = [0 : sections]) let (t = i/sections, p = bezier(t), normal = normal(t), n = normal/norm(normal)) [for (v = shape) [p.x+(mod(t) * mod_x(t) * n.x * v.x),p.y+(mod(t) * mod_x(t) * n.y * v.x), mod(t) * mod_y(t) * v.y]]]; - for(i = [0 : 1+gap : sections-1]){ - slice([slices[i],slices[i+1]]); + for(i = [0 : 1+gap : sections-merlon]){ + slice([slices[i],slices[i+merlon]]); } } diff --git a/catears.scad b/catears.scad index 5b491e1..ef6fa22 100644 --- a/catears.scad +++ b/catears.scad @@ -3,19 +3,20 @@ use ; thickness = 2.7; height = 5.5; +epsilon = 0.001; module catear(){ ctrl_ear1 = [[49,96],[58,112],[63,137],[61.5,141]]; - ctrl_ear2 = [[61.5,141],[60,145],[42.5,140.5],[18,123]]; + ctrl_ear2 = [[61.5+1.5*epsilon,141-4*epsilon],[60,145],[42.5,140.5],[18,123]]; - shape_band = [[thickness/2,height/2-0.5], - [thickness/2,-height/2+0.5], - [thickness/2-0.5,-height/2], - [-thickness/2+0.5,-height/2], - [-thickness/2,-height/2+0.5], - [-thickness/2,height/2-0.5], - [-thickness/2+0.5,height/2], + shape_band = [[thickness/2,height/2-0.25], + [thickness/2,-height/2+0.25], + [thickness/2-0.25,-height/2], + [-thickness/2+0.25,-height/2], + [-thickness/2,-height/2+0.25], + [-thickness/2,height/2-0.25], + [-thickness/2+0.25,height/2], [thickness/2-0.5,height/2]]; bezier_extrude(ctrl = ctrl_ear1, shape = shape_band, sections = 32); diff --git a/dogears.scad b/dogears.scad index 05d9064..4a4f41b 100644 --- a/dogears.scad +++ b/dogears.scad @@ -21,4 +21,4 @@ module dogears(rightear = "flop", leftear = "flop"){ } } -dogears(); \ No newline at end of file +dogears(rightear = "lflop"); \ No newline at end of file diff --git a/headband.scad b/headband.scad index fb5d236..840e319 100644 --- a/headband.scad +++ b/headband.scad @@ -3,26 +3,26 @@ use ; module headband(thickness, height){ rake_length = 3; - shape_band = [[thickness/2,height/2-0.5], - [thickness/2,-height/2+0.5], - [thickness/2-0.5,-height/2], - [-thickness/2+0.5,-height/2], - [-thickness/2,-height/2+0.5], - [-thickness/2,height/2-0.5], - [-thickness/2+0.5,height/2], - [thickness/2-0.5,height/2]]; + shape_band = [[thickness/2,height/2-0.25], + [thickness/2,-height/2+0.25], + [thickness/2-0.25,-height/2], + [-thickness/2+0.25,-height/2], + [-thickness/2,-height/2+0.25], + [-thickness/2,height/2-0.25], + [-thickness/2+0.25,height/2], + [thickness/2-0.25,height/2]]; shape_rake = [[0,-height/2], [0,height/2], [rake_length,height/2-2], [rake_length,-height/2+2]]; - shape_halfband = [[thickness/2,height/2-0.5], - [thickness/2,-height/2+0.5], - [thickness/2-0.5,-height/2], + shape_halfband = [[thickness/2,height/2-0.25], + [thickness/2,-height/2+0.25], + [thickness/2-0.25,-height/2], [0,-height/2], [0,height/2], - [thickness/2-0.5,height/2]]; + [thickness/2-0.25,height/2]]; ctrl_band = [[21,0],[77,56],[56,126],[0,126]]; ctrl_end = [[21,0],[20,-1],[18,-4],[17,-8]]; @@ -39,7 +39,7 @@ module headband(thickness, height){ translate([-17,-8]){ rotate_extrude(convexity = 10, $fn = 16) polygon(shape_halfband); } - bezier_extrude_partial(ctrl = ctrl_rake, shape = shape_rake, gap = 2, sections = 3*64+1); + bezier_extrude_partial(ctrl = ctrl_rake, shape = shape_rake, merlon = 2, gap = 3, sections = 5*42+1 ); } }