Moreton Moore在1974年發表一篇關於多圓柱相交的體積的論文,他設定圓柱的直徑為2
(d=2),
Sn代表
n對稱圓柱相交的體積。
二圓柱相交的體積
S2=32d3=316
三圓柱相交的體積
S3=(2−
2)d3=8(2−
2)
四圓柱相交的體積
S4=23
2(2−
3)d3=12(2
2−
6)
六圓柱相交的體積
S6=32(3+2
3−4
2)d3=316(3+2
3−4
2)
徒手畫四圓柱和六圓柱相交的圖形非常麻煩,要借助SketchUp的Ruby程式畫出圖形。
1.設定立方體8個頂點坐標為
(1
−1
1)
(1
1
1)
(−1
1
1)
(−1
−1
1)
(1
−1
−1)
(1
1
−1)
(−1
1
−1)
(−1
−1
−1)
立方體邊長2,中心為
(0
0
0)
2.從立方體8個頂點對角兩兩連線形成四圓柱相交的模型
圓柱1:
(−1
−1
−1)和
(1
1
1)連線
圓柱2:
(1
−1
−1
)和
(−1
1
1)連線
圓柱3:
(1
1
−1)和
(−1
−1
1)連線
圓柱4:
(−1
1
−1)和
(1
−1
1)連線
3.轉換成
SketcuUp程式碼
ent=Sketchup.active_model.entities
center=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]]
normal=[[2,2,2],[-2,2,2],[-2,-2,2],[2,-2,2]]
for i in 0..3
circle=ent.add_circle center[ i ],normal[ i ],1,60
circle_face=ent.add_face circle
circle_face.pushpull 4
ent.add_group circle_face.all_connected
end
程式碼解釋可以看底下參考資料的"當SketchUp遇見Ruby-邁向程式化建模之路"
4.將程式碼儲存成4intersection.rb,將檔案放到SketchUp目錄下
SketchUp2017
C:\Program Files\SketchUp\SketchUp 2017\ShippedExtensions
SketchUp 8
C:\Program Files (x86)\Google\Google SketchUp 8\Plugins
執行SketchUp可以看到四圓柱的模型,但要得到四圓柱交集後的結果,要另外安裝OScoolean plugins。
6.安裝OScoolean plugins
到
http://www.plotyuki.sakura.ne.jp ... =28&category=01下載OSCoolean_2013.zip
將解壓縮的檔案放到SketchUp目錄下
SketchUp2017
C:\Program Files\SketchUp\SketchUp 2017\ShippedExtensions
SketchUp 8
C:\Program Files (x86)\Google\Google SketchUp 8\Plugins
7.重新執行SketchUp,全選四個圓柱,按下滑鼠右鍵選"實心工具/交集",得到四圓柱交集後的模型。
===========================================================
取立方體12個邊中點對角兩兩連線形成六圓柱相交的圖形
圓柱1:
(1,-1,0)和
(-1,1,0)連線
圓柱2:
(-1,-1,0)和
(1,1,0)連線
圓柱3:
(1,0,1)和
(-1,0,-1)連線
圓柱4:
(-1,0,1)和
(1,0,-1)連線
圓柱5:
(0,-1,1)和
(0,1,-1)連線
圓柱6:
(0,-1,-1)和
(0,1,1)連線
轉換成
SketcuUp程式碼
ent=Sketchup.active_model.entities
center=[[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[0,-1,1],[0,-1,-1]]
normal=[[-2,2,0],[2,2,0],[-2,0,-2],[2,0,-2],[0,2,-2],[0,2,2]]
for i in 0..5
circle=ent.add_circle center[ i ],normal[ i ],1,60
circle_face=ent.add_face circle
circle_face.pushpull 3
ent.add_group circle_face.all_connected
end
其餘部分就和前面相同
但交集後的模型在6條線的交點處會有折線或斷線,這是比較可惜的地方
參考資料
Moore, M. "Symmetrical Intersections of Right Circular Cylinders." Math. Gaz. 58, 181-185, 1974.
http://mathworld.wolfram.com/SteinmetzSolid.html
當SketchUp遇見Ruby-邁向程式化建模之路,
https://books.google.com.tw/book ... e&q&f=false