Skip to content

Instantly share code, notes, and snippets.

@patmandenver
Created April 15, 2022 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patmandenver/4cae5eb780e0719714ad53346a635c51 to your computer and use it in GitHub Desktop.
Save patmandenver/4cae5eb780e0719714ad53346a635c51 to your computer and use it in GitHub Desktop.
//
// Created by Patrick Bailey iQless.com
//
////////////////////////////////////////
$fn=200;
stamp_knub = "stamp_knub.stl";
knub_height = 10;
knub_radius = 10;
wrapper_radius = 15;
svg_file = "bunny_01.svg";
svg_adjust = [0, -.5];
svg_scale = .0825;
stamp_ridge_height = 2.5;
reverse_svg = true;
padding = true;
union(){
stamp_svg(svg_file, svg_adjust, svg_scale, stamp_ridge_height,
knub_height, reverse_svg);
knub_import();
hex_wrapper(knub_height, knub_radius, wrapper_radius, padding);
custom_support(knub_height, stamp_ridge_height);
}
module custom_support(knub_height, stamp_ridge_height){
color("green"){
translate([0, 0, knub_height - .1]){
linear_extrude(stamp_ridge_height-.3){
translate([-3.5,-8.8]){
circle(1.2);
}
translate([1.7,-9.3]){
circle(1.05);
}
}
}
}
}
module hex_wrapper(knub_height, knub_radius, wrapper_radius, padding){
if(padding){
color("blue", 0.5){
linear_extrude(knub_height){
rotate(30){
difference(){
circle(wrapper_radius, $fn=6);
circle(knub_radius - .1);
}
}
}
}
}
}
module stamp_svg(svg_file, svg_adjust, svg_scale,
stamp_ridge_height, knub_height, reverse_svg){
color("white"){
if (reverse_svg){
rotate(180){
mirror([0,1,0]){
stamp_svg_initial(svg_file, svg_adjust, svg_scale,
stamp_ridge_height, knub_height);
}
}
}
else{
stamp_svg_initial(svg_file, svg_adjust, svg_scale,
stamp_ridge_height, knub_height);
}
}
}
module stamp_svg_initial(svg_file, svg_adjust, svg_scale,
stamp_ridge_height, knub_height){
translate([0,0, knub_height]){
translate([svg_adjust[0], svg_adjust[1],-.1]){
linear_extrude(stamp_ridge_height + .1){
scale([svg_scale,svg_scale,1]){
import(svg_file, center=true);
}
}
}
}
}
module knub_import(){
color("red", 0.5){
import(stamp_knub, center=true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment