From 122788decc32402a1c41000bf82e541279c8543c Mon Sep 17 00:00:00 2001
From: Jochen Vothknecht <jochen3120@gmail.com>
Date: Wed, 29 Sep 2021 22:55:50 +0200
Subject: [PATCH] Splitting executing between render and preview mode

---
 HeatSink.scad | 38 ++++++++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/HeatSink.scad b/HeatSink.scad
index 9f8bd73..f052683 100644
--- a/HeatSink.scad
+++ b/HeatSink.scad
@@ -1,8 +1,4 @@
 
-$fs = 0.2;
-$fa = $fs;
-
-
 use <WebWeaver/scad/Util.scad>;
 use <WebWeaver/scad/Piping.scad>;
 
@@ -286,19 +282,37 @@ module splitFunnel() {
 
 
 
+// TODO: choose a better name!
+// `overallSystem` describes it… but it sound bad :(
+module overallSystem() {
 
+  if ($preview) {
+    
+    $fs = 0.5;
+    $fa = 10;
 
-module preview() {
+    // display heat sink only in render mode
+    rotate([180, 0, 0]) symmetricHeatsink();
+    
+    
+    // translate([0, 0, 0]) curvyFunnel();  
+    translate([0, 0, 0]) splitFunnel();
 
-  // translate([0, 0, 0]) curvyFunnel();
-  
-  translate([0, 0, 0]) splitFunnel();
+    // color([0, 0, 1.0, 1.0]) translate([0, 0, 1]) linear_extrude(1) funnelFins();
+  } else {
 
-  // color([0, 0, 1.0, 1.0]) translate([0, 0, 1]) linear_extrude(1) funnelFins();
-  
-  rotate([180, 0, 0]) symmetricHeatsink();
+    $fs = 0.2;
+    $fa = 1.0;
+    
+    // TODO: 3D-Print positioning!
+
+    // translate([0, 0, 0]) curvyFunnel();  
+    translate([0, 0, 0]) splitFunnel();
+
+    // color([0, 0, 1.0, 1.0]) translate([0, 0, 1]) linear_extrude(1) funnelFins();
+  }
 }
 
 
-preview();
+overallSystem();
 
-- 
GitLab