2012-07-17 64 views
2

我遇到了問題,如何才能獲得一種類似圓環但「平方」的「開放環」? 我試着用造型加上作爲孔的路徑:Three.js - 形狀和內孔的問題

var arcShape = new THREE.Shape(); 
arcShape.moveTo(40, 0); 
arcShape.arc(0, 0, 40, 0, 2*Math.PI, false); 

var holePath = new THREE.Path(); 
holePath.moveTo(30,0) 
holePath.arc(0, 0, 30, 0, 2*Math.PI, true); 

而且到現在爲止,使得網格:

new THREE.Mesh(arcShape.extrude({ amount: 5, bevelEnabled: false }), MATERIAL); 

它的工作原理,但如何讓中環?我的意思是,有:

var arcShape = new THREE.Shape(); 
arcShape.moveTo(40, 0); 
arcShape.arc(0, 0, 40, 0, Math.PI, false); 

var holePath = new THREE.Path(); 
holePath.moveTo(30,0); 
holePath.arc(0, 0, 30, 0, Math.PI, true); 

它的工作原理,但它仍然是終端部分之間的微妙的臉......有沒有辦法讓它完全開放?

回答

2

而不是從頭做起,嘗試在圓環幾何構造改變參數:

// Torus geometry parameters: 
//  radius of entire torus, 
//  diameter of tube (should be less than total radius), 
//  segments around radius, 
//  segments around torus ("sides") 
var torusGeom = new THREE.TorusGeometry(25, 10, 4, 4);