Compare commits

...

2 commits

Author SHA1 Message Date
djerun effdc2e7e6 [WIP] badge_test 2024-12-08 19:18:29 +01:00
djerun 7950ae530e c3cat_bottle_tag v2.2 2024-11-29 18:53:44 +01:00
3 changed files with 85 additions and 4 deletions

4
badge_test.json Normal file
View file

@ -0,0 +1,4 @@
{
"parameterSets": "",
"fileFormatVersion": "1"
}

72
badge_test.scad Normal file
View file

@ -0,0 +1,72 @@
$fn=32;
LAYER_HEIGHT=1;
NAME="c6hex";
COLOR_BASE="#ffffff";
COLOR_LOGO="#7f7f7f";
COLOR_NAME="#7f7fff";
RENDER_BASE_COLOR=true;
RENDER_LOGO_COLOR=true;
RENDER_NAME_COLOR=true;
module name() {
translate([18, 4, 0]) text(NAME, font="Roboto:bold");
}
module logo() {
translate([10, 10])
scale([16, 16])
circle(d=1, $fn=6);
}
module name_outline() {
minkowski() {
name();
circle(r=2.5);
}
}
module logo_outline() {
minkowski() {
logo();
circle(r=2);
}
}
module outline() {
union() {
name_outline();
logo_outline();
}
}
module name_cutout() {
difference() {
outline();
name();
}
}
module logo_cutout() {
difference() {
name_cutout();
logo();
}
}
module name_cutout_plate() {
linear_extrude(height=LAYER_HEIGHT) name_cutout();
}
module logo_cutout_plate() {
linear_extrude(height=LAYER_HEIGHT) logo_cutout();
}
module name_base_plate() {
linear_extrude(height=LAYER_HEIGHT) outline();
}
if (RENDER_BASE_COLOR) color(COLOR_BASE) translate([0, 0, 3*LAYER_HEIGHT]) logo_cutout_plate();
if (RENDER_LOGO_COLOR) color(COLOR_LOGO) translate([0, 0, 2*LAYER_HEIGHT]) name_cutout_plate();
if (RENDER_NAME_COLOR) color(COLOR_NAME) translate([0, 0, 1*LAYER_HEIGHT]) name_base_plate();
if (RENDER_BASE_COLOR) color(COLOR_BASE) translate([0, 0, 0*LAYER_HEIGHT]) name_base_plate();

View file

@ -150,8 +150,13 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o
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);
difference() {
union() {
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);
}
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
@ -164,7 +169,7 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o
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);
cylinder(r1=rl+width/2, r2=ru+width/2, h=ht);
outer_cutoff(rl, e, ru, ht, width);
}
}
@ -172,7 +177,7 @@ module bottle_clip(ru=13, rl=17.5, ht=26, width=2.5, name="c3cat", font="write/o
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);
cylinder(r1=rl+width/2, r2=ru+width/2, h=ht);
outer_cutoff(rl, e, ru, ht, width);
}
}