EgtMachKernel :

- corretto errore visualizzazione Versori di oggetti CamData quando allineati
- nel calcolo angoli alzata tolleranza direzione richiesta allineata a direzione singolare a 0.001deg (tramite GetRotation con tolleranza SIN_EPS_ANG_SMALL).
This commit is contained in:
DarioS
2023-04-17 09:32:20 +02:00
parent dc3ed5ea0a
commit 8afece4a6c
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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) ;
+1 -1
View File
@@ -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 ;
+2 -2
View File
@@ -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