mirror of
https://git.hamburg.ccc.de/c3cat/scad.git
synced 2025-01-18 17:09:23 +01:00
Compare commits
2 commits
30b5285b6b
...
effdc2e7e6
Author | SHA1 | Date | |
---|---|---|---|
effdc2e7e6 | |||
7950ae530e |
4
badge_test.json
Normal file
4
badge_test.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"parameterSets": "",
|
||||||
|
"fileFormatVersion": "1"
|
||||||
|
}
|
72
badge_test.scad
Normal file
72
badge_test.scad
Normal 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();
|
|
@ -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) {
|
if (RENDER_COLOR_ONE) {
|
||||||
color("black") difference() {
|
color("black") difference() {
|
||||||
cylinder(r1=rl+width, r2=ru+width, h=ht);
|
cylinder(r1=rl+width, r2=ru+width, h=ht);
|
||||||
name(name=name, font=font, rl=rl, ht=ht, ru=ru);
|
difference() {
|
||||||
logo(logo=logo, rl=rl, ht=ht, ru=ru, width=width);
|
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])
|
translate([0,0,-1])
|
||||||
cylinder(r1=rl, r2=ru, h=ht+2);
|
cylinder(r1=rl, r2=ru, h=ht+2);
|
||||||
// finally, substract a cube as a gap so we can clip it to the bottle
|
// 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) {
|
if (RENDER_COLOR_TWO) {
|
||||||
color("orange") difference() {
|
color("orange") difference() {
|
||||||
name(name=name, font=font, rl=rl, ht=ht, ru=ru);
|
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);
|
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) {
|
if (RENDER_COLOR_THREE) {
|
||||||
color("yellow") difference() {
|
color("yellow") difference() {
|
||||||
logo(logo=logo, rl=rl, ht=ht, ru=ru, width=2*width);
|
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);
|
outer_cutoff(rl, e, ru, ht, width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue