Created
April 13, 2022 11:14
-
-
Save patmandenver/aff8f2670ca76f9f8aece356464af46b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by Patrick Bailey iQless.com | |
// | |
//////////////////////////////////////// | |
$fn=200; | |
size = 50; | |
corner_radius = 5; | |
sign_height =8; | |
corgi_height = 0.45; | |
corgi_adjust = [-2.3, 1]; | |
corgi_scale = .25; | |
corgi_image_file = "corgi.svg"; | |
sign_font = "Arial:style=Black"; | |
magnet_dia = 32.2; //33 too big | |
magnet_height = 3.3; | |
magnet_depth = .8; | |
difference(){ | |
union(){ | |
back_sign(size, corner_radius, sign_height - 2, 1.0); | |
rotate([0,180,0]){ | |
back_sign(size, corner_radius, 2, .95); | |
} | |
black_border(size, corner_radius, sign_height - 2, corgi_height); | |
corgi(corgi_image_file, sign_height - 2, corgi_height, | |
corgi_scale, corgi_adjust); | |
color("black"){ | |
translate([0,0,sign_height-.1 - 2]){ | |
linear_extrude(corgi_height+.1){ | |
words("CORGI",sign_font, 7, [0,18]); | |
words("XING",sign_font, 7, [0,-22]); | |
} | |
} | |
} | |
} | |
translate([0,0, magnet_height/2 - 2 + magnet_depth]){ | |
cylinder(magnet_height, d = magnet_dia, center=true); | |
} | |
} | |
module back_sign(size, corner_radius, sign_height, scale_it){ | |
color("yellow"){ | |
linear_extrude(sign_height, scale = scale_it){ | |
sign_2d(size, corner_radius); | |
} | |
} | |
} | |
module black_border(size, corner_radius, sign_height, corgi_height){ | |
color("black"){ | |
translate([0,0,sign_height-.1]){ | |
linear_extrude(corgi_height+.1){ | |
difference(){ | |
sign_2d(size-corner_radius/2, corner_radius); | |
sign_2d(size-corner_radius, corner_radius); | |
} | |
} | |
} | |
} | |
} | |
module sign_2d(size, corner_radius){ | |
d = sin(45)*size; | |
hull(){ | |
translate([d, 0, 0]){ | |
circle(corner_radius); | |
} | |
translate([0, d, 0]){ | |
circle(corner_radius); | |
} | |
translate([-d, 0, 0]){ | |
circle(corner_radius); | |
} | |
translate([0, -d, 0]){ | |
circle(corner_radius); | |
} | |
} | |
} | |
module corgi(corgi_image_file, sign_height, corgi_height, | |
corgi_scale, corgi_adjust){ | |
color("black"){ | |
translate([corgi_adjust[0],corgi_adjust[1],sign_height-.1]){ | |
linear_extrude(corgi_height + .1){ | |
scale([corgi_scale,corgi_scale,1]){ | |
import(corgi_image_file, center=true); | |
} | |
} | |
} | |
} | |
} | |
module words(word,sign_font, font_size, position){ | |
translate([position[0], position[1]]){ | |
text(word, size=font_size, | |
valign= "center", | |
halign="center", font=sign_font); | |
} | |
} | |
module mirror_copy(v = [1, 0, 0]) { | |
children(); | |
mirror(v) children(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment