diff --git a/CamData.cpp b/CamData.cpp index 61a2754..a2d284e 100644 --- a/CamData.cpp +++ b/CamData.cpp @@ -349,7 +349,7 @@ CamData::GetDrawPolyLines( POLYLINELIST& lstPL) const PL.AddUPoint( 1, ptTip) ; // aggiungo simil-freccia Frame3d frF ; - if ( m_vtTool. IsSmall()) + if ( m_vtTool. IsSmall() || AreSameOrOppositeVectorApprox( m_vtTool, m_vtCorr)) frF.Set( ptTip, m_vtCorr) ; else frF.Set( ptTip, m_vtCorr, m_vtTool) ; @@ -378,7 +378,7 @@ CamData::GetDrawPolyLines( POLYLINELIST& lstPL) const PL.AddUPoint( 1, ptTip) ; // aggiungo simil-freccia Frame3d frF ; - if ( m_vtTool. IsSmall()) + if ( m_vtTool. IsSmall() || AreSameOrOppositeVectorApprox( m_vtTool, m_vtAux)) frF.Set( ptTip, m_vtAux) ; else frF.Set( ptTip, m_vtAux, m_vtTool) ; diff --git a/GeoCalc.cpp b/GeoCalc.cpp index 6ca4d62..2f0aa47 100644 --- a/GeoCalc.cpp +++ b/GeoCalc.cpp @@ -82,7 +82,7 @@ GetRotationComponent( const Vector3d& vtDir1, double dComp, const Vector3d& vtDi double dDenom = dT0uv * dSinG ; double dNumer = dComp - dT0w * dCosG ; // due angoli possibili - if ( abs( dDenom) > abs( dNumer)) { + if ( abs( dDenom) > abs( dNumer) + SIN_EPS_ANG_ZERO) { double dDeltaAngRad = acos( dNumer / dDenom) ; dAng1Deg = ( dOffsAngRad + dDeltaAngRad) * RADTODEG ; dAng2Deg = ( dOffsAngRad - dDeltaAngRad) * RADTODEG ; diff --git a/MachineCalc.cpp b/MachineCalc.cpp index 13369ce..ff32903 100644 --- a/MachineCalc.cpp +++ b/MachineCalc.cpp @@ -1009,7 +1009,7 @@ Machine::GetMyAngles( const Vector3d& vtDirT, const Vector3d& vtDirA, // calcolo primo angolo di rotazione per seconda soluzione bool bDet2 = true ; if ( nStat == 2) { - if ( ! vtDirH2.GetRotation( vtDirTn, vtAx1, dAngA2, bDet2) ) + if ( ! vtDirH2.GetRotation( vtDirTn, vtAx1, SIN_EPS_ANG_SMALL, dAngA2, bDet2)) nStat = 1 ; else { // se indeterminato, provo a determinarlo con la direzione ausiliaria @@ -1032,7 +1032,7 @@ Machine::GetMyAngles( const Vector3d& vtDirT, const Vector3d& vtDirA, // calcolo primo angolo di rotazione per prima soluzione bool bDet1 = true ; if ( nStat >= 1) { - if ( ! vtDirH1.GetRotation( vtDirTn, vtAx1, dAngA1, bDet1) ) + if ( ! vtDirH1.GetRotation( vtDirTn, vtAx1, SIN_EPS_ANG_SMALL, dAngA1, bDet1)) nStat = 0 ; else { // se indeterminato, provo a determinarlo con la direzione ausiliaria