-rw-r--r-- | delta.jscad | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/delta.jscad b/delta.jscad index 5d40e26..b718fd4 100644 --- a/delta.jscad +++ b/delta.jscad | |||
@@ -587,49 +587,49 @@ function duet() { | |||
587 | function refaxes(o) { | 587 | function refaxes(o) { |
588 | if(!o) o = {}; | 588 | if(!o) o = {}; |
589 | var l = o.l||20, g = o.g||0.7; | 589 | var l = o.l||20, g = o.g||0.7; |
590 | return union([ | 590 | return union([ |
591 | CSG.cylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), | 591 | CSG.cylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), |
592 | CSG.cylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), | 592 | CSG.cylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), |
593 | CSG.cylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) | 593 | CSG.cylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) |
594 | ]); | 594 | ]); |
595 | } | 595 | } |
596 | 596 | ||
597 | function P(x) { | 597 | function P(x) { |
598 | return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); | 598 | return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); |
599 | } | 599 | } |
600 | 600 | ||
601 | var PARTS = { | 601 | var PARTS = { |
602 | wip: function(params) { | 602 | wip: function(params) { |
603 | return union(base_extrusions(),column_extrusions(),duet()); | 603 | return union(base_extrusions(),column_extrusions(),duet()); |
604 | } | 604 | } |
605 | }; | 605 | }; |
606 | 606 | ||
607 | function main(params) { | 607 | function main(params) { |
608 | var part = params.part && PARTS[params.part]; | 608 | var part = params.part && PARTS[params.part]; |
609 | if(!part) return refaxes(); | 609 | if(!part) return refaxes(); |
610 | var rv = P(part(params)); | 610 | var rv = P(part(params)); |
611 | if(true) rv = rv.union(refaxes()); | 611 | if(!params.print) rv = rv.union(refaxes()); |
612 | return rv; | 612 | return rv; |
613 | } | 613 | } |
614 | 614 | ||
615 | function _main(params) { | 615 | function _main(params) { |
616 | var e = EFFECTOR.effector(); | 616 | var e = EFFECTOR.effector(); |
617 | var hs = E3DV6.heatsink(); | 617 | var hs = E3DV6.heatsink(); |
618 | hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); | 618 | hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); |
619 | var ms = microswitch(); | 619 | var ms = microswitch(); |
620 | var hd = EFFECTOR.hinged({ | 620 | var hd = EFFECTOR.hinged({ |
621 | microswitch:ms,effector:e | 621 | microswitch:ms,effector:e |
622 | }); | 622 | }); |
623 | ms = ms.connectTo( | 623 | ms = ms.connectTo( |
624 | ms.properties.screw_connector[0], | 624 | ms.properties.screw_connector[0], |
625 | hd.properties.microswitch_screw_connector[0], | 625 | hd.properties.microswitch_screw_connector[0], |
626 | false, 0); | 626 | false, 0); |
627 | var hdhd = EFFECTOR.split_hinged(hd); | 627 | var hdhd = EFFECTOR.split_hinged(hd); |
628 | var fh = EFFECTOR.fanholder(); | 628 | var fh = EFFECTOR.fanholder(); |
629 | return union({ | 629 | return union({ |
630 | platform: e, | 630 | platform: e, |
631 | hinged: hdhd[1], | 631 | hinged: hdhd[1], |
632 | clamp: hdhd[0], | 632 | clamp: hdhd[0], |
633 | fanholder: fh, | 633 | fanholder: fh, |
634 | alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] | 634 | alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] |
635 | }[params.part||'alltogethernow']) | 635 | }[params.part||'alltogethernow']) |
@@ -644,28 +644,33 @@ function _main(params) { | |||
644 | } | 644 | } |
645 | 645 | ||
646 | function getParameterDefinitions() { | 646 | function getParameterDefinitions() { |
647 | return [{ | 647 | return [{ |
648 | name: 'part', | 648 | name: 'part', |
649 | type: 'choice', | 649 | type: 'choice', |
650 | values: [ | 650 | values: [ |
651 | 'platform', | 651 | 'platform', |
652 | 'hinged', | 652 | 'hinged', |
653 | 'clamp', | 653 | 'clamp', |
654 | 'fanholder', | 654 | 'fanholder', |
655 | 'alltogethernow', | 655 | 'alltogethernow', |
656 | 'wip' | 656 | 'wip' |
657 | ], | 657 | ], |
658 | captions: [ | 658 | captions: [ |
659 | 'Effector platform', | 659 | 'Effector platform', |
660 | 'Hinged part', | 660 | 'Hinged part', |
661 | 'Clamp', | 661 | 'Clamp', |
662 | 'Fan holder', | 662 | 'Fan holder', |
663 | 'All together now!', | 663 | 'All together now!', |
664 | 'Work in progress' | 664 | 'Work in progress' |
665 | ], | 665 | ], |
666 | caption: 'Part', | 666 | caption: 'Part', |
667 | initial: 'wip' | 667 | initial: 'wip' |
668 | },{ | ||
669 | name: 'print', | ||
670 | type: 'checkbox', | ||
671 | caption: 'For print, no nonsense', | ||
672 | initial: false | ||
668 | }]; | 673 | }]; |
669 | } | 674 | } |
670 | 675 | ||
671 | /* vim:set ft=javascript ai: */ | 676 | /* vim:set ft=javascript ai: */ |