Profile and libs
This commit is contained in:
parent
8dcd8f8ec7
commit
8378d8d105
152
SurfFins.scad
Normal file
152
SurfFins.scad
Normal file
@ -0,0 +1,152 @@
|
||||
|
||||
include <BOSL2/std.scad>;
|
||||
include <BOSL2/beziers.scad>;
|
||||
|
||||
|
||||
if (false) {
|
||||
|
||||
bez = [[0,0], [30,30], [80,0]];
|
||||
debug_bezier(bez, N=len(bez)-1);
|
||||
translate(bezier_points(bez, 0.3)) color("red") sphere(1);
|
||||
}
|
||||
|
||||
|
||||
if (false) {
|
||||
bez = [[0,0], [5,35], [60,-25], [80,0]];
|
||||
debug_bezier(bez, N=len(bez)-1);
|
||||
pts = bezier_points(bez, [0:0.2:1]);
|
||||
rainbow(pts) move($item) sphere(1.5, $fn=12);
|
||||
}
|
||||
|
||||
if (false) {
|
||||
|
||||
bez = [[0,0], [5,15], [40,20], [60,-15], [80,0]];
|
||||
move_copies(bezier_curve(bez, 8)) sphere(r=1.5, $fn=12);
|
||||
debug_bezier(bez, N=len(bez)-1);
|
||||
}
|
||||
|
||||
|
||||
fin_height = 250; // 10 inches in mm
|
||||
fin_width = 240; // Width at the base in mm
|
||||
fin_top_withdraw = 30;
|
||||
fin_back_withraw = 20;
|
||||
|
||||
fin_start_angle = 70; // Angle [Point 0 ]
|
||||
fin_sweep = 25; // Sweep Angle [Point 1]
|
||||
|
||||
fin_counter_angle = 30; // counter angle [Point 2]
|
||||
fin_counter_strength = 20; // Length [Point 2]
|
||||
|
||||
fin_base = 200; // Width at the base in mm
|
||||
|
||||
|
||||
|
||||
|
||||
fin_width_tip = 5; // Width at the tip in mm
|
||||
fin_thickness = 5; // Thickness of the fin in mm
|
||||
|
||||
fin_end_angle = 110;
|
||||
fin_end_strength = 30;
|
||||
|
||||
// Back
|
||||
fin_back_height = 30; // Percent height
|
||||
fin_back_widthdraw = 20; // Percent height
|
||||
fin_back_angle = 20; // back angle
|
||||
fin_back_strength=30;
|
||||
|
||||
|
||||
|
||||
pt1_x = adj_ang_to_opp(fin_height,fin_sweep)+fin_base/2;
|
||||
pt1_y = fin_height;
|
||||
|
||||
|
||||
|
||||
pt = [100,0];
|
||||
bez = [
|
||||
[0,0], // Point 0
|
||||
[opp_ang_to_adj(fin_height/3,fin_start_angle),fin_height/3], // Handle 0
|
||||
|
||||
|
||||
[pt1_x-100,pt1_y], // Handle 1 ()
|
||||
//[220,250], // Point 1
|
||||
[pt1_x,pt1_y], // Point 1
|
||||
[pt1_x+30,pt1_y], // Handle 1 (End)
|
||||
|
||||
// *****************
|
||||
// COUNTER POINT
|
||||
// *****************
|
||||
handleStart(fin_width,fin_top_withdraw,fin_counter_angle,fin_counter_strength),
|
||||
counterTop(fin_width,fin_top_withdraw), // [250,220], // Point 2
|
||||
handleEnd(fin_width,fin_top_withdraw,fin_counter_angle,fin_counter_strength),
|
||||
|
||||
// *****************
|
||||
// BACK POINT
|
||||
// *****************
|
||||
|
||||
//[165,100], // Handle 2 (Start)
|
||||
handle(backPoint(),fin_back_angle,fin_back_strength),
|
||||
//[155,80], // Point 2
|
||||
backPoint(),
|
||||
handle(backPoint(),-fin_back_angle,fin_back_strength),
|
||||
// [145,60], // Handle 2 (End)
|
||||
|
||||
|
||||
//[250,230],
|
||||
|
||||
// *****************
|
||||
// END POINT
|
||||
// *****************
|
||||
endHandle(fin_end_angle), // End Handle
|
||||
[fin_base,0] // End point
|
||||
];
|
||||
pos = bezpath_closest_point(bez, pt);
|
||||
xy = bezpath_points(bez,pos[0],pos[1]);
|
||||
debug_bezier(bez, N=3);
|
||||
color("red") translate(pt) sphere(r=1);
|
||||
color("blue") translate(xy) sphere(r=1);
|
||||
|
||||
|
||||
echo ("pt1_x",pt1_x);
|
||||
|
||||
|
||||
function counterTop(x,withdraw) = [x, x-withdraw ];
|
||||
function handleStart(x,withdraw,angle,strength) =
|
||||
[
|
||||
x+adj_ang_to_opp(strength,angle),
|
||||
x-withdraw +strength
|
||||
];
|
||||
|
||||
function handleEnd(x,withdraw,angle,strength) =
|
||||
[
|
||||
x-adj_ang_to_opp(strength,angle),
|
||||
x-withdraw -strength
|
||||
];
|
||||
|
||||
|
||||
function endHandle(angle)=
|
||||
angle < 90 ?
|
||||
[fin_base + adj_ang_to_opp(fin_end_strength,90-angle),fin_end_strength]
|
||||
:
|
||||
[fin_base - adj_ang_to_opp(fin_end_strength,angle-90),fin_end_strength]
|
||||
;
|
||||
|
||||
|
||||
//function backPoint() = [fin_base-fin_base * fin_back_widthdraw/100]; //[155,80];
|
||||
function backPoint() = [fin_base-(fin_back_widthdraw/100*fin_base),fin_back_height/100*fin_height];
|
||||
|
||||
|
||||
function handle(point,angle,strength)=
|
||||
[
|
||||
point[0] + adj_ang_to_opp(strength,angle) ,
|
||||
point[1] + (angle>0 ? strength : -strength)
|
||||
];
|
||||
|
||||
|
||||
//echo ("*** EndHandle",endHandle(70));
|
||||
|
||||
//echo ("*** test",[fin_base-(fin_back_widthdraw/100*fin_base),(fin_back_height/100*fin_height)]);
|
||||
|
||||
echo ("*** handle 0",handle(backPoint(),0,fin_back_strength));
|
||||
echo ("*** handle +30",handle(backPoint(),fin_back_angle,fin_back_strength));
|
||||
echo ("*** handle -30",handle(backPoint(),-fin_back_angle,fin_back_strength));
|
||||
|
98
lib/chinook.scad
Normal file
98
lib/chinook.scad
Normal file
@ -0,0 +1,98 @@
|
||||
module chinook(length)
|
||||
{
|
||||
difference()
|
||||
{
|
||||
base_cube(length);
|
||||
tab_cut();
|
||||
screw_cut();
|
||||
back_round_cut(length);
|
||||
pin_cut(length);
|
||||
thickness_cut(length, thick/2);
|
||||
thickness_cut(length, -thick/2);
|
||||
}
|
||||
}
|
||||
|
||||
module finfit(base_length, mirror_vec)
|
||||
{
|
||||
front_offset = tab_length;
|
||||
length = base_length + tab_length;
|
||||
echo ("length:",length);
|
||||
mirror(mirror_vec)
|
||||
translate([0,-front_offset, 0])
|
||||
chinook(length);
|
||||
}
|
||||
|
||||
module base_cube(BaseLength)
|
||||
{
|
||||
translate([0,0,-thick/2])
|
||||
cube(size=[height,
|
||||
BaseLength,
|
||||
thick],
|
||||
center=false);
|
||||
}
|
||||
|
||||
module tab_cut()
|
||||
{
|
||||
translate([tab_height,0,-thick/2*1.1])
|
||||
union()
|
||||
{
|
||||
translate([0,-thick,0])
|
||||
cube(size=[height,
|
||||
tab_length+thick,
|
||||
thick*1.1],
|
||||
center=false);
|
||||
translate([tab_round,tab_length,0])
|
||||
cylinder(h=thick*1.1,
|
||||
r=tab_round,
|
||||
center=false);
|
||||
}
|
||||
}
|
||||
|
||||
module screw_cut()
|
||||
{
|
||||
translate([tab_height/2,screw_pos,0])
|
||||
rotate([0,90,0])
|
||||
cylinder(h=tab_height*1.1,
|
||||
d=screw_dia,
|
||||
center=true);
|
||||
}
|
||||
|
||||
module back_round_cut(BaseLength)
|
||||
{
|
||||
translate([height-tab_round,
|
||||
BaseLength-tab_round,
|
||||
-thick/2*1.1])
|
||||
difference()
|
||||
{
|
||||
cube(size=[tab_round*1.1,
|
||||
tab_round*1.1,
|
||||
thick*1.1],
|
||||
center=false);
|
||||
cylinder(h=thick*1.2,
|
||||
r=tab_round,
|
||||
center=false);
|
||||
}
|
||||
}
|
||||
|
||||
module pin_cut(BaseLength)
|
||||
{
|
||||
translate([pin_depth,
|
||||
BaseLength-pin_back,
|
||||
0])
|
||||
rotate([0,0,0])
|
||||
cylinder(h=tab_height*1.1,
|
||||
d=pin_dia,
|
||||
center=true);
|
||||
}
|
||||
|
||||
module thickness_cut(BaseLength, zOffset)
|
||||
{
|
||||
translate([pin_depth,
|
||||
BaseLength-pin_back,
|
||||
zOffset])
|
||||
rotate([0,0,45])
|
||||
cube(size=[pin_depth*2.2,
|
||||
height*3,
|
||||
thick_cut],
|
||||
center=true);
|
||||
}
|
14
lib/round_cut.scad
Normal file
14
lib/round_cut.scad
Normal file
@ -0,0 +1,14 @@
|
||||
module round_cut(radius, height)
|
||||
{
|
||||
translate([0,0,-height*0.05])
|
||||
difference()
|
||||
{
|
||||
cube(size=[radius*1.1,
|
||||
radius*1.1,
|
||||
height*1.1],
|
||||
center=false);
|
||||
cylinder(h=height*1.1,
|
||||
r=radius,
|
||||
center=false);
|
||||
}
|
||||
}
|
23
lib/tab.scad
Normal file
23
lib/tab.scad
Normal file
@ -0,0 +1,23 @@
|
||||
use <round_cut.scad>
|
||||
module tab()
|
||||
{
|
||||
translate([0,0,-tab_thick/2])
|
||||
difference()
|
||||
{
|
||||
cube(size=[tab_height,
|
||||
tab_width,
|
||||
tab_thick],
|
||||
center=false);
|
||||
|
||||
translate([tab_height-tab_round,
|
||||
tab_width -tab_round,
|
||||
0])
|
||||
round_cut(tab_round, tab_thick);
|
||||
|
||||
translate([tab_height-tab_round,
|
||||
tab_round,
|
||||
0])
|
||||
rotate([0,0,-90])
|
||||
round_cut(tab_round, tab_thick);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user