2015-03-13 47 views
1

我的目標是將三維正交三角網格的所有頂點標記爲內或外頂點。 我知道無限的頂點。標記3d三角剖分後的邊界頂點

我遍歷無限頂點的所有相鄰頂點並將它們標記爲外頂點。 什麼時候我得到奇怪的結果:

右圖:蘑菇的所有頂點。 中間圖片:標記爲外部的頂點。 左圖:頂點標記爲內

http://i62.tinypic.com/2uqj6hj.jpg

當我做同樣的事情,但有球網,我得到正確的結果。 我沒有正確理解無限頂點? 我該如何解決這個問題?

P.S.我是新來的cgal。

回答

0

我終於設法通過子域來解決這個

for (C3t3::Facets_in_complex_iterator 
    fit = i_pTetrahedlizedMesh.facets_in_complex_begin(), 
    end = i_pTetrahedlizedMesh.facets_in_complex_end(); 
fit != end; ++fit) 
{ 
    C3t3::Subdomain_index cell_sd = i_pTetrahedlizedMesh.subdomain_index(fit->first); 
    C3t3::Subdomain_index opp_sd = i_pTetrahedlizedMesh.subdomain_index(fit->first->neighbor(fit->second)); 

    if (cell_sd != 0 && opp_sd != 0) continue; //this is an inner vertex 
    else .... //this is an outer vertex 
0

在CGAL三角剖分中,與無限頂點相鄰的頂點恰好是位於該組點的凸包上的頂點。

如果你想重建一個形狀,比如你的蘑菇,你需要使用重建算法。 CGAL中最簡單的是3D Alpha Shapes,但您可能想要使用 Surface Reconstruction from Point Sets