summaryrefslogtreecommitdiffabout
path: root/delta.jscad
authorMichael Krelin <hacker@klever.net>2016-01-08 22:17:13 (UTC)
committer Michael Krelin <hacker@klever.net>2016-01-08 22:17:13 (UTC)
commit717f3676d93e8b2f8d71ea4b25461614becb79ef (patch) (unidiff)
tree09e0de72b5828715c8c794ef10f513687caf12b4 /delta.jscad
parent34a65279effcec5f51a9853846f6593dadb72246 (diff)
downloadredelta-717f3676d93e8b2f8d71ea4b25461614becb79ef.zip
redelta-717f3676d93e8b2f8d71ea4b25461614becb79ef.tar.gz
redelta-717f3676d93e8b2f8d71ea4b25461614becb79ef.tar.bz2
wip wip
Diffstat (limited to 'delta.jscad') (more/less context) (ignore whitespace changes)
-rw-r--r--delta.jscad6
1 files changed, 5 insertions, 1 deletions
diff --git a/delta.jscad b/delta.jscad
index 01a5dc7..8233e74 100644
--- a/delta.jscad
+++ b/delta.jscad
@@ -719,50 +719,54 @@ function duetholder() {
719 rv.properties.duet.c_ne = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),-Math.sin(Math.PI/3),0]); 719 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_nw = new CSG.Connector(cp,[0,0,1],[-Math.cos(Math.PI/3),Math.sin(Math.PI/3),0]); 720 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.c_h = new CSG.Connector([0,-CONFIG.extrusion.w/2,0],[0,0,1],[1,0,0]); 721 rv.properties.c_h = new CSG.Connector([0,-CONFIG.extrusion.w/2,0],[0,0,1],[1,0,0]);
722 rv.properties.c_v = new CSG.Connector([0,0,CONFIG.extrusion.w/2],[0,-1,0],[0,0,1]); 722 rv.properties.c_v = new CSG.Connector([0,0,CONFIG.extrusion.w/2],[0,-1,0],[0,0,1]);
723 rv.properties.P = new CSG.Connector([-hw/2,0,0],[1,0,0],[0,1,0]); 723 rv.properties.P = new CSG.Connector([-hw/2,0,0],[1,0,0],[0,1,0]);
724 return rv.setColor(CONFIG.color.parts); 724 return rv.setColor(CONFIG.color.parts);
725} 725}
726 726
727function refaxes(o) { 727function refaxes(o) {
728 if(!o) o = {}; 728 if(!o) o = {};
729 var l = o.l||20, g = o.g||0.7; 729 var l = o.l||20, g = o.g||0.7;
730 return union([ 730 return union([
731 CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), 731 CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]),
732 CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), 732 CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]),
733 CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) 733 CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g])
734 ]); 734 ]);
735} 735}
736 736
737function P(x) { 737function P(x) {
738 return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); 738 return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0);
739} 739}
740 740
741var PARTS = { 741var PARTS = {
742 wip: function(params) { 742 wip: function(params) {
743 return duetholder(params);
744 return PARTS.alltogethernow(params);
745 return base_extrusions();
743 return foot(); 746 return foot();
744 return union(base_extrusions(),column_extrusions(),duet()); 747 return union(base_extrusions(),column_extrusions(),duet().translate([0,-20,0]));
748 },
745 alltogethernow: function(params) { 749 alltogethernow: function(params) {
746 var cols = columns(); 750 var cols = columns();
747 var sides = base_sides(); 751 var sides = base_sides();
748 var feet = THREEWINDS.map(function(w,i) { 752 var feet = THREEWINDS.map(function(w,i) {
749 var rv = foot(); 753 var rv = foot();
750 rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0); 754 rv = rv.connectTo(rv.properties.c_column,cols[i].properties.c_bottom,false,0);
751 return rv; 755 return rv;
752 }); 756 });
753 var dh = duetholder(); 757 var dh = duetholder();
754 var dhsw = dh.connectTo(dh.properties.c_h, 758 var dhsw = dh.connectTo(dh.properties.c_h,
755 new CSG.Connector([-CONFIG.duet.hole_spacing.x/2,-CD.base.mid_inscription_r,CONFIG.foot.h],[0,0,1],[1,0,0]), 759 new CSG.Connector([-CONFIG.duet.hole_spacing.x/2,-CD.base.mid_inscription_r,CONFIG.foot.h],[0,0,1],[1,0,0]),
756 false,0); 760 false,0);
757 var d = duet(); 761 var d = duet();
758 d = d.connectTo(d.properties.holes.c_sw,dhsw.properties.duet.c_sw,false,0); 762 d = d.connectTo(d.properties.holes.c_sw,dhsw.properties.duet.c_sw,false,0);
759 var dhse = dh.connectTo(dh.properties.duet.c_se,d.properties.holes.c_se,false,0); 763 var dhse = dh.connectTo(dh.properties.duet.c_se,d.properties.holes.c_se,false,0);
760 var dhne = dh.connectTo(dh.properties.duet.c_ne,d.properties.holes.c_ne,false,0); 764 var dhne = dh.connectTo(dh.properties.duet.c_ne,d.properties.holes.c_ne,false,0);
761 var dhnw = dh.connectTo(dh.properties.duet.c_nw,d.properties.holes.c_nw,false,0); 765 var dhnw = dh.connectTo(dh.properties.duet.c_nw,d.properties.holes.c_nw,false,0);
762 var rv = union(cols).union(sides.map(union)).union(feet).union([ 766 var rv = union(cols).union(sides.map(union)).union(feet).union([
763 d,dhsw,dhse,dhne,dhnw 767 d,dhsw,dhse,dhne,dhnw
764 ]); 768 ]);
765 rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); 769 rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]);
766 return rv; 770 return rv;
767 }, 771 },
768 duetholder: function(params) { 772 duetholder: function(params) {