From b342b09dab8a22ec213deb17bbadb5a7a825d983 Mon Sep 17 00:00:00 2001 From: Ajabep Date: Fri, 9 Jan 2026 20:31:34 +0100 Subject: [PATCH] Fix indent, some typo, and all of that --- c3cat-bottle-clip/c3cat-bottle-clip.scad | 107 ++++++++++++----------- 1 file changed, 58 insertions(+), 49 deletions(-) diff --git a/c3cat-bottle-clip/c3cat-bottle-clip.scad b/c3cat-bottle-clip/c3cat-bottle-clip.scad index 19a51e7..960978a 100644 --- a/c3cat-bottle-clip/c3cat-bottle-clip.scad +++ b/c3cat-bottle-clip/c3cat-bottle-clip.scad @@ -33,8 +33,8 @@ $fn = 360; NAME = "c3cat"; LOGO_FILE = ""; // empty string is catear model RENDER_COLOR_ONE = true; -RENDER_COLOR_TWO = true; -RENDER_COLOR_THREE = true; +RENDER_COLOR_TEXT = true; +RENDER_COLOR_LOGO = true; USE_TINY_EARS = true; /** @@ -48,9 +48,9 @@ USE_TINY_EARS = true; * rl: the radius on the lower side of the clip * ht: the height of the clip * width: the thickness of the wall. Values near 2.5 usually result in a good - * clippiness for PLA prints. + * clippiness for PLA prints. * name: the name that is printed on your name tag. For the default ru/rt/ht - * values, this string should not exceed 18 characters to fit on the name tag. + * values, this string should not exceed 18 characters to fit on the name tag. * font: the path to a font for Write.scad. */ @@ -61,9 +61,18 @@ USE_TINY_EARS = true; */ scale([0.2, 0.2, 0.2]) { difference() { - scale([5, 5, 5]) rotate(45, [0, 0, 1]) bottle_clip(name=NAME); - 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(); + scale([5, 5, 5]) + rotate(45, [0, 0, 1]) + bottle_clip( + name=NAME); + + 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(); } if (RENDER_COLOR_TWO) { color("orange") @@ -82,7 +91,7 @@ scale([0.2, 0.2, 0.2]) { module name(name, font, rl, ht, ru) { writecylinder( text=name, - where=[0,0,0], + where=[0, 0, 0], radius=rl+0.5, height=ht/13*7, h=ht/13*4, @@ -91,22 +100,22 @@ module name(name, font, rl, ht, ru) { } module logo(logo, rl, ht, ru, width) { - echo("logo: ", logo); + echo(logo=logo); if(logo == "") { ear_size=ht; - echo("ht: ", ht); - echo("ru: ", ru); - echo("rl: ", rl); - echo("width: ", width); - translate([0,-max(ru,rl),ht*3/4+.5]) - rotate([90,0,0]) - scale([1,1,1]) - scale([ht/100,ht/100,1]) - translate([0, -ht/2,0]) + echo(ht=ht); + echo(ru=ru); + echo(rl=rl); + echo(width=width); + translate([0, -max(ru,rl), ht*3/4+.5]) + rotate([90, 0, 0]) + 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), + height=max(ru, rl), thickness=width, stretch_len=0, tip_len=0, @@ -114,38 +123,38 @@ module logo(logo, rl, ht, ru, width) { with_rake=false ); } else { - // The logo has been split in 3 parts. // well was... TODO + // 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 - rotate([0,0,-45]) { + e = 100; // should be big enough, used for the outer boundary of the text/logo + rotate([0, 0, -45]) { // main cylinder if (RENDER_COLOR_ONE) { color("black") difference() { @@ -157,12 +166,12 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o } cylinder(r1=rl+width/2, r2=ru+width/2, h=ht); } - translate([0,0,-1]) + 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 + // finally, subtract 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]); + translate([0, 0, -1]) + cube([50, 50, 50]); } } // text @@ -185,11 +194,11 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o } module outer_cutoff(rl, e, ru, ht, width) { - // outer cylinder which is substracted, so the text and the logo end + // outer cylinder which is subtracted, so the text and the logo end // somewhere on the outside ;-) difference () { cylinder(r1=rl+e, r2=ru+e, h=ht); - translate([0,0,-1]) + translate([0, 0, -1]) // Note: bottom edges of characters are hard to print when character // depth is > 0.7 cylinder(r1=rl+width+0.7, r2=ru+width+0.7, h=ht+2);