From bbef35cb314c489e0765fcc0233a3dd647690cb2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 13 Feb 2016 17:00:35 +0000 Subject: [PATCH] cable-splice-clamp: make plus work; fix wall_x --- cable-splice-clamp.scad | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cable-splice-clamp.scad b/cable-splice-clamp.scad index c23c936..dd376d6 100644 --- a/cable-splice-clamp.scad +++ b/cable-splice-clamp.scad @@ -56,22 +56,25 @@ y_T_r = -tana * sina; top_r = wall_r - (d_OC_r - 1); +wall_x_r = wall_r / tan(90-alpha); + echo(r0,r1, "ratio",r1/r0); module CrossSection(plus=0) { difference(){ - polygon([[-0.1, y_T_r * r0], - [x_T_r * r0, y_T_r * r0], - [x_B_r * r1, y_B_r * r1], - [x_B_r * r1 + wall_r * rnom, y_B_r * r1], - [base_r * rnom, top_r * rnom], - [-0.1, top_r * rnom]]); + polygon([[-0.1, y_T_r * r0], + [x_T_r * r0, y_T_r * r0], + [x_B_r * r1, y_B_r * r1], + [x_B_r * r1 + wall_x_r * rnom + plus, y_B_r * r1], + [base_r * rnom + plus, top_r * rnom], + [-0.1, top_r * rnom]]); translate([0, -d_OC_r * r0]) circle(r = r0); } } module CrossSectionDemo(){ ////toplevel + color("black") CrossSection(2); CrossSection(); for (rc=[["red", r1], ["blue",r0]]) { -- 2.30.2