author | Michael Krelin <hacker@klever.net> | 2016-01-13 09:51:01 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2016-01-13 09:51:01 (UTC) |
commit | 10e299ccac1b7e6ab393df441e7e6e24baefc3ca (patch) (unidiff) | |
tree | c9014fcb02d5f2ed7b4eb8b3be56103d3b429742 /delta.jscad | |
parent | b1ff07b6fa7c70633ee564cefb3c0325b9da60ab (diff) | |
download | redelta-10e299ccac1b7e6ab393df441e7e6e24baefc3ca.zip redelta-10e299ccac1b7e6ab393df441e7e6e24baefc3ca.tar.gz redelta-10e299ccac1b7e6ab393df441e7e6e24baefc3ca.tar.bz2 |
heatbed and glass
-rw-r--r-- | delta.jscad | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/delta.jscad b/delta.jscad index 9061c28..83122af 100644 --- a/delta.jscad +++ b/delta.jscad | |||
@@ -680,140 +680,177 @@ function duetholder() { | |||
680 | CSG.cube({ // vertical | 680 | CSG.cube({ // vertical |
681 | corner1: [-hw/2,s,CONFIG.extrusion.w], | 681 | corner1: [-hw/2,s,CONFIG.extrusion.w], |
682 | corner2: [hw/2,0,-lower] | 682 | corner2: [hw/2,0,-lower] |
683 | }), | 683 | }), |
684 | CSG.cube({ // horizontal extrusion | 684 | CSG.cube({ // horizontal extrusion |
685 | corner1: [-hw/2,-CONFIG.extrusion.w,0], | 685 | corner1: [-hw/2,-CONFIG.extrusion.w,0], |
686 | corner2: [ hw/2,0,-s] | 686 | corner2: [ hw/2,0,-s] |
687 | }), | 687 | }), |
688 | CSG.cube({ // horizontal | 688 | CSG.cube({ // horizontal |
689 | corner1: [-hw/2,0,-lower], | 689 | corner1: [-hw/2,0,-lower], |
690 | corner2: [hw/2,hl,-lower+DH.s] | 690 | corner2: [hw/2,hl,-lower+DH.s] |
691 | }), | 691 | }), |
692 | CSG.cylinder({ // boltend of horizontal part | 692 | CSG.cylinder({ // boltend of horizontal part |
693 | start: [0,hl,-lower], end: [0,hl,-lower+DH.s], | 693 | start: [0,hl,-lower], end: [0,hl,-lower+DH.s], |
694 | radius: hw/2 | 694 | radius: hw/2 |
695 | }) | 695 | }) |
696 | ]); | 696 | ]); |
697 | rv = rv.subtract([ | 697 | rv = rv.subtract([ |
698 | CSG.cylinder({ // through vertical | 698 | CSG.cylinder({ // through vertical |
699 | start: [0,-1,CONFIG.extrusion.w/2], end: [0,s+1,CONFIG.extrusion.w/2], | 699 | start: [0,-1,CONFIG.extrusion.w/2], end: [0,s+1,CONFIG.extrusion.w/2], |
700 | radius: DH.bolt.d/2+PRINT.slide_tolerance | 700 | radius: DH.bolt.d/2+PRINT.slide_tolerance |
701 | }), | 701 | }), |
702 | CSG.cylinder({ // through horizontal to extrusion | 702 | CSG.cylinder({ // through horizontal to extrusion |
703 | start: [0,-CONFIG.extrusion.w/2,-s-1], | 703 | start: [0,-CONFIG.extrusion.w/2,-s-1], |
704 | end: [0,-CONFIG.extrusion.w/2,1], | 704 | end: [0,-CONFIG.extrusion.w/2,1], |
705 | radius: DH.bolt.d/2+PRINT.slide_tolerance | 705 | radius: DH.bolt.d/2+PRINT.slide_tolerance |
706 | }), | 706 | }), |
707 | CSG.cube({ // cut off | 707 | CSG.cube({ // cut off |
708 | corner1: [-hw/2-1,-2*s,0], | 708 | corner1: [-hw/2-1,-2*s,0], |
709 | corner2: [hw/2+1,0,-2*s] | 709 | corner2: [hw/2+1,0,-2*s] |
710 | }).rotateX(45).translate([0,-CONFIG.extrusion.w,0]), | 710 | }).rotateX(45).translate([0,-CONFIG.extrusion.w,0]), |
711 | CSG.cylinder({ // duet bolt | 711 | CSG.cylinder({ // duet bolt |
712 | start: [0,hl,-lower], end: [0,hl,-lower+DH.s], | 712 | start: [0,hl,-lower], end: [0,hl,-lower+DH.s], |
713 | radius: DH.bolt.d/2+PRINT.slide_tolerance | 713 | radius: DH.bolt.d/2+PRINT.slide_tolerance |
714 | }) | 714 | }) |
715 | ]); | 715 | ]); |
716 | var cp = [0,hl,-lower+DH.s]; | 716 | var cp = [0,hl,-lower+DH.s]; |
717 | rv.properties.duet = new CSG.Properties(); | 717 | rv.properties.duet = new CSG.Properties(); |
718 | rv.properties.duet.c_sw = new CSG.Connector(cp,[0,0,1],[1,0,0]); | 718 | rv.properties.duet.c_sw = new CSG.Connector(cp,[0,0,1],[1,0,0]); |
719 | rv.properties.duet.c_se = new CSG.Connector(cp,[0,0,1],[1,0,0]); | 719 | rv.properties.duet.c_se = new CSG.Connector(cp,[0,0,1],[1,0,0]); |
720 | rv.properties.duet.c_ne = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),-Math.sin(Math.PI/3),0]); | 720 | rv.properties.duet.c_ne = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),-Math.sin(Math.PI/3),0]); |
721 | rv.properties.duet.c_nw = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),Math.sin(Math.PI/3),0]); | 721 | rv.properties.duet.c_nw = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),Math.sin(Math.PI/3),0]); |
722 | rv.properties.c_h = new CSG.Connector([0,-CONFIG.extrusion.w/2,0],[0,0,1],[1,0,0]); | 722 | rv.properties.c_h = new CSG.Connector([0,-CONFIG.extrusion.w/2,0],[0,0,1],[1,0,0]); |
723 | rv.properties.c_v = new CSG.Connector([0,0,CONFIG.extrusion.w/2],[0,-1,0],[0,0,1]); | 723 | rv.properties.c_v = new CSG.Connector([0,0,CONFIG.extrusion.w/2],[0,-1,0],[0,0,1]); |
724 | rv.properties.P = new CSG.Connector([-hw/2,0,0],[1,0,0],[0,1,0]); | 724 | rv.properties.P = new CSG.Connector([-hw/2,0,0],[1,0,0],[0,1,0]); |
725 | return rv.setColor(CONFIG.color.parts); | 725 | return rv.setColor(CONFIG.color.parts); |
726 | } | 726 | } |
727 | 727 | ||
728 | function heatbed() { | ||
729 | var rv = CSG.cylinder({ | ||
730 | start: [0,0,0], end: [0,0,CONFIG.heatbed.h], | ||
731 | radius: CONFIG.heatbed.r, resolution: 72 | ||
732 | }); | ||
733 | var screw = CSG.cylinder({ | ||
734 | start: [0,-CONFIG.heatbed.sr,-1], | ||
735 | end: [0,-CONFIG.heatbed.sr,CONFIG.heatbed.h+1], | ||
736 | radius: 3/2 | ||
737 | }); | ||
738 | var screws = []; | ||
739 | for(var a=0;a<360;a+=60) screws.push(screw.rotateZ(a)); // TODO: connectors | ||
740 | rv = rv.subtract(screws); | ||
741 | rv.properties.c_glass = new CSG.Connector([0,0,CONFIG.heatbed.h],[0,0,1],[1,0,0]); | ||
742 | rv.properties.P = new CSG.Connector([0,0,-CONFIG.foot.h-CONFIG.extrusion.w*2-CONFIG.base.gap],[0,0,1],[1,0,0]); | ||
743 | rv.properties.vitamin = true; | ||
744 | return rv.setColor(CONFIG.color.heatbed); | ||
745 | } | ||
746 | function glass() { | ||
747 | var rv = CSG.cylinder({ | ||
748 | start: [0,0,0], end: [0,0,CONFIG.glass.h], | ||
749 | radius: CONFIG.glass.r, resolution: 72 | ||
750 | }); | ||
751 | rv.properties.c_bed = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); | ||
752 | rv.properties.P = new CSG.Connector([0,0,-CONFIG.foot.h-CONFIG.heatbed.h],[0,0,1],[1,0,0]); | ||
753 | rv.properties.vitamin = true; | ||
754 | return rv.setColor(CONFIG.color.glass); | ||
755 | } | ||
756 | function platform() { | ||
757 | var b = heatbed(); | ||
758 | var g = glass(); | ||
759 | g = g.connectTo(g.properties.c_bed,b.properties.c_glass,false,0); | ||
760 | return b.union(g); | ||
761 | } | ||
762 | |||
728 | function refaxes(o) { | 763 | function refaxes(o) { |
729 | if(!o) o = {}; | 764 | if(!o) o = {}; |
730 | var l = o.l||20, g = o.g||0.7; | 765 | var l = o.l||20, g = o.g||0.7; |
731 | return union([ | 766 | return union([ |
732 | CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), | 767 | CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), |
733 | CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), | 768 | CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), |
734 | CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) | 769 | CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) |
735 | ]); | 770 | ]); |
736 | } | 771 | } |
737 | 772 | ||
738 | function P(x) { | 773 | function P(x) { |
739 | return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); | 774 | return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); |
740 | } | 775 | } |
741 | 776 | ||
742 | var PARTS = { | 777 | var PARTS = { |
743 | wip: function(params) { | 778 | wip: function(params) { |
744 | return duetholder(params); | 779 | return duetholder(params); |
745 | return PARTS.alltogethernow(params); | 780 | return PARTS.alltogethernow(params); |
746 | return base_extrusions(); | 781 | return base_extrusions(); |
747 | return foot(); | 782 | return foot(); |
748 | return union(base_extrusions(),column_extrusions(),duet().translate([0,-20,0])); | 783 | return union(base_extrusions(),column_extrusions(),duet().translate([0,-20,0])); |
749 | }, | 784 | }, |
750 | alltogethernow: function(params) { | 785 | alltogethernow: function(params) { |
751 | var cols = columns(); | 786 | var cols = columns(); |
752 | var sides = base_sides(); | 787 | var sides = base_sides(); |
753 | var feet = THREEWINDS.map(function(w,i) { | 788 | var feet = THREEWINDS.map(function(w,i) { |
754 | var rv = foot(); | 789 | var rv = foot(); |
755 | rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0); | 790 | rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0); |
756 | var s = shoe(); | 791 | var s = shoe(); |
757 | s = s.connectTo(s.properties.c_foot,rv.properties.c_shoe,false,0); | 792 | s = s.connectTo(s.properties.c_foot,rv.properties.c_shoe,false,0); |
758 | return rv.union(s); | 793 | return rv.union(s); |
759 | }); | 794 | }); |
760 | var dh = duetholder(); | 795 | var dh = duetholder(); |
761 | var dhsw = dh.connectTo(dh.properties.c_h, | 796 | var dhsw = dh.connectTo(dh.properties.c_h, |
762 | new CSG.Connector([-CONFIG.duet.hole_spacing.x/2,-CD.base.mid_inscription_r,CONFIG.foot.h],[0,0,1],[1,0,0]), | 797 | new CSG.Connector([-CONFIG.duet.hole_spacing.x/2,-CD.base.mid_inscription_r,CONFIG.foot.h],[0,0,1],[1,0,0]), |
763 | false,0); | 798 | false,0); |
764 | var d = duet(); | 799 | var d = duet(); |
765 | d = d.connectTo(d.properties.holes.c_sw,dhsw.properties.duet.c_sw,false,0); | 800 | d = d.connectTo(d.properties.holes.c_sw,dhsw.properties.duet.c_sw,false,0); |
766 | var dhse = dh.connectTo(dh.properties.duet.c_se,d.properties.holes.c_se,false,0); | 801 | var dhse = dh.connectTo(dh.properties.duet.c_se,d.properties.holes.c_se,false,0); |
767 | var dhne = dh.connectTo(dh.properties.duet.c_ne,d.properties.holes.c_ne,false,0); | 802 | var dhne = dh.connectTo(dh.properties.duet.c_ne,d.properties.holes.c_ne,false,0); |
768 | var dhnw = dh.connectTo(dh.properties.duet.c_nw,d.properties.holes.c_nw,false,0); | 803 | var dhnw = dh.connectTo(dh.properties.duet.c_nw,d.properties.holes.c_nw,false,0); |
769 | var rv = union(cols).union(sides.map(union)).union(feet).union([ | 804 | var rv = union(cols).union(sides.map(union)).union(feet).union([ |
770 | d,dhsw,dhse,dhne,dhnw | 805 | d,dhsw,dhse,dhne,dhnw |
771 | ]); | 806 | ]); |
807 | var p = P(platform()); | ||
808 | rv = rv.union(p); | ||
772 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); | 809 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); |
773 | return rv; | 810 | return rv; |
774 | }, | 811 | }, |
775 | duetholder: function(params) { | 812 | duetholder: function(params) { |
776 | return duetholder(); | 813 | return duetholder(); |
777 | }, | 814 | }, |
778 | foot: foot, | 815 | foot: foot, |
779 | shoe: shoe | 816 | shoe: shoe |
780 | }; | 817 | }; |
781 | 818 | ||
782 | function main(params) { | 819 | function main(params) { |
783 | var part = params.part && PARTS[params.part]; | 820 | var part = params.part && PARTS[params.part]; |
784 | if(!part) return refaxes(); | 821 | if(!part) return refaxes(); |
785 | var rv = P(part(params)); | 822 | var rv = P(part(params)); |
786 | if(!params.print) rv = rv.union(refaxes()); | 823 | if(!params.print) rv = rv.union(refaxes()); |
787 | return rv; | 824 | return rv; |
788 | } | 825 | } |
789 | 826 | ||
790 | function _main(params) { | 827 | function _main(params) { |
791 | var e = EFFECTOR.effector(); | 828 | var e = EFFECTOR.effector(); |
792 | var hs = E3DV6.heatsink(); | 829 | var hs = E3DV6.heatsink(); |
793 | hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); | 830 | hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); |
794 | var ms = microswitch(); | 831 | var ms = microswitch(); |
795 | var hd = EFFECTOR.hinged({ | 832 | var hd = EFFECTOR.hinged({ |
796 | microswitch:ms,effector:e | 833 | microswitch:ms,effector:e |
797 | }); | 834 | }); |
798 | ms = ms.connectTo( | 835 | ms = ms.connectTo( |
799 | ms.properties.screw_connector[0], | 836 | ms.properties.screw_connector[0], |
800 | hd.properties.microswitch_screw_connector[0], | 837 | hd.properties.microswitch_screw_connector[0], |
801 | false, 0); | 838 | false, 0); |
802 | var hdhd = EFFECTOR.split_hinged(hd); | 839 | var hdhd = EFFECTOR.split_hinged(hd); |
803 | var fh = EFFECTOR.fanholder(); | 840 | var fh = EFFECTOR.fanholder(); |
804 | return union({ | 841 | return union({ |
805 | platform: e, | 842 | platform: e, |
806 | hinged: hdhd[1], | 843 | hinged: hdhd[1], |
807 | clamp: hdhd[0], | 844 | clamp: hdhd[0], |
808 | fanholder: fh, | 845 | fanholder: fh, |
809 | alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] | 846 | alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] |
810 | }[params.part||'alltogethernow']) | 847 | }[params.part||'alltogethernow']) |
811 | var rv = union( | 848 | var rv = union( |
812 | e, | 849 | e, |
813 | hs, | 850 | hs, |
814 | columns(), | 851 | columns(), |
815 | ///hd, | 852 | ///hd, |
816 | hdhd[0], hdhd[1], | 853 | hdhd[0], hdhd[1], |
817 | ms); | 854 | ms); |
818 | return rv; | 855 | return rv; |
819 | } | 856 | } |