EgtGeomKernel :

- aggiornate le funzioni per la conversione di curve in/da bezier.
This commit is contained in:
Daniele Bariletti
2025-09-12 15:40:39 +02:00
parent f2bb1deac4
commit b0c9c5be2e
2 changed files with 7 additions and 14 deletions
+7 -11
View File
@@ -513,10 +513,9 @@ CurveToBezierCurve( const ICurve* pCrv, int nDeg, bool bMakeRatOrNot)
//----------------------------------------------------------------------------
ICurveBezier*
LineToBezierCurve( const ICurve* pCrv, int nDeg, bool bMakeRatOrNot)
LineToBezierCurve( const ICurveLine* pCrvLine, int nDeg, bool bMakeRatOrNot)
{
// verifico sia una linea
const CurveLine* pCrvLine = GetBasicCurveLine( pCrv) ;
// verifico che esista la linea
if ( pCrvLine == nullptr)
return nullptr ;
@@ -531,12 +530,11 @@ LineToBezierCurve( const ICurve* pCrv, int nDeg, bool bMakeRatOrNot)
//----------------------------------------------------------------------------
ICurve*
ArcToBezierCurve( const ICurve* pCrv, int nDeg, bool bMakeRatOrNot)
ArcToBezierCurve( const ICurveArc* pArc, int nDeg, bool bMakeRatOrNot)
{
// una spirale non può essere forzata al grado 2
// verifico sia un arco
const CurveArc* pArc = GetBasicCurveArc( pCrv) ;
// verifico che esista l'arco
if ( pArc == nullptr)
return nullptr ;
@@ -589,10 +587,9 @@ ArcToBezierCurve( const ICurve* pCrv, int nDeg, bool bMakeRatOrNot)
//----------------------------------------------------------------------------
ICurve*
CompositeToBezierCurve( const ICurve* pCrv, int nDeg, bool bMakeRatOrNot)
CompositeToBezierCurve( const ICurveComposite* pCC, int nDeg, bool bMakeRatOrNot)
{
// verifico sia una composita
const CurveComposite* pCC = GetBasicCurveComposite( pCrv) ;
// verifico che esista la curva
if ( pCC == nullptr)
return nullptr ;
@@ -630,12 +627,11 @@ CompositeToBezierCurve( const ICurve* pCrv, int nDeg, bool bMakeRatOrNot)
//----------------------------------------------------------------------------
ICurve*
EditBezierCurve( const ICurve* pCrv, int nDeg, bool bMakeRatOrNot, double dTol)
EditBezierCurve( const ICurveBezier* pCrvBezier, int nDeg, bool bMakeRatOrNot, double dTol)
{
// se nDeg == -1 allora viene mantenuto il grado della curva originale
// verifico sia una bezier
const CurveBezier* pCrvBezier = GetBasicCurveBezier( pCrv) ;
if ( pCrvBezier == nullptr)
return nullptr ;
-3
View File
@@ -2858,7 +2858,6 @@ SurfBezier::UnprojectPointFromStm( int nT, const Point3d& ptI, Point3d& ptSP, in
// se sono in polo e mi hanno passato un punto precedente allora devo prendere il triangolo di quel punto
bool bIsPole = false ;
bool bNearPole = false ; // devo capire se il triangolo di riferimento ha un vertice in un polo
int nInters = 0 ;
INTVECTOR vInters(4) ;
fill( vInters.begin(), vInters.end(), 0) ;
// se il vettore dei poli non è stato riempito vuol dire che quando è stata creata la superficie non è stata chiamata la funzione CalcPoles
@@ -2876,11 +2875,9 @@ SurfBezier::UnprojectPointFromStm( int nT, const Point3d& ptI, Point3d& ptSP, in
vInters[c] = AreSamePointApprox( pt, ptI) ? 1 : 0 ;
if ( vInters[c] == 1)
bIsPole = true ;
nInters += vInters[c] ;
}
else {
vInters[c] = m_mCCEdge[c][i]->IsPointOn(ptI) ? 1 : 0 ;
nInters += vInters[c] ;
}
}
}