summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2016-01-13 09:51:01 (UTC)
committer Michael Krelin <hacker@klever.net>2016-01-13 09:51:01 (UTC)
commit10e299ccac1b7e6ab393df441e7e6e24baefc3ca (patch) (unidiff)
treec9014fcb02d5f2ed7b4eb8b3be56103d3b429742
parentb1ff07b6fa7c70633ee564cefb3c0325b9da60ab (diff)
downloadredelta-10e299ccac1b7e6ab393df441e7e6e24baefc3ca.zip
redelta-10e299ccac1b7e6ab393df441e7e6e24baefc3ca.tar.gz
redelta-10e299ccac1b7e6ab393df441e7e6e24baefc3ca.tar.bz2
heatbed and glass
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--delta.jscad37
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
@@ -722,12 +722,47 @@ function duetholder() {
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
728function 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}
746function 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}
756function 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
728function refaxes(o) { 763function 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]),
@@ -766,12 +801,14 @@ var PARTS = {
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 },