From 4914dda1ac7f0f00ca350539368931fad4a734f2 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 19 Sep 2019 09:58:58 +0800 Subject: [PATCH] add corn --- examples/floor_stand/floor_stand.scad | 47 +++++++------------- examples/floor_stand/floor_stand_symbol.scad | 5 ++- examples/floor_stand/floor_stand_text.scad | 5 ++- src/part/cone.scad | 30 +++++++++++++ 4 files changed, 53 insertions(+), 34 deletions(-) create mode 100644 src/part/cone.scad diff --git a/examples/floor_stand/floor_stand.scad b/examples/floor_stand/floor_stand.scad index d969586e..da000b63 100644 --- a/examples/floor_stand/floor_stand.scad +++ b/examples/floor_stand/floor_stand.scad @@ -1,8 +1,9 @@ -module floor_stand(width, height, thickness, joint_spacing) { +module floor_stand(width, height, thickness, spacing) { half_w = width / 2; half_h = height / 2; half_th = thickness / 2; - half_sc = joint_spacing / 2; + + double_spacing = spacing * 2; $fn = 24; @@ -21,23 +22,8 @@ module floor_stand(width, height, thickness, joint_spacing) { } } - module joint_tops(dist) { - module joint_top() { - linear_extrude(thickness / 4 + half_sc, scale = 0.1) - circle(thickness / 4 + half_sc); - } - - half_d = dist / 2; - translate([-half_d, 0, 0]) - rotate([0, -90, 0]) - joint_top(); - - translate([half_d, 0, 0]) - rotate([0, 90, 0]) - joint_top(); - } - module board_U() { + angles = [0, 90, 0]; difference() { union() { linear_extrude(thickness, center = true) @@ -45,38 +31,39 @@ module floor_stand(width, height, thickness, joint_spacing) { board_base(); square([width / 1.5, height / 3], center = true); } - rotate([0, 90, 0]) + rotate(angles) linear_extrude(width / 2.25 * 2, center = true) - circle(thickness / 2); + circle(half_th); } - rotate([0, 90, 0]) + rotate(angles) { linear_extrude(width / 1.5, center = true) circle(thickness, $fn = 24); - - joint_tops(half_w / 1.5 * 2); + + cone(half_th - spacing, length = half_w / 1.5 - spacing, spacing = spacing, heads = true, void = true); + } } } module board_T() { linear_extrude(thickness, center = true) - union() { + union() { difference() { board_base(); square([width, height / 3], center = true); } - translate([0, -height / 12 - joint_spacing / 4, 0]) + translate([0, -height / 12 - spacing / 2, 0]) difference() { - square([width / 1.5 - joint_spacing, height / 6 + joint_spacing / 2], center = true); + square([width / 1.5 - double_spacing, height / 6 + spacing], center = true); square([width / 1.5 - thickness * 2, height / 6], center = true); } } - rotate([0, 90, 0]) - linear_extrude(width / 1.5 - joint_spacing, center = true) + rotate([0, 90, 0]) { + linear_extrude(width / 1.5 - double_spacing, center = true) circle(half_th, $fn = 24); - - joint_tops(half_w / 1.5 * 2 - joint_spacing); + cone(half_th - spacing, length = half_w / 1.5 - spacing, spacing = spacing, heads = true); + } } module border() { diff --git a/examples/floor_stand/floor_stand_symbol.scad b/examples/floor_stand/floor_stand_symbol.scad index 95a566f3..f8d7b640 100644 --- a/examples/floor_stand/floor_stand_symbol.scad +++ b/examples/floor_stand/floor_stand_symbol.scad @@ -4,6 +4,7 @@ include ; include ; include ; include ; +include ; text = " Taiwan"; font = "Arial Black"; @@ -13,7 +14,7 @@ line_spacing = 7; stand_width = 40; stand_height = 80; stand_thickness = 4; -joint_spacing = 1; +stand_spacing = 0.5; symbol_source = "DEFAULT"; // [DEFAULT, PNG, UNICODE] @@ -71,5 +72,5 @@ module content(text, font, font_size, symbol_png, symbol_unicode, symbol_font, s } } -floor_stand(stand_width, stand_height, stand_thickness, joint_spacing) +floor_stand(stand_width, stand_height, stand_thickness, stand_spacing) content(text, font, font_size, symbol_png, symbol_unicode, symbol_font, symbol_font_size, stand_height, stand_thickness, line_spacing); diff --git a/examples/floor_stand/floor_stand_text.scad b/examples/floor_stand/floor_stand_text.scad index b15a67ac..b1443d74 100644 --- a/examples/floor_stand/floor_stand_text.scad +++ b/examples/floor_stand/floor_stand_text.scad @@ -3,6 +3,7 @@ include ; include ; include ; include ; +include ; text = "Coder at Work"; font = "Arial Black"; @@ -12,7 +13,7 @@ line_spacing = 10; stand_width = 40; stand_height = 80; stand_thickness = 4; -joint_spacing = 1; +stand_spacing = 0.5; module words(text, font, font_size, height, thickness, line_spacing) { half_th = thickness / 2; @@ -31,5 +32,5 @@ module words(text, font, font_size, height, thickness, line_spacing) { } } -floor_stand(stand_width, stand_height, stand_thickness, joint_spacing) +floor_stand(stand_width, stand_height, stand_thickness, stand_spacing) words(text, font, font_size, stand_height, stand_thickness, line_spacing); \ No newline at end of file diff --git a/src/part/cone.scad b/src/part/cone.scad new file mode 100644 index 00000000..b86bdc2a --- /dev/null +++ b/src/part/cone.scad @@ -0,0 +1,30 @@ +module cone(radius, length = 0, spacing = 0.5, angle = 50, void = false, heads = false) { + module base(r) { + rotate_extrude() { + if(length != 0) { + square([r, length]); + } + polygon([ + [0, length], [r, length], [0, r * tan(angle) + length] + ]); + } + + } + + module head() { + if(void) { + base(radius + spacing); + } + else { + base(radius); + } + } + + if(heads) { + head(); + mirror([0, 0, 1]) head(); + } + else { + head(); + } +} \ No newline at end of file