author | Michael Krelin <hacker@klever.net> | 2016-01-13 20:44:23 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2016-01-13 20:44:23 (UTC) |
commit | ba0d2b52cac7c0ff12fcefb41211177e31963cdc (patch) (unidiff) | |
tree | 959db70d5c0e00488c3e9d96d6737b6f0674b65f /delta.jscad | |
parent | 4463cba1eed4a59d4eba588389a169481798a73c (diff) | |
download | redelta-ba0d2b52cac7c0ff12fcefb41211177e31963cdc.zip redelta-ba0d2b52cac7c0ff12fcefb41211177e31963cdc.tar.gz redelta-ba0d2b52cac7c0ff12fcefb41211177e31963cdc.tar.bz2 |
comments
-rw-r--r-- | delta.jscad | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/delta.jscad b/delta.jscad index 0e8fd62..326d172 100644 --- a/delta.jscad +++ b/delta.jscad | |||
@@ -708,197 +708,197 @@ function duetholder() { | |||
708 | radius: DH.bolt.d/2+PRINT.slide_tolerance | 708 | radius: DH.bolt.d/2+PRINT.slide_tolerance |
709 | }), | 709 | }), |
710 | CSG.cylinder({ // through horizontal to extrusion | 710 | CSG.cylinder({ // through horizontal to extrusion |
711 | start: [0,-CONFIG.extrusion.w/2,-s-1], | 711 | start: [0,-CONFIG.extrusion.w/2,-s-1], |
712 | end: [0,-CONFIG.extrusion.w/2,1], | 712 | end: [0,-CONFIG.extrusion.w/2,1], |
713 | radius: DH.bolt.d/2+PRINT.slide_tolerance | 713 | radius: DH.bolt.d/2+PRINT.slide_tolerance |
714 | }), | 714 | }), |
715 | CSG.cube({ // cut off | 715 | CSG.cube({ // cut off |
716 | corner1: [-hw/2-1,-2*s,0], | 716 | corner1: [-hw/2-1,-2*s,0], |
717 | corner2: [hw/2+1,0,-2*s] | 717 | corner2: [hw/2+1,0,-2*s] |
718 | }).rotateX(45).translate([0,-CONFIG.extrusion.w,0]), | 718 | }).rotateX(45).translate([0,-CONFIG.extrusion.w,0]), |
719 | CSG.cylinder({ // duet bolt | 719 | CSG.cylinder({ // duet bolt |
720 | start: [0,hl,-lower], end: [0,hl,-lower+DH.s], | 720 | start: [0,hl,-lower], end: [0,hl,-lower+DH.s], |
721 | radius: DH.bolt.d/2+PRINT.slide_tolerance | 721 | radius: DH.bolt.d/2+PRINT.slide_tolerance |
722 | }) | 722 | }) |
723 | ]); | 723 | ]); |
724 | var cp = [0,hl,-lower+DH.s]; | 724 | var cp = [0,hl,-lower+DH.s]; |
725 | rv.properties.duet = new CSG.Properties(); | 725 | rv.properties.duet = new CSG.Properties(); |
726 | rv.properties.duet.c_sw = new CSG.Connector(cp,[0,0,1],[1,0,0]); | 726 | rv.properties.duet.c_sw = new CSG.Connector(cp,[0,0,1],[1,0,0]); |
727 | rv.properties.duet.c_se = new CSG.Connector(cp,[0,0,1],[1,0,0]); | 727 | rv.properties.duet.c_se = new CSG.Connector(cp,[0,0,1],[1,0,0]); |
728 | rv.properties.duet.c_ne = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),-Math.sin(Math.PI/3),0]); | 728 | rv.properties.duet.c_ne = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),-Math.sin(Math.PI/3),0]); |
729 | rv.properties.duet.c_nw = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),Math.sin(Math.PI/3),0]); | 729 | rv.properties.duet.c_nw = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),Math.sin(Math.PI/3),0]); |
730 | rv.properties.c_h = new CSG.Connector([0,-CONFIG.extrusion.w/2,0],[0,0,1],[1,0,0]); | 730 | rv.properties.c_h = new CSG.Connector([0,-CONFIG.extrusion.w/2,0],[0,0,1],[1,0,0]); |
731 | rv.properties.c_v = new CSG.Connector([0,0,CONFIG.extrusion.w/2],[0,-1,0],[0,0,1]); | 731 | rv.properties.c_v = new CSG.Connector([0,0,CONFIG.extrusion.w/2],[0,-1,0],[0,0,1]); |
732 | rv.properties.P = new CSG.Connector([-hw/2,0,0],[1,0,0],[0,1,0]); | 732 | rv.properties.P = new CSG.Connector([-hw/2,0,0],[1,0,0],[0,1,0]); |
733 | return rv.setColor(CONFIG.color.parts); | 733 | return rv.setColor(CONFIG.color.parts); |
734 | } | 734 | } |
735 | 735 | ||
736 | function heatbed() { | 736 | function heatbed() { |
737 | var rv = CSG.cylinder({ | 737 | var rv = CSG.cylinder({ |
738 | start: [0,0,0], end: [0,0,CONFIG.heatbed.h], | 738 | start: [0,0,0], end: [0,0,CONFIG.heatbed.h], |
739 | radius: CONFIG.heatbed.r, resolution: 72 | 739 | radius: CONFIG.heatbed.r, resolution: 72 |
740 | }); | 740 | }); |
741 | var screw = CSG.cylinder({ | 741 | var screw = CSG.cylinder({ |
742 | start: [0,-CONFIG.heatbed.sr,-1], | 742 | start: [0,-CONFIG.heatbed.sr,-1], |
743 | end: [0,-CONFIG.heatbed.sr,CONFIG.heatbed.h+1], | 743 | end: [0,-CONFIG.heatbed.sr,CONFIG.heatbed.h+1], |
744 | radius: 3/2 | 744 | radius: 3/2 |
745 | }); | 745 | }); |
746 | var screws = []; | 746 | var screws = []; |
747 | for(var a=0;a<360;a+=60) screws.push(screw.rotateZ(a)); // TODO: connectors | 747 | for(var a=0;a<360;a+=60) screws.push(screw.rotateZ(a)); // TODO: connectors |
748 | rv = rv.subtract(screws); | 748 | rv = rv.subtract(screws); |
749 | rv.properties.c_glass = new CSG.Connector([0,0,CONFIG.heatbed.h],[0,0,1],[1,0,0]); | 749 | rv.properties.c_glass = new CSG.Connector([0,0,CONFIG.heatbed.h],[0,0,1],[1,0,0]); |
750 | rv.properties.P = new CSG.Connector( | 750 | rv.properties.P = new CSG.Connector( |
751 | [0,0,-CONFIG.foot.h-CONFIG.extrusion.w*2-CONFIG.base.gap-CONFIG.bedholder.h], | 751 | [0,0,-CONFIG.foot.h-CONFIG.extrusion.w*2-CONFIG.base.gap-CONFIG.bedholder.h], |
752 | [0,0,1],[1,0,0]); | 752 | [0,0,1],[1,0,0]); |
753 | rv.properties.vitamin = true; | 753 | rv.properties.vitamin = true; |
754 | return rv.setColor(CONFIG.color.heatbed); | 754 | return rv.setColor(CONFIG.color.heatbed); |
755 | } | 755 | } |
756 | function glass() { | 756 | function glass() { |
757 | var rv = CSG.cylinder({ | 757 | var rv = CSG.cylinder({ |
758 | start: [0,0,0], end: [0,0,CONFIG.glass.h], | 758 | start: [0,0,0], end: [0,0,CONFIG.glass.h], |
759 | radius: CONFIG.glass.r, resolution: 72 | 759 | radius: CONFIG.glass.r, resolution: 72 |
760 | }); | 760 | }); |
761 | rv.properties.c_bed = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); | 761 | rv.properties.c_bed = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); |
762 | rv.properties.P = new CSG.Connector([0,0,-CONFIG.foot.h-CONFIG.heatbed.h],[0,0,1],[1,0,0]); | 762 | rv.properties.P = new CSG.Connector([0,0,-CONFIG.foot.h-CONFIG.heatbed.h],[0,0,1],[1,0,0]); |
763 | rv.properties.vitamin = true; | 763 | rv.properties.vitamin = true; |
764 | return rv.setColor(CONFIG.color.glass); | 764 | return rv.setColor(CONFIG.color.glass); |
765 | } | 765 | } |
766 | function platform() { | 766 | function platform() { |
767 | var b = heatbed(); | 767 | var b = heatbed(); |
768 | var g = glass(); | 768 | var g = glass(); |
769 | g = g.connectTo(g.properties.c_bed,b.properties.c_glass,false,0); | 769 | g = g.connectTo(g.properties.c_bed,b.properties.c_glass,false,0); |
770 | return b.union(g); | 770 | return b.union(g); |
771 | } | 771 | } |
772 | 772 | ||
773 | function bedholder(params) { | 773 | function bedholder(params) { |
774 | var h0 = CONFIG.foot.h+CONFIG.extrusion.w*2+CONFIG.base.gap; | 774 | var h0 = CONFIG.foot.h+CONFIG.extrusion.w*2+CONFIG.base.gap; |
775 | var bolt_s = CONFIG.bedholder.bolt.l-CONFIG.extrusion.slotdepth+PRINT.play_tolerance*2; | 775 | var bolt_s = CONFIG.bedholder.bolt.l-CONFIG.extrusion.slotdepth+PRINT.play_tolerance*2; |
776 | var nuth=h0+CONFIG.bedholder.h*3/4; | 776 | var nuth=h0+CONFIG.bedholder.h*3/4; |
777 | var nutth = nuth+CONFIG.bedholder.nut.h/2+PRINT.slide_tolerance/2; | 777 | var nutth = nuth+CONFIG.bedholder.nut.h/2+PRINT.slide_tolerance/2; |
778 | var rv = CSG.roundedCube({ | 778 | var rv = CSG.roundedCube({ |
779 | corner1: [-CONFIG.extrusion.w/2,-CD.base.inner_inscription_r,h0], | 779 | corner1: [-CONFIG.extrusion.w/2,-CD.base.inner_inscription_r,h0], |
780 | corner2: [ CONFIG.extrusion.w/2,-CONFIG.heatbed.sr-3/2-CONFIG.bedholder.margin,h0+CONFIG.bedholder.h], | 780 | corner2: [ CONFIG.extrusion.w/2,-CONFIG.heatbed.sr-3/2-CONFIG.bedholder.margin,h0+CONFIG.bedholder.h], |
781 | roundradius: CONFIG.bedholder.margin | 781 | roundradius: CONFIG.bedholder.margin |
782 | }); | 782 | }); |
783 | rv = rv.subtract([ | 783 | rv = rv.subtract([ |
784 | CSG.cylinder({ // base screw | 784 | CSG.cylinder({ // base screw |
785 | start: [0,-CD.base.mid_inscription_r,h0-1], | 785 | start: [0,-CD.base.mid_inscription_r,h0-1], |
786 | end: [0,-CD.base.mid_inscription_r,h0+CONFIG.bedholder.h+1], | 786 | end: [0,-CD.base.mid_inscription_r,h0+CONFIG.bedholder.h+1], |
787 | radius: CONFIG.bedholder.bolt.d/2+PRINT.screw_tolerance/2 | 787 | radius: CONFIG.bedholder.bolt.d/2+PRINT.screw_tolerance/2 |
788 | }), | 788 | }), |
789 | CSG.cylinder({ // bed screw | 789 | CSG.cylinder({ // bed screw |
790 | start: [0,-CONFIG.heatbed.sr,h0-1], | 790 | start: [0,-CONFIG.heatbed.sr,h0-1], |
791 | end: [0,-CONFIG.heatbed.sr,h0+CONFIG.bedholder.h+1], | 791 | end: [0,-CONFIG.heatbed.sr,h0+CONFIG.bedholder.h+1], |
792 | radius: CONFIG.bedholder.bolt.d/2+PRINT.screw_tolerance/2 | 792 | radius: CONFIG.bedholder.bolt.d/2+PRINT.screw_tolerance/2 |
793 | }), | 793 | }), |
794 | CSG.cube({ // nut pocket | 794 | CSG.cube({ // nut pocket |
795 | center: [0,-CONFIG.heatbed.sr,nuth], | 795 | center: [0,-CONFIG.heatbed.sr,nuth], |
796 | radius: [CONFIG.extrusion.w/2+1,(CONFIG.bedholder.nut.w+PRINT.slide_tolerance)/2,(CONFIG.bedholder.nut.h+PRINT.slide_tolerance)/2] | 796 | radius: [CONFIG.extrusion.w/2+1,(CONFIG.bedholder.nut.w+PRINT.slide_tolerance)/2,(CONFIG.bedholder.nut.h+PRINT.slide_tolerance)/2] |
797 | }), | 797 | }), |
798 | CSG.cylinder({ // sink base screw | 798 | CSG.cylinder({ // sink base screw |
799 | start: [0,-CD.base.mid_inscription_r,h0+bolt_s], | 799 | start: [0,-CD.base.mid_inscription_r,h0+bolt_s], |
800 | end: [0,-CD.base.mid_inscription_r,h0+CONFIG.bedholder.h+1], | 800 | end: [0,-CD.base.mid_inscription_r,h0+CONFIG.bedholder.h+1], |
801 | radius: CONFIG.bedholder.bolt.head.d/2+PRINT.play_tolerance | 801 | radius: CONFIG.bedholder.bolt.head.d/2+PRINT.play_tolerance |
802 | }) | 802 | }) |
803 | ]); | 803 | ]); |
804 | rv = rv.union(CSG.cylinder({ | 804 | rv = rv.union(CSG.cylinder({ // patch up for bridging |
805 | start: [0,-CONFIG.heatbed.sr,nutth], end: [0,-CONFIG.heatbed.sr,nutth+PRINT.layer_height], | 805 | start: [0,-CONFIG.heatbed.sr,nutth], end: [0,-CONFIG.heatbed.sr,nutth+PRINT.layer_height], |
806 | radius: (CONFIG.bedholder.nut.w+PRINT.slide_tolerance)/2+PRINT.extrusion_width | 806 | radius: (CONFIG.bedholder.nut.w+PRINT.slide_tolerance)/2+PRINT.extrusion_width |
807 | })); | 807 | })); |
808 | rv = rv.intersect(CSG.cylinder({ | 808 | rv = rv.intersect(CSG.cylinder({ // cut off excess |
809 | start: [0,0,h0-1], end: [0,0,h0+CONFIG.bedholder.h+1], | 809 | start: [0,0,h0-1], end: [0,0,h0+CONFIG.bedholder.h+1], |
810 | radius: CONFIG.heatbed.r, resolution: 270 | 810 | radius: CONFIG.heatbed.r, resolution: 270 |
811 | })); | 811 | })); |
812 | rv.properties.P = new CSG.Connector([0,-CD.base.mid_inscription_r,h0],[0,0,1],[1,0,0]); | 812 | rv.properties.P = new CSG.Connector([0,-CD.base.mid_inscription_r,h0],[0,0,1],[1,0,0]); |
813 | return rv.setColor(CONFIG.color.parts); | 813 | return rv.setColor(CONFIG.color.parts); |
814 | } | 814 | } |
815 | 815 | ||
816 | var PARTS = { | 816 | var PARTS = { |
817 | wip: function(params) { | 817 | wip: function(params) { |
818 | return duetholder(params); | 818 | return duetholder(params); |
819 | return PARTS.alltogethernow(params); | 819 | return PARTS.alltogethernow(params); |
820 | return base_extrusions(); | 820 | return base_extrusions(); |
821 | return foot(); | 821 | return foot(); |
822 | return union(base_extrusions(),column_extrusions(),duet().translate([0,-20,0])); | 822 | return union(base_extrusions(),column_extrusions(),duet().translate([0,-20,0])); |
823 | }, | 823 | }, |
824 | alltogethernow: function(params) { | 824 | alltogethernow: function(params) { |
825 | var cols = columns(); | 825 | var cols = columns(); |
826 | var sides = base_sides(); | 826 | var sides = base_sides(); |
827 | var feet = THREEWINDS.map(function(w,i) { | 827 | var feet = THREEWINDS.map(function(w,i) { |
828 | var rv = foot(); | 828 | var rv = foot(); |
829 | rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0); | 829 | rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0); |
830 | var s = shoe(); | 830 | var s = shoe(); |
831 | s = s.connectTo(s.properties.c_foot,rv.properties.c_shoe,false,0); | 831 | s = s.connectTo(s.properties.c_foot,rv.properties.c_shoe,false,0); |
832 | return rv.union(s); | 832 | return rv.union(s); |
833 | }); | 833 | }); |
834 | var dh = duetholder(); | 834 | var dh = duetholder(); |
835 | var dhsw = dh.connectTo(dh.properties.c_h, | 835 | var dhsw = dh.connectTo(dh.properties.c_h, |
836 | new CSG.Connector([-CONFIG.duet.hole_spacing.x/2,-CD.base.mid_inscription_r,CONFIG.foot.h],[0,0,1],[1,0,0]), | 836 | new CSG.Connector([-CONFIG.duet.hole_spacing.x/2,-CD.base.mid_inscription_r,CONFIG.foot.h],[0,0,1],[1,0,0]), |
837 | false,0); | 837 | false,0); |
838 | var d = duet(); | 838 | var d = duet(); |
839 | d = d.connectTo(d.properties.holes.c_sw,dhsw.properties.duet.c_sw,false,0); | 839 | d = d.connectTo(d.properties.holes.c_sw,dhsw.properties.duet.c_sw,false,0); |
840 | var dhse = dh.connectTo(dh.properties.duet.c_se,d.properties.holes.c_se,false,0); | 840 | var dhse = dh.connectTo(dh.properties.duet.c_se,d.properties.holes.c_se,false,0); |
841 | var dhne = dh.connectTo(dh.properties.duet.c_ne,d.properties.holes.c_ne,false,0); | 841 | var dhne = dh.connectTo(dh.properties.duet.c_ne,d.properties.holes.c_ne,false,0); |
842 | var dhnw = dh.connectTo(dh.properties.duet.c_nw,d.properties.holes.c_nw,false,0); | 842 | var dhnw = dh.connectTo(dh.properties.duet.c_nw,d.properties.holes.c_nw,false,0); |
843 | var rv = union(cols).union(sides.map(union)).union(feet).union([ | 843 | var rv = union(cols).union(sides.map(union)).union(feet).union([ |
844 | d,dhsw,dhse,dhne,dhnw | 844 | d,dhsw,dhse,dhne,dhnw |
845 | ]); | 845 | ]); |
846 | var p = P(platform()); | 846 | var p = P(platform()); |
847 | rv = rv.union(p); | 847 | rv = rv.union(p); |
848 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); | 848 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); |
849 | return rv; | 849 | return rv; |
850 | }, | 850 | }, |
851 | duetholder: function(params) { | 851 | duetholder: function(params) { |
852 | return duetholder(); | 852 | return duetholder(); |
853 | }, | 853 | }, |
854 | foot: foot, | 854 | foot: foot, |
855 | shoe: shoe, | 855 | shoe: shoe, |
856 | bedholder: bedholder | 856 | bedholder: bedholder |
857 | }; | 857 | }; |
858 | 858 | ||
859 | function main(params) { | 859 | function main(params) { |
860 | var part = params.part && PARTS[params.part]; | 860 | var part = params.part && PARTS[params.part]; |
861 | if(!part) return refaxes(); | 861 | if(!part) return refaxes(); |
862 | var rv = P(part(params)); | 862 | var rv = P(part(params)); |
863 | if(!params.print) rv = rv.union(refaxes()); | 863 | if(!params.print) rv = rv.union(refaxes()); |
864 | return rv; | 864 | return rv; |
865 | } | 865 | } |
866 | 866 | ||
867 | function _main(params) { | 867 | function _main(params) { |
868 | var e = EFFECTOR.effector(); | 868 | var e = EFFECTOR.effector(); |
869 | var hs = E3DV6.heatsink(); | 869 | var hs = E3DV6.heatsink(); |
870 | hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); | 870 | hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); |
871 | var ms = microswitch(); | 871 | var ms = microswitch(); |
872 | var hd = EFFECTOR.hinged({ | 872 | var hd = EFFECTOR.hinged({ |
873 | microswitch:ms,effector:e | 873 | microswitch:ms,effector:e |
874 | }); | 874 | }); |
875 | ms = ms.connectTo( | 875 | ms = ms.connectTo( |
876 | ms.properties.screw_connector[0], | 876 | ms.properties.screw_connector[0], |
877 | hd.properties.microswitch_screw_connector[0], | 877 | hd.properties.microswitch_screw_connector[0], |
878 | false, 0); | 878 | false, 0); |
879 | var hdhd = EFFECTOR.split_hinged(hd); | 879 | var hdhd = EFFECTOR.split_hinged(hd); |
880 | var fh = EFFECTOR.fanholder(); | 880 | var fh = EFFECTOR.fanholder(); |
881 | return union({ | 881 | return union({ |
882 | platform: e, | 882 | platform: e, |
883 | hinged: hdhd[1], | 883 | hinged: hdhd[1], |
884 | clamp: hdhd[0], | 884 | clamp: hdhd[0], |
885 | fanholder: fh, | 885 | fanholder: fh, |
886 | alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] | 886 | alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] |
887 | }[params.part||'alltogethernow']) | 887 | }[params.part||'alltogethernow']) |
888 | var rv = union( | 888 | var rv = union( |
889 | e, | 889 | e, |
890 | hs, | 890 | hs, |
891 | columns(), | 891 | columns(), |
892 | ///hd, | 892 | ///hd, |
893 | hdhd[0], hdhd[1], | 893 | hdhd[0], hdhd[1], |
894 | ms); | 894 | ms); |
895 | return rv; | 895 | return rv; |
896 | } | 896 | } |
897 | 897 | ||
898 | function refaxes(o) { | 898 | function refaxes(o) { |
899 | if(!o) o = {}; | 899 | if(!o) o = {}; |
900 | var l = o.l||20, g = o.g||0.7; | 900 | var l = o.l||20, g = o.g||0.7; |
901 | return union([ | 901 | return union([ |
902 | CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), | 902 | CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), |
903 | CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), | 903 | CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), |
904 | CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) | 904 | CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) |