EgtMachKernel :

- in fresatura di percorsi chiusi aggiunta gestione overlap.
This commit is contained in:
Dario Sassi
2016-10-06 17:58:06 +00:00
parent af60c946b7
commit 7e656dab01
2 changed files with 39 additions and 25 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ MachMgr::GetMachGroupNewName( string& sName) const
// se gruppo base per le lavorazioni assente
if ( ! VerifyMachBase()) {
if ( sName.empty())
sName = "Mach01" ;
sName = "Mach_1" ;
return true ;
}
// se nome vuoto, assegno radice standard
+38 -24
View File
@@ -922,10 +922,6 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
return false ;
ICurveComposite* pCompo = GetCurveComposite( m_pGeomDB->GetGeoObj( nCopyId)) ;
// unisco le parti allineate (tranne inizio-fine se chiusa)
if ( ! pCompo->MergeCurves( 10 * EPS_SMALL, 10 * EPS_ANG_SMALL, false))
return false ;
// eventuale inversione percorso
if ( m_Params.m_bInvert)
pCompo->Invert() ;
@@ -934,30 +930,48 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
Point3d ptStart ;
pCompo->GetStartPoint( ptStart) ;
// eventuale allungamento/accorciamento dell'inizio
if ( ! pCompo->IsClosed() && abs( m_Params.m_dStartAddLen) > EPS_SMALL) {
if ( m_Params.m_dStartAddLen > 0) {
if ( ! pCompo->ExtendStartByLen( m_Params.m_dStartAddLen))
return false ;
// eventuali allungamenti per percorso aperto
if ( ! pCompo->IsClosed()) {
// eventuale allungamento/accorciamento dell'inizio
if ( abs( m_Params.m_dStartAddLen) > EPS_SMALL) {
if ( m_Params.m_dStartAddLen > 0) {
if ( ! pCompo->ExtendStartByLen( m_Params.m_dStartAddLen))
return false ;
}
else {
if ( ! pCompo->TrimStartAtLen( - m_Params.m_dStartAddLen))
return false ;
}
}
else {
if ( ! pCompo->TrimStartAtLen( - m_Params.m_dStartAddLen))
return false ;
// eventuale allungamento/accorciamento della fine
if ( abs( m_Params.m_dEndAddLen) > EPS_SMALL) {
if ( m_Params.m_dEndAddLen > 0) {
if ( ! pCompo->ExtendEndByLen( m_Params.m_dEndAddLen))
return false ;
}
else {
double dLen ;
if ( ! pCompo->GetLength( dLen) || ! pCompo->TrimEndAtLen( dLen + m_Params.m_dEndAddLen))
return false ;
}
}
}
// eventuale sovrapposizione per percorso chiuso
else {
if ( m_Params.m_dOverlap > EPS_SMALL) {
double dParS, dParE ;
if ( pCompo->GetParamAtLength( 0.0, dParS) &&
pCompo->GetParamAtLength( m_Params.m_dOverlap, dParE)) {
PtrOwner<ICurve> pCrv( pCompo->CopyParamRange( dParS, dParE)) ;
if ( ! IsNull( pCrv))
pCompo->AddCurve( Release( pCrv)) ;
}
}
}
// eventuale allungamento/accorciamento della fine
if ( ! pCompo->IsClosed() && abs( m_Params.m_dEndAddLen) > EPS_SMALL) {
if ( m_Params.m_dEndAddLen > 0) {
if ( ! pCompo->ExtendEndByLen( m_Params.m_dEndAddLen))
return false ;
}
else {
double dLen ;
if ( ! pCompo->GetLength( dLen) || ! pCompo->TrimEndAtLen( dLen + m_Params.m_dEndAddLen))
return false ;
}
}
// unisco le parti allineate (tranne inizio-fine se chiusa)
if ( ! pCompo->MergeCurves( 10 * EPS_SMALL, 10 * EPS_ANG_SMALL, false))
return false ;
// se utensile non centrato, eseguo correzione raggio utensile ed eventuale offset
double dOffs = 0.5 * m_TParams.m_dDiam + GetOffsR() ;