author | Michael Krelin <hacker@klever.net> | 2016-03-20 14:39:18 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2016-03-20 14:39:18 (UTC) |
commit | 4a633d30598c5c230e42d3feafbca39b43292acc (patch) (unidiff) | |
tree | df14b54b33c5af558cab0d5e6dcd878aaa22a9c7 | |
parent | 00a023fb1fa3370550b2b30b6ce06aec45436a52 (diff) | |
download | redelta-4a633d30598c5c230e42d3feafbca39b43292acc.zip redelta-4a633d30598c5c230e42d3feafbca39b43292acc.tar.gz redelta-4a633d30598c5c230e42d3feafbca39b43292acc.tar.bz2 |
-rw-r--r-- | delta.jscad | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/delta.jscad b/delta.jscad index b783913..b46534a 100644 --- a/delta.jscad +++ b/delta.jscad | |||
@@ -457,41 +457,43 @@ var EFFECTOR = { | |||
457 | var ymax = Math.max(Math.abs(b[0].y),Math.abs(b[1].y)); | 457 | var ymax = Math.max(Math.abs(b[0].y),Math.abs(b[1].y)); |
458 | var zmax = Math.max(b[0].z,b[1].z); | 458 | var zmax = Math.max(b[0].z,b[1].z); |
459 | return [-1,1].map(function(s) { | 459 | return [-1,1].map(function(s) { |
460 | return hinged.intersect(CSG.cube({ | 460 | return hinged.intersect(CSG.cube({ |
461 | corner1: [Math.min(b[0].x,b[1].x)-1,s*e.clamp.split/2,-zmax-1], | 461 | corner1: [Math.min(b[0].x,b[1].x)-1,s*e.clamp.split/2,-zmax-1], |
462 | corner2: [Math.max(b[0].x,b[1].x)+1,s*(ymax+1),zmax+1] | 462 | corner2: [Math.max(b[0].x,b[1].x)+1,s*(ymax+1),zmax+1] |
463 | })); | 463 | })); |
464 | }); | 464 | }); |
465 | }, | 465 | }, |
466 | fanholder: function effector_fanholder() { | 466 | fanholder: function effector_fanholder() { |
467 | var fh = CONFIG.effector.fanholder; | 467 | var fh = CONFIG.effector.fanholder; |
468 | var od = fh.screw.d+2*fh.screw.m; | 468 | var od = fh.screw.d+2*fh.screw.m; |
469 | return linear_extrude({height:fh.w},hull( | 469 | var rv = linear_extrude({height:fh.w},hull( |
470 | CAG.circle({center:[0,-this.rmount],radius:od/2}), | 470 | CAG.circle({center:[0,-this.rmount],radius:od/2}), |
471 | CAG.circle({center:[0,-fh.r+od/2+fh.w/2],radius:fh.w/2}) | 471 | CAG.circle({center:[0,-fh.r+od/2+fh.w/2],radius:fh.w/2}) |
472 | )).translate([0,0,-fh.w]).union( | 472 | )).translate([0,0,-fh.w]).union( |
473 | linear_extrude({height:fh.w},hull( | 473 | linear_extrude({height:fh.w},hull( |
474 | CAG.circle({center:[fh.w/2,-this.rmount-od/2-fh.w/2],radius:fh.w/2}), | 474 | CAG.circle({center:[fh.w/2,-this.rmount-od/2-fh.w/2],radius:fh.w/2}), |
475 | CAG.circle({center:[od/2,-fh.r],radius:od/2}) | 475 | CAG.circle({center:[od/2,-fh.r],radius:od/2}) |
476 | )).rotateY(90).translate([-fh.w/2,0,0]) | 476 | )).rotateY(90).translate([-fh.w/2,0,0]) |
477 | ).subtract( CSG.cylinder({ | 477 | ).subtract( CSG.cylinder({ |
478 | start: [-fh.w,-fh.r,-od/2], | 478 | start: [-fh.w,-fh.r,-od/2], |
479 | end: [fh.w,-fh.r,-od/2], | 479 | end: [fh.w,-fh.r,-od/2], |
480 | radius: fh.screw.d/2 | 480 | radius: fh.screw.d/2 |
481 | })).subtract( CSG.cylinder({ | 481 | })).subtract( CSG.cylinder({ |
482 | start: [0,-this.rmount,1], | 482 | start: [0,-this.rmount,1], |
483 | end: [0,-this.rmount,-fh.w-1], | 483 | end: [0,-this.rmount,-fh.w-1], |
484 | radius: fh.screw.d/2 | 484 | radius: fh.screw.d/2 |
485 | })).setColor([0.3,0.8,0.3,0.9]).rotateZ(-120); | 485 | })); |
486 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,-1],[1,0,0]); | ||
487 | return rv.setColor([0.3,0.8,0.3,0.9]).rotateZ(-120); | ||
486 | } | 488 | } |
487 | }; | 489 | }; |
488 | 490 | ||
489 | function columns() { | 491 | function columns() { |
490 | var rv = [0,1,2].map(function(x) { | 492 | var rv = [0,1,2].map(function(x) { |
491 | return union(vector_char(0,0,String.fromCharCode('A'.charCodeAt(0)+x)).segments.map(function(x) { | 493 | return union(vector_char(0,0,String.fromCharCode('A'.charCodeAt(0)+x)).segments.map(function(x) { |
492 | return rectangular_extrude(x,{w:2,h:1}); | 494 | return rectangular_extrude(x,{w:2,h:1}); |
493 | })).center().rotateX(90).translate([0,50,0]).rotateZ(x*120+120); | 495 | })).center().rotateX(90).translate([0,50,0]).rotateZ(x*120+120); |
494 | }); | 496 | }); |
495 | return union(rv); | 497 | return union(rv); |
496 | } | 498 | } |
497 | 499 | ||