c3cat_bottle_tag v2.1

This commit is contained in:
djerun 2024-11-21 21:19:54 +01:00
parent 69e8b09fa7
commit 90521c426a

View file

@ -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([-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) {
translate([0, 5*5, 0]) catear(); color("orange")
rotate(180) translate([0, 5*5, 0]) catear(); 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) { module name(name, font, rl, ht, ru) {
@ -107,61 +116,70 @@ module logo(logo, rl, ht, ru, width) {
} else { } 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([0,0,-48]) translate([0,0,ht*3/4-0.1])
rotate([90,0,0]) rotate([90,0,0])
scale([0.9,0.9,1]) scale([0.9,0.9,1])
scale([ht/100,ht/100,1]) scale([ht/100,ht/100,1])
translate([-25,-29,0.5]) translate([-25,-29,0.5])
linear_extrude(height=max(ru,rl)*2) linear_extrude(height=max(ru,rl)*2)
import("logo_1.dxf"); import("logo_1.dxf");
*/ */
translate([0,0,ht*3/4-0.1]) translate([0,0,ht*3/4-0.1])
rotate([90,0,0]) rotate([90,0,0])
scale([0.8,0.8,1]) scale([0.8,0.8,1])
scale([ht/100,ht/100,1]) scale([ht/100,ht/100,1])
translate([-18,-22,0.5]) translate([-18,-22,0.5])
linear_extrude(height=max(ru,rl)*2) linear_extrude(height=max(ru,rl)*2)
import(logo); import(logo);
/* /*
rotate([0,0,44]) translate([0,0,ht*3/4-0.1]) rotate([0,0,44]) translate([0,0,ht*3/4-0.1])
rotate([90,0,0]) rotate([90,0,0])
scale([0.7,0.7,1]) scale([0.7,0.7,1])
scale([ht/100,ht/100,1]) scale([ht/100,ht/100,1])
translate([-25,-26,0.5]) translate([-25,-26,0.5])
linear_extrude(height=max(ru,rl)*2) linear_extrude(height=max(ru,rl)*2)
import("logo_3.dxf"); import("logo_3.dxf");
*/ */
} }
} }
module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/orbitron.dxf", logo="") { 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 e=100; // should be big enough, used for the outer boundary of the text/logo
rotate([0,0,-45]) {
difference() { // main cylinder
rotate([0,0,-45]) union() { if (RENDER_COLOR_ONE) {
// main cylinder color("black") difference() {
if (RENDER_COLOR_ONE) { cylinder(r1=rl+width, r2=ru+width, h=ht);
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")
name(name=name, font=font, rl=rl, ht=ht, ru=ru); name(name=name, font=font, rl=rl, ht=ht, ru=ru);
} logo(logo=logo, rl=rl, ht=ht, ru=ru, width=width);
// logo translate([0,0,-1])
if (RENDER_COLOR_THREE) { cylinder(r1=rl, r2=ru, h=ht+2);
color("yellow") logo(logo=logo, rl=rl, ht=ht, ru=ru, width=2*width); // 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 // text
translate([0,0,-1]) if (RENDER_COLOR_TWO) {
cylinder(r1=rl, r2=ru, h=ht+2); 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 // outer cylinder which is substracted, so the text and the logo end
// somewhere on the outside ;-) // somewhere on the outside ;-)
difference () { 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 // depth is > 0.7
cylinder(r1=rl+width+0.7, r2=ru+width+0.7, h=ht+2); 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() { module catear() {