From b059fe94865a820e1f4cfab45a39c6bca712b7f3 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 8 Mar 2022 11:19:52 +0100 Subject: [PATCH] EgtMachKernel 2.4b8 : - migliorata gestione direzione utensile da lavorazione faccia in parallelo. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes Operation.cpp | 29 +++++++++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index d5689997494afcfb63514663f0dee1f005de6d1f..9881ec52bd59197682ec24c5c90550ab3244a4ed 100644 GIT binary patch delta 236 zcmewt{V#gMI%aKGhCGIJh8%`WhGK>c1_cHUhESkLCPN8BDnkm89}HwAf_cT0IklxX ze_&=~X0+J+UhX2(<& nF)y2}rOv|(a;PWRX*mp)AcsxGetNextCurve() ; } - if ( dCosMax > 0) + // richiedo non pių di 85deg di deviazione + if ( dCosMax > 0.087) vtRef = vtPerpMax ; return vtRef ; } @@ -689,6 +690,9 @@ Operation::AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nF Vector3d vtN ; pCrvCompo->GetExtrusion( vtN) ; + // direzione di riferimento + Vector3d vtRef ; + // direzioni lati precedente e successivo Vector3d vtDirPrev ; Vector3d vtDirNext ; @@ -713,7 +717,7 @@ Operation::AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nF // altrimenti else { // determino la direzione di riferimento - Vector3d vtRef = GetDirInFacePerpSide( nFaceUse, vtN, pCrvCompo) ; + vtRef = GetDirInFacePerpSide( nFaceUse, vtN, pCrvCompo) ; // la curva gira in senso antiorario attorno al contorno faccia vista dalla normale uscente // elimino i segmenti che hanno la direzione di riferimento a destra o quasi (46deg o 16deg) const double COS_ANG_MAX = ( bLarge ? cos( 46.01 * DEGTORAD) : cos( 16.01 * DEGTORAD)) ; @@ -780,14 +784,19 @@ Operation::AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nF } else { // nToolDir == TOOL_PARAL o TOOL_PAR_SLANT // sistemo versore - //Point3d ptStart, ptEnd ; - //pCrvCompo->GetStartPoint( ptStart) ; - //pCrvCompo->GetEndPoint( ptEnd) ; - //Vector3d vtT = ptEnd - ptStart ; - Vector3d vtT ; pCrvCompo->GetMidDir( vtT) ; - Vector3d vtExtr = vtN ^ vtT ; - if ( ! vtExtr.Normalize()) - return false ; + Vector3d vtExtr ; + Vector3d vtTm ; pCrvCompo->GetMidDir( vtTm) ; + Vector3d vtEm = vtN ^ vtTm ; + if ( vtEm.Normalize()) + vtExtr = vtEm ; + Vector3d vtTs ; pCrvCompo->GetStartDir( vtTs) ; + Vector3d vtEs = vtN ^ vtTs ; + if ( vtEs.Normalize() && vtEs * vtRef > vtExtr * vtRef) + vtExtr = vtEs ; + Vector3d vtTe ; pCrvCompo->GetEndDir( vtTe) ; + Vector3d vtEe = vtN ^ vtTe ; + if ( vtEe.Normalize() && vtEe * vtRef > vtExtr * vtRef) + vtExtr = vtEe ; if ( nToolDir == TOOL_PAR_SLANT) { Vector3d vtDirPN = -vtDirPrev + vtDirNext ; // se le direzioni prima e dopo non sono troppo diverse tra loro (15deg) e la loro media č normalizzabile