From b7078cfe112b384241491124429fbd8be7063faa Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 24 Mar 2026 08:44:16 +0100 Subject: [PATCH] - in FreeContour.AddSawings corretta scelta invert/workside e inversione allungamento inizio/fine --- LuaLibs/WProcessFreeContour.lua | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 681fead..a4fed1b 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -1684,8 +1684,14 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw) end -- aggiungo geometria EgtSetMachiningGeometry( {{ Proc.Id, vFace[i].Fac}}) + -- si inverte il percorso, se necessario, per evitare che la sega a catena ruoti contro la traversa + local bToInvert = vFace[i].Norm:getX() >= 0.018 + -- allungamento e accorciamento percorso local dSal = - dSawDiam / 2 local dEal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2 + if bToInvert then + dSal, dEal = dEal, dSal + end EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) -- assegno utilizzo faccia @@ -1695,12 +1701,12 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw) -- assegno affondamento EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) -- assegno lato di lavoro e inversione direzione movimento - if vFace[i].Norm:getX() < 0.018 then - EgtSetMachiningParam( MCH_MP.INVERT, false) - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) - else + if bToInvert then EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + else + EgtSetMachiningParam( MCH_MP.INVERT, false) + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) end -- posizione braccio porta testa EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE) @@ -1732,11 +1738,17 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw) end -- aggiungo geometria EgtSetMachiningGeometry( {{ Proc.Id, vFace[i].Fac}}) + -- si inverte il percorso, se necessario, per evitare che la sega a catena ruoti contro la traversa + local bToInvert = vFace[i].Norm:getX() >= 0.018 + -- allungamento e accorciamento percorso local dSal = - dSawDiam / 2 local dEal = - dSawDiam / 2 if ( vFace[i].Type & 2) ~= 0 then dSal = vFace[i].Whisk - vFace[i].Len - dSawDiam / 2 end + if bToInvert then + dSal, dEal = dEal, dSal + end EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) -- assegno utilizzo faccia @@ -1746,12 +1758,12 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw) -- assegno affondamento EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) -- assegno lato di lavoro e inversione direzione movimento - if vFace[i].Norm:getX() < 0.018 then - EgtSetMachiningParam( MCH_MP.INVERT, false) - EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) - else + if bToInvert then EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + else + EgtSetMachiningParam( MCH_MP.INVERT, false) + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) end -- posizione braccio porta testa EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.NONE)