vulcan_

playing with mirror - customizer selector

Sep 25th, 2025 (edited)
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.38 KB | Source Code | 0 0
  1. /*
  2.  Playing with mirror() method
  3.  */
  4. vectorsize = "two"; // ["two","thr","for","fiv","six"]
  5. allthree=[2,2,2]; // [-5,1,5]
  6. /* [Hidden] */
  7. $fs=0.5;$fa=1.0;
  8.  
  9. if( vectorsize == "two" ) {
  10.     color("green")
  11.         %cube();
  12.     color("red") mirror([2,2]) cube();
  13.     }
  14. else if( vectorsize == "thr" ) {
  15.     color("green") cube();
  16.     color("red") mirror(allthree) cube();
  17.     }
  18. else if( vectorsize == "for" ) {
  19. color("green") translate([4,0]) cube();
  20. color("red") mirror( v=[1,0]) translate([4,0]) cube();
  21.     }
  22. else if( vectorsize == "fiv" ) {
  23. color("green") translate([4,0,-2]) cube();
  24. color("red") mirror( v=allthree) translate([4,0,-2]) cube();
  25. }
  26. else {
  27.     color("green")
  28.         union() {
  29.             cube([2,4,1]);
  30.             translate([1,1,0])cube([4,2,1]);
  31.             }
  32.     color("red")
  33.         mirror(allthree)
  34.         union() {
  35.             cube([2,4,1]);
  36.                 translate([1,1,0])cube([4,2,1]);
  37.             }
  38. }
  39.  
  40.  
  41. /*
  42.  Written by Jeff Hayes <vulcan_at_mac_com>
  43.  
  44.  To the extent possible under law, the author(s) have dedicated all
  45.  copyright and related and neighboring rights to this software to the
  46.  public domain worldwide. This software is distributed without any
  47.  warranty.
  48.  
  49.  You should have received a copy of the CC0 Public Domain
  50.  Dedication along with this software.
  51.  If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
  52.  */
Advertisement
Add Comment
Please, Sign In to add comment