EgtGeomKernel :
- correzione alla triangolazione di sup. di Bezier con patch con lati collassati in un polo.
This commit is contained in:
@@ -1712,12 +1712,15 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygons, INTVECTOR vCells)
|
||||
|
||||
}
|
||||
// se non l'ho già aggiunto tramite i vicini bottom aggiungo il punto bottom right
|
||||
else if ( ! bBottomRight) {
|
||||
// controllo anche che ptBL e ptBr non coincidano ( nel 3D). Altrimenti vuol dire che quel lato della cella è su un lato di polo e basta aggiungere un punto solo
|
||||
else if ( ! bBottomRight && ! AreSamePointApprox( m_mVert.at(nId).at(0), m_mVert.at(nId).at(1)) ) {
|
||||
Point3d ptBr( m_mTree.at( nId).GetTopRight().x, m_mTree.at( nId).GetBottomLeft().y) ;
|
||||
vVertices.push_back( ptBr) ;
|
||||
}
|
||||
vNeigh.clear() ;
|
||||
vVertices.push_back( m_mTree.at( nId).GetTopRight()) ;
|
||||
// se il lato destro della cella non sta su un lato di polo ( ptTR != ptBr nel 3D) allora aggiungo anche ptTR
|
||||
if( ! AreSamePointApprox( m_mVert.at(nId).at(1), m_mVert.at(nId).at(2)))
|
||||
vVertices.push_back( m_mTree.at( nId).GetTopRight()) ;
|
||||
GetTopNeigh ( nId, vNeigh) ;
|
||||
std::reverse( vNeigh.begin(), vNeigh.end()) ;
|
||||
// aggiungo i vertici che sono sul lato top, solo se ho più di un vicino top
|
||||
@@ -1757,12 +1760,15 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygons, INTVECTOR vCells)
|
||||
}
|
||||
}
|
||||
// se non l'ho già aggiunto tramite i vicini top aggiungo il punto top left
|
||||
else if ( ! bTopLeft) {
|
||||
// controllo anche che ptTl e ptTR non coincidano ( nel 3D). Altrimenti vuol dire che quel lato della cella è su un lato di polo e basta aggiungere un punto solo
|
||||
else if ( ! bTopLeft && ! AreSamePointApprox( m_mVert.at(nId).at(2), m_mVert.at(nId).at(3))) {
|
||||
Point3d ptTl( m_mTree.at( nId).GetBottomLeft().x, m_mTree.at( nId).GetTopRight().y) ;
|
||||
vVertices.push_back( ptTl) ;
|
||||
}
|
||||
vNeigh.clear() ;
|
||||
vVertices.push_back( m_mTree.at( nId).GetBottomLeft()) ;
|
||||
// se il lato sinistro della cella non sta su un lato di polo ( ptTR != ptBr nel 3D) allora aggiungo anche ptTR
|
||||
if( ! AreSamePointApprox( m_mVert.at(nId).at(3), m_mVert.at(nId).at(0)))
|
||||
vVertices.push_back( m_mTree.at( nId).GetBottomLeft()) ;
|
||||
if ( ! m_bTrimmed) {
|
||||
// se ho una cella con vicino dello stesso grado ( quindi il poligono ha solo 5 punti) controllo la curvatura nella cella e
|
||||
// se necessario cambio l'ordine dei vertici per scegliere la diagonale di split migliore
|
||||
@@ -1932,23 +1938,23 @@ Tree::FindCell( const Point3d& ptToAssign, const CurveLine& cl, INTVECTOR vCells
|
||||
// potrei essere su un lato
|
||||
if ( nEdge == 0 || nEdge == 1 || nEdge == 2 || nEdge == 3) {
|
||||
// se è orientato con il lato mi sposto a destra
|
||||
if ( ( nEdge == 0 || nEdge == 2 ) && abs(vtDir.x) > 1 - EPS_SMALL ) {
|
||||
if ( ( nEdge == 0 || nEdge == 2 ) && abs(vtDir.x) > 1 - EPS_SMALL/100 ) {
|
||||
Vector3d vtDirDX = vtDir ; vtDirDX.Rotate( Z_AX, -90) ;
|
||||
ptIntersPlus = ptIntersPlus + vtDirDX * EPS_SMALL ;
|
||||
}
|
||||
else if ( (nEdge == 0 || nEdge == 2) && abs(vtDir.y) > EPS_SMALL)
|
||||
else if ( (nEdge == 0 || nEdge == 2) && abs(vtDir.y) > EPS_SMALL/100)
|
||||
ptIntersPlus.y += (vtDir.y > 0 ? 1 : -1) * EPS_SMALL ;
|
||||
else if ( ( nEdge == 1 || nEdge == 3 ) && abs(vtDir.y) > 1 - EPS_SMALL ) {
|
||||
else if ( ( nEdge == 1 || nEdge == 3 ) && abs(vtDir.y) > 1 - EPS_SMALL/100 ) {
|
||||
Vector3d vtDirDX = vtDir ; vtDirDX.Rotate( Z_AX, -90) ;
|
||||
ptIntersPlus = ptIntersPlus + vtDirDX * EPS_SMALL ;
|
||||
}
|
||||
else if ( (nEdge == 1 || nEdge == 3) && abs(vtDir.x) > EPS_SMALL)
|
||||
else if ( (nEdge == 1 || nEdge == 3) && abs(vtDir.x) > EPS_SMALL/100)
|
||||
ptIntersPlus.x += (vtDir.x > 0 ? 1 : -1) * EPS_SMALL ;
|
||||
}
|
||||
// o in un vertice
|
||||
else if ( nEdge == 4 || nEdge == 5 || nEdge == 6 || nEdge == 7) {
|
||||
// se non è orientato con gli assi procedo con la direzione del trim
|
||||
if ( abs(vtDir.x) < 1 - EPS_SMALL && abs(vtDir.y) < 1 - EPS_SMALL )
|
||||
if ( abs(vtDir.x) < 1 - EPS_SMALL/100 && abs(vtDir.y) < 1 - EPS_SMALL/100 )
|
||||
ptIntersPlus = ptIntersPlus + vtDir * EPS_SMALL ;
|
||||
// altrimenti ruoto a destra
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user