diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index a35dbc2..96b45cc 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2022/06/25 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/07/03 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. -- 2021/01/24 Con sega a catena ora sempre impostato asse A. @@ -2754,7 +2754,7 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd, end end -- Eseguo i tagli - local nStep = ceil( ( dV - 10 * GEO.EPS_SMALL) / dSawThick) + local nStep = ceil( ( dV - 100 * GEO.EPS_SMALL) / dSawThick) local dStep = 0 if nStep > 1 then dStep = ( dV - dSawThick) / ( nStep - 1) @@ -2794,12 +2794,13 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFacesMaster, nBottomFace, nChamfer, nAddGrpId, b3Solid, dDepthCham, nSurfInt, bIs3Faces) - local bOrthoFaces local sWarn -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) -- ottengo la distanza tra la fine del pezzo e il pezzo successivo local dDistToNextPiece = EgtGetInfo( nRawId, 'BDST', 'd') or 5.4 + -- verifico e fessura con 3 facce o tunnel + local bOrthoFaces if bIs3Faces then -- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa local nFacInd1, dFacElev1, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId, bIs3Faces) @@ -2818,6 +2819,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, -- eventuale massima elevazione imposta dall'utente local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd') if dMaxElev and dMaxElev < 1 then dMaxElev = nil end + dElev = dMaxElev or dElev if bOrthoFaces then -- ottengo le dimensioni del tunnel @@ -2914,7 +2916,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, dSawMaxDepth = BD.MAX_DIM_HTCUT_HBEAM end -- Se entrambi gli estremi sono aperti e possibile, lavoro con la lama - if bOpenStart and bOpenEnd and bForceUseBlade and ( dMaxElev or dElev) < dSawMaxDepth + 10 * GEO.EPS_SMALL then + if bOpenStart and bOpenEnd and bForceUseBlade and dElev < dSawMaxDepth + 10 * GEO.EPS_SMALL then -- recupero altri dati dell'utensile local dSawDiam = 400 local dSawThick = 4 @@ -2933,7 +2935,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, -- Calcolo uso faccia local nFaceUse = BL.GetNearestOrthoOpposite( rfFac:getVersZ()) -- Eseguo i tagli - local nStep = ceil( ( dV - 10 * GEO.EPS_SMALL) / dSawThick) + local nStep = ceil( ( dV - 100 * GEO.EPS_SMALL) / dSawThick) local dStep = 0 if nStep > 1 then dStep = ( dV - dSawThick) / ( nStep - 1) @@ -2978,10 +2980,10 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, return false, sErr end local bGoFromHead = true - -- se la lunghezza utensile non riesce ad arrivare sul fondo assegno la possibilità di lavorare di testa o di fianco + -- se la lunghezza utensile non riesce ad arrivare sul fondo assegno la possibilità di lavorare di fianco (se possibile) if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then - -- lavora di testa se è un tunnel, lavora di fianco se non è un tunnel - bGoFromHead = not bOrthoFaces + -- continuo di testa se fessura con tre facce o non è tunnel + bGoFromHead = ( bIs3Faces or not bOrthoFaces) end -- se continuo a lavorare di testa if bGoFromHead then @@ -2990,7 +2992,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, -- Calcolo uso faccia local nFaceUse = BL.GetNearestParalOpposite( rfFac:getVersZ(), vtN) -- Verifico se necessarie più passate - local nStep = ceil( ( dV - 10 * GEO.EPS_SMALL) / dSawThick) + local nStep = ceil( ( dV - 100 * GEO.EPS_SMALL) / dSawThick) local dStep = 0 if nStep > 1 then dStep = ( dV - dSawThick) / ( nStep - 1) @@ -3081,7 +3083,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, if vtRef:getY() > 0.5 or vtRef:getZ() < -0.1 then vtRef = -vtRef end local nFaceUse = BL.GetNearestParalOpposite( vtRef, vtNL) -- Verifico se necessarie più passate - local nStep = ceil( ( dDimMin - 10 * GEO.EPS_SMALL) / dSawThick2) + local nStep = ceil( ( dDimMin - 100 * GEO.EPS_SMALL) / dSawThick2) local dStep = 0 if nStep > 1 then dStep = ( dDimMin - dSawThick2) / ( nStep - 1) @@ -3119,10 +3121,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, end -- considero estremi inizio/fine chiusi -- recupero massima elevazione da utente - if dMaxElev and dMaxElev > 10 then - local sNotes = 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';' - EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) - end + local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';' + EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) -- eseguo if not ML.ApplyMachining( true, false) then if EgtGetOutstrokeInfo() then @@ -4450,7 +4450,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa local bMakeChainSaw, sSawing, dMaxMat, dSawCornerRad, dSawThick = VerifyChainSaw( Proc, dDimMin, dDimMax) if bMakeChainSaw then -- Verifico se necessarie più passate - local nStep = ceil( ( dDimMin - 10 * GEO.EPS_SMALL) / dSawThick) + local nStep = ceil( ( dDimMin - 100 * GEO.EPS_SMALL) / dSawThick) local dStep = 0 if nStep > 1 then dStep = ( dDimMin - dSawThick) / ( nStep - 1)