From 839030f6b385f3c39e243ba063f3c9f7210a2e3b Mon Sep 17 00:00:00 2001 From: djerun Date: Thu, 21 Nov 2024 21:19:54 +0100 Subject: [PATCH] c3cat_bottle_tag v2.0 --- c3cat-bottle-clip/c3cat-bottle-clip.scad | 115 +++++++++++++---------- 1 file changed, 65 insertions(+), 50 deletions(-) diff --git a/c3cat-bottle-clip/c3cat-bottle-clip.scad b/c3cat-bottle-clip/c3cat-bottle-clip.scad index da96ba0..3c42e6f 100644 --- a/c3cat-bottle-clip/c3cat-bottle-clip.scad +++ b/c3cat-bottle-clip/c3cat-bottle-clip.scad @@ -65,9 +65,18 @@ scale([0.2, 0.2, 0.2]) { translate([ 15*5, 0*5, 18*5]) rotate(80, [0, 1, 0]) catear(); translate([-15*5, 0*5, 18*5]) rotate(-80, [0, 1, 0]) catear(); } - - translate([0, 5*5, 0]) catear(); - rotate(180) translate([0, 5*5, 0]) catear(); + if (RENDER_COLOR_TWO) { + color("orange") + translate([ 15*5, 0*5, 18*5]) + rotate(80, [0, 1, 0]) + catear(); + } + if (RENDER_COLOR_THREE) { + color("yellow") + translate([-15*5, 0*5, 18*5]) + rotate(-80, [0, 1, 0]) + catear(); + } } module name(name, font, rl, ht, ru) { @@ -107,61 +116,70 @@ module logo(logo, rl, ht, ru, width) { } else { // The logo has been split in 3 parts. // well was... TODO /* - rotate([0,0,-48]) translate([0,0,ht*3/4-0.1]) - rotate([90,0,0]) - scale([0.9,0.9,1]) - scale([ht/100,ht/100,1]) - translate([-25,-29,0.5]) - linear_extrude(height=max(ru,rl)*2) - import("logo_1.dxf"); + rotate([0,0,-48]) translate([0,0,ht*3/4-0.1]) + rotate([90,0,0]) + scale([0.9,0.9,1]) + scale([ht/100,ht/100,1]) + translate([-25,-29,0.5]) + linear_extrude(height=max(ru,rl)*2) + import("logo_1.dxf"); */ - translate([0,0,ht*3/4-0.1]) - rotate([90,0,0]) - scale([0.8,0.8,1]) - scale([ht/100,ht/100,1]) - translate([-18,-22,0.5]) - linear_extrude(height=max(ru,rl)*2) - import(logo); + translate([0,0,ht*3/4-0.1]) + rotate([90,0,0]) + scale([0.8,0.8,1]) + scale([ht/100,ht/100,1]) + translate([-18,-22,0.5]) + linear_extrude(height=max(ru,rl)*2) + import(logo); /* - rotate([0,0,44]) translate([0,0,ht*3/4-0.1]) - rotate([90,0,0]) - scale([0.7,0.7,1]) - scale([ht/100,ht/100,1]) - translate([-25,-26,0.5]) - linear_extrude(height=max(ru,rl)*2) - import("logo_3.dxf"); + rotate([0,0,44]) translate([0,0,ht*3/4-0.1]) + rotate([90,0,0]) + scale([0.7,0.7,1]) + scale([ht/100,ht/100,1]) + translate([-25,-26,0.5]) + linear_extrude(height=max(ru,rl)*2) + import("logo_3.dxf"); */ } } module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/orbitron.dxf", logo="") { - e=100; // should be big enough, used for the outer boundary of the text/logo - - difference() { - rotate([0,0,-45]) union() { - // main cylinder - if (RENDER_COLOR_ONE) { - color("black") - difference() { - cylinder(r1=rl+width, r2=ru+width, h=ht); - name(name=name, font=font, rl=rl, ht=ht, ru=ru); - logo(logo=logo, rl=rl, ht=ht, ru=ru, width=width); - } - } - // text - if (RENDER_COLOR_TWO) { - color("orange") + rotate([0,0,-45]) { + // main cylinder + if (RENDER_COLOR_ONE) { + color("black") difference() { + cylinder(r1=rl+width, r2=ru+width, h=ht); name(name=name, font=font, rl=rl, ht=ht, ru=ru); - } - // logo - if (RENDER_COLOR_THREE) { - color("yellow") logo(logo=logo, rl=rl, ht=ht, ru=ru, width=2*width); + logo(logo=logo, rl=rl, ht=ht, ru=ru, width=width); + translate([0,0,-1]) + cylinder(r1=rl, r2=ru, h=ht+2); + // finally, substract a cube as a gap so we can clip it to the bottle + rotate([0, 0, 45]) + translate([0,0,-1]) + cube([50,50,50]); } } - // inner cylinder which is substracted - translate([0,0,-1]) - cylinder(r1=rl, r2=ru, h=ht+2); + // text + if (RENDER_COLOR_TWO) { + color("orange") difference() { + name(name=name, font=font, rl=rl, ht=ht, ru=ru); + cylinder(r1=rl+width, r2=ru+width, h=ht); + outer_cutoff(rl, e, ru, ht, width); + } + } + // logo + if (RENDER_COLOR_THREE) { + color("yellow") difference() { + logo(logo=logo, rl=rl, ht=ht, ru=ru, width=2*width); + cylinder(r1=rl+width, r2=ru+width, h=ht); + outer_cutoff(rl, e, ru, ht, width); + } + } + } +} + +module outer_cutoff(rl, e, ru, ht, width) { // outer cylinder which is substracted, so the text and the logo end // somewhere on the outside ;-) difference () { @@ -171,9 +189,6 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o // depth is > 0.7 cylinder(r1=rl+width+0.7, r2=ru+width+0.7, h=ht+2); } - // finally, substract a cube as a gap so we can clip it to the bottle - translate([0,0,-1]) cube([50,50,50]); - } } module catear() {