EgtGeomKernel 1.8b4 :

- corretto errore in angoli interni di OffsetCurveOnX.
This commit is contained in:
Dario Sassi
2017-02-21 19:52:53 +00:00
parent 036aa216d3
commit 0bd0b0501d
2 changed files with 8 additions and 8 deletions
BIN
View File
Binary file not shown.
+8 -8
View File
@@ -245,9 +245,9 @@ OffsetCurveOnX::Make( const ICurve* pCrv, double dDist)
for ( auto iIter = m_CrvLst.begin() ; iIter != m_CrvLst.end() ;) {
ICurve* pCrv = *iIter ;
// distanza minima di alcuni punti interni della curva dalla curva originale
if ( ! SafeDist( dDist, 0.5, pCrv, &ccCopy) ||
! SafeDist( dDist, 0.25, pCrv, &ccCopy) ||
! SafeDist( dDist, 0.75, pCrv, &ccCopy)) {
if ( ! SafeDist( dDist, 0.53, pCrv, &ccCopy) ||
! SafeDist( dDist, 0.13, pCrv, &ccCopy) ||
! SafeDist( dDist, 0.89, pCrv, &ccCopy)) {
delete pCrv ;
iIter = m_CrvLst.erase( iIter) ;
continue ;
@@ -452,15 +452,15 @@ SafeDist( double dDist, double dCoeff, ICurve* pCrv1, ICurve* pCrv2)
// calcolo il punto e due vicini
double dUStart, dUEnd ;
pCrv1->GetDomain( dUStart, dUEnd) ;
double dU = dCoeff * dUStart + ( 1 - dCoeff) * dUEnd ;
double dU = ( 1 - dCoeff) * dUStart + dCoeff * dUEnd ;
Point3d ptP ;
pCrv1->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP) ;
Point3d ptPrev, ptNext ;
Vector3d vtPrev, vtNext ;
pCrv1->GetPointTang( dU - 100 * EPS_PARAM, ICurve::FROM_MINUS, ptPrev, vtPrev) ;
pCrv1->GetPointTang( dU + 100 * EPS_PARAM, ICurve::FROM_PLUS, ptNext, vtNext) ;
// non si considerano i tratti orizzontali (tolleranza fino a 5deg)
const double SEN_ANG_LIM = 0.0872 ;
pCrv1->GetPointTang( dU - 100 * EPS_PARAM, ICurve::FROM_PLUS, ptPrev, vtPrev) ;
pCrv1->GetPointTang( dU + 100 * EPS_PARAM, ICurve::FROM_MINUS, ptNext, vtNext) ;
// non si considerano i tratti orizzontali (tolleranza fino a 1deg)
const double SEN_ANG_LIM = 0.0175 ;
if ( abs( vtPrev.y) < SEN_ANG_LIM || abs( vtNext.y) < SEN_ANG_LIM)
return true ;
// segmento orizzontale di prova centrato sul punto e lungo dDist + dDist