vulcan_

example rotate extrude three shape

Sep 25th, 2025
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.12 KB | Source Code | 0 0
  1. bassiz = 4;
  2. baspos=[7,0,0]; // [-30:.5:30]
  3. bassca=[1,1,1]; // [0,001:.1:3.0]
  4. basfn = 0;      // [0:50]
  5. bascon= 2;      // [2:20]
  6.  
  7. rotang=360;     // [-400:10:400]
  8. rotsta=  0;     // [-400:20:400]
  9. rotfn =  0;     // [0:50]
  10. rotcon=  2;     // [2:20]
  11. rotgiv=true;
  12.  
  13. /* [Hidden] */
  14. $fa=.5;
  15. $fs=1;
  16.  
  17. module base_shape() {
  18.     translate(baspos){
  19.             square(bassiz);
  20.         translate(baspos*1.5)
  21.             scale( bassca )
  22.             circle(bassiz, $fn=basfn);
  23.         }
  24.     children();
  25.     }
  26. color("red")
  27.     base_shape();
  28. color("yellow")
  29.     rotate([90,0,0]) base_shape();
  30.  
  31. //if( rotfn % 2 !=0 )
  32.     //rotate(180)
  33.  
  34. if( rotgiv )
  35.     %rotate_extrude( a=rotang, start=rotsta, convexity=rotcon, $fn=rotfn )
  36.         base_shape();
  37. else
  38.     %rotate_extrude( convexity=rotcon, $fn=rotfn )
  39.         base_shape();
  40.  
  41. module pretty_red_arrow() {
  42.     color("red")
  43.     translate([15,0,baspos.y]){
  44.         square( [5,.5], center=true);
  45.         translate([-2,0,0])
  46.         rotate(180)
  47.             circle(2,$fn=3);
  48.         translate([4,0,0])
  49.             text( "joint", 2, valign="center");
  50.         }
  51.     }
Advertisement
Add Comment
Please, Sign In to add comment