summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2016-01-06 22:33:26 (UTC)
committer Michael Krelin <hacker@klever.net>2016-01-06 22:33:26 (UTC)
commit70221c34a5021b3a63aa7fe7a1e925404a36cc95 (patch) (unidiff)
tree3b95fb6effe03e653893241695b27c77787d593b
parent286fd5e24710cc535cfd07888cdcef02af466d30 (diff)
downloadredelta-70221c34a5021b3a63aa7fe7a1e925404a36cc95.zip
redelta-70221c34a5021b3a63aa7fe7a1e925404a36cc95.tar.gz
redelta-70221c34a5021b3a63aa7fe7a1e925404a36cc95.tar.bz2
reference axes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--delta.jscad10
1 files changed, 10 insertions, 0 deletions
diff --git a/delta.jscad b/delta.jscad
index 0ef25e3..baa977d 100644
--- a/delta.jscad
+++ b/delta.jscad
@@ -478,88 +478,98 @@ var E2020 = {
478 [ -e.T.width/2,e.outer/2-e.thickness-e.T.thickness], 478 [ -e.T.width/2,e.outer/2-e.thickness-e.T.thickness],
479 [ -e.T.width/2,e.outer/2-e.thickness], 479 [ -e.T.width/2,e.outer/2-e.thickness],
480 [ -e.slot_width/2,e.outer/2-e.thickness], 480 [ -e.slot_width/2,e.outer/2-e.thickness],
481 [ -e.slot_width/2,e.outer/2+1], 481 [ -e.slot_width/2,e.outer/2+1],
482 ]).rotateZ(w); 482 ]).rotateZ(w);
483 }) 483 })
484 ).subtract(CAG.circle({ 484 ).subtract(CAG.circle({
485 center: [0,0], radius: e.centerhole/2 485 center: [0,0], radius: e.centerhole/2
486 })).extrude({offset:[0,0,l]}); 486 })).extrude({offset:[0,0,l]});
487 rv.properties.c_top=rv.properties.c_left 487 rv.properties.c_top=rv.properties.c_left
488 = new CSG.Connector([0,0,l],[0,0,-1],[1,0,0]); 488 = new CSG.Connector([0,0,l],[0,0,-1],[1,0,0]);
489 rv.properties.c_bottom=rv.properties.c_right 489 rv.properties.c_bottom=rv.properties.c_right
490 = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); 490 = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]);
491 rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); 491 rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]);
492 return rv; 492 return rv;
493 }, 493 },
494 494
495 cap: function extrusion_cap(o) { 495 cap: function extrusion_cap(o) {
496 if(!o) o = {}; 496 if(!o) o = {};
497 var e = o.extrusion || this; 497 var e = o.extrusion || this;
498 var thickness = o.thickness||2, l = o.l||5; 498 var thickness = o.thickness||2, l = o.l||5;
499 var rv = CSG.roundedCube({ 499 var rv = CSG.roundedCube({
500 corner1: [-e.outer/2,-e.outer/2,thickness], 500 corner1: [-e.outer/2,-e.outer/2,thickness],
501 corner2: [e.outer/2,e.outer/2,0], 501 corner2: [e.outer/2,e.outer/2,0],
502 roundradius: [e.roundius,e.roundius,0] 502 roundradius: [e.roundius,e.roundius,0]
503 }); 503 });
504 var fw = [0,90,180,270]; // four winds 504 var fw = [0,90,180,270]; // four winds
505 var iy = e.outer/2-e.T.depth; 505 var iy = e.outer/2-e.T.depth;
506 var ix = e.T.width/2-(e.outer/2-iy-e.thickness-e.T.thickness); 506 var ix = e.T.width/2-(e.outer/2-iy-e.thickness-e.T.thickness);
507 rv = rv.union(fw.map(function(w) { 507 rv = rv.union(fw.map(function(w) {
508 return CAG.fromPoints([ 508 return CAG.fromPoints([
509 [ e.slot_width/2,e.outer/2], 509 [ e.slot_width/2,e.outer/2],
510 [ e.slot_width/2,e.outer/2-e.thickness], 510 [ e.slot_width/2,e.outer/2-e.thickness],
511 [ e.T.width/2,e.outer/2-e.thickness], 511 [ e.T.width/2,e.outer/2-e.thickness],
512 [ e.T.width/2,e.outer/2-e.thickness-e.T.thickness], 512 [ e.T.width/2,e.outer/2-e.thickness-e.T.thickness],
513 [ ix, iy ], 513 [ ix, iy ],
514 [ -ix, iy ], 514 [ -ix, iy ],
515 [ -e.T.width/2,e.outer/2-e.thickness-e.T.thickness], 515 [ -e.T.width/2,e.outer/2-e.thickness-e.T.thickness],
516 [ -e.T.width/2,e.outer/2-e.thickness], 516 [ -e.T.width/2,e.outer/2-e.thickness],
517 [ -e.slot_width/2,e.outer/2-e.thickness], 517 [ -e.slot_width/2,e.outer/2-e.thickness],
518 [ -e.slot_width/2,e.outer/2], 518 [ -e.slot_width/2,e.outer/2],
519 ]).extrude({offset:[0,0,l+thickness]}).rotateZ(w); 519 ]).extrude({offset:[0,0,l+thickness]}).rotateZ(w);
520 })); 520 }));
521 rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); 521 rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]);
522 return rv; 522 return rv;
523 } 523 }
524}; 524};
525 525
526
527function refaxes(o) {
528 if(!o) o = {};
529 var l = o.l||20, g = o.g||0.7;
530 return union([
531 CSG.cylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]),
532 CSG.cylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]),
533 CSG.cylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g])
534 ]);
535}
526function P(x) { 536function P(x) {
527 return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); 537 return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0);
528} 538}
529 539
530function main(params) { 540function main(params) {
531 return P(E2020.extrusion({l:40})).setColor(0.7,0.7,0.7,0.7); 541 return P(E2020.extrusion({l:40})).setColor(0.7,0.7,0.7,0.7);
532} 542}
533 543
534function _main(params) { 544function _main(params) {
535 var e = EFFECTOR.effector(); 545 var e = EFFECTOR.effector();
536 var hs = E3DV6.heatsink(); 546 var hs = E3DV6.heatsink();
537 hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); 547 hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0);
538 var ms = microswitch(); 548 var ms = microswitch();
539 var hd = EFFECTOR.hinged({ 549 var hd = EFFECTOR.hinged({
540 microswitch:ms,effector:e 550 microswitch:ms,effector:e
541 }); 551 });
542 ms = ms.connectTo( 552 ms = ms.connectTo(
543 ms.properties.screw_connector[0], 553 ms.properties.screw_connector[0],
544 hd.properties.microswitch_screw_connector[0], 554 hd.properties.microswitch_screw_connector[0],
545 false, 0); 555 false, 0);
546 var hdhd = EFFECTOR.split_hinged(hd); 556 var hdhd = EFFECTOR.split_hinged(hd);
547 var fh = EFFECTOR.fanholder(); 557 var fh = EFFECTOR.fanholder();
548 return union({ 558 return union({
549 platform: e, 559 platform: e,
550 hinged: hdhd[1], 560 hinged: hdhd[1],
551 clamp: hdhd[0], 561 clamp: hdhd[0],
552 fanholder: fh, 562 fanholder: fh,
553 alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] 563 alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh]
554 }[params.part||'alltogethernow']) 564 }[params.part||'alltogethernow'])
555 var rv = union( 565 var rv = union(
556 e, 566 e,
557 hs, 567 hs,
558 columns(), 568 columns(),
559 ///hd, 569 ///hd,
560 hdhd[0], hdhd[1], 570 hdhd[0], hdhd[1],
561 ms); 571 ms);
562 return rv; 572 return rv;
563} 573}
564/* vim:set ft=javascript ai: */ 574/* vim:set ft=javascript ai: */
565 575