Skip to content

Instantly share code, notes, and snippets.

@patmandenver
Last active April 5, 2022 11:36
Show Gist options
  • Select an option

  • Save patmandenver/f12507f6f018d0deae49dd53c79213e2 to your computer and use it in GitHub Desktop.

Select an option

Save patmandenver/f12507f6f018d0deae49dd53c79213e2 to your computer and use it in GitHub Desktop.
3D printing OpenScad Corgi XING
//
// Created by Patrick Bailey iQless.com
//
////////////////////////////////////////
$fn=200;
size = 170;
corner_radius = 15;
sign_height = 2;
corgi_height = 0.45;
corgi_adjust = [-113, -60];
corgi_scale = .87;
corgi_image_file = "../corgi.svg";
sign_font = "Arial:style=Black";
screw_holes=true;
rotate([0,0,45]){
union(){
back_sign(size, corner_radius, sign_height, screw_holes);
black_border(size, corner_radius, sign_height, corgi_height);
corgi(corgi_image_file, sign_height, corgi_height,
corgi_scale, corgi_adjust);
color("black"){
translate([0,0,sign_height-.1]){
linear_extrude(corgi_height+.1){
words("CORGI",sign_font, 22, [0,65]);
words("XING",sign_font, 22, [0,-75]);
}
}
}
}
}
module back_sign(size, corner_radius, height, screw_holes){
color("yellow"){
difference(){
linear_extrude(sign_height){
sign_2d(size, corner_radius);
}
//screw holes
if(screw_holes){
mirror_copy([0,1,0]){
translate([0,sin(45)*size - corner_radius/2,-.1]){
cylinder(height+2, 2.5, 2.5, $fn=6);
translate([0,0, height/2]){
cylinder(height/2+1, 5, 5, $fn=6);
}
}
}
}
}
}
}
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);
}
}
}
}
}
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