EgtGeomKernel :

- modifiche a RMF per avere la tangente media sul punto di calcolo (utile solo se la curva non è G1)
- modifiche a GetSurfTriMeshSwept per avere RMF anche con curve piane garantendo la retrocompatibilità.
This commit is contained in:
Dario Sassi
2026-05-14 13:02:47 +02:00
parent ba7379e752
commit 2dcaa57aa3
2 changed files with 13 additions and 6 deletions
+10 -3
View File
@@ -92,11 +92,18 @@ RotationMinimizingFrame::GetFrameAtParam( const Frame3d& frAct, const double dPa
Vector3d vtCurrR = frAct.VersX() ;
Vector3d vtCurrT = frAct.VersZ() ;
// punto i-esimo sulla curva e suo vettore tangente
// punto i-esimo sulla curva e suo vettore tangente medio
Point3d ptNextM, ptNextP ;
Vector3d vtNextM, vtNextP ;
if ( ! m_pCrv->GetPointD1D2( dParNext, ICurve::FROM_MINUS, ptNextM, &vtNextM) ||
! m_pCrv->GetPointD1D2( dParNext, ICurve::FROM_PLUS, ptNextP, &vtNextP) ||
! vtNextM.Normalize() || ! vtNextP.Normalize())
return false ;
Point3d ptNext ;
Vector3d vtNextT ;
if ( ! m_pCrv->GetPointD1D2( dParNext, ICurve::FROM_MINUS, ptNext, &vtNextT) ||
! vtNextT.Normalize())
ptNext = Media( ptNextM, ptNextP) ;
vtNextT = Media( vtNextM, vtNextP) ;
if ( ! vtNextT.Normalize())
return false ;
// controllo per casi degeneri
+3 -3
View File
@@ -1095,7 +1095,7 @@ GetSurfTriMeshSwept3d( const ICurve* pSect, const ICurve* pGuide, const Vector3d
// determino se la guida è chiusa
bool bGuideClosed = pGuide->IsClosed() ;
// determino algoritmo da usare per calcolare i riferimenti lungo la curva
bool bRMF = vtAx.IsSmall() ;
bool bRMF = ( ! vtAx.IsValid() || vtAx.IsSmall()) ;
// riferimento all'inizio della linea guida
Point3d ptStart ;
@@ -1242,9 +1242,9 @@ GetSurfTriMeshSwept( const ICurve* pSect, const ICurve* pGuide, const Vector3d&
if ( pCompo != nullptr && pCompo->IsALine( 10 * EPS_SMALL, ptStart, ptEnd))
bIsLine = true ;
}
// se la guida è piana
// se la guida è piana e il vettore di riferimento è non definito oppure non nullo
Plane3d plGuide ;
if ( pGuide->IsFlat( plGuide, bIsLine, 10 * EPS_SMALL))
if ( pGuide->IsFlat( plGuide, bIsLine, 10 * EPS_SMALL) && ( ! vtAx.IsValid() || ! vtAx.IsSmall()))
return GetSurfTriMeshSweptInPlane( pSect, pGuide, plGuide.GetVersN(), bCapEnds, dLinTol) ;
// altrimenti swept 3d