From 09bd3720714da839624a8ee154a7a5fa01e0bbd1 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Mon, 20 Nov 2023 12:54:09 -0500 Subject: Move badge rendering to case/logo.scad --- case/logo.scad | 19 +++++++++++++++++++ case/top.scad | 41 +++++++++-------------------------------- 2 files changed, 28 insertions(+), 32 deletions(-) create mode 100644 case/logo.scad (limited to 'case') diff --git a/case/logo.scad b/case/logo.scad new file mode 100644 index 0000000..3153ca1 --- /dev/null +++ b/case/logo.scad @@ -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); + } +} diff --git a/case/top.scad b/case/top.scad index 8288862..1b85f38 100644 --- a/case/top.scad +++ b/case/top.scad @@ -3,6 +3,7 @@ $fn = 72; include include include +include 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); - } - - module sextile() { - module shape(width) { - ratio = 33 / 197; - margin = 0.5; - - for (angle = [0, -55, 55]) { - rotate([0, 0, angle]) - square([width + margin, ratio * width + 2*margin], true); - } - } + logotype(size=10); - width = 16.0; - offset_y = keyboard_y_offset + (keyboard_switch_width + accent_width) / 2; - offset_x = case_width_bottom - width; + sextile_width = 16.0; + sextile_y = keyboard_y_offset + (keyboard_switch_width + accent_width) / 2; + sextile_x = case_width_bottom - sextile_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(); -- cgit v1.2.3