Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Open scad prusa faceshield stacking code
$fn=100;
headband_file="Prusa_RC3_PLA.stl";
num=2;
adjust_base=12.5;
adjust_base_x=7.8;
support_thickness=1.2;
support_bridge=1.5;
heigth=20;
bump=0.30;
cylinder_size=0.4;
extend_for_testing=0; //Set to 10 to see cylinders
//Supports on just one side
support_locs=[
[0,67.55],
[90.95,7.1],
[0,27.2],
[84.5,-29],
[86.25,-68],
];
rotate(180){
color("OrangeRed"){
for(x=[0:num-1]){
translate([adjust_base_x,0,x*(heigth+bump)+adjust_base]){
import(headband_file, convexity=3);
}
}
}
mirror_copy()
cylinder_supports();
//Supports
mirror_copy(){
support_front();
support_side();
}
}
module support_front(){
color("#00FF00"){
union(){
//Supports
linear_extrude(2*bump){
translate([29.55,67.5]){
difference(){
difference(){
union(){
circle(10);
}
translate([5,-30.8]){
rotate(73){
square(25);
}
}
}
circle(4-support_thickness);
translate([0,-4+support_thickness,0]){
square(8-2*support_thickness, center=true);
}
}
}
}
linear_extrude((num-1)*(heigth+bump)){
translate([29.55,67.5]){
difference(){
difference(){
union(){
circle(4);
translate([0,-4,0]){
square(8, center=true);
}
}
translate([0,-24]){
rotate(73){
square(20);
}
}
}
circle(4-support_thickness);
translate([0,-4+support_thickness,0]){
square(8-2*support_thickness, center=true);
}
}
}
}
for(y = [1:num-1]){
translate([0,0,y*(heigth+bump)-support_bridge-bump]){
//support_bridge
linear_extrude(support_bridge){
translate([29.55,67.5]){
difference(){
union(){
circle(4);
translate([0,-4,0]){
square(8, center=true);
}
}
translate([0,-24]){
rotate(73){
square(20);
}
}
}
}
}
}
}
}
}
}
module support_side(){
color("#00FFFF"){
//supports
linear_extrude(2*bump){
translate([93.05,13.9]){
rotate(-3){
difference(){
difference(){
union(){
circle(10);
}
translate([-17.7,-25]){
rotate(27){
square(24);
}
}
}
circle(4-support_thickness);
translate([-4+support_thickness,0,0]){
square(8-2*support_thickness, center=true);
}
}
}
}
}
//union(){
linear_extrude((num-1)*(heigth+bump)){
translate([93.05,13.9]){
rotate(-3){
difference(){
difference(){
union(){
circle(4);
translate([-4,0,0]){
square(8, center=true);
}
}
translate([-18.3,-14.9]){
rotate(25){
square(20);
}
}
}
circle(4-support_thickness);
translate([-4+support_thickness,0,0]){
square(8-2*support_thickness, center=true);
}
}
}
}
}
for(y = [1:num-1]){
translate([0,0,y*(heigth+bump)-support_bridge-bump]){
//support_bridge
linear_extrude(support_bridge){
translate([93.05,13.9]){
rotate(-3){
difference(){
union(){
circle(4);
translate([-4,0,0]){
square(8, center=true);
}
}
translate([-18.3,-14.4]){
rotate(27){
square(20);
}
}
}
}
}
}
}
}
}
}
module cylinder_supports() {
for(y = [0:len(support_locs)-1]){
translate(support_locs[y]){
color("#FFAA00"){
cylinder(num*heigth+(num-1)*bump+extend_for_testing,
cylinder_size, cylinder_size);
}
}
}
}
//See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Tips_and_Tricks#Create_a_mirrored_object_while_retaining_the_original
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
You can’t perform that action at this time.