summaryrefslogtreecommitdiffabout
path: root/delta.jscad
Unidiff
Diffstat (limited to 'delta.jscad') (more/less context) (show whitespace changes)
-rw-r--r--delta.jscad50
1 files changed, 26 insertions, 24 deletions
diff --git a/delta.jscad b/delta.jscad
index ef0d4ec..9941125 100644
--- a/delta.jscad
+++ b/delta.jscad
@@ -436,71 +436,48 @@ function microswitch() {
436 var rv = CSG.cube({ center:[0,0,2.5],radius: [19.8/2,6/2,10/2] }).union( 436 var rv = CSG.cube({ center:[0,0,2.5],radius: [19.8/2,6/2,10/2] }).union(
437 CSG.cube({ center: [2.5,0.5,6], radius: [2/2,3.5/2,5/2] }) 437 CSG.cube({ center: [2.5,0.5,6], radius: [2/2,3.5/2,5/2] })
438 ).union( 438 ).union(
439 [-8,-1,8].map(function(x) { 439 [-8,-1,8].map(function(x) {
440 return CSG.cube({ center:[x,0,0], radius: [0.6/2,3.2/2,13/2] }) 440 return CSG.cube({ center:[x,0,0], radius: [0.6/2,3.2/2,13/2] })
441 }) 441 })
442 ).subtract( 442 ).subtract(
443 [-9.5/2,9.5/2].map(function(x,i) { 443 [-9.5/2,9.5/2].map(function(x,i) {
444 screw_connector[i] = new CSG.Connector([x,6/2,0],[0,-1,0],[0,0,1]); 444 screw_connector[i] = new CSG.Connector([x,6/2,0],[0,-1,0],[0,0,1]);
445 return CSG.cylinder({ 445 return CSG.cylinder({
446 start: [x,-4,0], end: [x,4,0], 446 start: [x,-4,0], end: [x,4,0],
447 radius: 2/2 447 radius: 2/2
448 }) 448 })
449 }) 449 })
450 ); 450 );
451 rv.properties.switch_connector = new CSG.Connector([2.5,0.5,6+5/2],[0,0,1],[0,-1,0]); 451 rv.properties.switch_connector = new CSG.Connector([2.5,0.5,6+5/2],[0,0,1],[0,-1,0]);
452 rv.properties.screw_connector = screw_connector; 452 rv.properties.screw_connector = screw_connector;
453 rv.properties.microswitch = new CSG.Properties(); 453 rv.properties.microswitch = new CSG.Properties();
454 rv.properties.microswitch.size = new CSG.Vector3D( 454 rv.properties.microswitch.size = new CSG.Vector3D(
455 19.8,6,10 455 19.8,6,10
456 ); 456 );
457 return rv; 457 return rv;
458} 458}
459 459
460function getParameterDefinitions() {
461 return [{
462 name: 'part',
463 type: 'choice',
464 values: [
465 'platform',
466 'hinged',
467 'clamp',
468 'fanholder',
469 'alltogethernow'
470 ],
471 captions: [
472 'Effector platform',
473 'Hinged part',
474 'Clamp',
475 'Fan holder',
476 'All together now!'
477 ],
478 caption: 'Part',
479 initial: 'alltogethernow'
480 }];
481}
482
483var FOURWINDS = [0,90,180,270]; 460var FOURWINDS = [0,90,180,270];
484 461
485var E2020 = { 462var E2020 = {
486 outer: 20, thickness: 1.8, 463 outer: 20, thickness: 1.8,
487 roundius: 1, centerhole: 5, 464 roundius: 1, centerhole: 5,
488 slot_width: 6, 465 slot_width: 6,
489 T: { width: 10, thickness: 1.5, depth: 6.5 }, 466 T: { width: 10, thickness: 1.5, depth: 6.5 },
490 467
491 extrusion: function(o) { 468 extrusion: function(o) {
492 if(!o) o = {}; 469 if(!o) o = {};
493 var e = o.extrusion || this; 470 var e = o.extrusion || this;
494 var l = o.l||5; 471 var l = o.l||5;
495 var iy = e.outer/2-e.T.depth; 472 var iy = e.outer/2-e.T.depth;
496 var ix = e.T.width/2-(e.outer/2-iy-e.thickness-e.T.thickness); 473 var ix = e.T.width/2-(e.outer/2-iy-e.thickness-e.T.thickness);
497 var rv = CAG.roundedRectangle({ 474 var rv = CAG.roundedRectangle({
498 corner1: [-e.outer/2,-e.outer/2], corner2: [e.outer/2,e.outer/2], 475 corner1: [-e.outer/2,-e.outer/2], corner2: [e.outer/2,e.outer/2],
499 roundradius: e.roundius 476 roundradius: e.roundius
500 }).subtract( 477 }).subtract(
501 FOURWINDS.map(function(w) { 478 FOURWINDS.map(function(w) {
502 return CAG.fromPoints([ 479 return CAG.fromPoints([
503 [ e.slot_width/2,e.outer/2+1], 480 [ e.slot_width/2,e.outer/2+1],
504 [ e.slot_width/2,e.outer/2-e.thickness], 481 [ e.slot_width/2,e.outer/2-e.thickness],
505 [ e.T.width/2,e.outer/2-e.thickness], 482 [ e.T.width/2,e.outer/2-e.thickness],
506 [ e.T.width/2,e.outer/2-e.thickness-e.T.thickness], 483 [ e.T.width/2,e.outer/2-e.thickness-e.T.thickness],
@@ -599,26 +576,51 @@ function _main(params) {
599 microswitch:ms,effector:e 576 microswitch:ms,effector:e
600 }); 577 });
601 ms = ms.connectTo( 578 ms = ms.connectTo(
602 ms.properties.screw_connector[0], 579 ms.properties.screw_connector[0],
603 hd.properties.microswitch_screw_connector[0], 580 hd.properties.microswitch_screw_connector[0],
604 false, 0); 581 false, 0);
605 var hdhd = EFFECTOR.split_hinged(hd); 582 var hdhd = EFFECTOR.split_hinged(hd);
606 var fh = EFFECTOR.fanholder(); 583 var fh = EFFECTOR.fanholder();
607 return union({ 584 return union({
608 platform: e, 585 platform: e,
609 hinged: hdhd[1], 586 hinged: hdhd[1],
610 clamp: hdhd[0], 587 clamp: hdhd[0],
611 fanholder: fh, 588 fanholder: fh,
612 alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh] 589 alltogethernow: [e,hdhd[0],hdhd[1], columns(),hs,ms,fh]
613 }[params.part||'alltogethernow']) 590 }[params.part||'alltogethernow'])
614 var rv = union( 591 var rv = union(
615 e, 592 e,
616 hs, 593 hs,
617 columns(), 594 columns(),
618 ///hd, 595 ///hd,
619 hdhd[0], hdhd[1], 596 hdhd[0], hdhd[1],
620 ms); 597 ms);
621 return rv; 598 return rv;
622} 599}
623/* vim:set ft=javascript ai: */
624 600
601function getParameterDefinitions() {
602 return [{
603 name: 'part',
604 type: 'choice',
605 values: [
606 'platform',
607 'hinged',
608 'clamp',
609 'fanholder',
610 'alltogethernow',
611 'wip'
612 ],
613 captions: [
614 'Effector platform',
615 'Hinged part',
616 'Clamp',
617 'Fan holder',
618 'All together now!',
619 'Work in progress'
620 ],
621 caption: 'Part',
622 initial: 'wip'
623 }];
624}
625
626/* vim:set ft=javascript ai: */