EgtMachKernel :
- aggiunta gestione RB per affondamento taglio con lama.
This commit is contained in:
+33
-3
@@ -353,7 +353,8 @@ Sawing::Apply( void)
|
||||
// lavoro ogni singola catena
|
||||
int nPathId = m_pGeomDB->GetFirstGroupInGroup( nAuxId) ;
|
||||
while ( nPathId != GDB_ID_NULL) {
|
||||
PathApply( nPathId, nClId) ;
|
||||
if ( ! PathApply( nPathId, nClId))
|
||||
return false ;
|
||||
nPathId = m_pGeomDB->GetNextGroup( nPathId) ;
|
||||
}
|
||||
|
||||
@@ -765,9 +766,14 @@ Sawing::PathApply( int nPathId, int nClId)
|
||||
double dThick ;
|
||||
pCompo->GetThickness( dThick) ;
|
||||
|
||||
// recupero distanza da fondo dei grezzi interessati dal percorso
|
||||
double dRbDist ;
|
||||
if ( ! GetDistanceFromRawBottom( nCopyId, 2 * m_TParams.m_dThick, dRbDist))
|
||||
return false ;
|
||||
|
||||
// valuto l'espressione dell'affondamento
|
||||
string sExec = "TH=" + (( dThick * vtExtr.z < 0) ? ToString( fabs( dThick)) : ToString( 0)) ;
|
||||
ExeLuaExecLine( sExec) ;
|
||||
ExeLuaSetGlobNumVar( "TH", (( dThick * vtExtr.z < 0) ? fabs( dThick) : 0)) ;
|
||||
ExeLuaSetGlobNumVar( "RB", dRbDist) ;
|
||||
double dDepth ;
|
||||
if ( ! ExeLuaEvalNumExpr( m_Params.m_sDepth, &dDepth)) {
|
||||
string sOut = "Depth not computable by Sawing" ;
|
||||
@@ -1044,3 +1050,27 @@ Sawing::AdjustPositionForAxesCalc( const CamData* pCamData, Point3d& ptP)
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Sawing::GetDistanceFromRawBottom( int nPathId, double dToler, double & dRbDist)
|
||||
{
|
||||
// recupero distanza da fondo dei grezzi interessati dal percorso
|
||||
dRbDist = 0 ;
|
||||
BBox3d b3Compo ;
|
||||
if ( ! m_pGeomDB->GetGlobalBBox( nPathId, b3Compo))
|
||||
return false ;
|
||||
b3Compo.Expand( dToler, dToler, 0) ;
|
||||
int nRawId = m_pMchMgr->GetFirstRawPart() ;
|
||||
while ( nRawId != GDB_ID_NULL) {
|
||||
BBox3d b3Raw ;
|
||||
int nRawSolidId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_SOLID) ;
|
||||
if ( m_pGeomDB->GetGlobalBBox( nRawSolidId, b3Raw) && b3Compo.OverlapsXY( b3Raw)) {
|
||||
double dDist = b3Compo.GetMax().z - b3Raw.GetMin().z ;
|
||||
if ( dDist > dRbDist)
|
||||
dRbDist = dDist ;
|
||||
}
|
||||
nRawId = m_pMchMgr->GetNextRawPart( nRawId) ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ class Sawing : public Machining
|
||||
bool CalculateToolAndCorrVersors( const ICurve* pCurve, Vector3d& vtTool, Vector3d& vtCorr) ;
|
||||
bool AdjustForSide( ICurve* pCurve) ;
|
||||
bool AdjustForEdges( ICurveLine* pLine, double dElev, bool bIsFirst, bool bIsLast, bool bExtAngPC, bool bExtAngCN) ;
|
||||
bool GetDistanceFromRawBottom( int nPathId, double dToler, double& dRbDist) ;
|
||||
|
||||
private :
|
||||
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
|
||||
|
||||
Reference in New Issue
Block a user