Merge commit '8950f2aca1e4f7292dd46ccfd6e279a0a9a1f3ee' into Sgrossature
This commit is contained in:
Binary file not shown.
+1
-1
@@ -5685,7 +5685,7 @@ Milling::CalcTabsPositions( const ICurveComposite* pCompo, double dDepth, bool b
|
||||
// inizializzo intervallo valido (non sono ammessi tab a cavallo di inizio/fine)
|
||||
ivTabs.Set( 0, dLen - dTabLen) ;
|
||||
// elimino le zone con piccolo raggio e quelle vicine agli angoli
|
||||
const double RAD_MIN = 100 ;
|
||||
const double RAD_MIN = 50 ;
|
||||
const double CORNER_RAG = 2 ;
|
||||
const double CORNER_ANG = 5 ;
|
||||
const double CORNER_DIST = 2 ;
|
||||
|
||||
+9
-2
@@ -84,6 +84,7 @@ using namespace std ;
|
||||
// 3052 = "Warning in SurfRoughing : No machinable path"
|
||||
// 3053 = "Warning in SurfRoughing : Tool name changed (xx)"
|
||||
// 3054 = "Warning in SurfRoughing : Tool data changed (xx)"
|
||||
// 3055 = "Warning in SurfRoughing : CalcPocketing failed with substep (xx)"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static string KEY_SURF_POCK = "SurfPock_" ;
|
||||
@@ -1849,8 +1850,14 @@ SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, co
|
||||
// se si tratta di uno step base, allora lavoro l'intera superficie
|
||||
if ( ! CalcPocketing( pSfrPock, m_TParams.m_dDiam / 2, 0., m_Params.m_dSideStep, m_Params.m_dSideAngle,
|
||||
nSubType, true, bInvert, false, pSfrLimit, vpCrvs)) {
|
||||
m_pMchMgr->SetLastError( 3028, "Error in SurfRoughing : Error in CalcPocketing") ;
|
||||
return false ;
|
||||
if ( bIsSubStep) {
|
||||
string sWarn = "Warning in SurfRoughing : CalcPocketing failed with substep (" + ToString( pSfrPock->GetTempParam( 0), 1) + ")" ;
|
||||
m_pMchMgr->SetWarning( 3055, sWarn) ;
|
||||
}
|
||||
else {
|
||||
m_pMchMgr->SetLastError( 3028, "Error in SurfRoughing : Error in CalcPocketing") ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
// recupero la Depth della regione
|
||||
|
||||
@@ -551,6 +551,11 @@ ToolsMgr::SaveCurrTool( void)
|
||||
m_suData.emplace( m_tdCurrTool.m_sName, m_tdCurrTool.m_Uuid) ;
|
||||
}
|
||||
}
|
||||
// se fresa adatto sottotipo a seconda della capacità di lavorare di testa
|
||||
if ( m_tdCurrTool.m_nType == TT_MILL_STD && m_tdCurrTool.m_dTipFeed < EPS_SMALL)
|
||||
m_tdCurrTool.m_nType = TT_MILL_NOTIP ;
|
||||
else if ( m_tdCurrTool.m_nType == TT_MILL_NOTIP && m_tdCurrTool.m_dTipFeed > EPS_SMALL)
|
||||
m_tdCurrTool.m_nType = TT_MILL_STD ;
|
||||
// eseguo salvataggio
|
||||
m_bModified = true ;
|
||||
if ( find( m_utModified.begin(), m_utModified.end(), m_tdCurrTool.m_Uuid) == m_utModified.end())
|
||||
|
||||
+145
-72
@@ -498,15 +498,15 @@ WaterJetting::SetParam( int nType, const string& sVal)
|
||||
bool
|
||||
WaterJetting::SetGeometry( const SELVECTOR& vIds)
|
||||
{
|
||||
// verifico validità gestore DB geometrico
|
||||
// verifico validità gestore DB geometrico
|
||||
if ( m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// reset della geometria corrente
|
||||
m_vId.clear() ;
|
||||
// verifico che gli identificativi rappresentino delle entità ammissibili (tutte curve, tutti testi o tutte facce)
|
||||
// verifico che gli identificativi rappresentino delle entità ammissibili (tutte curve, tutti testi o tutte facce)
|
||||
int nType = GEO_NONE ;
|
||||
for ( const auto& Id : vIds) {
|
||||
// test sull'entità
|
||||
// test sull'entità
|
||||
int nSubs ;
|
||||
if ( ! VerifyGeometry( Id, nSubs, nType)) {
|
||||
string sInfo = "Warning in WaterJetting : Skipped entity " + ToString( Id) ;
|
||||
@@ -529,14 +529,14 @@ WaterJetting::Preview( bool bRecalc)
|
||||
// reset numero percorsi di lavoro generati
|
||||
m_nMills = 0 ;
|
||||
|
||||
// verifico validità gestore DB geometrico e Id del gruppo
|
||||
// verifico validità gestore DB geometrico e Id del gruppo
|
||||
if ( m_pGeomDB == nullptr || ! m_pGeomDB->ExistsObj( m_nOwnerId))
|
||||
return false ;
|
||||
|
||||
// recupero gruppo per geometria ausiliaria
|
||||
int nAuxId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_AUX) ;
|
||||
bool bChain = false ;
|
||||
// se non c'è, lo aggiungo
|
||||
// se non c'è, lo aggiungo
|
||||
if ( nAuxId == GDB_ID_NULL) {
|
||||
nAuxId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ;
|
||||
if ( nAuxId == GDB_ID_NULL)
|
||||
@@ -586,7 +586,7 @@ WaterJetting::Preview( bool bRecalc)
|
||||
|
||||
// recupero gruppo per geometria di Preview
|
||||
int nPvId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_PV) ;
|
||||
// se non c'è, lo aggiungo
|
||||
// se non c'è, lo aggiungo
|
||||
if ( nPvId == GDB_ID_NULL) {
|
||||
nPvId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ;
|
||||
if ( nPvId == GDB_ID_NULL)
|
||||
@@ -616,7 +616,7 @@ WaterJetting::Apply( bool bRecalc, bool bPostApply)
|
||||
int nCurrMills = m_nMills ;
|
||||
m_nMills = 0 ;
|
||||
|
||||
// verifico validità gestore DB geometrico e Id del gruppo
|
||||
// verifico validità gestore DB geometrico e Id del gruppo
|
||||
if ( m_pGeomDB == nullptr || ! m_pGeomDB->ExistsObj( m_nOwnerId))
|
||||
return false ;
|
||||
|
||||
@@ -646,7 +646,7 @@ WaterJetting::Apply( bool bRecalc, bool bPostApply)
|
||||
// recupero gruppo per geometria ausiliaria
|
||||
int nAuxId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_AUX) ;
|
||||
bool bChain = false ;
|
||||
// se non c'è, lo aggiungo
|
||||
// se non c'è, lo aggiungo
|
||||
if ( nAuxId == GDB_ID_NULL) {
|
||||
nAuxId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ;
|
||||
if ( nAuxId == GDB_ID_NULL)
|
||||
@@ -687,7 +687,7 @@ WaterJetting::Apply( bool bRecalc, bool bPostApply)
|
||||
|
||||
// recupero gruppo per geometria di lavorazione (Cutter Location)
|
||||
int nClId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_CL) ;
|
||||
// se non c'è, lo aggiungo
|
||||
// se non c'è, lo aggiungo
|
||||
if ( nClId == GDB_ID_NULL) {
|
||||
nClId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ;
|
||||
if ( nClId == GDB_ID_NULL)
|
||||
@@ -730,7 +730,7 @@ WaterJetting::Apply( bool bRecalc, bool bPostApply)
|
||||
bool
|
||||
WaterJetting::Update( bool bPostApply)
|
||||
{
|
||||
// verifico validità gestore DB geometrico e Id del gruppo
|
||||
// verifico validità gestore DB geometrico e Id del gruppo
|
||||
if ( m_pGeomDB == nullptr || ! m_pGeomDB->ExistsObj( m_nOwnerId))
|
||||
return false ;
|
||||
|
||||
@@ -740,7 +740,7 @@ WaterJetting::Update( bool bPostApply)
|
||||
return true ;
|
||||
}
|
||||
|
||||
// elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo)
|
||||
// elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo)
|
||||
RemoveClimbRiseHome() ;
|
||||
|
||||
// imposto eventuale asse bloccato da lavorazione
|
||||
@@ -1014,7 +1014,7 @@ WaterJetting::UpdateToolData( bool* pbChanged)
|
||||
bool
|
||||
WaterJetting::GetGeometry( SELVECTOR& vIds) const
|
||||
{
|
||||
// restituisco l'elenco delle entità
|
||||
// restituisco l'elenco delle entità
|
||||
vIds = m_vId ;
|
||||
return true ;
|
||||
}
|
||||
@@ -1027,7 +1027,7 @@ WaterJetting::VerifyGeometry( SelData Id, int& nSubs, int& nType)
|
||||
const IGeoObj* pGObj = m_pGeomDB->GetGeoObj( Id.nId) ;
|
||||
if ( pGObj == nullptr)
|
||||
return false ;
|
||||
// se ammesse curve ed è tale
|
||||
// se ammesse curve ed è tale
|
||||
if ( ( nType == GEO_NONE || nType == GEO_CURVE) && ( pGObj->GetType() & GEO_CURVE) != 0) {
|
||||
nType = GEO_CURVE ;
|
||||
const ICurve* pCurve = nullptr ;
|
||||
@@ -1051,7 +1051,7 @@ WaterJetting::VerifyGeometry( SelData Id, int& nSubs, int& nType)
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
// se altrimenti ammessi testi ed è tale
|
||||
// se altrimenti ammessi testi ed è tale
|
||||
else if ( ( nType == GEO_NONE || nType == EXT_TEXT) && pGObj->GetType() == EXT_TEXT) {
|
||||
nType = EXT_TEXT ;
|
||||
const IExtText* pText = ::GetExtText( pGObj) ;
|
||||
@@ -1061,7 +1061,7 @@ WaterJetting::VerifyGeometry( SelData Id, int& nSubs, int& nType)
|
||||
nSubs = 0 ;
|
||||
return true ;
|
||||
}
|
||||
// se altrimenti ammesse superfici trimesh ed è tale
|
||||
// se altrimenti ammesse superfici trimesh ed è tale
|
||||
else if ( ( nType == GEO_NONE || nType == SRF_TRIMESH) && pGObj->GetType() == SRF_TRIMESH) {
|
||||
nType = SRF_TRIMESH ;
|
||||
const ISurfTriMesh* pSurf = ::GetSurfTriMesh( pGObj) ;
|
||||
@@ -1083,7 +1083,7 @@ WaterJetting::VerifyGeometry( SelData Id, int& nSubs, int& nType)
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
// se altrimenti ammesse regioni ed è tale
|
||||
// se altrimenti ammesse regioni ed è tale
|
||||
else if ( ( nType == GEO_NONE || nType == SRF_FLATRGN) && pGObj->GetType() == SRF_FLATRGN) {
|
||||
nType = SRF_FLATRGN ;
|
||||
const ISurfFlatRegion* pReg = ::GetSurfFlatRegion( pGObj) ;
|
||||
@@ -1420,7 +1420,7 @@ WaterJetting::VerifySideAngle( void)
|
||||
bool
|
||||
WaterJetting::AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const
|
||||
{
|
||||
// non devo fare alcunché
|
||||
// non devo fare alcunché
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -1442,7 +1442,7 @@ WaterJetting::AdjustArcCenterForAxesCalc( const CamData* pCamData, Point3d& ptCe
|
||||
ptCen.Translate( dOffset * pCamData->GetCorrDir()) ;
|
||||
}
|
||||
}
|
||||
// negli altri casi, non devo fare alcunché
|
||||
// negli altri casi, non devo fare alcunché
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -1453,7 +1453,7 @@ WaterJetting::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
// recupero gruppo per geometria temporanea
|
||||
const string GRP_TEMP = "Temp" ;
|
||||
int nTempId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, GRP_TEMP) ;
|
||||
// se non c'è, lo aggiungo
|
||||
// se non c'è, lo aggiungo
|
||||
if ( nTempId == GDB_ID_NULL) {
|
||||
nTempId = m_pGeomDB->AddGroup( GDB_ID_NULL, m_nOwnerId, Frame3d()) ;
|
||||
if ( nTempId == GDB_ID_NULL)
|
||||
@@ -1589,7 +1589,7 @@ WaterJetting::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
m_pMchMgr->SetWarning( 3255, "Warning in WaterJetting : skipped Path too short") ;
|
||||
return true ;
|
||||
}
|
||||
// se una sola entità circonferenza completa, la divido in due per poterla allungare
|
||||
// se una sola entità circonferenza completa, la divido in due per poterla allungare
|
||||
if ( pCompo->GetCurveCount() == 1 && pCompo->IsClosed())
|
||||
pCompo->AddJoint( 0.5) ;
|
||||
// eventuali allungamenti
|
||||
@@ -1649,7 +1649,7 @@ WaterJetting::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
if ( ! pCompo->MergeCurves( 10 * EPS_SMALL, 10 * EPS_ANG_SMALL, false))
|
||||
return false ;
|
||||
|
||||
// recupero i punti di inizio e fine (per poi salvarli nelle info di CL path)
|
||||
// recupero i punti di inizio e fine ( per poi salvarli nelle info di CL path)
|
||||
Point3d ptStart ; pCompo->GetStartPoint( ptStart) ;
|
||||
Point3d ptEnd ; pCompo->GetEndPoint( ptEnd) ;
|
||||
|
||||
@@ -1682,7 +1682,7 @@ WaterJetting::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
VerifyArcs( pCompo) ;
|
||||
}
|
||||
|
||||
// se abilitato probing, verifico lunghezza entità ed eventualmente le divido
|
||||
// se abilitato probing, verifico lunghezza entità ed eventualmente le divido
|
||||
if ( m_Params.m_bProbing)
|
||||
VerifyMaxLenCurves( pCompo, m_Params.m_dProbingMaxDist) ;
|
||||
|
||||
@@ -1743,7 +1743,7 @@ WaterJetting::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
AdjustPathForInternalAngles( pCompo) ;
|
||||
|
||||
// Inserisco la lavorazione
|
||||
if ( ! AddStandardWj( pCompo, vtTool, bSplitArcs))
|
||||
if ( ! AddStandardWj( pCompo, vtTool, bSplitArcs, dAddedOverlap))
|
||||
return false ;
|
||||
}
|
||||
|
||||
@@ -2130,12 +2130,12 @@ WaterJetting::AdjustPathForInternalAngles( ICurveComposite* pCompo)
|
||||
return true ;
|
||||
// larghezza della lavorazione
|
||||
double dW = m_dElev * sin( m_Params.m_dSideAngle * DEGTORAD) ;
|
||||
// ciclo su tutte le entità
|
||||
// ciclo su tutte le entità
|
||||
int nMaxInd = pCompo->GetCurveCount() - 1 ;
|
||||
for ( int i = 0 ; i <= nMaxInd ; ++ i) {
|
||||
// curva corrente
|
||||
const ICurve* pCrvC = pCompo->GetCurve( i) ;
|
||||
// dati eventuale entità precedente
|
||||
// dati eventuale entità precedente
|
||||
const ICurve* pCrvP = nullptr ;
|
||||
bool bPrevIntAng = false ;
|
||||
double dPrevAng = 0 ;
|
||||
@@ -2153,7 +2153,7 @@ WaterJetting::AdjustPathForInternalAngles( ICurveComposite* pCompo)
|
||||
// lunghezza
|
||||
pCrvP->GetLength( dPrevLen) ;
|
||||
}
|
||||
// dati eventuale entità successiva
|
||||
// dati eventuale entità successiva
|
||||
const ICurve* pCrvN = nullptr ;
|
||||
bool bNextIntAng = false ;
|
||||
double dNextAng = 0 ;
|
||||
@@ -2171,15 +2171,15 @@ WaterJetting::AdjustPathForInternalAngles( ICurveComposite* pCompo)
|
||||
// lunghezza
|
||||
pCrvN->GetLength( dNextLen) ;
|
||||
}
|
||||
// se c'è angolo interno con la precedente
|
||||
// se c'è angolo interno con la precedente
|
||||
if ( bPrevIntAng) {
|
||||
// lunghezza entità
|
||||
// lunghezza entità
|
||||
double dLen ; pCrvC->GetLength( dLen) ;
|
||||
// verifico lunghezza minima
|
||||
double dSlowLen = dW / tan( ( 180 - abs( dPrevAng)) / 2 * DEGTORAD) ;
|
||||
double dExtraLen = dSlowLen + INTANG_ROT_LEN - dLen ;
|
||||
if ( dExtraLen > 0) {
|
||||
// se entità successiva è in tangenza e abbastanza lunga, allungo la corrente a scapito della successiva
|
||||
// se entità successiva è in tangenza e abbastanza lunga, allungo la corrente a scapito della successiva
|
||||
if ( ! bNextIntAng && dNextLen > dExtraLen) {
|
||||
double dU ; Point3d ptP ;
|
||||
if ( pCrvN->GetParamAtLength( dExtraLen, dU) &&
|
||||
@@ -2188,15 +2188,15 @@ WaterJetting::AdjustPathForInternalAngles( ICurveComposite* pCompo)
|
||||
}
|
||||
}
|
||||
}
|
||||
// se c'è angolo interno con l'entità successiva
|
||||
// se c'è angolo interno con l'entità successiva
|
||||
if ( bNextIntAng) {
|
||||
// lunghezza entità
|
||||
// lunghezza entità
|
||||
double dLen ; pCrvC->GetLength( dLen) ;
|
||||
// verifico lunghezza minima
|
||||
double dSlowLen = dW / tan( ( 180 - abs( dNextAng)) / 2 * DEGTORAD) ;
|
||||
double dExtraLen = dSlowLen + INTANG_ROT_LEN - dLen ;
|
||||
if ( dExtraLen > 0) {
|
||||
// se entità precedente è in tangenza e abbastanza lunga, allungo la corrente a scapito della precedente
|
||||
// se entità precedente è in tangenza e abbastanza lunga, allungo la corrente a scapito della precedente
|
||||
if ( ! bPrevIntAng && dPrevLen > dExtraLen) {
|
||||
double dU ; Point3d ptP ;
|
||||
if ( pCrvP->GetParamAtLength( dPrevLen - dExtraLen, dU) &&
|
||||
@@ -2212,7 +2212,7 @@ WaterJetting::AdjustPathForInternalAngles( ICurveComposite* pCompo)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTool, bool bSplitArcs)
|
||||
WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTool, bool bSplitArcs, double dAddedOverlap)
|
||||
{
|
||||
// numero punti di accelerazione/decelerazione
|
||||
const int ACC_PNT_NUM = 7 ;
|
||||
@@ -2223,22 +2223,27 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// Recupero versore estrusione
|
||||
Vector3d vtN ; pCompo->GetExtrusion( vtN) ;
|
||||
|
||||
// verifico se la curva è chiusa a meno di eventuale dAddedOverlap
|
||||
bool bClosed = ( pCompo->IsClosed() || dAddedOverlap > EPS_SMALL) ;
|
||||
|
||||
// ciclo sulle curve elementari
|
||||
int nIdxSkip = 0 ;
|
||||
int nMaxInd = pCompo->GetCurveCount() - 1 ;
|
||||
bool bStartSlowFull = false ;
|
||||
for ( int i = 0 ; i <= nMaxInd ; ++ i) {
|
||||
// curva corrente
|
||||
const ICurve* pCrvC = pCompo->GetCurve( i) ;
|
||||
// copio la curva (è già alla giusta quota)
|
||||
// copio la curva ( è già alla giusta quota)
|
||||
PtrOwner<ICurve> pCurve( pCrvC->Clone()) ;
|
||||
if ( IsNull( pCurve))
|
||||
return false ;
|
||||
double dUprev = 0 ;
|
||||
// se prima entità, approccio e affondo
|
||||
bool bSlowFull = false ; // modalità speciale per angoli interni con rallentamento uniforme su tutta l'entità
|
||||
// se prima entità, approccio e affondo
|
||||
if ( i == 0) {
|
||||
// imposto indice dei punti precedenti la partenza
|
||||
SetIndex( -1 - nIdxSkip) ;
|
||||
// dati inizio entità
|
||||
// dati inizio entità
|
||||
Point3d ptStart ; pCurve->GetStartPoint( ptStart) ;
|
||||
Vector3d vtStart ; pCurve->GetStartDir( vtStart) ;
|
||||
// determino inizio attacco
|
||||
@@ -2262,7 +2267,7 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
}
|
||||
m_ptLastProbe = ptStart ;
|
||||
}
|
||||
// altrimenti verifico con l'entità precedente
|
||||
// altrimenti verifico con l'entità precedente
|
||||
else {
|
||||
// direzione finale precedente
|
||||
const ICurve* pCrvP = pCompo->GetCurve( i - 1) ;
|
||||
@@ -2311,7 +2316,7 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
// se non è possibile suddividere anello
|
||||
// se non è possibile suddividere anello
|
||||
CalcAndSetToolCorrAuxDir( pCompo, i + 0.5) ;
|
||||
if ( AddCurveMove( pCompoArc, bSplitArcs) == GDB_ID_NULL)
|
||||
return false ;
|
||||
@@ -2329,7 +2334,7 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
}
|
||||
// se angolo esterno e richiesto rallentamento esterno, eseguo accelerazione
|
||||
else if ( IsExternalAngle( dAng) && m_Params.m_nExtCornerType == WJET_EC_SLOW) {
|
||||
// lunghezza entità
|
||||
// lunghezza entità
|
||||
double dLen ; pCrvC->GetLength( dLen) ;
|
||||
// lunghezza di accelerazione
|
||||
double dAccLen = min( m_Params.m_dCornerSlowLen, dLen / 2 - EXTRA_ACC_LEN) ;
|
||||
@@ -2352,21 +2357,45 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// se angolo interno, spezzo per interpolazione direzione utensile e se necessario aggiungo accelerazione
|
||||
else if ( IsInternalAngle( dAng)) {
|
||||
// flag di rallentamento
|
||||
bool bReduceFeed = ( m_Params.m_nIntCornerType == WJET_IC_SLOW) ;
|
||||
// lunghezza entità
|
||||
bool bReduceFeed = ( m_Params.m_nIntCornerType == WJET_IC_SLOW || m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) ;
|
||||
// lunghezza entità
|
||||
double dLen ; pCrvC->GetLength( dLen) ;
|
||||
double dFreeLen = dLen ;
|
||||
// lunghezza di accelerazione
|
||||
double dAccLen = min( dFreeLen - EXTRA_ACC_LEN, ( bReduceFeed ? m_Params.m_dCornerSlowLen : INTANG_ROT_LEN)) ;
|
||||
if ( m_Params.m_dSideAngle > 0) {
|
||||
double dW = m_dElev * sin( m_Params.m_dSideAngle * DEGTORAD) ;
|
||||
double dSlowLen = dW / tan( ( 180 - abs( dAng)) / 2 * DEGTORAD) ;
|
||||
if ( dSlowLen > dFreeLen - EXTRA_ACC_LEN) {
|
||||
m_pMchMgr->SetLastError( 3204, "Error in WaterJetting : entity too small near inside corner") ;
|
||||
return false ;
|
||||
}
|
||||
dAccLen = min( dSlowLen + m_Params.m_dCornerSlowLen, dFreeLen - EXTRA_ACC_LEN) ;
|
||||
double dAccLen = 0 ;
|
||||
if ( m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) {
|
||||
// se ultima entità
|
||||
if ( i == nMaxInd) {
|
||||
// sfrutto tutta la lunghezza a disposizione
|
||||
dAccLen = dFreeLen - EXTRA_ACC_LEN ;
|
||||
// verifico che la modalità WJET_IC_SLOW_FULL sia fattibile
|
||||
bSlowFull = ( ! bClosed || bStartSlowFull) ;
|
||||
}
|
||||
else {
|
||||
// devo verificare se anche angolo next è interno, altrimenti applico la modalità WJET_IC_SLOW
|
||||
const ICurve* pCrvN = pCompo->GetCurve( i + 1) ;
|
||||
Vector3d vtEndC ; pCurve->GetEndDir( vtEndC) ;
|
||||
Vector3d vtStartN ; pCrvN->GetStartDir( vtStartN) ;
|
||||
double dAngN ; vtEndC.GetAngleXY( vtStartN, dAngN) ;
|
||||
if ( IsInternalAngle( dAngN)) {
|
||||
bSlowFull = true ;
|
||||
dAccLen = dFreeLen / 2 ;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( ! bSlowFull) {
|
||||
dAccLen = min( dFreeLen - EXTRA_ACC_LEN, ( bReduceFeed ? m_Params.m_dCornerSlowLen : INTANG_ROT_LEN)) ;
|
||||
if ( m_Params.m_dSideAngle > 0) {
|
||||
double dW = m_dElev * sin( m_Params.m_dSideAngle * DEGTORAD) ;
|
||||
double dSlowLen = dW / tan( ( 180 - abs( dAng)) / 2 * DEGTORAD) ;
|
||||
if ( dSlowLen > dFreeLen - EXTRA_ACC_LEN) {
|
||||
m_pMchMgr->SetLastError( 3204, "Error in WaterJetting : entity too small near inside corner") ;
|
||||
return false ;
|
||||
}
|
||||
dAccLen = min( dSlowLen + m_Params.m_dCornerSlowLen, dFreeLen - EXTRA_ACC_LEN) ;
|
||||
}
|
||||
}
|
||||
|
||||
// Feed ridotta
|
||||
double dMinFeed = ( bReduceFeed ? GetActualReducedFeed() : GetActualFeed()) ;
|
||||
// Direzioni utensile nell'angolo e finale
|
||||
@@ -2392,7 +2421,7 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
}
|
||||
}
|
||||
}
|
||||
// se non è l'ultima entità, verifico con l'entità successiva
|
||||
// se non è l'ultima entità, verifico con l'entità successiva
|
||||
double dNextFeed = GetActualFeed() ;
|
||||
if ( i < nMaxInd) {
|
||||
// controlli per indice del punto di arrivo
|
||||
@@ -2408,7 +2437,7 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
double dAng ; vtEnd.GetAngleXY( vtStart, dAng) ;
|
||||
// se angolo esterno e richiesto rallentamento esterno, aggiungo decelerazione
|
||||
if ( IsExternalAngle( dAng) && m_Params.m_nExtCornerType == WJET_EC_SLOW) {
|
||||
// lunghezza entità
|
||||
// lunghezza entità
|
||||
double dLen ; pCrvC->GetLength( dLen) ;
|
||||
// lunghezza di decelerazione
|
||||
double dAccLen = min( m_Params.m_dCornerSlowLen, dLen / 2 - EXTRA_ACC_LEN) ;
|
||||
@@ -2418,6 +2447,8 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
for ( int j = 0 ; j < ACC_PNT_NUM ; ++ j) {
|
||||
double dCoeff = j / double( ACC_PNT_NUM) ;
|
||||
double dU ; pCrvC->GetParamAtLength( dLen - ( 1 - dCoeff) * dAccLen, dU) ;
|
||||
if ( abs( dUprev - dU) < EPS_SMALL)
|
||||
continue ;
|
||||
PtrOwner<ICurve> pCrvT( pCrvC->Clone()) ;
|
||||
if ( IsNull( pCrvT) || ! pCrvT->TrimStartEndAtParam( dUprev, dU))
|
||||
return false ;
|
||||
@@ -2432,32 +2463,71 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// se angolo interno, spezzo per interpolazione direzione utensile e se necessario aggiungo decelerazione
|
||||
else if ( IsInternalAngle( dAng)) {
|
||||
// flag di rallentamento
|
||||
bool bReduceFeed = ( m_Params.m_nIntCornerType == WJET_IC_SLOW) ;
|
||||
// lunghezza entità
|
||||
bool bReduceFeed = ( m_Params.m_nIntCornerType == WJET_IC_SLOW || m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) ;
|
||||
// lunghezza entità
|
||||
double dLen ; pCrvC->GetLength( dLen) ;
|
||||
double dFreeLen = dLen * ( 1 - dUprev) ;
|
||||
// lunghezza di decelerazione
|
||||
double dAccLen = min( dFreeLen - EXTRA_ACC_LEN, ( bReduceFeed ? m_Params.m_dCornerSlowLen : INTANG_ROT_LEN)) ;
|
||||
if ( m_Params.m_dSideAngle > 0) {
|
||||
double dW = m_dElev * sin( m_Params.m_dSideAngle * DEGTORAD) ;
|
||||
double dSlowLen = dW / tan( ( 180 - abs( dAng)) / 2 * DEGTORAD) ;
|
||||
if ( dSlowLen > dFreeLen - EXTRA_ACC_LEN) {
|
||||
m_pMchMgr->SetLastError( 3204, "Error in WaterJetting : entity too small near inside corner") ;
|
||||
return false ;
|
||||
}
|
||||
dAccLen = min( dSlowLen + m_Params.m_dCornerSlowLen, dFreeLen - EXTRA_ACC_LEN) ;
|
||||
// lunghezza di decelerazione
|
||||
double dAccLen = 0 ;
|
||||
|
||||
// se prima entità e modalità WJET_IC_SLOW_FULL verifico se davvero applicabile controllando angolo con ultima entità
|
||||
if ( i == 0 && m_Params.m_nIntCornerType == WJET_IC_SLOW_FULL) {
|
||||
bSlowFull = true ;
|
||||
if ( bClosed) {
|
||||
// creo una copia della curva senza l'overlap aggiunto
|
||||
PtrOwner<ICurveComposite> pCrvTmp( pCompo->Clone()) ;
|
||||
double dLen ; pCrvTmp->GetLength( dLen) ;
|
||||
if ( IsNull( pCrvTmp) || ! pCrvTmp->TrimEndAtLen( dLen - dAddedOverlap))
|
||||
return false ;
|
||||
// verifico che anche angolo sullo start della curva sia di tipo prev
|
||||
const ICurve* pCrvLast = pCrvTmp->GetLastCurve() ;
|
||||
Vector3d vtStart ; pCurve->GetStartDir( vtStart) ;
|
||||
Vector3d vtEnd ; pCrvLast->GetEndDir( vtEnd) ;
|
||||
if ( AreSameVectorApprox( vtStart, vtEnd)) {
|
||||
// se curve in tangenza controllo angolo tra l'ultima e la penultima curva
|
||||
int nCrvNbr = pCrvTmp->GetCurveCount() ;
|
||||
const ICurve* pCrvP = pCrvTmp->GetCurve( nCrvNbr - 2) ;
|
||||
pCrvLast->GetStartDir( vtStart) ;
|
||||
pCrvP->GetEndDir( vtEnd) ;
|
||||
}
|
||||
// se angolo precedente non è interno il tratto non va realizzato in modalità full
|
||||
double dAngPrev ; vtEnd.GetAngleXY( vtStart, dAngPrev) ;
|
||||
if ( ! IsInternalAngle( dAngPrev))
|
||||
bSlowFull = false ;
|
||||
}
|
||||
// salvo il valore per l'ultima entità
|
||||
bStartSlowFull = bSlowFull ;
|
||||
}
|
||||
|
||||
if ( bSlowFull)
|
||||
// sfrutto tutta la lunghezza a disposizone
|
||||
dAccLen = dFreeLen ;
|
||||
else {
|
||||
dAccLen = min( dFreeLen - EXTRA_ACC_LEN, ( bReduceFeed ? m_Params.m_dCornerSlowLen : INTANG_ROT_LEN)) ;
|
||||
if ( m_Params.m_dSideAngle > 0) {
|
||||
double dW = m_dElev * sin( m_Params.m_dSideAngle * DEGTORAD) ;
|
||||
double dSlowLen = dW / tan( ( 180 - abs( dAng)) / 2 * DEGTORAD) ;
|
||||
if ( dSlowLen > dFreeLen - EXTRA_ACC_LEN) {
|
||||
m_pMchMgr->SetLastError( 3204, "Error in WaterJetting : entity too small near inside corner") ;
|
||||
return false ;
|
||||
}
|
||||
dAccLen = min( dSlowLen + m_Params.m_dCornerSlowLen, dFreeLen - EXTRA_ACC_LEN) ;
|
||||
}
|
||||
}
|
||||
|
||||
// Feed ridotta
|
||||
double dMinFeed = ( bReduceFeed ? GetActualReducedFeed() : GetActualFeed()) ;
|
||||
// Direzioni utensile iniziale e nell'angolo
|
||||
double dUsta ; pCrvC->GetParamAtLength( dLen - dAccLen, dUsta) ;
|
||||
double dUend = 1 ;
|
||||
Vector3d vtTp = CalcToolDir( pCompo, i + dUsta) ;
|
||||
double dUend = 1 ;
|
||||
Vector3d vtTp = CalcToolDir( pCompo, i + dUsta) ;
|
||||
Vector3d vtTn = CalcToolDir( pCompo, i + dUend) ;
|
||||
// ciclo sui punti di decelerazione
|
||||
for ( int j = 0 ; j < ACC_PNT_NUM ; ++ j) {
|
||||
double dCoeff = j / double( ACC_PNT_NUM) ;
|
||||
double dU ; pCrvC->GetParamAtLength( dLen - ( 1 - dCoeff) * dAccLen, dU) ;
|
||||
if ( abs( dUprev - dU) < EPS_SMALL)
|
||||
continue ;
|
||||
PtrOwner<ICurve> pCrvT( pCrvC->Clone()) ;
|
||||
if ( IsNull( pCrvT) || ! pCrvT->TrimStartEndAtParam( dUprev, dU))
|
||||
return false ;
|
||||
@@ -2473,12 +2543,12 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
dNextFeed = dMinFeed ;
|
||||
}
|
||||
|
||||
// se successivo non è angolo esterno ad anello imposto versore correzione e ausiliario del punto di arrivo
|
||||
// se successivo non è angolo esterno ad anello imposto versore correzione e ausiliario del punto di arrivo
|
||||
if ( ! IsExternalAngle( dAng) || m_Params.m_nExtCornerType != WJET_EC_LOOP)
|
||||
CalcAndSetToolCorrAuxDir( pCompo, i + 1) ;
|
||||
}
|
||||
else {
|
||||
// se ultima entità imposto versore correzione e ausiliario del punto finale
|
||||
// se ultima entità imposto versore correzione e ausiliario del punto finale
|
||||
CalcAndSetToolCorrAuxDir( pCompo, i + 1) ;
|
||||
}
|
||||
|
||||
@@ -2507,12 +2577,15 @@ WaterJetting::AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
}
|
||||
else
|
||||
++ nIdxSkip ;
|
||||
if ( AddCurveMove( pCurve, bSplitArcs) == GDB_ID_NULL)
|
||||
PtrOwner<ICurve> pCrvT( pCrvC->Clone()) ;
|
||||
if ( IsNull( pCrvT) || ! pCrvT->TrimStartAtParam( dUprev))
|
||||
return false ;
|
||||
if ( AddCurveMove( pCrvT, bSplitArcs) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
// se ultima entità, uscita e retrazione
|
||||
// se ultima entità, uscita e retrazione
|
||||
if ( i == nMaxInd) {
|
||||
// dati fine entità
|
||||
// dati fine entità
|
||||
Point3d ptEnd ; pCurve->GetEndPoint( ptEnd) ;
|
||||
Vector3d vtEnd ; pCurve->GetEndDir( vtEnd) ;
|
||||
// aggiungo uscita
|
||||
@@ -2946,7 +3019,7 @@ WaterJetting::VerifyMaxLenCurves( ICurveComposite* pCompo, double dMaxLen)
|
||||
// verifiche sulla lunghezza delle curve
|
||||
int nMaxInd = pCompo->GetCurveCount() - 1 ;
|
||||
for ( int i = 0 ; i <= nMaxInd ; ) {
|
||||
// se lunghezza oltre il limite, la divido a metà
|
||||
// se lunghezza oltre il limite, la divido a metà
|
||||
const ICurve* pCrv = GetCurve( pCompo->GetCurve( i)) ;
|
||||
double dLen ;
|
||||
if ( pCrv != nullptr && pCrv->GetLength( dLen) && dLen > dMaxLen) {
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ class WaterJetting : public Machining
|
||||
bool AddLeadInPreview( const ICurveComposite* pCompo, ISurfFlatRegion* pSPV) ;
|
||||
bool AddLeadOutPreview( const ICurveComposite* pCompo, ISurfFlatRegion* pSPV) ;
|
||||
bool AddLoopsPreview( const ICurveComposite* pCompo, ISurfFlatRegion* pSPV) ;
|
||||
bool AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTool, bool bSplitArcs) ;
|
||||
bool AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTool, bool bSplitArcs, double dAddedOverlap) ;
|
||||
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, bool bSplit) ;
|
||||
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, bool bSplit) ;
|
||||
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
|
||||
|
||||
@@ -133,7 +133,7 @@ WaterJettingData::Clone( void) const
|
||||
bool
|
||||
WaterJettingData::CopyFrom( const MachiningData* pMdata)
|
||||
{
|
||||
// è inutile copiare se sorgente coincide con destinazione
|
||||
// è inutile copiare se sorgente coincide con destinazione
|
||||
if ( pMdata == this)
|
||||
return true ;
|
||||
// la sorgente deve essere dello stesso tipo
|
||||
@@ -242,7 +242,7 @@ WaterJettingData::SameAs( const MachiningData* pMdata) const
|
||||
int
|
||||
WaterJettingData::GetSize( void) const
|
||||
{
|
||||
// in debug verifico validità ultimo campo
|
||||
// in debug verifico validità ultimo campo
|
||||
assert( sWaterJettingKey[KEY_WS] == "WS") ;
|
||||
return KEY_ZZZ ;
|
||||
}
|
||||
@@ -486,7 +486,7 @@ WaterJettingData::VerifyExtCornerType( int nVal) const
|
||||
bool
|
||||
WaterJettingData::VerifyIntCornerType( int nVal) const
|
||||
{
|
||||
return ( nVal == WJET_IC_NONE || nVal == WJET_IC_SLOW) ;
|
||||
return ( nVal == WJET_IC_NONE || nVal == WJET_IC_SLOW || nVal == WJET_IC_SLOW_FULL) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user