[WIP] badge_test

This commit is contained in:
djerun 2024-11-25 23:40:27 +01:00
parent 7950ae530e
commit effdc2e7e6
2 changed files with 76 additions and 0 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();