-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 | |||
@@ -373,209 +373,211 @@ var EFFECTOR = { | |||
373 | CSG.cylinder({ | 373 | CSG.cylinder({ |
374 | start: [0,0,e.h+e.hinge.e+CONFIG.hotend.groove.h], | 374 | start: [0,0,e.h+e.hinge.e+CONFIG.hotend.groove.h], |
375 | end: [0,0,e.h+e.hinge.e+CONFIG.hotend.groove.h+CONFIG.hotend.ungroove.above], | 375 | end: [0,0,e.h+e.hinge.e+CONFIG.hotend.groove.h+CONFIG.hotend.ungroove.above], |
376 | radius: hhr | 376 | radius: hhr |
377 | }).subtract(CSG.cylinder({ | 377 | }).subtract(CSG.cylinder({ |
378 | start: [0,0,e.h+e.hinge.e+CONFIG.hotend.groove.h-1], | 378 | start: [0,0,e.h+e.hinge.e+CONFIG.hotend.groove.h-1], |
379 | end: [0,0,e.h+e.hinge.e+CONFIG.hotend.groove.h+CONFIG.hotend.ungroove.above+1], | 379 | end: [0,0,e.h+e.hinge.e+CONFIG.hotend.groove.h+CONFIG.hotend.ungroove.above+1], |
380 | radius: CONFIG.hotend.ungroove.d/2 +PRINT.fit_tolerance | 380 | radius: CONFIG.hotend.ungroove.d/2 +PRINT.fit_tolerance |
381 | })) | 381 | })) |
382 | ).union( /* connect mount with hinge */ | 382 | ).union( /* connect mount with hinge */ |
383 | CSG.cube({ | 383 | CSG.cube({ |
384 | corner1: [-hinges_apart+PRINT.slide_tolerance,CONFIG.hotend.ungroove.d/2+PRINT.fit_tolerance,e.h+e.hinge.e], | 384 | corner1: [-hinges_apart+PRINT.slide_tolerance,CONFIG.hotend.ungroove.d/2+PRINT.fit_tolerance,e.h+e.hinge.e], |
385 | corner2: [hinges_apart-PRINT.slide_tolerance,e.o,e.h+e.hinge.h+e.hinge.d/2+e.hinge.margin] | 385 | corner2: [hinges_apart-PRINT.slide_tolerance,e.o,e.h+e.hinge.h+e.hinge.d/2+e.hinge.margin] |
386 | }) | 386 | }) |
387 | ).subtract( /* hinge screwhole */ | 387 | ).subtract( /* hinge screwhole */ |
388 | CSG.cylinder({ | 388 | CSG.cylinder({ |
389 | start: [-hinges_apart-1,e.o,e.h+e.hinge.h], | 389 | start: [-hinges_apart-1,e.o,e.h+e.hinge.h], |
390 | end: [hinges_apart+1,e.o,e.h+e.hinge.h], | 390 | end: [hinges_apart+1,e.o,e.h+e.hinge.h], |
391 | radius: e.hinge.d/2 | 391 | radius: e.hinge.d/2 |
392 | }) | 392 | }) |
393 | ).union( /* hold clamp together */ | 393 | ).union( /* hold clamp together */ |
394 | [-1,1].map(function(s) { | 394 | [-1,1].map(function(s) { |
395 | return CSG.roundedCube({ | 395 | return CSG.roundedCube({ |
396 | corner1: [s*(-hhr-e.clamp.margin*2-e.clamp.d),-e.clamp.shell,e.h+e.hinge.e], | 396 | corner1: [s*(-hhr-e.clamp.margin*2-e.clamp.d),-e.clamp.shell,e.h+e.hinge.e], |
397 | corner2: [s*(-CONFIG.hotend.ungroove.d/2-PRINT.fit_tolerance),+e.clamp.shell,e.h+e.hinge.e+hhh], | 397 | corner2: [s*(-CONFIG.hotend.ungroove.d/2-PRINT.fit_tolerance),+e.clamp.shell,e.h+e.hinge.e+hhh], |
398 | roundradius: 1.5 | 398 | roundradius: 1.5 |
399 | }); | 399 | }); |
400 | }) | 400 | }) |
401 | ).subtract( /* screws for holding clamp */ | 401 | ).subtract( /* screws for holding clamp */ |
402 | [-1,1].map(function(s) { | 402 | [-1,1].map(function(s) { |
403 | var nuthole = nut(CONFIG.nut); | 403 | var nuthole = nut(CONFIG.nut); |
404 | var x = s*(-hhr-e.clamp.margin-e.clamp.d/2); | 404 | var x = s*(-hhr-e.clamp.margin-e.clamp.d/2); |
405 | return CSG.cylinder({ | 405 | return CSG.cylinder({ |
406 | start: [x,-e.clamp.shell-1,e.h+e.hinge.e+hhh/2], | 406 | start: [x,-e.clamp.shell-1,e.h+e.hinge.e+hhh/2], |
407 | end: [x,e.clamp.shell+1,e.h+e.hinge.e+hhh/2], | 407 | end: [x,e.clamp.shell+1,e.h+e.hinge.e+hhh/2], |
408 | radius: e.clamp.d/2 | 408 | radius: e.clamp.d/2 |
409 | }).union(nuthole.connectTo( | 409 | }).union(nuthole.connectTo( |
410 | nuthole.properties.axis_connector, | 410 | nuthole.properties.axis_connector, |
411 | new CSG.Connector([x,e.clamp.shell,e.h+e.hinge.e+hhh/2],[0,-1,0],[0,0,1]), | 411 | new CSG.Connector([x,e.clamp.shell,e.h+e.hinge.e+hhh/2],[0,-1,0],[0,0,1]), |
412 | false, 0 | 412 | false, 0 |
413 | )).union(CSG.cylinder({ | 413 | )).union(CSG.cylinder({ |
414 | start: [x,-e.clamp.shell-1,e.h+e.hinge.e+hhh/2], | 414 | start: [x,-e.clamp.shell-1,e.h+e.hinge.e+hhh/2], |
415 | end: [x,0,e.h+e.hinge.e+hhh/2], | 415 | end: [x,0,e.h+e.hinge.e+hhh/2], |
416 | radius: e.clamp.d/2+PRINT.slide_tolerance | 416 | radius: e.clamp.d/2+PRINT.slide_tolerance |
417 | })); | 417 | })); |
418 | }) | 418 | }) |
419 | ); | 419 | ); |
420 | var ms = o.microswitch; | 420 | var ms = o.microswitch; |
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 | ||
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 | ||
498 | function microswitch() { | 500 | function 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 | ||
524 | var FOURWINDS = [0,90,180,270]; | 526 | var FOURWINDS = [0,90,180,270]; |
525 | 527 | ||
526 | var E2020 = { | 528 | var 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 = {}; |
534 | var e = o.extrusion || this; | 536 | var e = o.extrusion || this; |
535 | var l = o.l||5; | 537 | var l = o.l||5; |
536 | var iy = e.outer/2-e.T.depth; | 538 | var iy = e.outer/2-e.T.depth; |
537 | var ix = e.T.width/2-(e.outer/2-iy-e.thickness-e.T.thickness); | 539 | var ix = e.T.width/2-(e.outer/2-iy-e.thickness-e.T.thickness); |
538 | var rv = CAG.roundedRectangle({ | 540 | var rv = CAG.roundedRectangle({ |
539 | corner1: [-e.outer/2,-e.outer/2], corner2: [e.outer/2,e.outer/2], | 541 | corner1: [-e.outer/2,-e.outer/2], corner2: [e.outer/2,e.outer/2], |
540 | roundradius: e.roundius | 542 | roundradius: e.roundius |
541 | }).subtract( | 543 | }).subtract( |
542 | FOURWINDS.map(function(w) { | 544 | FOURWINDS.map(function(w) { |
543 | return CAG.fromPoints([ | 545 | return CAG.fromPoints([ |
544 | [ e.slot_width/2,e.outer/2+1], | 546 | [ e.slot_width/2,e.outer/2+1], |
545 | [ e.slot_width/2,e.outer/2-e.thickness], | 547 | [ e.slot_width/2,e.outer/2-e.thickness], |
546 | [ e.T.width/2,e.outer/2-e.thickness], | 548 | [ e.T.width/2,e.outer/2-e.thickness], |
547 | [ e.T.width/2,e.outer/2-e.thickness-e.T.thickness], | 549 | [ e.T.width/2,e.outer/2-e.thickness-e.T.thickness], |
548 | [ ix, iy ], | 550 | [ ix, iy ], |
549 | [ -ix, iy ], | 551 | [ -ix, iy ], |
550 | [ -e.T.width/2,e.outer/2-e.thickness-e.T.thickness], | 552 | [ -e.T.width/2,e.outer/2-e.thickness-e.T.thickness], |
551 | [ -e.T.width/2,e.outer/2-e.thickness], | 553 | [ -e.T.width/2,e.outer/2-e.thickness], |
552 | [ -e.slot_width/2,e.outer/2-e.thickness], | 554 | [ -e.slot_width/2,e.outer/2-e.thickness], |
553 | [ -e.slot_width/2,e.outer/2+1], | 555 | [ -e.slot_width/2,e.outer/2+1], |
554 | ]).rotateZ(w); | 556 | ]).rotateZ(w); |
555 | }) | 557 | }) |
556 | ).subtract(CAG.circle({ | 558 | ).subtract(CAG.circle({ |
557 | center: [0,0], radius: e.centerhole/2 | 559 | center: [0,0], radius: e.centerhole/2 |
558 | })).extrude({offset:[0,0,l]}); | 560 | })).extrude({offset:[0,0,l]}); |
559 | rv.properties.c_top=rv.properties.c_left | 561 | rv.properties.c_top=rv.properties.c_left |
560 | = new CSG.Connector([0,0,l],[0,0,-1],[1,0,0]); | 562 | = new CSG.Connector([0,0,l],[0,0,-1],[1,0,0]); |
561 | rv.properties.c_bottom=rv.properties.c_right | 563 | rv.properties.c_bottom=rv.properties.c_right |
562 | = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); | 564 | = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); |
563 | rv.properties.c_midway = new CSG.Connector([0,0,l/2],[0,0,1],[1,0,0]); | 565 | rv.properties.c_midway = new CSG.Connector([0,0,l/2],[0,0,1],[1,0,0]); |
564 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); | 566 | rv.properties.P = new CSG.Connector([0,0,0],[0,0,1],[1,0,0]); |
565 | rv.properties.vitamin = true; | 567 | rv.properties.vitamin = true; |
566 | return rv; | 568 | return rv; |
567 | }, | 569 | }, |
568 | 570 | ||
569 | cap: function extrusion_cap(o) { | 571 | cap: function extrusion_cap(o) { |
570 | if(!o) o = {}; | 572 | if(!o) o = {}; |
571 | var e = o.extrusion || this; | 573 | var e = o.extrusion || this; |
572 | var thickness = o.thickness||2, l = o.l||5; | 574 | var thickness = o.thickness||2, l = o.l||5; |
573 | var rv = CSG.roundedCube({ | 575 | var rv = CSG.roundedCube({ |
574 | corner1: [-e.outer/2,-e.outer/2,thickness], | 576 | corner1: [-e.outer/2,-e.outer/2,thickness], |
575 | corner2: [e.outer/2,e.outer/2,0], | 577 | corner2: [e.outer/2,e.outer/2,0], |
576 | roundradius: [e.roundius,e.roundius,0] | 578 | roundradius: [e.roundius,e.roundius,0] |
577 | }); | 579 | }); |
578 | var fw = [0,90,180,270]; // four winds | 580 | var fw = [0,90,180,270]; // four winds |
579 | var iy = e.outer/2-e.T.depth; | 581 | var iy = e.outer/2-e.T.depth; |
580 | var ix = e.T.width/2-(e.outer/2-iy-e.thickness-e.T.thickness); | 582 | var ix = e.T.width/2-(e.outer/2-iy-e.thickness-e.T.thickness); |
581 | rv = rv.union(fw.map(function(w) { | 583 | rv = rv.union(fw.map(function(w) { |