EgtGeomKernel :
- ricalcolo delle facce dopo scalatura per TriMesh - Rimozione punti allineati nei contatti tra facce diverse.
This commit is contained in:
@@ -313,15 +313,41 @@ AdjustLoop( PNTULIST& PointList, double dMaxEdgeLen, bool& bModif)
|
||||
{
|
||||
// Ciclo sui punti del loop
|
||||
auto itLast = PointList.begin() ;
|
||||
vector<IGeoObj*> VT ;
|
||||
for ( auto it = next( itLast) ; it != PointList.end() ; ++ it) {
|
||||
|
||||
// Se dal punto corrente inizia un segmento adiacente a un'altra faccia
|
||||
if ( itLast->second != it->second) {
|
||||
// Elimino i punti interni
|
||||
// Elimino i punti interni allineati
|
||||
auto itNextToLast = next( itLast) ;
|
||||
PolyLine PL ;
|
||||
int nPar = 0 ;
|
||||
PL.AddUPoint( nPar, itLast->first) ;
|
||||
for ( auto itInn = itNextToLast ; itInn != it ; ) {
|
||||
itInn = PointList.erase( itInn) ;
|
||||
bModif = true ;
|
||||
++ nPar ;
|
||||
PL.AddUPoint( nPar, itInn->first) ;
|
||||
itInn = next( itInn) ;
|
||||
}
|
||||
PL.AddUPoint( nPar + 1, it->first) ;
|
||||
// se ho almeno 3 punti riferiti alla stessa adiacenza ( quindi 2 edges )
|
||||
if ( PL.GetPointNbr() > 2) {
|
||||
PL.RemoveAlignedPoints( 50 * EPS_SMALL) ; // può cambiare...
|
||||
// aggiorno la lista di punti con i rimanenti
|
||||
for ( auto itInn = itNextToLast ; itInn != it ; ) {
|
||||
Point3d ptCurr ;
|
||||
bool bFound = false ;
|
||||
if ( PL.GetFirstPoint( ptCurr)) {
|
||||
bFound = AreSamePointApprox( ptCurr, itInn->first) ;
|
||||
while ( ! bFound && PL.GetNextPoint( ptCurr))
|
||||
bFound = AreSamePointApprox( ptCurr, itInn->first) ;
|
||||
}
|
||||
if ( ! bFound) {
|
||||
itInn = PointList.erase( itInn) ;
|
||||
bModif = true ;
|
||||
}
|
||||
else
|
||||
itInn = next( itInn) ;
|
||||
}
|
||||
}
|
||||
// Se la lunghezza del segmento supera il limite imposto
|
||||
double dSegLen = Dist( it->first, itLast->first) ;
|
||||
|
||||
Reference in New Issue
Block a user