EgtMachKernel 1.6w3 :
- miglioria a separazione grezzo con pezzi piani per tagli e fresate - in fresatura migliorata applicazione allungamento e accorciamento di percorso - in fresatura a spirale aperta corretta direzione inizio - in taglio con lama su archi corretta direzione fresa con attacco/uscita interni - in taglio con lama su arco interno corretto calcolo preview.
This commit is contained in:
Binary file not shown.
@@ -74,3 +74,6 @@ const double RAW_MIN_H = 1 ;
|
||||
// Minima feed
|
||||
const double FEED_MIN = 1 ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Per FlatParts (vedi Nesting di EgtExecutor)
|
||||
const std::string NST_EXT_LAYER = "OutLoop" ;
|
||||
|
||||
+3
-1
@@ -980,7 +980,9 @@ MachMgr::SplitFlatRawPartWithMachinings( int nRawId, const INTVECTOR& vMchId)
|
||||
// scambio con pezzo
|
||||
int nPartId = SwapRawPartPart( nNewGroupId, true) ;
|
||||
// verifico se il pezzo sta nel grezzo
|
||||
int nLayerId = m_pGeomDB->GetFirstGroupInGroup( nPartId) ;
|
||||
int nLayerId = m_pGeomDB->GetFirstNameInGroup( nPartId, NST_EXT_LAYER) ;
|
||||
if ( nLayerId == GDB_ID_NULL || m_pGeomDB->GetGdbType( nLayerId) != GDB_TY_GROUP)
|
||||
nLayerId = m_pGeomDB->GetFirstGroupInGroup( nPartId) ;
|
||||
int nEntId = m_pGeomDB->GetFirstInGroup( nLayerId) ;
|
||||
int nEntGeoType = m_pGeomDB->GetGeoType( nEntId) ;
|
||||
Point3d ptTest ;
|
||||
|
||||
+27
-25
@@ -931,28 +931,7 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
double dThick ;
|
||||
pCompo->GetThickness( dThick) ;
|
||||
|
||||
// se utensile non centrato, eseguo correzione raggio utensile ed eventuale offset
|
||||
double dOffs = 0.5 * m_TParams.m_dDiam + GetOffsR() ;
|
||||
if ( m_Params.m_nWorkSide != MILL_WS_CENTER && abs( dOffs) > EPS_SMALL) {
|
||||
// valore offset
|
||||
double dSignOffs = ( m_Params.m_nWorkSide == MILL_WS_RIGHT) ? dOffs : - dOffs ;
|
||||
// flag offset
|
||||
int nFlag = ICurve::OFF_EXTEND ;
|
||||
if ( pCompo->IsClosed()) {
|
||||
Vector3d vtStart, vtEnd ;
|
||||
if ( pCompo->GetStartDir( vtStart) && pCompo->GetEndDir( vtEnd) &&
|
||||
( vtEnd ^ vtStart) * vtExtr * dSignOffs > 0)
|
||||
nFlag += ICurve::OFF_FORCE_OPEN ;
|
||||
}
|
||||
// esecuzione offset
|
||||
if ( ! pCompo->SimpleOffset( dSignOffs, nFlag)) {
|
||||
LOG_INFO( GetEMkLogger(), "Error in Milling : SimpleOffset not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
// eventuali allungamenti/accorciamenti per percorso aperto
|
||||
bool bOverlapOn = false ;
|
||||
if ( ! pCompo->IsClosed()) {
|
||||
// verifico che il percorso sia abbastanza lungo
|
||||
double dLen ; pCompo->GetLength( dLen) ;
|
||||
@@ -980,8 +959,31 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
// se utensile non centrato, eseguo correzione raggio utensile ed eventuale offset
|
||||
double dOffs = 0.5 * m_TParams.m_dDiam + GetOffsR() ;
|
||||
if ( m_Params.m_nWorkSide != MILL_WS_CENTER && abs( dOffs) > EPS_SMALL) {
|
||||
// valore offset
|
||||
double dSignOffs = ( m_Params.m_nWorkSide == MILL_WS_RIGHT) ? dOffs : - dOffs ;
|
||||
// flag offset
|
||||
int nFlag = ICurve::OFF_EXTEND ;
|
||||
// se percorso chiuso senza overlap ed inizio/fine è un angolo esterno
|
||||
if ( pCompo->IsClosed() && m_Params.m_dOverlap < EPS_SMALL) {
|
||||
Vector3d vtStart, vtEnd ;
|
||||
if ( pCompo->GetStartDir( vtStart) && pCompo->GetEndDir( vtEnd) &&
|
||||
( vtEnd ^ vtStart) * vtExtr * dSignOffs > 0)
|
||||
nFlag += ICurve::OFF_FORCE_OPEN ;
|
||||
}
|
||||
// esecuzione offset
|
||||
if ( ! pCompo->SimpleOffset( dSignOffs, nFlag)) {
|
||||
LOG_INFO( GetEMkLogger(), "Error in Milling : SimpleOffset not computable") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
// eventuale sovrapposizione per percorso chiuso
|
||||
else {
|
||||
bool bOverlapOn = false ;
|
||||
if ( pCompo->IsClosed()) {
|
||||
if ( m_Params.m_dOverlap > EPS_SMALL) {
|
||||
double dParS, dParE ;
|
||||
if ( pCompo->GetParamAtLength( 0.0, dParS) &&
|
||||
@@ -1408,7 +1410,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
for ( int j = 1 ; j <= nStep ; ++ j) {
|
||||
// ciclo sulle curve elementari
|
||||
for ( int i = 0 ; i <= nMaxInd ; ++ i) {
|
||||
// flag direzione
|
||||
// flag direzione (prima passata indice 1)
|
||||
bool bInvert = ( ( j % 2) == 0) ;
|
||||
// curva corrente
|
||||
const ICurve* pCrvC = pCompo->GetCurve( ( bInvert ? nMaxInd - i : i)) ;
|
||||
@@ -1765,8 +1767,8 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// ciclo sulle curve elementari
|
||||
double dCurrLen = 0 ;
|
||||
for ( int i = 0 ; i <= nMaxInd ; ++ i) {
|
||||
// flag direzione
|
||||
bool bInvert = ( ( j % 2) == 0) ;
|
||||
// flag direzione (prima passata indice 0)
|
||||
bool bInvert = ( ( j % 2) == 1) ;
|
||||
// curva corrente
|
||||
const ICurve* pCrvC = pCompo->GetCurve( ( bInvert ? nMaxInd - i : i)) ;
|
||||
// copio la curva
|
||||
|
||||
+41
-12
@@ -1606,7 +1606,7 @@ Sawing::ProcessExtArc( const ICurve* pCrvP, const ICurveArc* pArcC, const ICurve
|
||||
}
|
||||
// aggiusto per tipo estremi
|
||||
bool bToSkip = false ;
|
||||
if ( ! AdjustArcForEdges( pArc, dElev, vtStaThick, vtEndThick, bIsFirst, bIsLast, bExtAngPC, bExtAngCN, bToSkip)) {
|
||||
if ( ! AdjustArcForEdges( pArc, dElev, 1.0, bIsFirst, bIsLast, bExtAngPC, bExtAngCN, bToSkip)) {
|
||||
LOG_INFO( GetEMkLogger(), "Error in Sawing : Entity AdjustForEdges") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -1614,6 +1614,16 @@ Sawing::ProcessExtArc( const ICurve* pCrvP, const ICurveArc* pArcC, const ICurve
|
||||
LOG_INFO( GetEMkLogger(), "Warning in Sawing : skipped Entity too small") ;
|
||||
return true ;
|
||||
}
|
||||
// ricalcolo i versori fresa alle estremità (potrebbero essere cambiate)
|
||||
pArc->GetStartDir( vtStaDirC) ;
|
||||
pArc->GetMidDir( vtMidDirC) ;
|
||||
pArc->GetEndDir( vtEndDirC) ;
|
||||
if ( ! CalculateToolAndCorrVersors( vtStaDirC, m_Params.m_nHeadSide, m_Params.m_nWorkSide, m_Params.m_dSideAngle, vtStaTool, vtStaCorr) ||
|
||||
! CalculateToolAndCorrVersors( vtMidDirC, m_Params.m_nHeadSide, m_Params.m_nWorkSide, m_Params.m_dSideAngle, vtMidTool, vtMidCorr) ||
|
||||
! CalculateToolAndCorrVersors( vtEndDirC, m_Params.m_nHeadSide, m_Params.m_nWorkSide, m_Params.m_dSideAngle, vtEndTool, vtEndCorr)) {
|
||||
LOG_INFO( GetEMkLogger(), "Error in Sawing : Entity CalculateToolAndCorrVersors 2nd") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// Se richiesto Preview
|
||||
if ( nPvId != GDB_ID_NULL) {
|
||||
@@ -2233,8 +2243,12 @@ Sawing::ProcessIntArc( const ICurve* pCrvP, const ICurveArc* pArcC, const ICurve
|
||||
bExtAngCN = false ;
|
||||
}
|
||||
// aggiusto per tipo estremi
|
||||
double dCosA = vtStaCorr.z ;
|
||||
double dSlantElev = dElev / dCosA ;
|
||||
double dDelta = dElev * dSinA / dCosA + m_TParams.m_dThick * dCosA ; // larghezza impronta
|
||||
double dLenCoeff = ( dRad + 0.8 * dDelta) / dRad ; // coefficiente per riportare lunghezza
|
||||
bool bToSkip = false ;
|
||||
if ( ! AdjustArcForEdges( pArc, dElev, vtStaThick, vtEndThick, bIsFirst, bIsLast, bExtAngPC, bExtAngCN, bToSkip)) {
|
||||
if ( ! AdjustArcForEdges( pArc, dSlantElev, dLenCoeff, bIsFirst, bIsLast, bExtAngPC, bExtAngCN, bToSkip)) {
|
||||
LOG_INFO( GetEMkLogger(), "Error in Sawing : Entity AdjustForEdges") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -2242,11 +2256,21 @@ Sawing::ProcessIntArc( const ICurve* pCrvP, const ICurveArc* pArcC, const ICurve
|
||||
LOG_INFO( GetEMkLogger(), "Warning in Sawing : skipped Entity too small") ;
|
||||
return true ;
|
||||
}
|
||||
// ricalcolo i versori fresa alle estremità (potrebbero essere cambiate)
|
||||
pArc->GetStartDir( vtStaDirC) ;
|
||||
pArc->GetMidDir( vtMidDirC) ;
|
||||
pArc->GetEndDir( vtEndDirC) ;
|
||||
if ( ! CalculateToolAndCorrVersors( vtStaDirC, nHeadSide, m_Params.m_nWorkSide, dSideAng, vtStaTool, vtStaCorr) ||
|
||||
! CalculateToolAndCorrVersors( vtMidDirC, nHeadSide, m_Params.m_nWorkSide, dSideAng, vtMidTool, vtMidCorr) ||
|
||||
! CalculateToolAndCorrVersors( vtEndDirC, nHeadSide, m_Params.m_nWorkSide, dSideAng, vtEndTool, vtEndCorr)) {
|
||||
LOG_INFO( GetEMkLogger(), "Error in Sawing : Entity CalculateToolAndCorrVersors 2nd") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// Se richiesto Preview
|
||||
if ( nPvId != GDB_ID_NULL) {
|
||||
if ( ! GenerateIntArcPv( pArc, vtStaTool, vtMidTool, vtEndTool,
|
||||
vtStaCorr, vtMidCorr, vtEndCorr, dElev, dExtraCut, sName, nPvId))
|
||||
vtStaCorr, vtMidCorr, vtEndCorr, dElev, dExtraCut, dLenCoeff, sName, nPvId))
|
||||
return false ;
|
||||
}
|
||||
|
||||
@@ -2268,7 +2292,7 @@ bool
|
||||
Sawing::GenerateIntArcPv( const ICurveArc* pArc,
|
||||
const Vector3d& vtStaTool, const Vector3d& vtMidTool, const Vector3d& vtEndTool,
|
||||
const Vector3d& vtStaCorr, const Vector3d& vtMidCorr, const Vector3d& vtEndCorr,
|
||||
double dElev, double dExtraCut, const string& sName, int nPvId)
|
||||
double dElev, double dExtraCut, double dLenCoeff, const string& sName, int nPvId)
|
||||
{
|
||||
// creo gruppo per anteprima di lavorazione dell'arco
|
||||
int nPxId = m_pGeomDB->AddGroup( GDB_ID_NULL, nPvId, Frame3d()) ;
|
||||
@@ -2280,19 +2304,22 @@ Sawing::GenerateIntArcPv( const ICurveArc* pArc,
|
||||
// disabilito eventuale registrazione comandi EXE (riabilitazione automatica)
|
||||
CmdLogOff cmdLogOff ;
|
||||
|
||||
// lunghezza taglio parziale
|
||||
double dDeltaT = (( dElev < 0.5 * m_TParams.m_dDiam) ? sqrt( dElev * m_TParams.m_dDiam - dElev * dElev) : 0) ;
|
||||
|
||||
// seno e coseno dell'angolo di sbndamento
|
||||
// seno e coseno dell'angolo di sbandamento
|
||||
double dSinA = sqrt( vtStaCorr.x * vtStaCorr.x + vtStaCorr.y * vtStaCorr.y) ;
|
||||
double dCosA = vtStaCorr.z ;
|
||||
|
||||
// elevazione inclinata
|
||||
double dSlantElev = dElev / dCosA ;
|
||||
|
||||
// lunghezza taglio parziale
|
||||
double dDeltaT = (( dSlantElev < 0.5 * m_TParams.m_dDiam) ? sqrt( dSlantElev * m_TParams.m_dDiam - dSlantElev * dSlantElev) : 0) ;
|
||||
|
||||
// scostamenti da linea di lavoro (testa e lavoro sono da parti opposte)
|
||||
double dDeltaInt = dElev * dSinA / dCosA ;
|
||||
double dDeltaExt = m_TParams.m_dThick * dCosA ;
|
||||
|
||||
// larghezza inclinata della lama
|
||||
double dSlantThick = m_TParams.m_dThick / dCosA ;
|
||||
// larghezza inclinata della lama (formula euristica che funziona abbastanza)
|
||||
double dSlantThick = m_TParams.m_dThick * dCosA ;
|
||||
|
||||
// contorno per parte di taglio completo
|
||||
PtrOwner<ICurveComposite> pCompo( GenerateIntArcPvTrueCut( pArc, dDeltaInt, dDeltaExt, 0)) ;
|
||||
@@ -2377,7 +2404,7 @@ Sawing::GenerateIntArcPv( const ICurveArc* pArc,
|
||||
|
||||
// salvo in info del gruppo la larghezza XY del taglio e la distanza XY tra centro e bordo taglio
|
||||
m_pGeomDB->SetInfo( nPxId, MCH_PV_KEY_WT, dDeltaInt + dDeltaExt) ;
|
||||
m_pGeomDB->SetInfo( nPxId, MCH_PV_KEY_DT, dDeltaT) ;
|
||||
m_pGeomDB->SetInfo( nPxId, MCH_PV_KEY_DT, dDeltaT * dLenCoeff) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
@@ -3062,7 +3089,7 @@ Sawing::AdjustLineForEdges( ICurveLine* pLine, double dElev, const Vector3d& vtC
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Sawing::AdjustArcForEdges( ICurveArc* pArc, double dElev, const Vector3d& vtStaThick, const Vector3d& vtEndThick,
|
||||
Sawing::AdjustArcForEdges( ICurveArc* pArc, double dElev, double dLenCoeff,
|
||||
bool bIsFirst, bool bIsLast, bool bExtAngPC, bool bExtAngCN, bool& bToSkip)
|
||||
{
|
||||
// --- gli archi non vanno estesi al bordo del grezzo ---
|
||||
@@ -3081,6 +3108,7 @@ Sawing::AdjustArcForEdges( ICurveArc* pArc, double dElev, const Vector3d& vtStaT
|
||||
// all'esterno
|
||||
dDeltaI = dDeltaT ;
|
||||
}
|
||||
dDeltaI *= dLenCoeff ;
|
||||
// verifiche e aggiustamenti sulla fine
|
||||
double dDeltaF = 0 ;
|
||||
if ( ! bExtAngCN)
|
||||
@@ -3089,6 +3117,7 @@ Sawing::AdjustArcForEdges( ICurveArc* pArc, double dElev, const Vector3d& vtStaT
|
||||
if ( m_Params.m_nLeadOutType == SAW_LO_STRICT)
|
||||
dDeltaF = - dDeltaT ;
|
||||
}
|
||||
dDeltaF *= dLenCoeff ;
|
||||
// controllo se lunghezza entità accettabile
|
||||
const double MIN_LEN = 10 ;
|
||||
double dLenXY ;
|
||||
|
||||
@@ -101,7 +101,7 @@ class Sawing : public Machining
|
||||
bool GenerateIntArcPv( const ICurveArc* pArc,
|
||||
const Vector3d& vtStaTool, const Vector3d& vtMidTool, const Vector3d& vtEndTool,
|
||||
const Vector3d& vtStaCorr, const Vector3d& vtMidCorr, const Vector3d& vtEndCorr,
|
||||
double dElev, double dExtraCut, const string& sName, int nPvId) ;
|
||||
double dElev, double dExtraCut, double dLenCoeff, const string& sName, int nPvId) ;
|
||||
ICurveComposite* GenerateIntArcPvTrueCut( const ICurveArc* pArc, double dDeltaInt, double dDeltaExt,
|
||||
double dSafety) ;
|
||||
ICurveComposite* GenerateIntArcPvPreCut( const ICurveArc* pArc, double dDeltaInt, double dDeltaExt,
|
||||
@@ -118,7 +118,7 @@ class Sawing : public Machining
|
||||
bool AdjustIntArcForSide( ICurve* pCurve, double dSideAng) ;
|
||||
bool AdjustLineForEdges( ICurveLine* pLine, double dElev, const Vector3d& vtCorr, const Vector3d& vtThick,
|
||||
bool bIsFirst, bool bIsLast, bool bExtAngPC, bool bExtAngCN, bool& ToSkip) ;
|
||||
bool AdjustArcForEdges( ICurveArc* pArc, double dElev, const Vector3d& vtStaThick, const Vector3d& vtEndThick,
|
||||
bool AdjustArcForEdges( ICurveArc* pArc, double dElev, double dLenCoeff,
|
||||
bool bIsFirst, bool bIsLast, bool bExtAngPC, bool bExtAngCN, bool& ToSkip) ;
|
||||
bool AddApproach( const Point3d& ptP, const Vector3d& vtCorr, double dSafeZ, double dElev, double dAppr) ;
|
||||
bool AddRetract( const Point3d& ptP, const Vector3d& vtCorr, double dSafeZ, double dElev, double dAppr) ;
|
||||
|
||||
Reference in New Issue
Block a user