Advertisement
Guest User

Untitled

a guest
Feb 17th, 2022
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 8.67 KB | None | 0 0
  1. //////////////////////////////////////////////////////
  2. //
  3. // twin_csg_stl("p2");
  4. // twin_csg_stl("p1");
  5. // twin_csg_stl("clutch_axle");
  6. // twin_csg_stl("clutch_gear_AA");
  7. // twin_csg_stl("clutch_gear_BB");
  8. // twin_csg_stl("motor_A_gear_AA");
  9. // twin_csg_stl("motor_A_gear_BB");
  10. // twin_csg_stl("motor_B_gear_AA");
  11. // twin_csg_stl("motor_A_gearbox_shell");
  12. // twin_csg_stl("motor_A_gearbox_gears");
  13. // twin_csg_stl("motor_A_motor");
  14. // twin_csg_stl("motor_B_gearbox_shell");
  15. // twin_csg_stl("motor_B_gearbox_gears");
  16. // twin_csg_stl("motor_B_motor");
  17. // twin_csg_stl("CAM");
  18. // twin_csg_stl("CAM_p1");
  19. // twin_csg_stl("CAM_p2");
  20. //
  21. //////////////////////////////////////////////////////
  22.  
  23.  
  24. module twin_csg_stl (select="",c,scafold=false){
  25.  
  26.   if(select=="p2") p2()children();
  27.   if(select=="p1") p1()children();
  28.   if(select=="clutch_axle") clutch_axle()children();
  29.   if(select=="clutch_gear_AA") clutch_gear_AA()children();
  30.   if(select=="clutch_gear_BB") clutch_gear_BB()children();
  31.   if(select=="motor_A_gear_AA") motor_A_gear_AA()children();
  32.   if(select=="motor_A_gear_BB") motor_A_gear_BB()children();
  33.   if(select=="motor_B_gear_AA") motor_B_gear_AA()children();
  34.   if(select=="motor_A_gearbox_shell") motor_A_gearbox_shell()children();
  35.   if(select=="motor_A_gearbox_gears") motor_A_gearbox_gears()children();
  36.   if(select=="motor_A_motor") motor_A_motor()children();
  37.   if(select=="motor_B_gearbox_shell") motor_B_gearbox_shell()children();
  38.   if(select=="motor_B_gearbox_gears") motor_B_gearbox_gears()children();
  39.   if(select=="motor_B_motor") motor_B_motor()children();
  40.   if(select=="CAM") CAM()children();
  41.   if(select=="CAM_p1") CAM_p1()children();
  42.   if(select=="CAM_p2") CAM_p2()children();
  43.  
  44.   module p2(){
  45.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  46.     lt = lt_?lt_:translation([0,0,0]);
  47.     multmatrix(lt){
  48.       if(scafold==false)
  49.         color(
  50.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  51.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  52.           import("twin.csg.stl/p2.stl", convexity=3);
  53.       children();
  54.     }
  55.   }
  56.   module p1(){
  57.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  58.     lt = lt_?lt_:translation([0,0,0]);
  59.     multmatrix(lt){
  60.       if(scafold==false)
  61.         color(
  62.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  63.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  64.           import("twin.csg.stl/p1.stl", convexity=3);
  65.       children();
  66.     }
  67.   }
  68.   module clutch_axle(){
  69.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  70.     lt = lt_?lt_:translation([0,0,0]);
  71.     multmatrix(lt){
  72.       if(scafold==false)
  73.         color(
  74.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  75.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  76.           import("twin.csg.stl/clutch_axle.stl", convexity=3);
  77.       children();
  78.     }
  79.   }
  80.   module clutch_gear_AA(){
  81.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  82.     lt = lt_?lt_:translation([0,0,0]);
  83.     multmatrix(lt){
  84.       if(scafold==false)
  85.         color(
  86.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  87.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  88.           import("twin.csg.stl/clutch_gear_AA.stl", convexity=3);
  89.       children();
  90.     }
  91.   }
  92.   module clutch_gear_BB(){
  93.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  94.     lt = lt_?lt_:translation([0,0,0]);
  95.     multmatrix(lt){
  96.       if(scafold==false)
  97.         color(
  98.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  99.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  100.           import("twin.csg.stl/clutch_gear_BB.stl", convexity=3);
  101.       children();
  102.     }
  103.   }
  104.   module motor_A_gear_AA(){
  105.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  106.     lt = lt_?lt_:translation([0,0,0]);
  107.     multmatrix(lt){
  108.       if(scafold==false)
  109.         color(
  110.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  111.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  112.           import("twin.csg.stl/motor_A_gear_AA.stl", convexity=3);
  113.       children();
  114.     }
  115.   }
  116.   module motor_A_gear_BB(){
  117.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  118.     lt = lt_?lt_:translation([0,0,0]);
  119.     multmatrix(lt){
  120.       if(scafold==false)
  121.         color(
  122.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  123.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  124.           import("twin.csg.stl/motor_A_gear_BB.stl", convexity=3);
  125.       children();
  126.     }
  127.   }
  128.   module motor_B_gear_AA(){
  129.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  130.     lt = lt_?lt_:translation([0,0,0]);
  131.     multmatrix(lt){
  132.       if(scafold==false)
  133.         color(
  134.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  135.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  136.           import("twin.csg.stl/motor_B_gear_AA.stl", convexity=3);
  137.       children();
  138.     }
  139.   }
  140.   module motor_A_gearbox_shell(){
  141.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  142.     lt = lt_?lt_:translation([0,0,0]);
  143.     multmatrix(lt){
  144.       if(scafold==false)
  145.         color(
  146.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  147.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  148.           import("twin.csg.stl/motor_A_gearbox_shell.stl", convexity=3);
  149.       children();
  150.     }
  151.   }
  152.   module motor_A_gearbox_gears(){
  153.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  154.     lt = lt_?lt_:translation([0,0,0]);
  155.     multmatrix(lt){
  156.       if(scafold==false)
  157.         color(
  158.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  159.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  160.           import("twin.csg.stl/motor_A_gearbox_gears.stl", convexity=3);
  161.       children();
  162.     }
  163.   }
  164.   module motor_A_motor(){
  165.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  166.     lt = lt_?lt_:translation([0,0,0]);
  167.     multmatrix(lt){
  168.       if(scafold==false)
  169.         color(
  170.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  171.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  172.           import("twin.csg.stl/motor_A_motor.stl", convexity=3);
  173.       children();
  174.     }
  175.   }
  176.   module motor_B_gearbox_shell(){
  177.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  178.     lt = lt_?lt_:translation([0,0,0]);
  179.     multmatrix(lt){
  180.       if(scafold==false)
  181.         color(
  182.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  183.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  184.           import("twin.csg.stl/motor_B_gearbox_shell.stl", convexity=3);
  185.       children();
  186.     }
  187.   }
  188.   module motor_B_gearbox_gears(){
  189.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  190.     lt = lt_?lt_:translation([0,0,0]);
  191.     multmatrix(lt){
  192.       if(scafold==false)
  193.         color(
  194.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  195.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  196.           import("twin.csg.stl/motor_B_gearbox_gears.stl", convexity=3);
  197.       children();
  198.     }
  199.   }
  200.   module motor_B_motor(){
  201.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  202.     lt = lt_?lt_:translation([0,0,0]);
  203.     multmatrix(lt){
  204.       if(scafold==false)
  205.         color(
  206.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  207.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  208.           import("twin.csg.stl/motor_B_motor.stl", convexity=3);
  209.       children();
  210.     }
  211.   }
  212.   module CAM(){
  213.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  214.     lt = lt_?lt_:translation([0,0,0]);
  215.     multmatrix(lt){
  216.       if(scafold==false)
  217.         color(
  218.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  219.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  220.           import("twin.csg.stl/CAM.stl", convexity=3);
  221.       children();
  222.     }
  223.   }
  224.   module CAM_p1(){
  225.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  226.     lt = lt_?lt_:translation([0,0,0]);
  227.     multmatrix(lt){
  228.       if(scafold==false)
  229.         color(
  230.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  231.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  232.           import("twin.csg.stl/CAM_p1.stl", convexity=3);
  233.       children();
  234.     }
  235.   }
  236.   module CAM_p2(){
  237.     lt_ = dict(twin_csg_transforms,parent_module(2),parent_module(0));
  238.     lt = lt_?lt_:translation([0,0,0]);
  239.     multmatrix(lt){
  240.       if(scafold==false)
  241.         color(
  242.           c?c[0]:dict(twin_csg_colors,parent_module(0))[0],
  243.           c?c[1]:dict(twin_csg_colors,parent_module(0))[1])
  244.           import("twin.csg.stl/CAM_p2.stl", convexity=3);
  245.       children();
  246.     }
  247.   }
  248.  
  249. }
  250.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement