EgtGeomKernel :
- piccola correzione CalcPocketing.
This commit is contained in:
+2
-45
@@ -2973,49 +2973,6 @@ CalcPocketing( const ISurfFlatRegion *pSfr, double dRad, double dStep, double dA
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static bool
|
||||
CheckZigZagInfillTangentLink( const ICurve* pCrvSegPrec, const ICurve* pCrvSegSucc, const ICurveComposite* pCrvLink,
|
||||
bool& bOkS, bool& bOkE)
|
||||
{
|
||||
// controllo dei parametri
|
||||
if ( pCrvLink == nullptr || ! pCrvLink->IsValid())
|
||||
return false ;
|
||||
bOkS = false ;
|
||||
bOkE = false ;
|
||||
|
||||
// ricavo prima e ultima curva del link
|
||||
const ICurve* pCrvFirst = pCrvLink->GetFirstCurve() ;
|
||||
const ICurve* pCrvLast = pCrvLink->GetLastCurve() ;
|
||||
if ( pCrvFirst == nullptr || pCrvLast == nullptr)
|
||||
return false ;
|
||||
|
||||
Vector3d vtDirZigZag ;
|
||||
// se la prima curva è lineare...
|
||||
if ( pCrvSegPrec != nullptr && pCrvFirst->GetType() == CRV_LINE) {
|
||||
if ( pCrvSegPrec->GetType() != CRV_LINE)
|
||||
return false ;
|
||||
// ... controllo la tangenza con il percorso a ZigZag
|
||||
pCrvSegPrec->GetEndDir( vtDirZigZag) ;
|
||||
Vector3d vtDirStartLink ; pCrvFirst->GetStartDir( vtDirStartLink) ;
|
||||
if ( AreSameVectorApprox( vtDirZigZag, vtDirStartLink))
|
||||
bOkS = true ;
|
||||
}
|
||||
// se l'ultima curva è lineare...
|
||||
if ( pCrvSegSucc != nullptr && pCrvLast->GetType() == CRV_LINE) {
|
||||
if ( pCrvSegSucc->GetType() != CRV_LINE)
|
||||
return false ;
|
||||
// ... controllo la tangenza con il percorso a ZigZag
|
||||
pCrvSegSucc->GetStartDir( vtDirZigZag) ;
|
||||
Vector3d vtDirStartLink ; pCrvLast->GetEndDir( vtDirStartLink) ;
|
||||
if ( AreSameVectorApprox( vtDirZigZag, vtDirStartLink))
|
||||
bOkE = true ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static bool
|
||||
AdjustZigZagPathTangentLinks( ICurveComposite* pCrvCompo)
|
||||
@@ -3253,8 +3210,8 @@ AdjustLinkZigZagInfill( ICurveComposite* pCrvCompo, ICRVCOMPOPOVECTOR& vNewCrv)
|
||||
if ( bSplit) {
|
||||
// se dimensione sopra la tolleranza, allora spezzo la curva e rimuovo il link
|
||||
CopyRange CR {
|
||||
nCrvStartBreak, // dParS
|
||||
u - pCrvLink->GetCurveCount() // dParE
|
||||
1. * nCrvStartBreak, // dParS
|
||||
1. * ( u - pCrvLink->GetCurveCount()) // dParE
|
||||
} ;
|
||||
// se il primo tratto è un link non valido, non considero l'intervallo
|
||||
if ( ! ( nCrvStartBreak == 0 && abs( CR.dParS - CR.dParE) < 20 * EPS_SMALL))
|
||||
|
||||
Reference in New Issue
Block a user