Holes
This commit is contained in:
parent
a216fb2dd6
commit
125a792f38
@ -198,27 +198,9 @@ function decrease_y(points, percentage) = [ for (p = points) [p[0], p[1] * (1 -
|
||||
|
||||
function pathProfile(points) = bezpath_curve(points,N=3);
|
||||
|
||||
//function remove_last(arr) = select(arr, 0, len(arr) - 2);
|
||||
|
||||
|
||||
// Surf Fin profile
|
||||
fin_profile = pathProfile( profile_points );
|
||||
|
||||
|
||||
//function pathProcess2(path) = subdivide_path(path,100);
|
||||
|
||||
/*
|
||||
function pathProcess(path) = path;
|
||||
function expandPath(path,delta) =
|
||||
pathProcess(
|
||||
offset(
|
||||
deduplicate(path),
|
||||
delta=delta,
|
||||
chamfer=false,
|
||||
same_length=true
|
||||
)
|
||||
);
|
||||
*/
|
||||
function expandPath(path,delta) =
|
||||
offset(
|
||||
deduplicate(path),
|
||||
@ -233,8 +215,7 @@ function expandPath(path,delta) =
|
||||
// * Fin Drawing *
|
||||
// *****************
|
||||
if (build_fin) {
|
||||
scale([scale_factor, scale_factor, scale_factor])
|
||||
buildFin();
|
||||
scale([scale_factor, scale_factor, scale_factor]) buildFin();
|
||||
}
|
||||
|
||||
if (build_mold) {
|
||||
@ -254,14 +235,31 @@ module buildMold() {
|
||||
}
|
||||
// Top Mold
|
||||
up(printable ? 0 : 60) fwd(printable ? fin_height+50 : 0) down(mold_base_height) mirror([0,0,printable ? 1 : 0 ]) {
|
||||
case(mold_top_height,false);
|
||||
// Piston
|
||||
down(mold_top_height+piston_depth-OFFSET) fwd(20) topPiston();
|
||||
}
|
||||
|
||||
|
||||
difference() {
|
||||
union() {
|
||||
// case
|
||||
case(mold_top_height,false);
|
||||
|
||||
// Piston
|
||||
mirror([1,0,0])
|
||||
down(mold_top_height+piston_depth-OFFSET) fwd(20) topPiston();
|
||||
};
|
||||
resin_escape(40);
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
module case(height,bottom=true) {
|
||||
/**
|
||||
* Mold Case
|
||||
*
|
||||
* @param height - Height of the case
|
||||
* @param bottom - Is bottom or top
|
||||
*/
|
||||
module case_old(height,bottom=true) {
|
||||
diff() cuboid( [ mold_length, mold_width, height ],
|
||||
rounding=4,
|
||||
edges=[bottom ? BOTTOM: TOP],
|
||||
@ -271,13 +269,74 @@ module case(height,bottom=true) {
|
||||
color("orange")
|
||||
tag("remove")
|
||||
drilling();
|
||||
// Material holes
|
||||
// Material holes
|
||||
/*
|
||||
align(TOP,[CENTER+BACK+LEFT],inside=true,inset=15,overlap=-OFFSET)
|
||||
color("Red") wedge([mold_height+2*OFFSET, 50, 30], center=true,orient=FRONT,spin=-90);
|
||||
color("Red") wedge([mold_height+2*OFFSET, 50, 30], center=true,orient=FRONT,spin=-90 );
|
||||
*/
|
||||
// Material holes
|
||||
align(TOP,[CENTER+BACK+LEFT]/*,inside=true*/,inset=15,overlap=-OFFSET)
|
||||
color("Red")
|
||||
up(OFFSET)
|
||||
tag("remove")
|
||||
rounded_triangle(radius=3, height=height+2*OFFSET);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
module case(height,bottom=true) {
|
||||
difference() {
|
||||
diff() cuboid( [ mold_length, mold_width, height ],
|
||||
rounding=4,
|
||||
edges=[bottom ? BOTTOM: TOP],
|
||||
anchor=TOP ){
|
||||
// Drills
|
||||
align(BOTTOM,[FRONT+LEFT,FRONT+RIGHT,BACK+LEFT,BACK+RIGHT],inset=10,overlap=-OFFSET)
|
||||
color("orange")
|
||||
tag("remove")
|
||||
drilling();
|
||||
// Material holes
|
||||
/*
|
||||
align(TOP,[CENTER+BACK+LEFT],inside=true,inset=15,overlap=-OFFSET)
|
||||
color("Red") wedge([mold_height+2*OFFSET, 50, 30], center=true,orient=FRONT,spin=-90 );
|
||||
*/
|
||||
|
||||
|
||||
};
|
||||
// Material holes
|
||||
mirror([bottom ? 0:1,0,0])
|
||||
back(38) left(55)
|
||||
color("Red")
|
||||
up(OFFSET)
|
||||
//tag("remove")
|
||||
rounded_triangle(radius=3, height=height+2*OFFSET);
|
||||
// Length hole
|
||||
fwd(32) cuboid([120,10,50],rounding=5);
|
||||
// Side holes
|
||||
left(67) cuboid([10,40,50],rounding=5);
|
||||
right(67) cuboid([10,40,50],rounding=5);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module rounded_triangle(radius, height) {
|
||||
triangle_points = [[0, 0], [75, 0], [0, -35]]; // Equilateral triangle with side length 100
|
||||
// Round the corners of the triangle
|
||||
rounded_shape = round_corners( triangle_points, r=radius );
|
||||
// Extrude the 2D rounded triangle
|
||||
//mirror([0,0,1]) linear_extrude(height = height) polygon(rounded_shape);
|
||||
mirror([0,0,1]) linear_extrude(height = height) polygon(rounded_shape);
|
||||
|
||||
//mirror([0,0,1]) linear_extrude(height = height) polygon(round_corners(right_triangle([40,30]),r=radius));
|
||||
//mirror([0,0,1]) linear_extrude(height = height) polygon(right_triangle([40,30]));
|
||||
//mirror([0,0,1]) cyl(l=80, r=10); // Work with cylinder
|
||||
}
|
||||
|
||||
|
||||
|
||||
// *****************
|
||||
// * Bottom insert *
|
||||
// *****************
|
||||
@ -319,8 +378,8 @@ module buildFinSide(flip=false) {
|
||||
polygon(profile_path);
|
||||
}
|
||||
|
||||
module resin_escape() {
|
||||
color ("Blue") cylinder(h=drilling_length, r=resin_escape_diameter/2);
|
||||
module resin_escape(length) {
|
||||
color ("Blue") cylinder(h=length, r=resin_escape_diameter/2);
|
||||
}
|
||||
|
||||
// *****************
|
||||
@ -373,7 +432,6 @@ module subtracted(anchor) {
|
||||
|
||||
|
||||
|
||||
echo ("layerHeights(3,thickness):",layerHeights(3,base_tickness/2));
|
||||
|
||||
if (show_debug_layers) {
|
||||
left(130) {
|
||||
@ -447,20 +505,6 @@ module drawProfile( points,debug = true ){
|
||||
function addBase(path) = concat(path,[[fin_base,-base_extra_thickness],[0,-base_extra_thickness]]);
|
||||
|
||||
|
||||
/**
|
||||
* Calculates heights for n layers where the first layer starts at 0 and the last at fin_thickness.
|
||||
*
|
||||
* @param n - Number of layers.
|
||||
* @param fin_thickness - The total height to be divided.
|
||||
* @return An array where each element represents the height of the top of each layer.
|
||||
*/
|
||||
function layerHeights(n, fin_thickness) =
|
||||
let(
|
||||
layer_height = fin_thickness / (n - 1)
|
||||
)
|
||||
[ for (i = [0 : n-1]) i * layer_height ];
|
||||
|
||||
|
||||
/**
|
||||
* Function to translate a path manually along X and Y
|
||||
*/
|
||||
@ -481,7 +525,11 @@ echo ("* Configuration *");
|
||||
echo ("**********************");
|
||||
//echo ("Layers count" ,len(layers));
|
||||
echo ("Base thickness" ,str(base_tickness," mm"));
|
||||
//echo ("Layers heights" ,layerHeights(len(layers),fin_thickness/2));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user