Thursday, September 24, 2015

OpenSCAD 六角形原來是這樣做的






原本在做 3D 印表機 Sanguinololu 的主版風扇框架,很納悶他是怎麼弄的可以在尾巴生出六角形,剛剛試著用 circle 玩了一遍不得其解,作罷上網找看看。如下圖我用圓形兜得很醜


沒辦法像這樣


 

/* Left Side */
cube ([THICK, LENGTH, H2]);
translate ([THICK, LENGTH, 0]) {
difference () {
linear_extrude (height = H2)
circle (r=R1);
linear_extrude (height = H2)
circle (r=R2);
translate ([1,0,0]) linear_extrude (height = H2)
circle (r=R2);
}
}

沒想到這麼簡單,只要把 $fn 設為 6 就可以了。


No comments: