diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 0a9e3ae..ec1857e 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ 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