OpenSCAD improvements
This commit is contained in:
@@ -6,7 +6,7 @@ plate_rounding = 20;
|
|||||||
|
|
||||||
wall_thickness = 2;
|
wall_thickness = 2;
|
||||||
|
|
||||||
hex_hole_size = 4;
|
hex_hole_size = 4; // [4:0.5:20]
|
||||||
hex_spacing = hex_hole_size/2;
|
hex_spacing = hex_hole_size/2;
|
||||||
|
|
||||||
pipe_outer_diameter = 100;
|
pipe_outer_diameter = 100;
|
||||||
|
|||||||
@@ -2,11 +2,19 @@
|
|||||||
include <BOSL2/std.scad>
|
include <BOSL2/std.scad>
|
||||||
include <BOSL2/skin.scad>
|
include <BOSL2/skin.scad>
|
||||||
|
|
||||||
loop_r = 30;
|
// Radius of the hook ends
|
||||||
hook_d = 15;
|
loop_radius = 30;
|
||||||
hook_angle = 145;
|
|
||||||
straight_l = 85;
|
// Diameter of the hook
|
||||||
flatten_h = hook_d/20;
|
hook_diameter = 15;
|
||||||
|
|
||||||
|
// How many degrees should the hook ends bend
|
||||||
|
hook_angle = 145; // [60:270]
|
||||||
|
|
||||||
|
// Length of the straight part
|
||||||
|
straight_length = 85;
|
||||||
|
|
||||||
|
flatten_height = hook_diameter/20;
|
||||||
|
|
||||||
$fn=80;
|
$fn=80;
|
||||||
|
|
||||||
@@ -14,44 +22,35 @@ difference() {
|
|||||||
/* Hook */
|
/* Hook */
|
||||||
group() {
|
group() {
|
||||||
/* Start cap */
|
/* Start cap */
|
||||||
rotate([0,-90,0]) {
|
rotate([0,-90,0])
|
||||||
rotate_extrude(){
|
rotate_extrude()
|
||||||
intersection(){
|
intersection(){
|
||||||
circle(d=hook_d);
|
circle(d=hook_diameter);
|
||||||
square(hook_d);
|
square(hook_diameter);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Draw the hook */
|
/* Draw the hook */
|
||||||
turtle_cmds = ["arcrightto", loop_r, hook_angle,
|
turtle_cmds = ["arcrightto", loop_radius, hook_angle,
|
||||||
"move", straight_l,
|
"move", straight_length,
|
||||||
"arcleftto", loop_r, 0];
|
"arcleftto", loop_radius, 0];
|
||||||
path = turtle(turtle_cmds,
|
path = turtle(turtle_cmds, state=[0,0], full_state=false);
|
||||||
state=[0,0],
|
path_sweep(circle(d = hook_diameter), path);
|
||||||
full_state=false);
|
|
||||||
path_sweep(circle(d = hook_d), path);
|
|
||||||
|
|
||||||
/* End cap */
|
/* End cap */
|
||||||
translate(path[len(path) - 1]) {
|
translate(path[len(path) - 1])
|
||||||
rotate([0,90,0]) {
|
rotate([0,90,0])
|
||||||
rotate_extrude(){
|
rotate_extrude()
|
||||||
intersection(){
|
intersection(){
|
||||||
circle(d=hook_d);
|
circle(d=hook_diameter);
|
||||||
square(hook_d);
|
square(hook_diameter);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flatten the hook with two cubes */
|
/* Flatten the hook with two cubes */
|
||||||
group(){
|
group(){
|
||||||
translate([-4*straight_l+2*loop_r,-2*straight_l+loop_r,(hook_d/2)-flatten_h]) {
|
translate([-4*straight_length+2*loop_radius,-2*straight_length+loop_radius,(hook_diameter/2)-flatten_height])
|
||||||
cube([4*straight_l,2*straight_l,flatten_h]);
|
cube([4*straight_length,2*straight_length,flatten_height]);
|
||||||
}
|
translate([-4*straight_length+2*loop_radius,-2*straight_length+loop_radius,-(hook_diameter/2)])
|
||||||
translate([-4*straight_l+2*loop_r,-2*straight_l+loop_r,-(hook_d/2)]) {
|
cube([4*straight_length,2*straight_length,flatten_height]);
|
||||||
cube([4*straight_l,2*straight_l,flatten_h]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user