From da1d1229478f8886664a54a69d524897c7a77b7f Mon Sep 17 00:00:00 2001 From: djerun Date: Sat, 28 Jun 2025 01:41:42 +0200 Subject: [PATCH] [WIP] align chamfer --- globals.scad | 4 ++-- headband.scad | 2 +- primitives.scad | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/globals.scad b/globals.scad index 2f53cd2..1d74fc4 100644 --- a/globals.scad +++ b/globals.scad @@ -12,8 +12,8 @@ RAKE_WIDTH=1; RAKE_STRETCH=1; RAKE_CHAMFER=0.5; CHAMFER=1; -CHAMFER_SHAPE="curve"; +CHAMFER_SHAPE="cone"; INSERTICLE_X = 4.6; INSERTICLE_Y = 7.4; -INSERTICLE_Z = 5.4; \ No newline at end of file +INSERTICLE_Z = 5.4; diff --git a/headband.scad b/headband.scad index 768ea3a..53465e7 100644 --- a/headband.scad +++ b/headband.scad @@ -4,7 +4,7 @@ use module headband(debug=DEBUG, size=SIZE, height=HEIGHT, thickness=THICKNESS, part=PART, stretch_len=STRETCH_LEN, tip_len=TIP_LEN, tip_bend=TIP_BEND, rake_depth=RAKE_DEPTH, rake_width=RAKE_WIDTH, rake_stretch=RAKE_STRETCH, rake_chamfer=RAKE_CHAMFER, chamfer=CHAMFER, chamfer_shape=CHAMFER_SHAPE, with_rake=true, details=true) { union() { - /*chamfer(size=(details)?chamfer:0, child_h=height, child_bot=-height/2, shape=chamfer_shape)*/ union() { + chamfer(size=(details)?chamfer:0, child_h=height, child_bot=-height/2, shape=chamfer_shape) union() { color("purple") partial_ring(part, radius=size, thickness=thickness, height=height); rotate( 90-180*part, [0, 0, 1]) diff --git a/primitives.scad b/primitives.scad index 72d37ca..7b4959c 100644 --- a/primitives.scad +++ b/primitives.scad @@ -37,7 +37,8 @@ module bezier_curve_debug(control_points, $fn=$fn) { // c^2=2a^2 // /2 // c^2/2=a^2 // sqrt // sqrt(c^2/2)=a -chamfer_offset = function (c) sqrt((c*c)/2); +//chamfer_offset = function (c) sqrt((c*c)/2); +chamfer_offset = function (c) c/2; rendered_curve_segment_vertices = function (p, v, n, width, height, chamfer) let (d=normalize(n-p)) let (up=[0, 0, 1]) let (right=normalize(cross(d, up))) [