EgtMachKernel 2.4i3 :

- in lavorazione WaterJet aggiunta gestione ponticelli.
This commit is contained in:
DarioS
2022-09-20 07:50:41 +02:00
parent b5d15e4a11
commit dffc7ec956
4 changed files with 110 additions and 0 deletions
BIN
View File
Binary file not shown.
+2
View File
@@ -31,6 +31,8 @@ const std::string MACH_FIXT_GROUP = "Fixt" ;
const std::string MACH_SETUP_GROUP = "Setup" ;
// Gruppo dei grezzi in una macchinata
const std::string MACH_RAW_GROUP = "Raws" ;
// Gruppo dei collegamenti per waterjet in una macchinata
const std::string MACH_BRIDGES_GROUP = "Bridges" ;
// Gruppo delle operazioni in una macchinata
const std::string MACH_OPER_GROUP = "Opers" ;
// Chiave per info fase di appartenenza di una fixture
+107
View File
@@ -1177,6 +1177,11 @@ WaterJetting::Chain( int nGrpDestId)
vInds.emplace_back( Id) ;
}
}
// verifico se sono necessarie sistemazioni per collegamenti (bridges)
if ( abs( m_Params.m_dSideAngle) < EPS_ANG_SMALL &&
m_pGeomDB->GetFirstNameInGroup( m_pMchMgr->GetCurrMachGroup(), MACH_BRIDGES_GROUP) != GDB_ID_NULL) {
AdjustCurvesForBridges( vpCrvs, vInds) ;
}
// preparo i dati per il concatenamento
bool bFirst = true ;
Point3d ptNear = ORIG ;
@@ -1263,6 +1268,108 @@ WaterJetting::Chain( int nGrpDestId)
return true ;
}
//----------------------------------------------------------------------------
bool
WaterJetting::AdjustCurvesForBridges( ICURVEPOVECTOR& vpCrvs, SELVECTOR& vInds)
{
// Gruppo dei collegamenti
struct Bridge {
int nId ;
int nEnt1 ;
int nEnt2 ;
double dWidth ;
Point3d ptP1 ;
Point3d ptP2 ;
Bridge( int nI, int nE1, int nE2, double dW, const Point3d& ptQ1, const Point3d& ptQ2)
: nId( nI), nEnt1( nE1), nEnt2( nE2), dWidth( dW), ptP1( ptQ1), ptP2( ptQ2) {}
} ;
vector<Bridge> vBridges ;
int nBridGrpId = m_pGeomDB->GetFirstNameInGroup( m_pMchMgr->GetCurrMachGroup(), MACH_BRIDGES_GROUP) ;
int nBridgeId = m_pGeomDB->GetFirstInGroup( nBridGrpId) ;
while ( nBridgeId != GDB_ID_NULL) {
int nEnt1, nEnt2 ;
double dWidth ;
Point3d ptP1, ptP2 ;
if ( m_pGeomDB->GetInfo( nBridgeId, "EntStart", nEnt1) &&
m_pGeomDB->GetInfo( nBridgeId, "EntEnd", nEnt2) &&
m_pGeomDB->GetInfo( nBridgeId, "BridgeW", dWidth) &&
ExeStartPoint( nBridgeId, GDB_ID_ROOT, ptP1) &&
ExeEndPoint( nBridgeId, GDB_ID_ROOT, ptP2)) {
vBridges.emplace_back( nBridgeId, nEnt1, nEnt2, dWidth, ptP1, ptP2) ;
}
nBridgeId = m_pGeomDB->GetNext( nBridgeId) ;
}
// Verifico i collegamenti che interessano le geometrie della lavorazione
for ( int i = 0 ; i < int( vBridges.size()) ; ++ i) {
// cerco le due curve interessate dal collegamento
int nI1 = -1 ;
for ( int j = 0 ; j < int( vInds.size()) ; ++ j) {
if ( vInds[j].nId == vBridges[i].nEnt1) {
nI1 = j ;
break ;
}
}
int nI2 = -1 ;
for ( int j = 0 ; j < int( vInds.size()) ; ++ j) {
if ( vInds[j].nId == vBridges[i].nEnt2) {
nI2 = j ;
break ;
}
}
if ( nI1 == -1 || nI2 == -1)
continue ;
// calcolo e verifico la posizione dei punti di collegamento sulle due curve
double const DIST_MAX = 5 ;
double dDist1, dU1, dLenP1, dLen1 ; int nF1 ;
DistPointCurve distPC1( vBridges[i].ptP1, *vpCrvs[nI1]) ;
if ( ! distPC1.GetDist( dDist1) || dDist1 > DIST_MAX ||
! distPC1.GetParamAtMinDistPoint( 0, dU1, nF1) ||
! vpCrvs[nI1]->GetLengthAtParam( dU1, dLenP1) ||
! vpCrvs[nI1]->GetLength( dLen1) ||
dLenP1 < vBridges[i].dWidth + m_TParams.m_dDiam ||
( dLen1 - dLenP1) < vBridges[i].dWidth + m_TParams.m_dDiam)
continue ;
double dDist2, dU2, dLenP2, dLen2 ; int nF2 ;
DistPointCurve distPC2( vBridges[i].ptP2, *vpCrvs[nI2]) ;
if ( ! distPC2.GetDist( dDist2) || dDist2 > DIST_MAX ||
! distPC2.GetParamAtMinDistPoint( 0, dU2, nF2) ||
! vpCrvs[nI2]->GetLengthAtParam( dU2, dLenP2) ||
! vpCrvs[nI2]->GetLength( dLen2) ||
dLenP2 < vBridges[i].dWidth + m_TParams.m_dDiam ||
( dLen2 - dLenP2) < vBridges[i].dWidth + m_TParams.m_dDiam)
continue ;
// spezzo le curve nei punti del collegamento e creo i segmenti di collegamento
PtrOwner<ICurve> pCopy1( vpCrvs[nI1]->Clone()) ;
PtrOwner<ICurve> pCopy2( vpCrvs[nI2]->Clone()) ;
PtrOwner<ICurveLine> pLinkA( CreateCurveLine()) ;
PtrOwner<ICurveLine> pLinkB( CreateCurveLine()) ;
if ( IsNull( pCopy1) || IsNull( pCopy2) || IsNull( pLinkA) || IsNull( pLinkB))
continue ;
vpCrvs[nI1]->TrimEndAtLen( dLenP1 - vBridges[i].dWidth / 2) ;
pCopy1->TrimStartAtLen( dLenP1 + vBridges[i].dWidth / 2) ;
vpCrvs[nI2]->TrimEndAtLen( dLenP2 - vBridges[i].dWidth / 2) ;
pCopy2->TrimStartAtLen( dLenP2 + vBridges[i].dWidth / 2) ;
Point3d ptAs ; vpCrvs[nI1]->GetEndPoint( ptAs) ;
Point3d ptAe ; pCopy2->GetStartPoint( ptAe) ;
pLinkA->Set( ptAs, ptAe) ;
Point3d ptBs ; vpCrvs[nI2]->GetEndPoint( ptBs) ;
Point3d ptBe ; pCopy1->GetStartPoint( ptBe) ;
pLinkB->Set( ptBs, ptBe) ;
// inserisco le nuove curve nel vettore delle curve e aggiorno il vettore degli indici
vpCrvs.emplace_back( Release( pCopy1)) ;
vInds.emplace_back( vInds[nI1]) ;
vpCrvs.emplace_back( Release( pCopy2)) ;
vInds.emplace_back( vInds[nI2]) ;
vpCrvs.emplace_back( Release( pLinkA)) ;
vInds.emplace_back( 0, 0) ;
vpCrvs.emplace_back( Release( pLinkB)) ;
vInds.emplace_back( 0, 0) ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
WaterJetting::VerifySideAngle( void)
+1
View File
@@ -72,6 +72,7 @@ class WaterJetting : public Machining
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
bool GetCurves( SelData Id, ICURVEPLIST& lstPC) ;
bool Chain( int nGrpDestId) ;
bool AdjustCurvesForBridges( ICURVEPOVECTOR& vpCrvs, SELVECTOR& vInds) ;
bool VerifySideAngle( void) ;
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool AdjustPathForInternalAngles( ICurveComposite* pCompo) ;