From 0cfa818e3703d3da64478666071c54de6d82fffd Mon Sep 17 00:00:00 2001
From: DerGrumpf
Date: Fri, 16 Aug 2024 16:47:15 +0200
Subject: [PATCH] Updated Bottle
---
.gitignore | 1 +
Bottle Adapter/adapter.scad | 68 +++++++++++++++++++++++++++++++++++++
2 files changed, 69 insertions(+)
create mode 100644 .gitignore
create mode 100644 Bottle Adapter/adapter.scad
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e43b0f9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.DS_Store
diff --git a/Bottle Adapter/adapter.scad b/Bottle Adapter/adapter.scad
new file mode 100644
index 0000000..ef5852b
--- /dev/null
+++ b/Bottle Adapter/adapter.scad
@@ -0,0 +1,68 @@
+/*
+ module Adapter
+
+ parameters:
+ - height is the height of the Adapter (top to bottom)
+ - top_radius is the top radius
+ - bottom_radius is the bottom radius
+ */
+
+module Adapter(height, top_radius, bottom_radius) {
+ $fn = 128;
+ difference() {
+ cylinder(h = height, r1 = bottom_radius, r2 = top_radius);
+ translate([0,0,-0.5])
+ cylinder(h = height+1, r1 = bottom_radius*0.9, r2 = top_radius*.8);
+ }
+}
+
+
+/*
+ module PolyRing
+
+ parameters:
+ - height is the height of the Adapter (top to bottom)
+ - radius is the outer radius of the ring (inner radius is 80% of outer)
+ - sides is the number of sides at the ring
+ */
+
+module PolyRing(height, outer_radius, inner_radius, sides) {
+ $fn = sides;
+ difference() {
+ cylinder(h = height, r = outer_radius);
+
+ translate([0,0,-0.5])
+ cylinder(h = height+1, r = inner_radius);
+ }
+}
+
+/*
+ module BottleAdpater
+
+ parameters:
+ - radius is the radius defining the outer circle
+ - height is the height of the Adapter (top to bottom)
+ */
+
+module BottleAdapter(radius, height, adapter_radius) {
+ union() {
+ PolyRing(height/6, radius, radius*.6, 128);
+
+ translate([0, 0, height/6]) {
+ PolyRing(height/4, radius*0.95, radius*0.7, 8);
+ }
+
+ translate([0, 0, height*5/12]) {
+ PolyRing(height/8, radius*0.95, radius*0.7, 128);
+ }
+
+
+ translate([0, 0, height/2]) {
+ Adapter(height/2, adapter_radius, radius*.8);
+ }
+ }
+}
+
+BottleAdapter(32, 60, 40);
+rotate([180, 0, 0])
+BottleAdapter(32, 60, 32);
\ No newline at end of file