EgtGeomKernel :

- correzione a chiusura composita formata da un solo arco (il nuovo angolo giro al centro deve avere lo steso segno del precedente).
This commit is contained in:
Dario Sassi
2024-05-30 16:45:38 +02:00
parent b5d879cd3d
commit 01bf44cf1e
+8 -4
View File
@@ -292,8 +292,10 @@ CurveComposite::Close( void)
// se molto vicini li modifico
if ( AreSamePointEpsilon( ptStart, ptEnd, 10 * EPS_SMALL)) {
// se un solo arco
if ( m_CrvSmplS.size() == 1 && m_CrvSmplS.front()->GetType() == CRV_ARC)
return GetBasicCurveArc( m_CrvSmplS.front())->ChangeAngCenter( ANG_FULL) ;
if ( m_CrvSmplS.size() == 1 && m_CrvSmplS.front()->GetType() == CRV_ARC) {
CurveArc* pArc = GetBasicCurveArc( m_CrvSmplS.front()) ;
return pArc->ChangeAngCenter( pArc->GetAngCenter() > 0 ? ANG_FULL : -ANG_FULL) ;
}
// caso generale
Point3d ptMid = Media( ptStart, ptEnd) ;
if ( ! m_CrvSmplS.front()->ModifyStart( ptMid) ||
@@ -883,8 +885,10 @@ CurveComposite::TestClosure( void)
// se distanza superiore al limite ridotto forzo i punti a coincidere
if ( ! AreSamePointEpsilon( ptStart, ptEnd, EPS_CONNECT)) {
// se un solo arco
if ( m_CrvSmplS.size() == 1 && m_CrvSmplS.front()->GetType() == CRV_ARC)
return GetBasicCurveArc( m_CrvSmplS.front())->ChangeAngCenter( ANG_FULL) ;
if ( m_CrvSmplS.size() == 1 && m_CrvSmplS.front()->GetType() == CRV_ARC) {
CurveArc* pArc = GetBasicCurveArc( m_CrvSmplS.front()) ;
return pArc->ChangeAngCenter( pArc->GetAngCenter() > 0 ? ANG_FULL : -ANG_FULL) ;
}
// caso generale
Point3d ptM = Media( ptStart, ptEnd) ;
return ( m_CrvSmplS.front()->ModifyStart( ptM) &&