EgtGeomkernel :
- piccola correzione alla remove span - aggiunto comando di debug.
This commit is contained in:
+23
-6
@@ -44,6 +44,11 @@
|
||||
#define EIGEN_NO_IO
|
||||
#include "/EgtDev/Extern/Eigen/Dense"
|
||||
|
||||
//#define SAVEFAILEDTRIANGULATION
|
||||
#ifdef SAVEFAILEDTRIANGULATION
|
||||
#include "/EgtDev/Include/EGkGeoObjSave.h"
|
||||
#endif
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -868,8 +873,10 @@ SurfBezier::CopyFrom( const SurfBezier& sbSrc)
|
||||
m_bTrimmed = true ;
|
||||
m_pTrimReg = sbSrc.m_pTrimReg->Clone() ;
|
||||
}
|
||||
#ifndef SAVEFAILEDTRIANGULATION
|
||||
if( sbSrc.GetAuxSurf() != nullptr)
|
||||
m_pSTM = sbSrc.GetAuxSurf()->Clone() ;
|
||||
#endif
|
||||
for ( int i = 0 ; i < int( sbSrc.m_mCCEdge.size()) ; ++i) {
|
||||
m_mCCEdge.emplace_back() ;
|
||||
for ( int j = 0 ; j < int( sbSrc.m_mCCEdge[i].size()) ; ++j ) {
|
||||
@@ -1842,6 +1849,10 @@ SurfBezier::GetAuxSurfRefined( void) const
|
||||
return m_pSTMRefined ;
|
||||
}
|
||||
|
||||
#ifdef SAVEFAILEDTRIANGULATION
|
||||
static int nErr = 0 ;
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
SurfTriMesh*
|
||||
SurfBezier::GetApproxSurf( double dTol, double dSideMin, bool bUpdateEdges) const
|
||||
@@ -1886,9 +1897,14 @@ SurfBezier::GetApproxSurf( double dTol, double dSideMin, bool bUpdateEdges) cons
|
||||
m_bClosedU = m_bClosedU || Tree.IsClosedU() ;
|
||||
m_bClosedV = m_bClosedV || Tree.IsClosedV() ;
|
||||
}
|
||||
|
||||
if ( vvPL.empty())
|
||||
|
||||
if ( vvPL.empty()) {
|
||||
LOG_DBG_ERR( GetEGkLogger(), "ERROR : Bezier Surface couldn't be triangulated")
|
||||
#ifdef SAVEFAILEDTRIANGULATION
|
||||
SaveGeoObj( Clone(),"D:\\Temp\\bezier\\not_triangulated\\" + ToString( nErr) + ".nge") ;
|
||||
++nErr ;
|
||||
#endif
|
||||
}
|
||||
|
||||
StmFromTriangleSoup stmSoup ;
|
||||
if ( ! stmSoup.Start())
|
||||
@@ -5906,6 +5922,7 @@ SurfBezier::CreateByIsoParamSet( const ICurve* pCurve0, const ICurve* pCurve1, c
|
||||
bool
|
||||
SurfBezier::RemoveCollapsedSpans()
|
||||
{
|
||||
double dTol = EPS_SMALL ;
|
||||
//controllo se ho delle span collassate e le rimuovo
|
||||
if( m_nSpanU > 1 || m_nSpanV > 1) {
|
||||
CalcPoles() ;
|
||||
@@ -5917,14 +5934,14 @@ SurfBezier::RemoveCollapsedSpans()
|
||||
Point3d ptFirst = m_vPtCtrl[m_nDegU * i] ;
|
||||
// cerco se trovo tutti i punti in U coincidenti in una delle Span
|
||||
for( int j = 1 ; j < m_nDegU + 1 && bSamePoint ; ++j) {
|
||||
if( ! AreSamePointExact( ptFirst, m_vPtCtrl[m_nDegU * i + j]))
|
||||
if( ! AreSamePointEpsilon( ptFirst, m_vPtCtrl[m_nDegU * i + j], dTol))
|
||||
bSamePoint = false ;
|
||||
}
|
||||
if( bSamePoint) {
|
||||
// se trovo un'altra riga collassata do per scontato che tutta span sia collassata
|
||||
ptFirst = m_vPtCtrl[GetInd( m_nDegU * i, 1)] ;
|
||||
for( int j = 1 ; j < m_nDegU + 1 && bSamePoint ; ++j) {
|
||||
if( ! AreSamePointExact( ptFirst, m_vPtCtrl[GetInd( m_nDegU * i + j, 1)]))
|
||||
if( ! AreSamePointEpsilon( ptFirst, m_vPtCtrl[GetInd( m_nDegU * i + j, 1)], dTol))
|
||||
bSamePoint = false ;
|
||||
}
|
||||
if( bSamePoint)
|
||||
@@ -6010,14 +6027,14 @@ SurfBezier::RemoveCollapsedSpans()
|
||||
Point3d ptFirst = m_vPtCtrl[GetInd( 0, i * m_nDegV)] ;
|
||||
// cerco se trovo tutti i punti in U coincidenti in una delle Span
|
||||
for( int j = 1 ; j < m_nDegV + 1 && bSamePoint ; ++j) {
|
||||
if( ! AreSamePointExact( ptFirst, m_vPtCtrl[GetInd( 0, i * m_nDegV + j)]))
|
||||
if( ! AreSamePointEpsilon( ptFirst, m_vPtCtrl[GetInd( 0, i * m_nDegV + j)], dTol))
|
||||
bSamePoint = false ;
|
||||
}
|
||||
if( bSamePoint) {
|
||||
// se trovo un'altra colonna collassata do per scontato che tutta span sia collassata
|
||||
ptFirst = m_vPtCtrl[GetInd( 1, i * m_nDegV)] ;
|
||||
for( int j = 1 ; j < m_nDegV + 1 && bSamePoint ; ++j) {
|
||||
if( ! AreSamePointExact( ptFirst, m_vPtCtrl[GetInd( 1, i * m_nDegV + j)]))
|
||||
if( ! AreSamePointEpsilon( ptFirst, m_vPtCtrl[GetInd( 1, i * m_nDegV + j)], dTol))
|
||||
bSamePoint = false ;
|
||||
}
|
||||
if( bSamePoint)
|
||||
|
||||
Reference in New Issue
Block a user