From 71c7833b588323a7ed6af8a5b5ee7671e5d0bd73 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 6 Feb 2018 09:29:39 +0000 Subject: [PATCH] EgtMachKernel 1.9b2 : - corretto senso rotazione archi con inversione direzione utensile. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes OperationCL.cpp | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 0a9e3ae589ece737be46eeebb27bceb4d8622a26..ec1857ee4f354564c5f88fe0396d9f1f571b685d 100644 GIT binary patch delta 97 zcmewt{V#gMFE&P_&A-`fnHh~HKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU8!BZvS1 delta 97 zcmewt{V#gMFE&QQ&A-`fnHdcyKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU3rBY*$^ diff --git a/OperationCL.cpp b/OperationCL.cpp index 97635c5..08e8bc0 100644 --- a/OperationCL.cpp +++ b/OperationCL.cpp @@ -256,14 +256,21 @@ Operation::AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen, PtrOwner pArc( CreateCurveArc()) ; if ( IsNull( pArc)) return GDB_ID_NULL ; + // verifico normale arco rispetto a versore utensile, ed eventualmente modifico opportunamente + Vector3d vtMyN = vtN ; + double dMyAngCen = dAngCen ; + if ( vtMyN * m_vtTool < - EPS_ZERO) { + vtMyN = - vtMyN ; + dMyAngCen = - dMyAngCen ; + } // assegno i dati dell'arco - double dDeltaZ = ( ptP - m_ptCurr) * vtN ; - if ( ! pArc->SetCPAN( ptCen, m_ptCurr, dAngCen, dDeltaZ, vtN)) + double dDeltaZ = ( ptP - m_ptCurr) * vtMyN ; + if ( ! pArc->SetCPAN( ptCen, m_ptCurr, dMyAngCen, dDeltaZ, vtMyN)) return GDB_ID_NULL ; Point3d ptFin ; if ( ! pArc->GetEndPoint( ptFin) || ! AreSamePointApprox( ptFin, ptP)) return GDB_ID_NULL ; - int nMove = ( dAngCen > 0 ? 3 : 2) ; + int nMove = ( dMyAngCen > 0 ? 3 : 2) ; // inserisco l'oggetto nel DB geometrico int nId = m_pGeomDB->AddGeoObj( GDB_ID_NULL, m_nPathId, Release( pArc)) ; if ( nId == GDB_ID_NULL) @@ -279,9 +286,9 @@ Operation::AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen, pCam->SetAuxDir( m_vtAux) ; pCam->SetEndPoint( ptP) ; pCam->SetCenter( ptCen) ; - pCam->SetAngCen( dAngCen) ; + pCam->SetAngCen( dMyAngCen) ; pCam->SetDeltaN( dDeltaZ) ; - pCam->SetNormDir( vtN) ; + pCam->SetNormDir( vtMyN) ; pCam->SetFeed( m_dFeed) ; pCam->SetFlag( m_nFlag) ; // associo questo oggetto a quello geometrico