diff --git a/VolZmapVolume.cpp b/VolZmapVolume.cpp index fd78d24..cd8f7d8 100644 --- a/VolZmapVolume.cpp +++ b/VolZmapVolume.cpp @@ -914,6 +914,8 @@ VolZmap::MillingGeneralMotionStep( const Point3d& ptPs, const Vector3d& vtDs, co double dAlongAngDeg, dAcrossAngDeg ; GetAlongAcrossRotation( vtDs, vtDe, ptPe - ptPs, dAlongAngDeg, dAcrossAngDeg) ; // Divido il movimento in tratti con direzione utensile costante + // !!! Per errori riscontrati si eliminano i movimenti e si lasciano solo le posizioni utensile !!! + // !!! In attesa dell'algoritmo esatto !!! 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.})) ; @@ -932,7 +934,14 @@ VolZmap::MillingGeneralMotionStep( const Point3d& ptPs, const Vector3d& vtDs, co Point3d ptEn = Media( ptPs, ptPe, dPosCoeff) ; Vector3d vtD = Media( vtDs, vtDe, dDirCoeff) ; vtD.Normalize() ; Vector3d vtA = Media( vtAs, vtAe, dDirCoeff) ; vtA.Normalize() ; - bOk = bOk && MillingTranslationStep( ptSt, ptEn, vtD, vtA) ; + if ( i == 0) + bOk = bOk && MillingTranslationStep( ptSt, ptSt, vtD, vtA) ; + else if ( i < nStepCnt) { + Point3d ptMid = Media( ptSt, ptEn) ; + bOk = bOk && MillingTranslationStep( ptMid, ptMid, vtD, vtA) ; + } + else + bOk = bOk && MillingTranslationStep( ptEn, ptEn, vtD, vtA) ; // aggiorno prossimo inizio ptSt = ptEn ; }