EgtGeomKernel :
- ricalcolo delle facce dopo scalatura per TriMesh - Rimozione punti allineati nei contatti tra facce diverse.
This commit is contained in:
+2
-6
@@ -3244,7 +3244,6 @@ SurfTriMesh::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double
|
||||
bMirror = ( bMirror ? ( dCoeffZ > 0) : ( dCoeffZ < 0)) ;
|
||||
|
||||
// aggiorno le facce
|
||||
bool bRecalc = ( abs( dCoeffX) < EPS_ZERO || abs( dCoeffY) < EPS_ZERO || abs( dCoeffZ) < EPS_ZERO) ;
|
||||
for ( int i = 0 ; i < GetTriangleSize() ; ++ i) {
|
||||
if ( m_vTria[i].nIdVert[0] != SVT_DEL) {
|
||||
// se c'è mirror, devo invertire la faccia
|
||||
@@ -3254,15 +3253,12 @@ SurfTriMesh::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double
|
||||
if ( ! CalcTriangleNormal( i)) {
|
||||
// elimino il triangolo
|
||||
RemoveTriangle( i) ;
|
||||
// richiedo ricalcolo vertici e topologia
|
||||
bRecalc = true ;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( bRecalc)
|
||||
return DoCompacting() ;
|
||||
|
||||
return true ;
|
||||
return DoCompacting() ;
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
@@ -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