From e1805885839b27499869498d2390f5f752c2cce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dante=20Ursini?= Date: Wed, 15 Jan 2025 15:36:30 -0300 Subject: [PATCH] printable --- Kitesurf-Fins.scad | 93 ++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 48 deletions(-) diff --git a/Kitesurf-Fins.scad b/Kitesurf-Fins.scad index c9cc22e..1da794c 100644 --- a/Kitesurf-Fins.scad +++ b/Kitesurf-Fins.scad @@ -83,11 +83,14 @@ piston_depth = 5; /* [Rendering] */ // Rendering parts -parts = "all"; // [all, top, bottom] +parts = "all"; // [all, top, bottom] -mold_part= "all"; // [all, top, bottom] +mold_part = "all"; // [all, top, bottom] // Scaling -scale_factor = 1.0; // [0.1:0.1:2] +scale_factor = 1.0; // [0.1:0.1:2] + +// Printable rendering +printable = true; // Rendering mold //render_mold = true; @@ -195,34 +198,16 @@ 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); +//function remove_last(arr) = select(arr, 0, len(arr) - 2); // Surf Fin profile fin_profile = pathProfile( profile_points ); -//vertical_profile = pathProfile(vertical_shape); -// **************** -// * Slicing * -// **************** + +//function pathProcess2(path) = subdivide_path(path,100); + /* -layer_0 = pathProcess(addBase(fin_profile)); // Master layer with base -layer_1 = contract(layer_0,-5); -layer_2 = contract(layer_1,-4); -layer_3 = contract(layer_2,-4); -layer_4 = contract(layer_3,-2); - -//echo ("layer_2",layer_2); -//echo ("layer_3",layer_3); - - -//layers = [layer_0,layer_1,layer_2,layer_3,layer_4]; -layers = [layer_0,layer_1,layer_2,layer_3]; -*/ - - - -function pathProcess2(path) = subdivide_path(path,100); function pathProcess(path) = path; function expandPath(path,delta) = pathProcess( @@ -233,7 +218,17 @@ function expandPath(path,delta) = same_length=true ) ); - +*/ +function expandPath(path,delta) = + offset( + deduplicate(path), + delta=delta, + chamfer=false, + same_length=true + ) + ; + + // ***************** // * Fin Drawing * // ***************** @@ -274,28 +269,30 @@ if (build_mold) { */ if (build_mold) { - back(mold_width/2-mold_extra_width-5) - // Bottom mold - difference() { - case(mold_base_height); - - // Piston - down(piston_depth-OFFSET) - fwd(20) - bottomInsert(); - } - // Top Mold - - fwd(0) up(60) { - // Top Mold - case(mold_top_height); - // Piston - down(mold_top_height+piston_depth-OFFSET) fwd(20) - topPiston(); - } + buildMold(); } +/** + * Build mold + * + */ +module buildMold() { + // Bottom mold + difference() { + case(mold_base_height); + // Piston + down(piston_depth-OFFSET) fwd(20) bottomInsert(); + } + // 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); + // Piston + down(mold_top_height+piston_depth-OFFSET) fwd(20) topPiston(); + } +} + + module case(height) { diff() cuboid( [ mold_length, mold_width, height ],anchor=TOP ){ // Drills @@ -315,7 +312,8 @@ module case(height) { // ***************** module bottomInsert() { debug=true; - layer_profile = pathProcess(profile_path); + //layer_profile = pathProcess(profile_path); + layer_profile = profile_path; skin( [ layer_profile,expandPath(layer_profile,3) ], z=[0,piston_depth], slices=0 ) //up(debug ? 2 : 0) up(OFFSET) @@ -328,14 +326,13 @@ module bottomInsert() { // ***************** module topPiston() { debug=true; - layer_profile = pathProcess(profile_path); + layer_profile = profile_path; difference() { %skin( [ layer_profile,expandPath(layer_profile,3) ], z=[0,piston_depth], slices=0 ); down(OFFSET) buildFinSide(false); } } -//up(50) topPiston(); /**