diff --git a/SurfBezier.cpp b/SurfBezier.cpp index cc6ba21..d0c66ed 100644 --- a/SurfBezier.cpp +++ b/SurfBezier.cpp @@ -42,7 +42,6 @@ #include "/EgtDev/Include/EGkIntervals.h" #define EIGEN_NO_IO #include "/EgtDev/Extern/Eigen/Dense" -#include "/EgtDev/Include/EGkGeoObjSave.h" using namespace std ; @@ -1792,8 +1791,10 @@ SurfBezier::GetAuxSurf( void) const } else { // se con la stessa precisione di quella di visualizzazione restituisco quella - if ( m_pSTMRefined!= nullptr && s_dAuxSurfTol > m_pSTMRefined->GetTempParam() - EPS_SMALL) - return m_pSTMRefined ; + if ( m_pSTMRefined != nullptr && s_dAuxSurfTol > m_pSTMRefined->GetTempParam() - EPS_SMALL) { + m_pSTM = m_pSTMRefined->Clone() ; + return m_pSTM ; + } } // eseguo calcolo m_pSTM = GetApproxSurf( s_dAuxSurfTol, 100 * EPS_SMALL, false) ; @@ -1824,8 +1825,10 @@ SurfBezier::GetAuxSurfRefined( void) const } else { // se con la stessa precisione di quella di visualizzazione restituisco quella - if ( m_pSTM != nullptr && s_dAuxSurfRefinedTol > m_pSTM->GetTempParam() - EPS_SMALL) - return m_pSTM ; + if ( m_pSTM != nullptr && s_dAuxSurfRefinedTol > m_pSTM->GetTempParam() - EPS_SMALL) { + m_pSTMRefined = m_pSTM->Clone() ; + return m_pSTMRefined ; + } } // eseguo calcolo m_pSTMRefined = GetApproxSurf( s_dAuxSurfRefinedTol, 100 * EPS_SMALL, true) ; @@ -3400,7 +3403,7 @@ SurfBezier::CalcPoles( void) const bool SurfBezier::GetLoops( ICRVCOMPOPOVECTOR& vCC, bool bLineOrBezier) const { - // se necessario calcolo i poli + // se necessario calcolo i poli if ( m_vbPole.empty()) CalcPoles() ; @@ -3780,9 +3783,9 @@ SurfBezier::GetSingleEdge3D( bool bLineOrBezier, int nEdge) const else pCrvBz0->SetControlPoint( p, GetControlPoint( nIndex, nullptr), GetControlWeight( nIndex, nullptr)) ; } - pCrvBz0->Invert() ; pCrvCompo->AddCurve( Release( pCrvBz0)) ; } + pCrvCompo->Invert() ; } break ; } @@ -3802,9 +3805,9 @@ SurfBezier::GetSingleEdge3D( bool bLineOrBezier, int nEdge) const else pCrvBz1->SetControlPoint( p, GetControlPoint( nIndex, nullptr), GetControlWeight( nIndex, nullptr)) ; } - pCrvBz1->Invert() ; pCrvCompo->AddCurve( Release( pCrvBz1)) ; } + pCrvCompo->Invert() ; } break ; } @@ -4917,11 +4920,6 @@ SurfBezier::CreateByTwoCurves( const ICurve* pCurve0, const ICurve* pCurve1, int ++c ; continue ; } - // ho un match con una joint esistente - else if( dParam - int( dParam) < EPS_SMALL) { - ++c ; - continue ; - } if ( dParam <= dLastParamMatch || AreSamePointApprox( ptJoint, ptLastPointMatch)) { dParam = dLastParamMatch ; vbRep0[c] = true ; @@ -4932,6 +4930,12 @@ SurfBezier::CreateByTwoCurves( const ICurve* pCurve0, const ICurve* pCurve1, int else { dLastParamMatch = dParam ; ptLastPointMatch = ptJoint ; + // ho un match con una joint esistente + if( dParam - int( dParam) < EPS_SMALL) { + ++c ; + continue ; + } + vdSplit0.push_back( dParam) ; // verifico se ho un match per questo punto // in tal caso vuol dire che sto creando una ripetizione nRep1 @@ -4992,11 +4996,6 @@ SurfBezier::CreateByTwoCurves( const ICurve* pCurve0, const ICurve* pCurve1, int ++c ; continue ; } - // ho un match con una joint esistente - else if( dParam - int( dParam) < EPS_SMALL) { - ++c ; - continue ; - } if ( dParam <= dLastParamMatch || AreSamePointApprox( ptJoint, ptLastPointMatch)) { dParam = dLastParamMatch ; vbRep1[c] = true ; @@ -5007,6 +5006,11 @@ SurfBezier::CreateByTwoCurves( const ICurve* pCurve0, const ICurve* pCurve1, int else { dLastParamMatch = dParam ; ptLastPointMatch = ptJoint ; + // ho un match con una joint esistente + if( dParam - int( dParam) < EPS_SMALL) { + ++c ; + continue ; + } vdSplit1.push_back( dParam) ; // verifico se ho un match per questo punto @@ -5190,17 +5194,6 @@ SurfBezier::CreateByTwoCurves( const ICurve* pCurve0, const ICurve* pCurve1, int ++ nAddedSpan ; } - //debug - ICURVEPOVECTOR vCrv ; - GetAllPatchesIsocurves( false, vCrv) ; - vector vGeo ; - for( int i = 0 ; i < int(vCrv.size()); ++i) - vGeo.push_back( vCrv[i]) ; - vector vCol( vGeo.size()) ; - fill( vCol.begin(), vCol.end(), Color( 255, 0 ,128)) ; - SaveGeoObj( vGeo, vCol, "D:/Temp/bezier/ruled/isoCurves.nge") ; - //debug - return bOk ; } else if ( RLT_B_LENPAR ) {