EgtGeomKernel 2.7d2 :

- in VolZmap migliorato calcolo step per Vmill 4assi.
This commit is contained in:
Dario Sassi
2025-04-21 10:01:41 +02:00
parent 3cd6c9299f
commit c5573e438b
2 changed files with 26 additions and 4 deletions
+26 -4
View File
@@ -874,6 +874,7 @@ VolZmap::MillingStep( int nCurrTool,
bool bOk ;
if ( AreSameVectorApprox( vtDLs, vtDLe))
bOk = MillingTranslationStep( ptPLs, ptPLe, vtDLs, vtALs) ;
// altrimenti anche rotazione
else
bOk = MillingGeneralMotionStep( ptPLs, vtDLs, vtALs, ptPLe, vtDLe, vtALe) ;
@@ -886,15 +887,36 @@ VolZmap::MillingStep( int nCurrTool,
return bOk ;
}
//----------------------------------------------------------------------------
static bool
GetAlongAcrossRotation( const Vector3d& vtDir1, const Vector3d& vtDir2, const Vector3d& vtRef,
double& dAlongAngDeg, double& dAcrossAngDeg)
{
Vector3d vtAxis = vtRef ;
if ( vtAxis.Normalize()) {
bool bDet ; vtDir1.GetRotation( vtDir2, vtAxis, dAcrossAngDeg, bDet) ;
Vector3d vtDirM = GetRotate( vtDir1, vtAxis, dAcrossAngDeg) ;
vtDirM.GetAngle( vtDir2, dAlongAngDeg) ;
}
else {
vtDir1.GetAngle( vtDir2, dAlongAngDeg) ;
dAcrossAngDeg = 0 ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
VolZmap::MillingGeneralMotionStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d& vtAs,
const Point3d& ptPe, const Vector3d& vtDe, const Vector3d& vtAe)
{
// Calcolo angoli di rotazione utensile longitudinale e trasversale rispetto al movimento
double dAlongAngDeg, dAcrossAngDeg ;
GetAlongAcrossRotation( vtDs, vtDe, ptPe - ptPs, dAlongAngDeg, dAcrossAngDeg) ;
// Divido il movimento in tratti con direzione utensile costante
const double ANG_STEP = 0.04 ;
double dAngDeg ; vtDs.GetAngle( vtDe, dAngDeg) ;
int nStepCnt = int( abs( dAngDeg) / ANG_STEP) + 1 ;
const double ANG_ACROSS_STEP = 0.04 ;
const double ANG_ALONG_STEP = 1.0 ;
int nStepCnt = int( max( { abs( dAlongAngDeg) / ANG_ALONG_STEP, abs( dAcrossAngDeg) / ANG_ACROSS_STEP, 1.})) ;
bool bOk = true ;
Point3d ptSt = ptPs ;
for ( int i = 0 ; i <= nStepCnt && bOk ; ++ i) {
@@ -1168,7 +1190,7 @@ VolZmap::SelectMotion( int nGrid, const Point3d& ptLs, const Point3d& ptLe, cons
}
// ---------- VERSORE UTENSILE DERETTO COME Z --------------------------------
// ---------- VERSORE UTENSILE DIRETTO COME Z --------------------------------
// ---------- Cilindro e sfera -----------------------------------------------