EgtGeomKernel 1.6p3 :
- modifiche a CurveComposite::ApproxWithLines per approssimare anche composite formate da linee - migliorie a OffsetCurveOnX per tratti quasi orizzontali o archi a tg orizz - aumentato coeff. di deduzione di tolleranza in approssimazione di polilinee.
This commit is contained in:
+22
-7
@@ -1251,6 +1251,28 @@ CurveComposite::ApproxWithLines( double dLinTol, double dAngTolDeg, int nType, P
|
||||
if ( m_nStatus != OK)
|
||||
return false ;
|
||||
|
||||
// limiti minimi su tolleranza e deviazione angolare
|
||||
dLinTol = max( dLinTol, LIN_TOL_MIN) ;
|
||||
dAngTolDeg = max( dAngTolDeg, ANG_TOL_MIN_DEG) ;
|
||||
|
||||
// se lineare con lato obbligato, gestione speciale
|
||||
if ( nType == APL_LEFT || nType == APL_LEFT_CONVEX ||
|
||||
nType == APL_RIGHT || nType == APL_RIGHT_CONVEX) {
|
||||
// prima approssimazione lineare a 10 * Epsilon
|
||||
if ( ! ApproxWithLines( 10 * EPS_SMALL, dAngTolDeg, APL_STD, PL))
|
||||
return false ;
|
||||
// eliminazione dei punti in tolleranza andando solo dalla parte ammessa
|
||||
Vector3d vtExtr = ( m_VtExtr.IsSmall() ? Z_AX : m_VtExtr) ;
|
||||
if ( ! PL.ApproxOnSide( vtExtr, ( nType == APL_LEFT), dLinTol))
|
||||
return false ;
|
||||
// se necessario, sistemo per convessità dalla parte ammessa
|
||||
if ( nType == APL_RIGHT_CONVEX || nType == APL_LEFT_CONVEX) {
|
||||
if ( ! PL.MakeConvex( vtExtr, ( nType == APL_LEFT_CONVEX)))
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
// eseguo approssimazione
|
||||
double dStartPar = 0 ;
|
||||
for ( auto& pCrv : m_CrvSmplS) {
|
||||
@@ -1270,13 +1292,6 @@ CurveComposite::ApproxWithLines( double dLinTol, double dAngTolDeg, int nType, P
|
||||
// incremento inizio parametro per prossima curva semplice
|
||||
dStartPar += 1 ;
|
||||
}
|
||||
|
||||
// se necessario, sistemo per convessità dalla parte ammessa
|
||||
if ( nType == APL_RIGHT_CONVEX || nType == APL_LEFT_CONVEX) {
|
||||
Vector3d vtExtr = ( m_VtExtr.IsSmall() ? Z_AX : m_VtExtr) ;
|
||||
if ( ! PL.MakeConvex( vtExtr, ( nType == APL_LEFT_CONVEX)))
|
||||
return false ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
Binary file not shown.
+5
-4
@@ -89,8 +89,8 @@ OffsetCurveOnX::Make( const ICurve* pCrv, double dDist)
|
||||
if ( ! SplitLeftRightArcs( ccCopy))
|
||||
return false ;
|
||||
|
||||
// se offset nullo, copio la curva nel risultato ed esco
|
||||
if ( abs( dDist) < EPS_SMALL) {
|
||||
// se offset qusi nullo, copio la curva nel risultato ed esco
|
||||
if ( abs( dDist) < 10 * EPS_SMALL) {
|
||||
PtrOwner<CurveComposite> pCopy( CreateBasicCurveComposite()) ;
|
||||
if ( IsNull( pCopy) || ! pCopy->RelocateFrom( ccCopy))
|
||||
return false ;
|
||||
@@ -459,8 +459,9 @@ SafeDist( double dDist, double dCoeff, ICurve* pCrv1, ICurve* pCrv2)
|
||||
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
|
||||
if ( abs( vtPrev.y) < EPS_SMALL || abs( vtNext.y) < EPS_SMALL)
|
||||
// non si considerano i tratti orizzontali (tolleranza fino a 5deg)
|
||||
const double SEN_ANG_LIM = 0.0872 ;
|
||||
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
|
||||
Vector3d vtDelta( abs(dDist) - 5 * EPS_SMALL, 0, 0) ;
|
||||
|
||||
+1
-1
@@ -736,7 +736,7 @@ PolyLine::ApproxOnSide( const Vector3d& vtN, bool bLeftSide, double dToler)
|
||||
if ( m_lUPoints.size() < 3)
|
||||
return true ;
|
||||
// coefficienti deduzione tolleranza
|
||||
const double COEFF_TOL = 0.7 ;
|
||||
const double COEFF_TOL = 0.90 ;
|
||||
// punto precedente
|
||||
auto precP = m_lUPoints.begin() ;
|
||||
// punto corrente
|
||||
|
||||
Reference in New Issue
Block a user