From: Ian Jackson Date: Tue, 27 May 2014 21:23:49 +0000 (+0100) Subject: Merge branch 'master' of chiark:/u/ianmdlvl/reprap/play X-Git-Tag: filamentspool-v2-release~373 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=commitdiff_plain;h=c88984757c32927d4cab9adaec78a7bec75825b5;hp=460b0d944eaf5dd53b58d3edf3d855ed894e65e0 Merge branch 'master' of chiark:/u/ianmdlvl/reprap/play Conflicts: brompton-computer-guard.scad Ditch old version in favour of new simple version --- diff --git a/brompton-computer-guard.scad b/brompton-computer-guard.scad index 822e399..b720bf1 100644 --- a/brompton-computer-guard.scad +++ b/brompton-computer-guard.scad @@ -1,173 +1,65 @@ // -*- C -*- -cover_ysz = 45; -cover_len = 70; +arch_height = 24; +arch_width = 75; +end_width = 25; -tube_dia = 21; +arch_thick = 5; -attach_cx = -7; -attach_cdy = 0; -attach_w = 25; +arch_breadth = 25; -attach_inrad = 29; -attach_hole_dist = 5; -attach_hole_dia = 4 + 0.5; -attach_ang = 45; +hole_dia = 3 + 0.5; -attach_dz = 2; +// computed -comp_dx = 22; -comp_xsz = 45; -comp_zsz = 28; +arch_alpha = atan(arch_height / (arch_width/2)); +arch_beta = 2*arch_alpha; +echo(arch_alpha,arch_beta); +arch_in_rad = arch_width/2 / sin(arch_beta); +arch_to_chord = arch_in_rad * cos(arch_beta); -comp_dy = 5; +end_thick = arch_thick; -comp_slope = 60; +holes = [[[ 5 , 5 ], [16 , 21]], // left + [[ 18.5, 4.5], [ 4.5, 22]]]; // right -leftend_zsz = 10; -leftend_dz = comp_zsz * 0.6; - -min_thick = 4; - -rightend_thick = 10; -bolthead_space = 4; - -// calculated - -cover_lcircle_r = cover_ysz / (1 + 1/sqrt(2)); - -base_len = cover_len - cover_lcircle_r; - -attach_end_r = attach_w/2; - -attach_straight_len = - attach_inrad + tube_dia + attach_hole_dist + attach_hole_dia/2 - - attach_end_r + attach_hole_dist; - -attach_down = tube_dia/2 + attach_dz; - -attach_xmax = attach_cx + - cos(attach_ang) * attach_straight_len + attach_end_r; - -module RearSideTemplate(){ - polygon([[0.1,0], - [-base_len,0], - [-base_len,-cover_ysz], - [0.1, -cover_ysz]]); - translate([-base_len, -cover_ysz + cover_lcircle_r]) - circle(r=cover_lcircle_r); -} - -module AttachTemplate(){ - hull(){ - polygon([[0, 0], - [-0.1, 0], - [-0.1, -cover_ysz], - [0, -cover_ysz]]); - translate([attach_cx, -attach_cdy]) rotate([0,0,-attach_ang]) { - polygon([[-attach_cx, attach_w/2], - [0, -attach_w/2], - [attach_straight_len, -attach_w/2], - [attach_straight_len, attach_w/2]]); - translate([attach_straight_len, 0]) - circle(r=attach_end_r); - } - } -} - -module AttachElevation(anddown){ - hull(){ - translate([-cover_len - 0.5, leftend_dz - leftend_zsz/2]) - square([1, leftend_zsz]); - translate([-comp_dx - comp_xsz/2, -0.1]) - square([comp_xsz, comp_zsz + min_thick]); - translate([attach_xmax, 0]) - square([1, rightend_thick + bolthead_space]); - } - if (anddown) - translate([-comp_dx, -attach_down-5]) - square([comp_dx + attach_xmax+2, attach_down+6]); -} - -module AttachElevationSelector(anddown) { - translate([0,100,0]) rotate([90,0,0]) linear_extrude(height=200) - AttachElevation(anddown); -} - -module BodyPositive(){ +module ArchProfile(){ intersection(){ - linear_extrude(height=60) RearSideTemplate(); - AttachElevationSelector(false); - } - intersection(){ - translate([0,0,-attach_down]) linear_extrude(height=100) AttachTemplate(); - AttachElevationSelector(true); - } -} - -module Cutouts(){ - Tube(); - Bolts(); - Computer(); -} - -module Body(){ - difference(){ - intersection(){ - BodyPositive(); - translate([-100,-200,-100]) cube([200,200,200]); - } - Cutouts(); - } -} - -module Computer(){ - multmatrix([[1,0,0,0], - [0,1, tan(90-comp_slope), 0], - [0,0,1,0], - [0,0,0,1]]) - translate([-comp_dx - comp_xsz/2, -cover_ysz + comp_dy, -50]) - cube([comp_xsz, 100, comp_zsz + 50]); -} - -module Tube(){ - translate([attach_cx, -attach_cdy, -tube_dia/2 - 0.1 - attach_dz]) { - rotate_extrude(convexity=10) { - translate([attach_inrad + tube_dia/2, 0]) - circle(r=tube_dia/2); + translate([-200,0]) + square([400,200]); + union(){ + translate([0,-arch_to_chord]){ + difference(){ + circle(arch_in_rad + arch_thick, $fa=0.1); + circle(arch_in_rad, $fa=0.1); + } + } + for (m=[0,1]) + mirror([m,0]) + translate([arch_width/2,0]) + square([end_width, end_thick]); } } } -module Bolt(){ - translate([0,0,-50]) linear_extrude(height=80) { - circle(r=attach_hole_dia/2, $fn=20); - } - translate([0,0,rightend_thick]) linear_extrude(height=80) { - circle(r=attach_hole_dia/2 * 2, $fn=20); +module Holes(){ + for (m=[0,1]) { + mirror([1-m,0]) + translate([arch_width/2, 50, 0]) + rotate([90,0,0]) + for (h=holes[m]) { + translate(h) + cylinder(r=hole_dia/2, h=100, $fn=20); + } } } -module Bolts(){ - translate([attach_cx, -attach_cdy]) rotate([0,0,-attach_ang]) { - translate([attach_inrad - attach_hole_dist - attach_hole_dia/2, 0]) - Bolt(); - translate([attach_inrad + tube_dia - +attach_hole_dist + attach_hole_dia/2, 0]) - Bolt(); +module Arch(){ + difference(){ + rotate([0,0,180]) + linear_extrude(height=arch_breadth) ArchProfile(); + Holes(); } } -module Demo(){ - Cutouts(); - %BodyPositive(); -} - -module Print(){ - rotate([-90,00]) - Body(); -} - -//Demo(); -//Body(); -Print(); +Arch();