Advertisement
Guest User

logo nightly

a guest
Mar 10th, 2022
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. RES=$preview ? 100 : 20;
  2. Logo(50, RES);
  3.  
  4. module colDark(alpha = 1) color("#0057b8", alpha) children();
  5. module colLight(alpha = 1) color("#ffd700", alpha) children();
  6.  
  7. module Logo(size=50, $fn=100) {
  8. hole = size/2;
  9. starHeight = size * 1.01;
  10. cylinderHeight = size * 1.25;
  11. difference() {
  12. union() {
  13. colDark() sphere(d=size);
  14. rotate([30,30,0]) colLight() star(starHeight, 12, [2,5]);
  15. rotate([45,-30,0]) colLight() star(starHeight, 14, [2,5]);
  16. rotate([90,0,45]) colLight() star(starHeight, 16, [1.6,4]);
  17. }
  18. colLight() cylinder(d=hole, h=cylinderHeight, center=true);
  19. rotate([0, 90, 0]) colLight() cylinder(d=hole, h=cylinderHeight, center=true);
  20. rotate([90, 0, 0]) colLight() cylinder(d=hole, h=cylinderHeight, center=true);
  21. }
  22.  
  23. difference(){
  24. colLight(0.75) rotate([90, 0, 0]) cylinder(d=hole, h=54, center=true);
  25. colDark(0.75) colLight(0.85) translate ([6.5,0,0]) rotate([90, 0, 0]) cylinder(d=hole*0.8, h=cylinderHeight, center=true);
  26. }
  27. }
  28.  
  29. module star(height, num, radii) {
  30. function r(a) = (floor(a / 10) % 2) ? 10 : 8;
  31. intersection() {
  32. sphere(d = height);
  33. linear_extrude(height, center=true, convexity=3) polygon([for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)]) [ r*cos(a), r*sin(a) ]]);
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement