diff --git a/c3cat-bottle-clip/c3cat-bottle-clip.scad b/c3cat-bottle-clip/c3cat-bottle-clip.scad index 95f6176..0abfe50 100644 --- a/c3cat-bottle-clip/c3cat-bottle-clip.scad +++ b/c3cat-bottle-clip/c3cat-bottle-clip.scad @@ -34,7 +34,7 @@ LOGO_FILE = ""; // empty string is catear model FONT = ""; // empty string is for Orbitron font // Format of the bottle clip you want to create. -FORMAT = 0; // [0=Club Mate 50cL, 1=Long Neck as 25cL Club Mate or Fritz-kola, 2=Euroform 2, 3=Steinie bottles, 4=Monster can] +FORMAT = 0; // [0=Club Mate 50cL, 1=Long Neck as 25cL Club Mate or Fritz-kola, 2=Euroform 2, 3=Steinie bottles] // Style of the ears to add... or not add. This parameter can add a LOT of calculation time. EARS_STYLE = 0; // [0=No ears, 1=Just arcs, 2=Filled ears with the same thickness, 3=Filled ears with the a thinner thickness inside, 4=Filled ears with the same thickness but shifted] @@ -131,7 +131,7 @@ module render_bottle_clip(name="", font="", logo="", format=0, ears_style=1) { name = name == "" ? "c3cat" : name ; font = font == "" ? "write/orbitron.dxf" : font ; - if (format < 0 || format > 4) { + if (format < 0 || format > 3) { assert(false, str("Unknown format ", format, ".")); } @@ -139,10 +139,9 @@ module render_bottle_clip(name="", font="", logo="", format=0, ears_style=1) { // Format == 1: Long Neck bottle (like fritz-kola) 0.25L // Format == 2: Euroform 2 bottle // Format == 3: Steinie bottle - // Format == 4: Monster Can - ru = format == 4 ? 26 : 13; - rl = format == 4 ? 32 : format == 1 ? 15 : format == 2 ? 22.5 : 17.5 ; - ht = format == 4 ? 10 : format == 3 ? 13 : 26 ; + ru = 13; + rl = format == 1 ? 15 : format == 2 ? 22.5 : 17.5 ; + ht = format == 3 ? 13 : 26 ; width = 2.5; @@ -155,8 +154,7 @@ module render_bottle_clip(name="", font="", logo="", format=0, ears_style=1) { ru=ru, rl=rl, ht=ht, - width=width, - format=format); + width=width); // Render ears if requested if (ears_style > 0) { @@ -197,18 +195,18 @@ module render_bottle_clip(name="", font="", logo="", format=0, ears_style=1) { } } -module name(name, font, rl, ht, ru, format) { +module name(name, font, rl, ht, ru) { writecylinder( text=name, where=[0, 0, 0], radius=rl+0.5, - height=format == 4 ? ht : ht/13*7, - h=format == 4 ? ht/13*7 : ht/13*4, + height=ht/13*7, + h=ht/13*4, t=max(rl,ru), font=font); } -module logo(logo, rl, ht, ru, width, format) { +module logo(logo, rl, ht, ru, width) { echo(logo=logo); if(logo == "") { // No logo file specified? Let's print a catear headband instead! @@ -217,20 +215,21 @@ module logo(logo, rl, ht, ru, width, format) { echo(ru=ru); echo(rl=rl); echo(width=width); - translate([0, -max(ru,rl), format == 4 ? ht/2 : ht*3/4+.5]) + translate([0, -max(ru,rl), ht*3/4+.5]) rotate([90, 0, 0]) - scale([format == 4 ? ht/50 : ht/100, format == 4 ? ht/50 : ht/100, 1]) - translate([0, format == 4 ? 0 : -ht/2, 0]) - rotate(-90, [0, 0, 1]) - catear_headband( - size=ear_size, - height=max(ru, rl), - thickness=width, - stretch_len=0, - tip_len=0, - details=false, - with_rake=false - ); + scale([1, 1, 1]) + scale([ht/100, ht/100, 1]) + translate([0, -ht/2, 0]) + rotate(-90, [0, 0, 1]) + catear_headband( + size=ear_size, + height=max(ru, rl), + thickness=width, + stretch_len=0, + tip_len=0, + details=false, + with_rake=false + ); } else { translate([0, 0, ht*3/4-0.1]) rotate([90, 0, 0]) @@ -261,7 +260,7 @@ module logo(logo, rl, ht, ru, width, format) { * * An empty logo file will create a headband with cat ears as a logo. */ -module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/orbitron.dxf", logo="", format=0) { +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 // main cylinder @@ -270,12 +269,8 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o cylinder(r1=rl+width, r2=ru+width, h=ht); difference() { union() { - if (name != "" || format != 4) { - name(name=name, font=font, rl=rl, ht=ht, ru=ru, format=format); - } - if (name == "" || format != 4) { - logo(logo=logo, rl=rl, ht=ht, ru=ru, width=width, format=format); - } + name(name=name, font=font, rl=rl, ht=ht, ru=ru); + logo(logo=logo, rl=rl, ht=ht, ru=ru, width=width); } cylinder(r1=rl+width/2, r2=ru+width/2, h=ht); } @@ -286,21 +281,21 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o // finally, subtract a cube as a gap so we can clip it to the bottle rotate([0, 0, 45]) translate([0, 0, -1]) - cube([rl+ru, rl+ru, 2*ht]); + cube([50, 50, 50]); } } // text - if (RENDER_COLOR_TEXT && (name != "" || format != 4)) { + if (RENDER_COLOR_TEXT) { color("orange") difference() { - name(name=name, font=font, rl=rl, ht=ht, ru=ru, format=format); + name(name=name, font=font, rl=rl, ht=ht, ru=ru); cylinder(r1=rl+width/2, r2=ru+width/2, h=ht); outer_cutoff(rl, e, ru, ht, width); } } // logo - if (RENDER_COLOR_LOGO && (name == "" || format != 4)) { + if (RENDER_COLOR_LOGO) { color("yellow") difference() { - logo(logo=logo, rl=rl, ht=ht, ru=ru, width=2*width, format=format); + logo(logo=logo, rl=rl, ht=ht, ru=ru, width=2*width); cylinder(r1=rl+width/2, r2=ru+width/2, h=ht); outer_cutoff(rl, e, ru, ht, width); }