summaryrefslogtreecommitdiffabout
path: root/delta.jscad
Unidiff
Diffstat (limited to 'delta.jscad') (more/less context) (ignore whitespace changes)
-rw-r--r--delta.jscad6
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
@@ -421,113 +421,115 @@ var EFFECTOR = {
421 var msedge = o.effector.properties.rcorner; 421 var msedge = o.effector.properties.rcorner;
422 var msh = 9.5; // microswitch holes apart 422 var msh = 9.5; // microswitch holes apart
423 var mshh = Math.abs(ms.properties.switch_connector.point.z-ms.properties.screw_connector[0].point.z); // microswitch holes height 423 var mshh = Math.abs(ms.properties.switch_connector.point.z-ms.properties.screw_connector[0].point.z); // microswitch holes height
424 rv = rv.union(CSG.cube({ // connect clamp with microswitch 424 rv = rv.union(CSG.cube({ // connect clamp with microswitch
425 corner1: [-ms.properties.microswitch.size.x/2,-msedge+.1,e.h+e.hinge.e], 425 corner1: [-ms.properties.microswitch.size.x/2,-msedge+.1,e.h+e.hinge.e],
426 corner2: [+ms.properties.microswitch.size.x/2,-CONFIG.hotend.ungroove.d/2-PRINT.fit_tolerance,e.h+e.hinge.e+hhh] 426 corner2: [+ms.properties.microswitch.size.x/2,-CONFIG.hotend.ungroove.d/2-PRINT.fit_tolerance,e.h+e.hinge.e+hhh]
427 })).union([-msh/2,msh/2].map(function(x) { // shell for microswitch screws 427 })).union([-msh/2,msh/2].map(function(x) { // shell for microswitch screws
428 return CSG.roundedCylinder({ 428 return CSG.roundedCylinder({
429 start: [x,-CONFIG.hotend.ungroove.d/2-PRINT.fit_tolerance-(e.mswitch.screw.d/2+e.mswitch.screw.s),e.h+e.hinge.e+mshh], 429 start: [x,-CONFIG.hotend.ungroove.d/2-PRINT.fit_tolerance-(e.mswitch.screw.d/2+e.mswitch.screw.s),e.h+e.hinge.e+mshh],
430 end: [x,-msedge+ms.properties.microswitch.size.y,e.h+e.hinge.e+mshh], 430 end: [x,-msedge+ms.properties.microswitch.size.y,e.h+e.hinge.e+mshh],
431 radius: e.mswitch.screw.d/2+e.mswitch.screw.s 431 radius: e.mswitch.screw.d/2+e.mswitch.screw.s
432 }); 432 });
433 })).subtract(CSG.cube({ // cut off excess if any 433 })).subtract(CSG.cube({ // cut off excess if any
434 corner1:[-hhr,-msedge+ms.properties.microswitch.size.y,e.h+e.hinge.e-1], 434 corner1:[-hhr,-msedge+ms.properties.microswitch.size.y,e.h+e.hinge.e-1],
435 corner2:[hhr,-msedge-1,e.h+e.hinge.e+hhh+e.mswitch.screw.d+e.mswitch.screw.s+1] 435 corner2:[hhr,-msedge-1,e.h+e.hinge.e+hhh+e.mswitch.screw.d+e.mswitch.screw.s+1]
436 })).subtract([-msh/2,msh/2].map(function(x) { return CSG.roundedCylinder({ // screwholes 436 })).subtract([-msh/2,msh/2].map(function(x) { return CSG.roundedCylinder({ // screwholes
437 start: [x,-CONFIG.hotend.ungroove.d/2-PRINT.fit_tolerance-(e.mswitch.screw.d/2+e.mswitch.screw.s),e.h+e.hinge.e+mshh], 437 start: [x,-CONFIG.hotend.ungroove.d/2-PRINT.fit_tolerance-(e.mswitch.screw.d/2+e.mswitch.screw.s),e.h+e.hinge.e+mshh],
438 end: [x,-msedge+ms.properties.microswitch.size.y,e.h+e.hinge.e+mshh], 438 end: [x,-msedge+ms.properties.microswitch.size.y,e.h+e.hinge.e+mshh],
439 radius: e.mswitch.screw.d/2 439 radius: e.mswitch.screw.d/2
440 })})).subtract(CSG.cylinder({ // pulldown screw 440 })})).subtract(CSG.cylinder({ // pulldown screw
441 start:[0,-msedge+ms.properties.microswitch.size.y+3/2/*XXX:config*/+PRINT.extrusion_width,e.h+e.hinge.e-1], 441 start:[0,-msedge+ms.properties.microswitch.size.y+3/2/*XXX:config*/+PRINT.extrusion_width,e.h+e.hinge.e-1],
442 end:[0,-msedge+ms.properties.microswitch.size.y+3/2/*XXX:config*/+PRINT.extrusion_width,e.h+e.hinge.e+hhh+1], 442 end:[0,-msedge+ms.properties.microswitch.size.y+3/2/*XXX:config*/+PRINT.extrusion_width,e.h+e.hinge.e+hhh+1],
443 radius: 3/2/*XXX:config*/ 443 radius: 3/2/*XXX:config*/
444 })); 444 }));
445 rv.properties.microswitch_screw_connector = new CSG.Properties(); 445 rv.properties.microswitch_screw_connector = new CSG.Properties();
446 [-msh/2,msh/2].forEach(function(x,i) { 446 [-msh/2,msh/2].forEach(function(x,i) {
447 rv.properties.microswitch_screw_connector[i] = new CSG.Connector( 447 rv.properties.microswitch_screw_connector[i] = new CSG.Connector(
448 [x,-msedge,e.h+e.hinge.e+mshh], 448 [x,-msedge,e.h+e.hinge.e+mshh],
449 [0,1,0], [0,0,-1] 449 [0,1,0], [0,0,-1]
450 ); 450 );
451 }); 451 });
452 return rv.setColor([0.3,0.8,0.3,0.9]); 452 return rv.setColor([0.3,0.8,0.3,0.9]);
453 }, 453 },
454 split_hinged: function effector_split_hinged(hinged) { 454 split_hinged: function effector_split_hinged(hinged) {
455 var e = CONFIG.effector; 455 var e = CONFIG.effector;
456 var b = hinged.getBounds(); 456 var b = hinged.getBounds();
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
489function columns() { 491function 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
498function microswitch() { 500function microswitch() {
499 var screw_connector = new CSG.Properties(); 501 var screw_connector = new CSG.Properties();
500 var rv = CSG.cube({ center:[0,0,2.5],radius: [19.8/2,6/2,10/2] }).union( 502 var rv = CSG.cube({ center:[0,0,2.5],radius: [19.8/2,6/2,10/2] }).union(
501 CSG.cube({ center: [2.5,0.5,6], radius: [2/2,3.5/2,5/2] }) 503 CSG.cube({ center: [2.5,0.5,6], radius: [2/2,3.5/2,5/2] })
502 ).union( 504 ).union(
503 [-8,-1,8].map(function(x) { 505 [-8,-1,8].map(function(x) {
504 return CSG.cube({ center:[x,0,0], radius: [0.6/2,3.2/2,13/2] }) 506 return CSG.cube({ center:[x,0,0], radius: [0.6/2,3.2/2,13/2] })
505 }) 507 })
506 ).subtract( 508 ).subtract(
507 [-9.5/2,9.5/2].map(function(x,i) { 509 [-9.5/2,9.5/2].map(function(x,i) {
508 screw_connector[i] = new CSG.Connector([x,6/2,0],[0,-1,0],[0,0,1]); 510 screw_connector[i] = new CSG.Connector([x,6/2,0],[0,-1,0],[0,0,1]);
509 return CSG.cylinder({ 511 return CSG.cylinder({
510 start: [x,-4,0], end: [x,4,0], 512 start: [x,-4,0], end: [x,4,0],
511 radius: 2/2 513 radius: 2/2
512 }) 514 })
513 }) 515 })
514 ); 516 );
515 rv.properties.switch_connector = new CSG.Connector([2.5,0.5,6+5/2],[0,0,1],[0,-1,0]); 517 rv.properties.switch_connector = new CSG.Connector([2.5,0.5,6+5/2],[0,0,1],[0,-1,0]);
516 rv.properties.screw_connector = screw_connector; 518 rv.properties.screw_connector = screw_connector;
517 rv.properties.microswitch = new CSG.Properties(); 519 rv.properties.microswitch = new CSG.Properties();
518 rv.properties.microswitch.size = new CSG.Vector3D( 520 rv.properties.microswitch.size = new CSG.Vector3D(
519 19.8,6,10 521 19.8,6,10
520 ); 522 );
521 return rv; 523 return rv;
522} 524}
523 525
524var FOURWINDS = [0,90,180,270]; 526var FOURWINDS = [0,90,180,270];
525 527
526var E2020 = { 528var E2020 = {
527 outer: 20, thickness: 1.8, 529 outer: 20, thickness: 1.8,
528 roundius: 1, centerhole: 5, 530 roundius: 1, centerhole: 5,
529 slot_width: 6, 531 slot_width: 6,
530 T: { width: 10, thickness: 1.5, depth: 6.5 }, 532 T: { width: 10, thickness: 1.5, depth: 6.5 },
531 533
532 extrusion: function(o) { 534 extrusion: function(o) {
533 if(!o) o = {}; 535 if(!o) o = {};