author | Michael Krelin <hacker@klever.net> | 2016-01-08 11:36:08 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2016-01-08 11:36:08 (UTC) |
commit | 2104176d49450d4fb31c430a12bc16fa5befb63b (patch) (unidiff) | |
tree | a5f2d948fb82cedb5e8e5fea4e654d4c259abc1a | |
parent | 8eb0d1b0f417ac889bad97a582377130e4603b3d (diff) | |
download | redelta-2104176d49450d4fb31c430a12bc16fa5befb63b.zip redelta-2104176d49450d4fb31c430a12bc16fa5befb63b.tar.gz redelta-2104176d49450d4fb31c430a12bc16fa5befb63b.tar.bz2 |
rubber shoes
-rw-r--r-- | delta.jscad | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/delta.jscad b/delta.jscad index ad19f88..eb538d2 100644 --- a/delta.jscad +++ b/delta.jscad | |||
@@ -1,142 +1,144 @@ | |||
1 | var PRINT = { | 1 | var PRINT = { |
2 | layer_height: 0.2, | 2 | layer_height: 0.2, |
3 | extrusion_width: 0.4, | 3 | extrusion_width: 0.4, |
4 | 4 | ||
5 | fit_tolerance: .2, slide_tolerance: .4, play_tolerance: .6 | 5 | fit_tolerance: .2, slide_tolerance: .4, play_tolerance: .6 |
6 | }; | 6 | }; |
7 | 7 | ||
8 | var CONFIG = { | 8 | var CONFIG = { |
9 | extrusion: { | 9 | extrusion: { |
10 | w: 20 | 10 | w: 20 |
11 | }, | 11 | }, |
12 | base: { | 12 | base: { |
13 | el: 240, // side extrusion length | 13 | el: 240, // side extrusion length |
14 | sl: 240+2*70, // triangle side length | 14 | sl: 240+2*70, // triangle side length |
15 | gap: 9 // vertical gap between side extrusions | 15 | gap: 9 // vertical gap between side extrusions |
16 | }, | 16 | }, |
17 | column: { | 17 | column: { |
18 | h: 600 // column height | 18 | h: 600 // column height |
19 | }, | 19 | }, |
20 | heatbed: { | 20 | heatbed: { |
21 | r: 220/2, // heatbed radius | 21 | r: 220/2, // heatbed radius |
22 | sr: 220/2-4.5,// radius of the screwholes circle | 22 | sr: 220/2-4.5,// radius of the screwholes circle |
23 | h: 3+1.5 // thickness (including insulation) | 23 | h: 3+1.5 // thickness (including insulation) |
24 | }, | 24 | }, |
25 | glass: { | 25 | glass: { |
26 | r: 195/2, // glass radius | 26 | r: 195/2, // glass radius |
27 | h: 3 // glass thickness | 27 | h: 3 // glass thickness |
28 | }, | 28 | }, |
29 | duet: { | 29 | duet: { |
30 | pcb_size: { x: 124, y: 100, z: 1 }, | 30 | pcb_size: { x: 124, y: 100, z: 1 }, |
31 | hole_spacing: { x: 115, y: 92 }, | 31 | hole_spacing: { x: 115, y: 92 }, |
32 | h: 30 | 32 | h: 30 |
33 | }, | 33 | }, |
34 | foot: { | 34 | foot: { |
35 | d: 20*Math.sqrt(2), h: 30, | 35 | d: 20*Math.sqrt(2), h: 30, |
36 | bolt: { d:5, l: 19, hd: 10 }, | 36 | bolt: { d:5, l: 19, hd: 10 }, |
37 | margin: 2.5, | 37 | margin: 2.5, |
38 | nut: { d: 8.6 /* TODO: */, h: 3.5 }, | 38 | nut: { d: 8.6 /* TODO: */, h: 3.5 }, |
39 | shell: 4, | 39 | shell: 4, |
40 | zscalefactor: 1.6 | 40 | zscalefactor: 1.6, |
41 | foot: { ho: 2.5, hi: 5 } | ||
41 | }, | 42 | }, |
42 | hotend: { | 43 | hotend: { |
43 | h: 62.4, // full assembly height | 44 | h: 62.4, // full assembly height |
44 | groove: { d:12, h:6 }, // grove diameter and height | 45 | groove: { d:12, h:6 }, // grove diameter and height |
45 | ungroove: { d:16, above:3.7, below: 3+4 } | 46 | ungroove: { d:16, above:3.7, below: 3+4 } |
46 | }, | 47 | }, |
47 | effector: { | 48 | effector: { |
48 | h: 6, | 49 | h: 6, |
49 | o: 20,// offset to the rod mounts line | 50 | o: 20,// offset to the rod mounts line |
50 | rods_apart: 40, | 51 | rods_apart: 40, |
51 | cone: { shell: 1, angle: Math.PI/6 }, | 52 | cone: { shell: 1, angle: Math.PI/6 }, |
52 | rodend: { | 53 | rodend: { |
53 | joint_w: 7,// thickness of the joint | 54 | joint_w: 7,// thickness of the joint |
54 | screw_l: 20-1, // 20 with the head | 55 | screw_l: 20-1, // 20 with the head |
55 | screw_d: 3 | 56 | screw_d: 3 |
56 | }, | 57 | }, |
57 | hotend: { margin: 2 }, | 58 | hotend: { margin: 2 }, |
58 | hinge: { | 59 | hinge: { |
59 | d: 3, w: 5, margin: 2.5, | 60 | d: 3, w: 5, margin: 2.5, |
60 | h: 1+(6+3.7)/2, // elevation + grove + top | 61 | h: 1+(6+3.7)/2, // elevation + grove + top |
61 | e: 1 // elevation | 62 | e: 1 // elevation |
62 | }, | 63 | }, |
63 | clamp: { | 64 | clamp: { |
64 | shell: 4.6, | 65 | shell: 4.6, |
65 | d: 3, | 66 | d: 3, |
66 | margin: 2.5, | 67 | margin: 2.5, |
67 | split: 0.6 | 68 | split: 0.6 |
68 | }, | 69 | }, |
69 | mswitch: { | 70 | mswitch: { |
70 | size: [ 19.8, 6, 10 ], | 71 | size: [ 19.8, 6, 10 ], |
71 | screw: { | 72 | screw: { |
72 | d: 2, h: 10/2-2, | 73 | d: 2, h: 10/2-2, |
73 | s: 1.3, // screw shell | 74 | s: 1.3, // screw shell |
74 | o: [-9.5/2,9.5/2].map(function(x) { | 75 | o: [-9.5/2,9.5/2].map(function(x) { |
75 | return -19.8/2+x; | 76 | return -19.8/2+x; |
76 | }) | 77 | }) |
77 | }, | 78 | }, |
78 | switch_x: 2.5 | 79 | switch_x: 2.5 |
79 | }, | 80 | }, |
80 | guide: { | 81 | guide: { |
81 | width: 3, height: 5+1, length: 6 | 82 | width: 3, height: 5+1, length: 6 |
82 | }, | 83 | }, |
83 | fanholder: { | 84 | fanholder: { |
84 | r: 30, | 85 | r: 30, |
85 | screw: { d: 3, m: 2.5/*margin*/ }, | 86 | screw: { d: 3, m: 2.5/*margin*/ }, |
86 | w: 3 | 87 | w: 3 |
87 | } | 88 | } |
88 | }, | 89 | }, |
89 | nut: { h: 2.3, w: 5.5 }, | 90 | nut: { h: 2.3, w: 5.5 }, |
90 | color: { | 91 | color: { |
91 | extrusion: [0.8, 0.8, 0.8, 0.8], | 92 | extrusion: [0.8, 0.8, 0.8, 0.8], |
92 | pcb: [ 0, 0.3, 0.2, 0.8 ], | 93 | pcb: [ 0, 0.3, 0.2, 0.8 ], |
93 | bulk: [ .9, .9, .9, .2 ], | 94 | bulk: [ .9, .9, .9, .2 ], |
94 | parts: [ 0, 0.8, 0, 0.9 ] | 95 | parts: [ 0, 0.8, 0, 0.9 ], |
96 | softparts: [ 0, 0, 0.8, 0.9 ] | ||
95 | } | 97 | } |
96 | }; | 98 | }; |
97 | 99 | ||
98 | var CD = { | 100 | var CD = { |
99 | base: (function(){ | 101 | base: (function(){ |
100 | var rv = {}; | 102 | var rv = {}; |
101 | rv.circumscription_r = | 103 | rv.circumscription_r = |
102 | CONFIG.base.sl/2/Math.cos(Math.PI/6); | 104 | CONFIG.base.sl/2/Math.cos(Math.PI/6); |
103 | rv.outer_inscription_r = | 105 | rv.outer_inscription_r = |
104 | Math.sqrt(Math.pow(rv.circumscription_r,2)- | 106 | Math.sqrt(Math.pow(rv.circumscription_r,2)- |
105 | Math.pow(CONFIG.base.sl/2,2)); | 107 | Math.pow(CONFIG.base.sl/2,2)); |
106 | rv.mid_inscription_r = | 108 | rv.mid_inscription_r = |
107 | rv.outer_inscription_r-CONFIG.extrusion.w/2; | 109 | rv.outer_inscription_r-CONFIG.extrusion.w/2; |
108 | rv.inner_inscription_r = | 110 | rv.inner_inscription_r = |
109 | rv.outer_inscription_r-CONFIG.extrusion.w/2; | 111 | rv.outer_inscription_r-CONFIG.extrusion.w/2; |
110 | // TODO: properly calculate | 112 | // TODO: properly calculate |
111 | rv.column_r = rv.circumscription_r - 48.29; | 113 | rv.column_r = rv.circumscription_r - 48.29; |
112 | return rv; | 114 | return rv; |
113 | })() | 115 | })() |
114 | }; | 116 | }; |
115 | 117 | ||
116 | var U = { | 118 | var U = { |
117 | hypotenuse: function(a,b) { | 119 | hypotenuse: function(a,b) { |
118 | return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)); | 120 | return Math.sqrt(Math.pow(a,2)+Math.pow(b,2)); |
119 | }, | 121 | }, |
120 | peek: function(x,m) { | 122 | peek: function(x,m) { |
121 | console.log(x,m); | 123 | console.log(x,m); |
122 | return x; | 124 | return x; |
123 | } | 125 | } |
124 | }; | 126 | }; |
125 | 127 | ||
126 | /* {h:,w:} */ | 128 | /* {h:,w:} */ |
127 | function nut(o) { | 129 | function nut(o) { |
128 | var rv = CSG.cylinder({ | 130 | var rv = CSG.cylinder({ |
129 | start:[0,0,0],end:[0,0,o.h], | 131 | start:[0,0,0],end:[0,0,o.h], |
130 | radius: o.w/2/Math.cos(Math.PI/6), | 132 | radius: o.w/2/Math.cos(Math.PI/6), |
131 | resolution: 6 | 133 | resolution: 6 |
132 | }); | 134 | }); |
133 | rv.properties.axis_connector = new CSG.Connector([0,0,0],[0,0,1],[0,1,0]); | 135 | rv.properties.axis_connector = new CSG.Connector([0,0,0],[0,0,1],[0,1,0]); |
134 | return rv; | 136 | return rv; |
135 | } | 137 | } |
136 | 138 | ||
137 | var E3DV6 = { | 139 | var E3DV6 = { |
138 | dimensions: { | 140 | dimensions: { |
139 | big_d: 22.3, | 141 | big_d: 22.3, |
140 | 142 | ||
141 | }, | 143 | }, |
142 | heatsink: function() { | 144 | heatsink: function() { |
@@ -591,96 +593,110 @@ function duet() { | |||
591 | } | 593 | } |
592 | rv = CSG.cube({ | 594 | rv = CSG.cube({ |
593 | corner1: [-C.pcb_size.x/2, -C.pcb_size.y/2, 0], | 595 | corner1: [-C.pcb_size.x/2, -C.pcb_size.y/2, 0], |
594 | corner2: [ C.pcb_size.x/2, C.pcb_size.y/2, C.pcb_size.z] | 596 | corner2: [ C.pcb_size.x/2, C.pcb_size.y/2, C.pcb_size.z] |
595 | }).subtract(holes).setColor(CONFIG.color.pcb).union( | 597 | }).subtract(holes).setColor(CONFIG.color.pcb).union( |
596 | CSG.cube({ | 598 | CSG.cube({ |
597 | corner1: [-C.pcb_size.x/2,-C.hole_spacing.y/2+3,C.pcb_size.z], | 599 | corner1: [-C.pcb_size.x/2,-C.hole_spacing.y/2+3,C.pcb_size.z], |
598 | corner2: [ C.pcb_size.x/2, C.hole_spacing.y/2-3,C.h] | 600 | corner2: [ C.pcb_size.x/2, C.hole_spacing.y/2-3,C.h] |
599 | }).setColor(CONFIG.color.bulk) | 601 | }).setColor(CONFIG.color.bulk) |
600 | ); | 602 | ); |
601 | rv.properties.holes = pholes; | 603 | rv.properties.holes = pholes; |
602 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); | 604 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); |
603 | rv.properties.vitamin = true; | 605 | rv.properties.vitamin = true; |
604 | return rv; | 606 | return rv; |
605 | } | 607 | } |
606 | 608 | ||
607 | function foot() { | 609 | function foot() { |
608 | var F = CONFIG.foot; | 610 | var F = CONFIG.foot; |
609 | var br = F.bolt.hd/2+F.margin; | 611 | var br = F.bolt.hd/2+F.margin; |
610 | var bh = F.zscalefactor*Math.sqrt(Math.pow(F.d/2,2)-Math.pow(br,2)); | 612 | var bh = F.zscalefactor*Math.sqrt(Math.pow(F.d/2,2)-Math.pow(br,2)); |
611 | var th = F.h-bh; | 613 | var th = F.h-bh; |
612 | var r = 2*F.d; | 614 | var r = 2*F.d; |
613 | var rv = CSG.sphere({ // botom contorted sphere | 615 | var rv = CSG.sphere({ // botom contorted sphere |
614 | center: [0,0,0], radius: F.d/2, resolution: r | 616 | center: [0,0,0], radius: F.d/2, resolution: r |
615 | }).scale([1,1,F.zscalefactor]).translate([0,0,bh]).union(CSG.cylinder({ // top hat | 617 | }).scale([1,1,F.zscalefactor]).translate([0,0,bh]).union(CSG.cylinder({ // top hat |
616 | start: [0,0,bh], end: [0,0,F.h], radius: F.d/2, resolution: r | 618 | start: [0,0,bh], end: [0,0,F.h], radius: F.d/2, resolution: r |
617 | })).intersect(CSG.cylinder({ // cut off excess | 619 | })).intersect(CSG.cylinder({ // cut off excess |
618 | start: [0,0,0], end: [0,0,F.h], radius: F.d | 620 | start: [0,0,0], end: [0,0,F.h], radius: F.d |
619 | })).subtract([ | 621 | })).subtract([ |
620 | CSG.cylinder({ // bolt hole | 622 | CSG.cylinder({ // bolt hole |
621 | start: [0,0,-1], end: [0,0,F.h+1], radius: F.bolt.d/2+PRINT.slide_tolerance | 623 | start: [0,0,-1], end: [0,0,F.h+1], radius: F.bolt.d/2+PRINT.slide_tolerance |
622 | }), CSG.cylinder({ // nut hole | 624 | }), CSG.cylinder({ // nut hole |
623 | start: [0,0,F.h-F.nut.h-PRINT.play_tolerance], | 625 | start: [0,0,F.h-F.nut.h-PRINT.play_tolerance], |
624 | end: [0,0,F.h], | 626 | end: [0,0,F.h], |
625 | radius: F.nut.d/2+PRINT.slide_tolerance, resolution: 6 | 627 | radius: F.nut.d/2+PRINT.slide_tolerance, resolution: 6 |
626 | }), CSG.cylinder({ // bolthead/washer hole | 628 | }), CSG.cylinder({ // bolthead/washer hole |
627 | start: [0,0,-1], end: [0,0,F.h-F.nut.h-PRINT.play_tolerance-F.shell], | 629 | start: [0,0,-1], end: [0,0,F.h-F.nut.h-PRINT.play_tolerance-F.shell], |
628 | radius: F.bolt.hd/2+PRINT.play_tolerance | 630 | radius: F.bolt.hd/2+PRINT.play_tolerance |
629 | }) | 631 | }) |
630 | ]).union(CSG.cylinder({ // bridging patch | 632 | ]).union(CSG.cylinder({ // bridging patch |
631 | start: [0,0,F.h-F.nut.h-PRINT.play_tolerance-PRINT.layer_height], | 633 | start: [0,0,F.h-F.nut.h-PRINT.play_tolerance-PRINT.layer_height], |
632 | end: [0,0,F.h-F.nut.h-PRINT.play_tolerance], | 634 | end: [0,0,F.h-F.nut.h-PRINT.play_tolerance], |
633 | radius: F.nut.d/2 | 635 | radius: F.nut.d/2 |
634 | })); | 636 | })); |
635 | rv.properties.c_column = new CSG.Connector([0,0,F.h],[0,0,1],[1,0,0]); | 637 | rv.properties.c_column = new CSG.Connector([0,0,F.h],[0,0,1],[1,0,0]); |
636 | rv.properties.P = new CSG.Connector([0,0,F.h],[0,0,-1],[1,0,0]); | 638 | rv.properties.P = new CSG.Connector([0,0,F.h],[0,0,-1],[1,0,0]); |
637 | return rv.setColor(CONFIG.color.parts); | 639 | return rv.setColor(CONFIG.color.parts); |
638 | } | 640 | } |
641 | function foot_foot() { | ||
642 | // TODO: connect in the altogethernow? | ||
643 | var F = CONFIG.foot; | ||
644 | var rv = CSG.cylinder({ | ||
645 | start: [0,0,0], end: [0,0,F.foot.ho], | ||
646 | radius: F.bolt.hd/2+F.margin | ||
647 | }).union(CSG.cylinder({ | ||
648 | start: [0,0,0], end: [0,0,F.foot.ho+F.foot.hi], | ||
649 | radius: F.bolt.hd/2+PRINT.play_tolerance-PRINT.fit_tolerance | ||
650 | })); | ||
651 | rv.properties.c_foot = new CSG.Connector([0,0,F.foot.ho],[0,0,1],[1,0,0]); | ||
652 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); | ||
653 | return rv.setColor(CONFIG.color.softparts); | ||
654 | } | ||
639 | 655 | ||
640 | function refaxes(o) { | 656 | function refaxes(o) { |
641 | if(!o) o = {}; | 657 | if(!o) o = {}; |
642 | var l = o.l||20, g = o.g||0.7; | 658 | var l = o.l||20, g = o.g||0.7; |
643 | return union([ | 659 | return union([ |
644 | CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), | 660 | CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), |
645 | CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), | 661 | CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), |
646 | CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) | 662 | CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) |
647 | ]); | 663 | ]); |
648 | } | 664 | } |
649 | 665 | ||
650 | function P(x) { | 666 | function P(x) { |
651 | return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); | 667 | return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); |
652 | } | 668 | } |
653 | 669 | ||
654 | var PARTS = { | 670 | var PARTS = { |
655 | wip: function(params) { | 671 | wip: function(params) { |
656 | return foot(); | 672 | return foot(); |
657 | return union(base_extrusions(),column_extrusions(),duet()); | 673 | return union(base_extrusions(),column_extrusions(),duet()); |
658 | alltogethernow: function(params) { | 674 | alltogethernow: function(params) { |
659 | var cols = columns(); | 675 | var cols = columns(); |
660 | var sides = base_sides(); | 676 | var sides = base_sides(); |
661 | var feet = THREEWINDS.map(function(w,i) { | 677 | var feet = THREEWINDS.map(function(w,i) { |
662 | var rv = foot(); | 678 | var rv = foot(); |
663 | rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0); | 679 | rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0); |
664 | return rv; | 680 | return rv; |
665 | }); | 681 | }); |
666 | var rv = union(cols).union(sides.map(union)).union(feet); | 682 | var rv = union(cols).union(sides.map(union)).union(feet); |
667 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); | 683 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); |
668 | return rv; | 684 | return rv; |
669 | } | 685 | } |
670 | }; | 686 | }; |
671 | 687 | ||
672 | function main(params) { | 688 | function main(params) { |
673 | var part = params.part && PARTS[params.part]; | 689 | var part = params.part && PARTS[params.part]; |
674 | if(!part) return refaxes(); | 690 | if(!part) return refaxes(); |
675 | var rv = P(part(params)); | 691 | var rv = P(part(params)); |
676 | if(!params.print) rv = rv.union(refaxes()); | 692 | if(!params.print) rv = rv.union(refaxes()); |
677 | return rv; | 693 | return rv; |
678 | } | 694 | } |
679 | 695 | ||
680 | function _main(params) { | 696 | function _main(params) { |
681 | var e = EFFECTOR.effector(); | 697 | var e = EFFECTOR.effector(); |
682 | var hs = E3DV6.heatsink(); | 698 | var hs = E3DV6.heatsink(); |
683 | hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); | 699 | hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); |
684 | var ms = microswitch(); | 700 | var ms = microswitch(); |
685 | var hd = EFFECTOR.hinged({ | 701 | var hd = EFFECTOR.hinged({ |
686 | microswitch:ms,effector:e | 702 | microswitch:ms,effector:e |