From c35d2c8d4466560398a9a8f7aa980fff00760e50 Mon Sep 17 00:00:00 2001
From: Jochen Vothknecht <jochen3120@gmail.com>
Date: Fri, 1 Oct 2021 08:26:11 +0200
Subject: [PATCH] curvy pipe mathematics

---
 HeatSink.scad | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/HeatSink.scad b/HeatSink.scad
index 06441f3..b5b0a7b 100644
--- a/HeatSink.scad
+++ b/HeatSink.scad
@@ -277,7 +277,20 @@ module splitFunnel() {
     
     sp_len = 10;  // TODO: calculate!
     
-    translate([0, 0, 0]) rotate([0, 0, 0]) straightPipe(fu_outlet_w, hs_h, sp_len, fu_r, fu_str);
+    // translate([hs_l/2, y_off, hs_h/2 + d]) rotate([90, 0, -90]) straightPipe(fu_outlet_w, hs_h, sp_len, fu_r, fu_str);
+    
+    
+    
+    // connecting a straight pipe to the end of a curve in a fully generic way
+    //
+    // step 1: move to a very specific point beneath origin
+    // step 2: rotate by curve pipe angle
+    // step 3: move to the beginning(!) of the curve pipe  where we want them to meet
+    //
+    translate([0, 0, 0])                                            // step 3
+      rotate([0, 0, -alpha])                                        // step 2
+      translate([0, -fu_outlet_w/2 - d/2, 0]) rotate([90, 0, -90])  // step 1
+      straightPipe(fu_outlet_w, hs_h, sp_len, fu_r, fu_str);
     
     
     
-- 
GitLab