Cleanup
This commit is contained in:
parent
420a543229
commit
63a06192a9
@ -106,6 +106,8 @@ skirt_angle=80;
|
|||||||
// Dimensions in mm
|
// Dimensions in mm
|
||||||
//length = 180;
|
//length = 180;
|
||||||
//length=fin_base;
|
//length=fin_base;
|
||||||
|
|
||||||
|
box_thickness = 9.6;
|
||||||
height = 25;
|
height = 25;
|
||||||
thick = 9.2;
|
thick = 9.2;
|
||||||
mirror_vec = [1,1,0];
|
mirror_vec = [1,1,0];
|
||||||
@ -288,9 +290,11 @@ if ( render_drill_template ) buildDrillTemplate();
|
|||||||
|
|
||||||
|
|
||||||
module buildCompletFin() {
|
module buildCompletFin() {
|
||||||
union(){
|
difference(){
|
||||||
buildFin( fin_thickness );
|
buildFin( fin_thickness );
|
||||||
//buildBox();
|
//buildBox();
|
||||||
|
// Remove extra base
|
||||||
|
baseMask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +316,9 @@ module buildBoxMold() {
|
|||||||
// To be defined
|
// 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
|
* Build mold
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
module buildMold() {
|
module buildMold() {
|
||||||
moldHeight = 10;
|
|
||||||
skirtHeight = 30;
|
|
||||||
|
|
||||||
|
|
||||||
moldContour = expandPath(profile,mold_extra_width);
|
|
||||||
buildMoldSkirt(skirtHeight,mold_extra_width,3);
|
|
||||||
|
|
||||||
// Bottom Mold
|
// Bottom Mold
|
||||||
if (mold_part != "top") {
|
if (mold_part != "top") {
|
||||||
|
|
||||||
// Fin mold
|
// Fin mold
|
||||||
difference() {
|
difference() {
|
||||||
union() {
|
//union() {
|
||||||
down(moldHeight) linear_extrude (moldHeight) polygon(moldContour); // bottom
|
difference(){
|
||||||
//back(5) left(95) cube([20+10,25,moldHeight],anchor=BACK+TOP); // Box shell
|
bottomSupport();
|
||||||
difference() {
|
usBoxMask();
|
||||||
skirt( profile, moldThickness = 3 , angle = skirt_angle, moldDeep = fin_thickness );
|
}
|
||||||
moldBottomMask(height=fin_thickness * 3,angle=skirt_angle);
|
//moldBottomSkirt();
|
||||||
|
//};
|
||||||
|
|
||||||
//
|
|
||||||
//moldJunctionMask(height=fin_thickness * 3,angle=skirt_angle);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
// Remove Fin
|
// Remove Fin
|
||||||
buildCompletFin();
|
buildCompletFin();
|
||||||
}
|
}
|
||||||
// Box mold
|
// Box mold
|
||||||
assert (fin_base,"fin_base missing");
|
|
||||||
echo ("fin_base----------",fin_base);
|
|
||||||
// left(80) finBoxMold( length = 130, finLength = fin_base );
|
|
||||||
//diff() {
|
|
||||||
difference() {
|
difference() {
|
||||||
left(80) finBoxMold( fin_base+30,skirtAngle = skirt_angle );
|
left(80) finBoxMold( fin_base+30,part="bottom",skirt=false );
|
||||||
|
// Remove fin
|
||||||
// Remove junction between skirt
|
buildCompletFin();
|
||||||
//tag("remove")
|
|
||||||
moldJunctionMask(height=fin_thickness * 3,angle=skirt_angle);
|
|
||||||
//tag("remove")
|
|
||||||
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);
|
//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){
|
module moldJunctionMask(moldThickness = 3,height,angle){
|
||||||
|
|
||||||
deviation = opp_ang_to_adj (height,angle);
|
deviation = opp_ang_to_adj (height,angle);
|
||||||
@ -719,5 +720,9 @@ module drawProfile( points,debug = true ){
|
|||||||
debug_bezier(points, N=3,width=1.2);
|
debug_bezier(points, N=3,width=1.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -17,6 +17,11 @@ OFFSET=0.01;
|
|||||||
**/
|
**/
|
||||||
module boxProfileUS( length ,height=23, tabHeight = 8,tabLength = 20, backRounding = 8, backExtra = 10 ) {
|
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);
|
tabExtra = opp_ang_to_adj(height-tabHeight,45);
|
||||||
points = [
|
points = [
|
||||||
@ -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 == 130,"Not 130");
|
||||||
|
assert (length >0,"length should be bigger than 0");
|
||||||
|
|
||||||
moldHeight = thickness + 2 * moldThickness;
|
moldHeight = thickness + 2 * moldThickness;
|
||||||
skirtHeight = 3 * thickness;
|
skirtHeight = 3 * thickness;
|
||||||
|
echo ("---skirtHeight",skirtHeight);
|
||||||
|
echo ("---part",part);
|
||||||
deviation = opp_ang_to_adj (skirtHeight,skirtAngle); // Skirt devitation
|
deviation = opp_ang_to_adj (skirtHeight,skirtAngle); // Skirt devitation
|
||||||
|
|
||||||
baseInt = profileUS (length);
|
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 );
|
topInt = offset(baseInt,delta=deviation , chamfer=false, same_length=true );
|
||||||
topExt = offset(baseInt,delta=deviation+moldThickness , chamfer=false, same_length=true );
|
topExt = offset(baseInt,delta=deviation+moldThickness , chamfer=false, same_length=true );
|
||||||
|
|
||||||
union() {
|
union() {
|
||||||
difference() {
|
difference() {
|
||||||
// Mold
|
// Mold
|
||||||
{
|
{
|
||||||
if ( part == "bottom")
|
if ( part == "bottom")
|
||||||
|
|
||||||
down (moldHeight/2) linear_extrude(moldHeight)
|
down (moldHeight/2) linear_extrude(moldHeight)
|
||||||
offset(r=moldThickness)
|
offset(r=moldThickness)
|
||||||
boxProfileUS( length, height );
|
boxProfileUS( length, height );
|
||||||
if ( part == "top") {
|
|
||||||
|
if ( part == "top" ) {
|
||||||
//baseInt = profileUS (length);
|
//baseInt = profileUS (length);
|
||||||
//baseInt = profileUS (length);
|
//baseInt = profileUS (length);
|
||||||
//topInt = offset(baseInt,delta=-deviation,chamfer=false,same_length=true);
|
//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
|
// US Box to subtract
|
||||||
usBox(length,height,drill=false,color="Red");
|
usBox(length,height,drill=false,color="Red");
|
||||||
|
|
||||||
@ -110,14 +122,12 @@ module usBoxMold( length, height=23, thickness = 9, moldThickness = 4,tabLength
|
|||||||
linear_extrude( moldHeight )
|
linear_extrude( moldHeight )
|
||||||
offset( r = moldThickness*2 )
|
offset( r = moldThickness*2 )
|
||||||
boxProfileUS( length, height );
|
boxProfileUS( length, height );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( part == "bottom") {
|
if ( part == "bottom" ) {
|
||||||
// offset is a function
|
|
||||||
|
|
||||||
//topInt = offset(baseInt,delta=deviation,chamfer=false,same_length=true);
|
//topInt = offset(baseInt,delta=deviation,chamfer=false,same_length=true);
|
||||||
showSkirt = true;
|
if (skirt) difference(){
|
||||||
if (showSkirt) difference(){
|
|
||||||
skin([baseExt,topExt],z=[0,skirtHeight],slices=0);
|
skin([baseExt,topExt],z=[0,skirtHeight],slices=0);
|
||||||
skin([baseInt,topInt],z=[0,skirtHeight+OFFSET],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");
|
assert (finLength,"Missing 'finLength' parameter in finBoxMold module");
|
||||||
//if (part=="bottom") {
|
//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 );
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user