printable

This commit is contained in:
Sébastien Dante Ursini 2025-01-15 15:36:30 -03:00
parent 8b72052a15
commit e180588583

View File

@ -83,11 +83,14 @@ piston_depth = 5;
/* [Rendering] */ /* [Rendering] */
// Rendering parts // 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 // 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 // Rendering mold
//render_mold = true; //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 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 // Surf Fin profile
fin_profile = pathProfile( profile_points ); 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 pathProcess(path) = path;
function expandPath(path,delta) = function expandPath(path,delta) =
pathProcess( pathProcess(
@ -233,7 +218,17 @@ function expandPath(path,delta) =
same_length=true same_length=true
) )
); );
*/
function expandPath(path,delta) =
offset(
deduplicate(path),
delta=delta,
chamfer=false,
same_length=true
)
;
// ***************** // *****************
// * Fin Drawing * // * Fin Drawing *
// ***************** // *****************
@ -274,28 +269,30 @@ if (build_mold) {
*/ */
if (build_mold) { if (build_mold) {
back(mold_width/2-mold_extra_width-5) buildMold();
// 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();
}
} }
/**
* 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) { module case(height) {
diff() cuboid( [ mold_length, mold_width, height ],anchor=TOP ){ diff() cuboid( [ mold_length, mold_width, height ],anchor=TOP ){
// Drills // Drills
@ -315,7 +312,8 @@ module case(height) {
// ***************** // *****************
module bottomInsert() { module bottomInsert() {
debug=true; 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 ) skin( [ layer_profile,expandPath(layer_profile,3) ], z=[0,piston_depth], slices=0 )
//up(debug ? 2 : 0) //up(debug ? 2 : 0)
up(OFFSET) up(OFFSET)
@ -328,14 +326,13 @@ module bottomInsert() {
// ***************** // *****************
module topPiston() { module topPiston() {
debug=true; debug=true;
layer_profile = pathProcess(profile_path); layer_profile = profile_path;
difference() { difference() {
%skin( [ layer_profile,expandPath(layer_profile,3) ], z=[0,piston_depth], slices=0 ); %skin( [ layer_profile,expandPath(layer_profile,3) ], z=[0,piston_depth], slices=0 );
down(OFFSET) down(OFFSET)
buildFinSide(false); buildFinSide(false);
} }
} }
//up(50) topPiston();
/** /**