From eb9173adc91b45cd31c9673fd02434716dee4c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Tk=C3=A1=C4=8Dik?= Date: Tue, 18 Oct 2016 15:59:45 +0200 Subject: [PATCH] Initial drop of konstrukt - beams. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tony Tkáčik --- bricks/konstrukt-beam-25.scad | 4 ++ konstrukt-beam.scad | 94 +++++++++++++++++++++++++++++++++++ measurements.scad | 12 +++++ 3 files changed, 110 insertions(+) create mode 100644 bricks/konstrukt-beam-25.scad create mode 100644 konstrukt-beam.scad create mode 100644 measurements.scad diff --git a/bricks/konstrukt-beam-25.scad b/bricks/konstrukt-beam-25.scad new file mode 100644 index 0000000..6349e02 --- /dev/null +++ b/bricks/konstrukt-beam-25.scad @@ -0,0 +1,4 @@ +include <../konstrukt-beam.scad>; + +konstrukt_beam([[5,0]]); + diff --git a/konstrukt-beam.scad b/konstrukt-beam.scad new file mode 100644 index 0000000..9c180de --- /dev/null +++ b/konstrukt-beam.scad @@ -0,0 +1,94 @@ +include <./measurements.scad>; +$fn=50; + +//konstrukt_beam_base_L(4,3); + +//konstrukt_beam_p(konstrukt_beam_arc(3,3,180)); +//konstrukt_beam_p(konstrukt_beam_circle(6,3)); + +//konstrukt_beam_p([[25,0]]); + +function konstrukt_beam_L(len1=4,len2=3)=[[len1,90],[len2,0]]; +function konstrukt_beam_arc(segments=3,length=2,angle=90) = [ for (i= [1:1:segments]) [length,angle/(segments) ]]; +function konstrukt_beam_circle(segments=3,length=2) = [ for (i= [1:1:segments]) [length,360/segments] ]; + +module konstrukt_beam_p(components=[[5,0]],height=KB_BEAM_HEIGHT) { + konstrukt_beam_base(components, height); + konstrukt_beam_holes(components, height); +} + +module konstrukt_beam(components=[[5,0]],height=KB_BEAM_HEIGHT) { + difference() { + konstrukt_beam_base(components, height); + konstrukt_beam_holes(components, height); + } +} + + + +module konstrukt_beam_base(subs=[[5,0]],height=KB_BEAM_HEIGHT,num=0) { + length = subs[num][0]; + angle = subs[num][1]; + konstrukt_beam_base_straight(length); + next = num+1; + if(next < len(subs)) { + translate(konstrukt_beam_move_holes(length)) { + rotate([0,0,angle]) { + konstrukt_beam_base(subs,height,next); + } + } + } +} + + +module konstrukt_beam_holes(subs=[[5,0]],height=KB_BEAM_HEIGHT,num=0) { + length = subs[num][0]; + angle = subs[num][1]; + + next = num+1; + if(next < len(subs)) { + konstrukt_beam_holes_straight(length-1); + translate(konstrukt_beam_move_holes(length)) { + rotate([0,0,angle]) { + konstrukt_beam_holes(subs,height,next); + } + } + } + konstrukt_beam_holes_straight(length); +} + +module konstrukt_beam_base_straight(l=2,h=KB_BEAM_HEIGHT) { + cube_length= (l-1)*KB_HOLE_SPACING; + union() { + cylinder(d=KB_BEAM_WIDTH, h=h); + translate([0,-KB_BEAM_WIDTH/2]) { + cube([cube_length, KB_BEAM_WIDTH, h]); + } + translate([cube_length,0]) { + cylinder(d=KB_BEAM_WIDTH, h=h); + } + } +} + +function konstrukt_beam_move_holes(len)=[(len-1)*KB_HOLE_SPACING,0]; + +/** + * Construct object to be substracted from base bean + * in order to create LEGO Technic compatible hole + * + * @param h Height of beam + **/ +module konstrukt_beam_hole(h=KB_BEAM_HEIGHT) { + union() { + cylinder(d=KB_HOLE_RING_DIAMETER, h=KB_HOLE_RING_DEPTH); + cylinder(d=KB_HOLE_INSIDE_DIAMETER, h=h ); + translate([0,0,h-KB_HOLE_RING_DEPTH]) + cylinder(d=KB_HOLE_RING_DIAMETER, h=KB_HOLE_RING_DEPTH); + } +} + +module konstrukt_beam_holes_straight(n=1,h=KB_BEAM_HEIGHT) { + for(i=[0:n-1]) + translate([i*KB_HOLE_SPACING,0]) + konstrukt_beam_hole(h); +} diff --git a/measurements.scad b/measurements.scad new file mode 100644 index 0000000..5153559 --- /dev/null +++ b/measurements.scad @@ -0,0 +1,12 @@ +KB_HOLE_SPACING = 8.0; +KB_HOLE_INSIDE_DIAMETER = 5.0; +KB_STUD_DIAMETER = 4.8; +KB_HOLE_RING_DIAMETER = 6.25; +KB_HOLE_RING_DEPTH = 0.9; +KB_BEAM_WIDTH = 7.6; +KB_AXLE_GAP = 1.95; +KB_AXLE_LENGTH = 5.1; +KB_MOUSE_EARS = false; + +KB_BEAM_HEIGHT = 7.8; +KB_THIN_BEAM_HEIGHT = KB_BEAM_HEIGHT/3;