Fill the repository
This commit is contained in:
@@ -0,0 +1,265 @@
|
||||
// ----------------------------------------------------------------
|
||||
// A collection of a few parameterizable lugs for Fischertechnik
|
||||
// struts
|
||||
//
|
||||
|
||||
/* [Lug options] */
|
||||
// Type
|
||||
Lug_type = 0; // [0 : no output, 1:Connecting strip, 2:L-shaped lug, 3:T-shaped lug, 4: X-shaped lug, 5: Star-shaped lug, 6: Y-shaped lug, 7: Angle lug]
|
||||
// Legth of a lug
|
||||
Lug_length = 45; // [45.0 : 0.1 : 150.0]
|
||||
/* [Options for the star shaped lug] */
|
||||
// use only the half of a star?
|
||||
Half_star = 0; // [0:no, 1:yes]
|
||||
/* [Options for the Y-shaped lug] */
|
||||
// Angle between the two branches
|
||||
Y_Angle = 60.0; // [5 : 0.1 : 177]
|
||||
/* [Options for the lug with a branch] */
|
||||
// Angle of the branch in relation to the lug
|
||||
Angle = 30.0; // [22.0 : 0.1 : 158.0]
|
||||
|
||||
/* [Hidden] */
|
||||
|
||||
// **********************
|
||||
// ** Static Settings: **
|
||||
// **********************
|
||||
include<ft_util.scad>
|
||||
|
||||
segment_length = 22.5;
|
||||
segment_width = 10.0;
|
||||
segment_height = 2.0;
|
||||
wall_length = 11.8;
|
||||
wall_width = 1.0;
|
||||
wall_height = 4.0;
|
||||
|
||||
|
||||
// *********************
|
||||
// ** Helper Modules: **
|
||||
// *********************
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// One part of a lug. Multiple segments asre combined to build the
|
||||
// different forms of as lug
|
||||
// --------------------------------------------------------------------
|
||||
module lug_segment(length = segment_length, eyelet_row = true) {
|
||||
difference() {
|
||||
rotate([0,0,180])
|
||||
translate([0,-length / 2,0])
|
||||
union() {
|
||||
translate([0, 0 , segment_height / 2])
|
||||
cube([segment_width, length, segment_height], center = true);
|
||||
translate([-(segment_width / 2), length / 2 - wall_length ,0])
|
||||
cube([wall_width, wall_length, wall_height]);
|
||||
translate([segment_width / 2 - wall_width, length / 2 - wall_length ,0])
|
||||
cube([wall_width, wall_length, wall_height]);
|
||||
}
|
||||
|
||||
if (eyelet_row == true) {
|
||||
if (length < 22) {
|
||||
translate([0, BASIC_BLOCK_HALF, 0])
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
}
|
||||
else {
|
||||
for (i = [0 : BASIC_BLOCK_SIZE : length - 22]) {
|
||||
translate([0, BASIC_BLOCK_HALF + i, 0])
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
translate([0, BASIC_BLOCK_HALF, 0])
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ******************
|
||||
// ** Lug Modules: **
|
||||
// ******************
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// Two parts in a row with a configurable length and an optional
|
||||
// eyelet in the center
|
||||
// --------------------------------------------------------------------
|
||||
module connecting_strip(length = 45, center_eyelet = true) {
|
||||
part_length = length / 2 + MANIFOLD_CORRECTION;
|
||||
|
||||
difference() {
|
||||
union() {
|
||||
translate([0,-part_length + MANIFOLD_CORRECTION,0])
|
||||
lug_segment(part_length);
|
||||
rotate([0,0,180])
|
||||
translate([0, -part_length + MANIFOLD_CORRECTION, 0])
|
||||
lug_segment(part_length);
|
||||
}
|
||||
if (center_eyelet == true)
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// a l-lug with configurable length
|
||||
// --------------------------------------------------------------------
|
||||
module l_lug(length = 27.5) {
|
||||
difference() {
|
||||
union() {
|
||||
lug_segment(length);
|
||||
translate([length - (segment_width / 2), length - (segment_width / 2), 0])
|
||||
rotate([0,0,90])
|
||||
lug_segment(length);
|
||||
}
|
||||
translate([0, length - segment_width / 2, 0])
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// a t-lug with configurable length
|
||||
// --------------------------------------------------------------------
|
||||
module t_lug(length = 45) {
|
||||
l_lug_length = length * 0.6111111;
|
||||
|
||||
difference() {
|
||||
union() {
|
||||
l_lug(l_lug_length);
|
||||
rotate([0,0,180])
|
||||
translate([0, -l_lug_length * 2 + segment_width, 0])
|
||||
lug_segment (l_lug_length);
|
||||
}
|
||||
translate([0, l_lug_length - segment_width / 2, 0])
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// an x-lug with configurable length
|
||||
// --------------------------------------------------------------------
|
||||
module x_lug(length = 45) {
|
||||
l_lug_length = length * 0.6111111;
|
||||
union() {
|
||||
translate([0,-l_lug_length + segment_width / 2,0])
|
||||
l_lug(l_lug_length);
|
||||
rotate([0,0,180])
|
||||
translate([0,-l_lug_length + segment_width / 2,0])
|
||||
l_lug(l_lug_length);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// a star-lug with configurable length and the option to build only
|
||||
// half of the star
|
||||
// --------------------------------------------------------------------
|
||||
module star_lug(length = 45, half_star = 0) {
|
||||
lug_length = length * 0.6111111;
|
||||
lug_length2 = length * 0.5111111;
|
||||
difference() {
|
||||
union() {
|
||||
translate([0,-lug_length + segment_width / 2,0])
|
||||
lug_segment(lug_length);
|
||||
rotate([0,0,60])
|
||||
translate([0,-lug_length + segment_width / 2,0])
|
||||
lug_segment(lug_length2);
|
||||
rotate([0,0,120])
|
||||
translate([0,-lug_length + segment_width / 2,0])
|
||||
lug_segment(lug_length2);
|
||||
rotate([0,0,180])
|
||||
translate([0,-lug_length + segment_width / 2,0])
|
||||
lug_segment(lug_length);
|
||||
if (half_star == 0) {
|
||||
rotate([0,0,240])
|
||||
translate([0,-lug_length + segment_width / 2,0])
|
||||
lug_segment(lug_length2);
|
||||
rotate([0,0,300])
|
||||
translate([0,-lug_length + segment_width / 2,0])
|
||||
lug_segment(lug_length2);
|
||||
}
|
||||
}
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// a lug with configurable length and angle of the second part
|
||||
// --------------------------------------------------------------------
|
||||
module angle_lug(length = 45, angle = 158) {
|
||||
save_angle = max(min(angle, 158), 22);
|
||||
part_length = length / 2 + MANIFOLD_CORRECTION;
|
||||
branch_length = part_length * sqrt(1/sin(save_angle));
|
||||
difference() {
|
||||
union() {
|
||||
rotate([0, 0, save_angle])
|
||||
translate([0, -branch_length, 0])
|
||||
lug_segment(branch_length);
|
||||
connecting_strip(length, center_eyelet = false);
|
||||
}
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
if (save_angle < 35) {
|
||||
translate ([0, -length / 2 + BASIC_BLOCK_HALF, 0])
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
|
||||
}
|
||||
if (save_angle > 145) {
|
||||
translate ([0, length / 2 - BASIC_BLOCK_HALF, 0])
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// an y-lug with a configurable length and angel between the two ends
|
||||
// --------------------------------------------------------------------
|
||||
module y_lug(length = 45, angle = 60) {
|
||||
save_length = max(length, 45);
|
||||
save_angle = max(min(angle, 177), 5);
|
||||
center_length = segment_width;
|
||||
part_length = save_length / 2 + MANIFOLD_CORRECTION;
|
||||
branch_length = part_length * sqrt(1/sin(save_angle));
|
||||
difference() {
|
||||
union() {
|
||||
if (save_angle > 90) {
|
||||
translate([0, 0 , segment_height / 2])
|
||||
cube([segment_width, center_length, segment_height], center = true);
|
||||
}
|
||||
rotate([0,0,180])
|
||||
translate([0, -part_length + MANIFOLD_CORRECTION, 0])
|
||||
lug_segment(part_length);
|
||||
rotate([0,0,save_angle])
|
||||
translate([0,-branch_length,0])
|
||||
lug_segment(branch_length, eyelet_row = false);
|
||||
rotate([0,0,-save_angle])
|
||||
translate([0,-branch_length,0])
|
||||
lug_segment(branch_length, eyelet_row = false);
|
||||
}
|
||||
eyelet(height = segment_height * 2 + MANIFOLD_CORRECTION);
|
||||
}
|
||||
}
|
||||
|
||||
// ********************
|
||||
// ** Build section: **
|
||||
// ********************
|
||||
module main() {
|
||||
if (Lug_type == 1) {
|
||||
connecting_strip(length = Lug_length);
|
||||
}
|
||||
else if (Lug_type == 2) {
|
||||
l_lug(length = Lug_length);
|
||||
}
|
||||
else if (Lug_type == 3) {
|
||||
t_lug(length = Lug_length);
|
||||
}
|
||||
else if (Lug_type == 4) {
|
||||
x_lug(length = Lug_length);
|
||||
}
|
||||
else if (Lug_type == 5) {
|
||||
star_lug(length = Lug_length, half_star = Half_star);
|
||||
}
|
||||
else if (Lug_type == 6) {
|
||||
y_lug(length = Lug_length, angle = Y_Angle);
|
||||
}
|
||||
else if (Lug_type == 7) {
|
||||
angle_lug(length = Lug_length, angle = Angle);
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user