This repository has been archived on 2020-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
namensschilder/namensschild.scad.j2
Simon Bruder 8b38f192d5
All checks were successful
continuous-integration/drone/push Build is passing
Accurately invert text
2020-04-29 16:26:33 +02:00

45 lines
1,007 B
Django/Jinja

$fn=64;
//$fn=32;
length = 50/3;
width = 50;
name_length = 40/3;
name_width = 40;
height = 2;
height_plate = 1;
module name_file() {
translate([(width-name_width)/2, (length-name_length)/2, 0]) {
difference() {
hull() {
resize([name_width, name_length, 0]) import("{{ name}}.dxf");
}
resize([name_width, name_length, 0]) import("{{ name }}.dxf");
}
}
}
module box(height) {
hull() {
for(x=[0, width]) {
for(y=[0, length]) {
translate([x, y, 0]) linear_extrude(height) circle(r=1);
}
}
}
}
difference() {
union() {
difference() {
box(height);
translate([1.5, 1.5, height_plate]) resize([width-1, length-1, height-height_plate]) box(height-height_plate);
}
linear_extrude(height) {
name_file();
}
}
translate([width-2.5, length-2.5, 0]) linear_extrude(height_plate) circle(r=1.9);
}