1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
| pi = 3.1415926; segments = 24; diameter = 50; height = 17; outer_displace = -2; outer_d = diameter * pi / segments + 1;
decoration_type = 1; text_frame = false;
intersection() { union() { for(i=[0:1:segments]) { x=cos(i*360/segments)*(diameter/2+outer_displace); y=sin(i*360/segments)*(diameter/2+outer_displace); translate([x,y,0]) cylinder(d=outer_d,h=height, $fn=48); } if(decoration_type==1) { difference() { cylinder(d=diameter,h=height+.5,$fn=96); translate([0,0,height]) union() { rotate([0,0,10]) for(cx=[-7:1:7]) for(cy=[-5:1:5]) { dx=cx%2; translate([cx*5*sin(60),cy*5+dx*5/2,0]) cylinder(h=2,r=2.5,$fn=6); } }} } else if(decoration_type==2) { cylinder(d=diameter,h=height,$fn=96); translate([0,0,height]) for(i=[0:1:30]) { x=cos(i*360/30)*(diameter/2-5); y=sin(i*360/30)*(diameter/2-5); translate([x,y,0]) difference() { cylinder(d=10,h=.5, $fn=48); cylinder(d=8.5,h=2, $fn=48); } } } else if(decoration_type==3) { cylinder(d=diameter,h=height,$fn=96); translate([0,0,height]) { lines=6; difference() { cylinder(d=diameter,h=.5, $fn=lines); cylinder(d=diameter-2,h=.5, $fn=lines); } rotate([0,0,360/16]) difference() { cylinder(d=diameter,h=.5, $fn=lines); cylinder(d=diameter-2,h=.5, $fn=lines); } } } else if(decoration_type==4) { cylinder(d=diameter,h=height,$fn=96); for(cx=[-10:1:10]) translate([cx*4,-35,height]) cube([.8,70,0.5]); for(cy=[-10:1:10]) translate([-35,cy*4,height]) cube([70,.8,0.5]); } } translate([0,0,-42.3]) sphere(d=130);
}
translate([0,0,height]) { difference() { cylinder(d=diameter -9,h=.5+1,$fn=48); cylinder(d=diameter -11,h=2,$fn=48); } difference() { cylinder(d=diameter -14,h=.5+1,$fn=48); cylinder(d=diameter -15,h=2,$fn=48); } cylinder(d=diameter -10, h=.5,$fn=96); }
if(text_frame) { translate([0,0,height]) { difference() { cube([17,28,1+1], center=true); cube([17-1.5,28-1.5,2+1], center=true); } } }
translate([0,0,height]) linear_extrude(1.5) { text("糊", size = 21, font = "楷体", halign = "center", valign = "center");
}
|