-rw-r--r-- | delta.jscad | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/delta.jscad b/delta.jscad index fa33a0d..e6516f9 100644 --- a/delta.jscad +++ b/delta.jscad | |||
@@ -584,99 +584,99 @@ function duet() { | |||
584 | }).subtract(holes).setColor(CONFIG.color.pcb).union( | 584 | }).subtract(holes).setColor(CONFIG.color.pcb).union( |
585 | CSG.cube({ | 585 | CSG.cube({ |
586 | corner1: [-C.pcb_size.x/2,-C.hole_spacing.y/2+3,C.pcb_size.z], | 586 | corner1: [-C.pcb_size.x/2,-C.hole_spacing.y/2+3,C.pcb_size.z], |
587 | corner2: [ C.pcb_size.x/2, C.hole_spacing.y/2-3,C.h] | 587 | corner2: [ C.pcb_size.x/2, C.hole_spacing.y/2-3,C.h] |
588 | }).setColor(CONFIG.color.bulk) | 588 | }).setColor(CONFIG.color.bulk) |
589 | ); | 589 | ); |
590 | rv.properties.holes = pholes; | 590 | rv.properties.holes = pholes; |
591 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); | 591 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); |
592 | rv.properties.vitamin = true; | 592 | rv.properties.vitamin = true; |
593 | return rv; | 593 | return rv; |
594 | } | 594 | } |
595 | 595 | ||
596 | function foot() { | 596 | function foot() { |
597 | var F = CONFIG.foot; | 597 | var F = CONFIG.foot; |
598 | var br = F.bolt.hd/2+F.margin; | 598 | var br = F.bolt.hd/2+F.margin; |
599 | var bh = F.zscalefactor*Math.sqrt(Math.pow(F.d/2,2)-Math.pow(br,2)); | 599 | var bh = F.zscalefactor*Math.sqrt(Math.pow(F.d/2,2)-Math.pow(br,2)); |
600 | var th = F.h-bh; | 600 | var th = F.h-bh; |
601 | var r = 2*F.d; | 601 | var r = 2*F.d; |
602 | var rv = CSG.sphere({ // botom contorted sphere | 602 | var rv = CSG.sphere({ // botom contorted sphere |
603 | center: [0,0,0], radius: F.d/2, resolution: r | 603 | center: [0,0,0], radius: F.d/2, resolution: r |
604 | }).scale([1,1,F.zscalefactor]).translate([0,0,bh]).union(CSG.cylinder({ // top hat | 604 | }).scale([1,1,F.zscalefactor]).translate([0,0,bh]).union(CSG.cylinder({ // top hat |
605 | start: [0,0,bh], end: [0,0,F.h], radius: F.d/2, resolution: r | 605 | start: [0,0,bh], end: [0,0,F.h], radius: F.d/2, resolution: r |
606 | })).intersect(CSG.cylinder({ // cut off excess | 606 | })).intersect(CSG.cylinder({ // cut off excess |
607 | start: [0,0,0], end: [0,0,F.h], radius: F.d | 607 | start: [0,0,0], end: [0,0,F.h], radius: F.d |
608 | })).subtract([ | 608 | })).subtract([ |
609 | CSG.cylinder({ // bolt hole | 609 | CSG.cylinder({ // bolt hole |
610 | start: [0,0,-1], end: [0,0,F.h+1], radius: F.bolt.d/2+PRINT.slide_tolerance | 610 | start: [0,0,-1], end: [0,0,F.h+1], radius: F.bolt.d/2+PRINT.slide_tolerance |
611 | }), CSG.cylinder({ // nut hole | 611 | }), CSG.cylinder({ // nut hole |
612 | start: [0,0,F.h-F.nut.h-PRINT.play_tolerance], | 612 | start: [0,0,F.h-F.nut.h-PRINT.play_tolerance], |
613 | end: [0,0,F.h], | 613 | end: [0,0,F.h], |
614 | radius: F.nut.d/2+PRINT.slide_tolerance, resolution: 6 | 614 | radius: F.nut.d/2+PRINT.slide_tolerance, resolution: 6 |
615 | }), CSG.cylinder({ // bolthead/washer hole | 615 | }), CSG.cylinder({ // bolthead/washer hole |
616 | start: [0,0,-1], end: [0,0,F.h-F.nut.h-PRINT.play_tolerance-F.shell], | 616 | start: [0,0,-1], end: [0,0,F.h-F.nut.h-PRINT.play_tolerance-F.shell], |
617 | radius: F.bolt.hd/2+PRINT.play_tolerance | 617 | radius: F.bolt.hd/2+PRINT.play_tolerance |
618 | }) | 618 | }) |
619 | ]).union(CSG.cylinder({ // bridging patch | 619 | ]).union(CSG.cylinder({ // bridging patch |
620 | start: [0,0,F.h-F.nut.h-PRINT.play_tolerance-PRINT.layer_height], | 620 | start: [0,0,F.h-F.nut.h-PRINT.play_tolerance-PRINT.layer_height], |
621 | end: [0,0,F.h-F.nut.h-PRINT.play_tolerance], | 621 | end: [0,0,F.h-F.nut.h-PRINT.play_tolerance], |
622 | radius: F.nut.d/2 | 622 | radius: F.nut.d/2 |
623 | })); | 623 | })); |
624 | rv.properties.P = new CSG.Connector([0,0,F.h],[0,0,-1],[1,0,0]); | 624 | rv.properties.P = new CSG.Connector([0,0,F.h],[0,0,-1],[1,0,0]); |
625 | return rv.setColor(CONFIG.color.parts); | 625 | return rv.setColor(CONFIG.color.parts); |
626 | } | 626 | } |
627 | 627 | ||
628 | function refaxes(o) { | 628 | function refaxes(o) { |
629 | if(!o) o = {}; | 629 | if(!o) o = {}; |
630 | var l = o.l||20, g = o.g||0.7; | 630 | var l = o.l||20, g = o.g||0.7; |
631 | return union([ | 631 | return union([ |
632 | CSG.cylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), | 632 | CSG.roundedCylinder({start:[0,0,0],end:[l,0,0]}).setColor([1,0,0,g]), |
633 | CSG.cylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), | 633 | CSG.roundedCylinder({start:[0,0,0],end:[0,l,0]}).setColor([0,1,0,g]), |
634 | CSG.cylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) | 634 | CSG.roundedCylinder({start:[0,0,0],end:[0,0,l]}).setColor([0,0,1,g]) |
635 | ]); | 635 | ]); |
636 | } | 636 | } |
637 | 637 | ||
638 | function P(x) { | 638 | function P(x) { |
639 | return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); | 639 | return x.connectTo(x.properties.P,new CSG.Connector([0,0,0],[0,0,1],[1,0,0]), false, 0); |
640 | } | 640 | } |
641 | 641 | ||
642 | var PARTS = { | 642 | var PARTS = { |
643 | wip: function(params) { | 643 | wip: function(params) { |
644 | return foot(); | 644 | return foot(); |
645 | return union(base_extrusions(),column_extrusions(),duet()); | 645 | return union(base_extrusions(),column_extrusions(),duet()); |
646 | } | 646 | } |
647 | }; | 647 | }; |
648 | 648 | ||
649 | function main(params) { | 649 | function main(params) { |
650 | var part = params.part && PARTS[params.part]; | 650 | var part = params.part && PARTS[params.part]; |
651 | if(!part) return refaxes(); | 651 | if(!part) return refaxes(); |
652 | var rv = P(part(params)); | 652 | var rv = P(part(params)); |
653 | if(!params.print) rv = rv.union(refaxes()); | 653 | if(!params.print) rv = rv.union(refaxes()); |
654 | return rv; | 654 | return rv; |
655 | } | 655 | } |
656 | 656 | ||
657 | function _main(params) { | 657 | function _main(params) { |
658 | var e = EFFECTOR.effector(); | 658 | var e = EFFECTOR.effector(); |
659 | var hs = E3DV6.heatsink(); | 659 | var hs = E3DV6.heatsink(); |
660 | hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); | 660 | hs = hs.connectTo(hs.properties.grove_connector,e.properties.grove_connector,false,0); |
661 | var ms = microswitch(); | 661 | var ms = microswitch(); |
662 | var hd = EFFECTOR.hinged({ | 662 | var hd = EFFECTOR.hinged({ |
663 | microswitch:ms,effector:e | 663 | microswitch:ms,effector:e |
664 | }); | 664 | }); |
665 | ms = ms.connectTo( | 665 | ms = ms.connectTo( |
666 | ms.properties.screw_connector[0], | 666 | ms.properties.screw_connector[0], |
667 | hd.properties.microswitch_screw_connector[0], | 667 | hd.properties.microswitch_screw_connector[0], |
668 | false, 0); | 668 | false, 0); |
669 | var hdhd = EFFECTOR.split_hinged(hd); | 669 | var hdhd = EFFECTOR.split_hinged(hd); |
670 | var fh = EFFECTOR.fanholder(); | 670 | var fh = EFFECTOR.fanholder(); |
671 | return union({ | 671 | return union({ |
672 | platform: e, | 672 | platform: e, |
673 | hinged: hdhd[1], | 673 | hinged: hdhd[1], |
674 | clamp: hdhd[0], | 674 | clamp: hdhd[0], |
675 | fanholder: fh, | 675 | fanholder: fh, |
676 | alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] | 676 | alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] |
677 | }[params.part||'alltogethernow']) | 677 | }[params.part||'alltogethernow']) |
678 | var rv = union( | 678 | var rv = union( |
679 | e, | 679 | e, |
680 | hs, | 680 | hs, |
681 | columns(), | 681 | columns(), |
682 | ///hd, | 682 | ///hd, |