This commit is contained in:
Sébastien Dante Ursini 2025-01-21 18:10:35 -03:00
parent 420a543229
commit 63a06192a9
2 changed files with 65 additions and 50 deletions

View File

@ -106,6 +106,8 @@ skirt_angle=80;
// Dimensions in mm
//length = 180;
//length=fin_base;
box_thickness = 9.6;
height = 25;
thick = 9.2;
mirror_vec = [1,1,0];
@ -288,9 +290,11 @@ if ( render_drill_template ) buildDrillTemplate();
module buildCompletFin() {
union(){
difference(){
buildFin( fin_thickness );
//buildBox();
// Remove extra base
baseMask();
}
}
@ -312,7 +316,9 @@ module buildBoxMold() {
// To be defined
}
module baseMask() {
fwd(OFFSET) cube([fin_base*1.1,base_extra_thickness*1.1,fin_thickness*1.1],anchor=BACK);
}
/**
@ -335,60 +341,49 @@ module moldBottomMask(moldThickness = 3,height,angle) {
);
}
module usBoxMask() {
left(80) color("Blue") usBox(fin_base+30,thickness = box_thickness+2*OFFSET,drill=false);
}
module bottomSupport() {
moldHeight = 10;
moldContour = expandPath(profile,mold_extra_width);
down(moldHeight) linear_extrude (moldHeight) polygon(moldContour); // bottom support
}
/**
* Build mold
*
*/
module buildMold() {
moldHeight = 10;
skirtHeight = 30;
moldContour = expandPath(profile,mold_extra_width);
buildMoldSkirt(skirtHeight,mold_extra_width,3);
// Bottom Mold
if (mold_part != "top") {
// Fin mold
difference() {
union() {
down(moldHeight) linear_extrude (moldHeight) polygon(moldContour); // bottom
//back(5) left(95) cube([20+10,25,moldHeight],anchor=BACK+TOP); // Box shell
difference() {
skirt( profile, moldThickness = 3 , angle = skirt_angle, moldDeep = fin_thickness );
moldBottomMask(height=fin_thickness * 3,angle=skirt_angle);
//
//moldJunctionMask(height=fin_thickness * 3,angle=skirt_angle);
//union() {
difference(){
bottomSupport();
usBoxMask();
}
};
//moldBottomSkirt();
//};
// Remove Fin
buildCompletFin();
}
// Box mold
assert (fin_base,"fin_base missing");
echo ("fin_base----------",fin_base);
// left(80) finBoxMold( length = 130, finLength = fin_base );
//diff() {
difference() {
left(80) finBoxMold( fin_base+30,skirtAngle = skirt_angle );
// Remove junction between skirt
//tag("remove")
moldJunctionMask(height=fin_thickness * 3,angle=skirt_angle);
//tag("remove")
left(80) finBoxMold( fin_base+30,part="bottom",skirt=false );
// Remove fin
buildCompletFin();
}
//moldJunctionMask(height=fin_thickness * 3,angle=skirt_angle);
// Mold skirt
moldBottomSkirt();
}
up(50) buildCompletFin();
//up(50) buildCompletFin();
//left(300) linear_extrude (skirtHeight) polygon(moldSkirtRegion);
/*
@ -415,6 +410,12 @@ module buildMold() {
*/
}
module moldBottomSkirt(){
box_profile = move([-80,0],profileUS (fin_base+30));
finAndBoxProfile = path_merge_collinear(union([box_profile,profile]));
skirt( finAndBoxProfile, moldThickness = 3 , angle = skirt_angle, moldDeep = fin_thickness );
}
module moldJunctionMask(moldThickness = 3,height,angle){
deviation = opp_ang_to_adj (height,angle);
@ -721,3 +722,7 @@ module drawProfile( points,debug = true ){

View File

@ -18,6 +18,11 @@ OFFSET=0.01;
module boxProfileUS( length ,height=23, tabHeight = 8,tabLength = 20, backRounding = 8, backExtra = 10 ) {
echo ("------ height",height);
echo ("------ tabHeight",tabHeight);
echo ("------ height-tabHeight",height-tabHeight);
assert (height-tabHeight,"height-tabHeight should be bigger than 0");
tabExtra = opp_ang_to_adj(height-tabHeight,45);
points = [
[ -tabLength , 0 ,1], // 0
@ -58,12 +63,15 @@ module usBox( length, height=23, thickness = 9, tabLength = 20,pinDiameter = 5,p
}
module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength = 20,part = "bottom",skirtAngle=80 ) {
module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength = 20,part = "bottom",skirtAngle=80 , skirt = true ) {
//assert(length == 130,"Not 130");
assert (length >0,"length should be bigger than 0");
moldHeight = thickness + 2 * moldThickness;
skirtHeight = 3 * thickness;
echo ("---skirtHeight",skirtHeight);
echo ("---part",part);
deviation = opp_ang_to_adj (skirtHeight,skirtAngle); // Skirt devitation
baseInt = profileUS (length);
@ -71,15 +79,17 @@ module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength
topInt = offset(baseInt,delta=deviation , chamfer=false, same_length=true );
topExt = offset(baseInt,delta=deviation+moldThickness , chamfer=false, same_length=true );
union() {
union() {
difference() {
// Mold
{
if ( part == "bottom")
down (moldHeight/2) linear_extrude(moldHeight)
offset(r=moldThickness)
boxProfileUS( length, height );
if ( part == "top") {
if ( part == "top" ) {
//baseInt = profileUS (length);
//baseInt = profileUS (length);
//topInt = offset(baseInt,delta=-deviation,chamfer=false,same_length=true);
@ -98,6 +108,8 @@ module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength
*/
}
}
// US Box to subtract
usBox(length,height,drill=false,color="Red");
@ -110,14 +122,12 @@ module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength
linear_extrude( moldHeight )
offset( r = moldThickness*2 )
boxProfileUS( length, height );
}
if ( part == "bottom") {
// offset is a function
if ( part == "bottom" ) {
//topInt = offset(baseInt,delta=deviation,chamfer=false,same_length=true);
showSkirt = true;
if (showSkirt) difference(){
if (skirt) difference(){
skin([baseExt,topExt],z=[0,skirtHeight],slices=0);
skin([baseInt,topInt],z=[0,skirtHeight+OFFSET],slices=0);
}
@ -129,11 +139,11 @@ module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength
}
module finBoxMold( length, finLength=-1, skirtAngle = 80, part="bottom") {
module finBoxMold( length, finLength=-1, skirtAngle = 80, part="bottom", skirt = true) {
assert (finLength,"Missing 'finLength' parameter in finBoxMold module");
//if (part=="bottom") {
usBoxMold( length,part=part,skirtAngle=skirtAngle );
usBoxMold( length,part=part,skirtAngle=skirtAngle,skirt=skirt );
//}
}
@ -166,6 +176,6 @@ module thickness_cut(thickness,height) {
//down(50) usBoxMold( 130,part="bottom" );
if (false )down(50) usBoxMold( 130,part="bottom",skirt=false );