From d150fea651d1788af06ca4787876cf2dc1c1a9ca Mon Sep 17 00:00:00 2001
From: Michael Sippel <micha@fragmental.art>
Date: Mon, 7 Oct 2024 21:25:35 +0200
Subject: [PATCH] refactor ripple_stencil into separate module

---
 handlebar_grip.scad | 44 ++++++++++++++++++++++++--------------------
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/handlebar_grip.scad b/handlebar_grip.scad
index 0361e22..bc8cda2 100644
--- a/handlebar_grip.scad
+++ b/handlebar_grip.scad
@@ -47,30 +47,34 @@ module handle_shape(l=0) {
    }
 }
 
-module handle() {
-    difference() {
-        handle_shape();
+module ripple_stencil() {
+    translate([0,0,-1]) {
+        for( z = [0:10] ) {
+            translate([0,0,z*(LEN-5)/10]) {
+                hull() {
+                    cylinder(h=0.1, d=DIAM+1, $fn=64);
 
-        translate([0,0,-1]) {
-            for( z = [0:10] ) {
-              translate([0,0,z*(LEN-5)/10]) {
-                  hull() {
-                      cylinder(h=0.1, d=DIAM+1, $fn=64);
-
-                      translate([0,0,(LEN-5)/10])
-                      cylinder(h=0.1, d=DIAM-1, $fn=64);
-                  }
-              }
+                    translate([0,0,(LEN-5)/10])
+                    cylinder(h=0.1, d=DIAM-1, $fn=64);
+                }
             }
         }
+    }
 
-        translate([0,0,LEN+3+5])
-        difference() {
-            cylinder(h=10, d=DIAM-3, $fn=64);
-            
-            translate([0,0,-8])
-            cylinder(h=10, d=DIAM-8, $fn=64);
-        }
+    translate([0,0,LEN+3+5])
+    difference() {
+        cylinder(h=10, d=DIAM-3, $fn=64);
+
+        translate([0,0,-8])
+        cylinder(h=10, d=DIAM-8, $fn=64);
+    } 
+}
+
+module handle() {
+    difference()
+    {
+        handle_shape();
+        ripple_stencil();
     }
 }