Move badge rendering to case/logo.scad
This commit is contained in:
parent
ba7a24b16b
commit
09bd372071
2 changed files with 28 additions and 32 deletions
19
case/logo.scad
Normal file
19
case/logo.scad
Normal file
|
@ -0,0 +1,19 @@
|
|||
module logotype(size) {
|
||||
font = "Proxima Nova Semibold";
|
||||
font_size_ratio = 1/5;
|
||||
|
||||
text("XANTRONIX", font=font, size=size*font_size_ratio);
|
||||
|
||||
translate([16, 0, 0])
|
||||
text("Z32", font=font, size=size);
|
||||
}
|
||||
|
||||
module sextile(width) {
|
||||
ratio = 33 / 197;
|
||||
margin = 0.5;
|
||||
|
||||
for (angle = [0, -55, 55]) {
|
||||
rotate([0, 0, angle])
|
||||
square([width + margin, ratio * width + 2*margin], true);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ $fn = 72;
|
|||
include <dimensions.scad>
|
||||
include <support.scad>
|
||||
include <keyboard.scad>
|
||||
include <logo.scad>
|
||||
|
||||
module top_case(with_keyboard=false) {
|
||||
keyboard_deck_z_offset = wall_height - keyboard_switch_height;
|
||||
|
@ -158,43 +159,20 @@ module top_case(with_keyboard=false) {
|
|||
}
|
||||
}
|
||||
|
||||
module logotype() {
|
||||
module logotype_text(size) {
|
||||
size_ratio = 1/5;
|
||||
|
||||
text("XANTRONIX", font="Proxima Nova Semibold", size=size*size_ratio);
|
||||
|
||||
translate([16, 0, 0])
|
||||
text("Z32", font="Proxima Nova Semibold", size=size);
|
||||
}
|
||||
|
||||
size = 10;
|
||||
|
||||
module badges() {
|
||||
translate([keyboard_x_offset,
|
||||
keyboard_y_offset + keyboard_pcb_length + keyboard_switch_length + accent_width,
|
||||
wall_height - accent_depth])
|
||||
linear_extrude(accent_depth + eps)
|
||||
logotype_text(size);
|
||||
}
|
||||
logotype(size=10);
|
||||
|
||||
module sextile() {
|
||||
module shape(width) {
|
||||
ratio = 33 / 197;
|
||||
margin = 0.5;
|
||||
sextile_width = 16.0;
|
||||
sextile_y = keyboard_y_offset + (keyboard_switch_width + accent_width) / 2;
|
||||
sextile_x = case_width_bottom - sextile_width;
|
||||
|
||||
for (angle = [0, -55, 55]) {
|
||||
rotate([0, 0, angle])
|
||||
square([width + margin, ratio * width + 2*margin], true);
|
||||
}
|
||||
}
|
||||
|
||||
width = 16.0;
|
||||
offset_y = keyboard_y_offset + (keyboard_switch_width + accent_width) / 2;
|
||||
offset_x = case_width_bottom - width;
|
||||
|
||||
translate([offset_x, offset_y, wall_height - accent_depth])
|
||||
translate([sextile_x, sextile_y, wall_height - accent_depth])
|
||||
linear_extrude(accent_depth + eps)
|
||||
shape(width);
|
||||
sextile(width=sextile_width);
|
||||
}
|
||||
|
||||
module body() {
|
||||
|
@ -221,10 +199,9 @@ module top_case(with_keyboard=false) {
|
|||
|
||||
difference() {
|
||||
body();
|
||||
logotype();
|
||||
sextile();
|
||||
accents();
|
||||
vents();
|
||||
badges();
|
||||
}
|
||||
|
||||
screw_posts();
|
||||
|
|
Loading…
Add table
Reference in a new issue