From 906272b9599a38e6a66bde17dbaac99ebaef4986 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 19 Apr 2022 20:18:13 +0200 Subject: [PATCH] =?UTF-8?q?DataWall=20:=20-=20possibilit=C3=A0=20di=20fres?= =?UTF-8?q?ature=20parziali=20su=20FreeContour=20se=20impossibili=20fresat?= =?UTF-8?q?ure=20complete=20e=20sega=20a=20catena.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/WProcessFreeContour.lua | 97 +++++++++++++++++++++++---------- 1 file changed, 68 insertions(+), 29 deletions(-) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 2083155..30e3e46 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -8,6 +8,7 @@ -- 2022/03/14 Corretto riconoscimento lato esterno per percorsi aperti. -- 2022/03/16 Ulteriore modifica per riconoscimento lato esterno (aggiunto uso vExtr a GetFacesExternalSide). -- 2022/04/03 Correzioni e modifiche per pulitura spigoli tipo 2 e 3. +-- 2022/04/19 Aggiunta passibilita' fresatura ad affondamento ridotto quando non possibile completa o sega a catena. -- Tabella per definizione modulo local WPF = {} @@ -1919,8 +1920,9 @@ local function MakeByCut( Proc, nRawId, b3Raw) local sSawing = WM.FindSawing( 'Sawing') -- recupero la lavorazione di fresatura local sMilling, dMillMaxDepth = WM.FindMilling( 'FreeContour', dMaxWidth + WD.CUT_EXTRA, nil, nil, nil, nil, true) + local sMilling2 = WM.FindMilling( 'FreeContour', nil, nil, nil, nil, nil, true) if not sMilling and ( not sSawing or bSlanting) then - sMilling = WM.FindMilling( 'FreeContour', nil, nil, nil, nil, nil, true) + sMilling = sMilling2 if not sMilling then local sErr = 'Error : milling not found in library' EgtOutLog( sErr) @@ -1928,9 +1930,73 @@ local function MakeByCut( Proc, nRawId, b3Raw) end end -- se possibile, inserimento delle fresature + local bDone = false if sMilling then local nMlOk, sMlErr, dThick = AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAddGrpId) if nMlOk == 0 then return false, sMlErr end + bDone = ( dThick ~= nil) + -- se ci sono almeno due facce e lavorato almeno un angolo + if Proc.Fct >= 2 and bDone then + -- se abilitata la lavorazione corner con stop macchina e lavorazione precedente passante e spessore sotto il limite + -- o con fresa cono piccola e spessore sotto il limite + if ( nConeCut == 1 and nMlOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL)) or + ( nConeCut == 2 and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL)) then + local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw, + sMlErr, nAddGrpId, dThick, nNewProc, 0, + true) + if not bMcok then return bMcok, sMcErr end + else + -- messaggi nel log + if nConeCut == 1 then + if nMlOk ~= 1 then + local sErr = 'Clean corner 60° not applid because Milling not thru the thickness' + EgtOutLog( sErr) + else + local sErr = 'Clean corner 60° not applid because thickness: ' .. EgtNumToString( dThick, 2) .. + ' is bigger than parameter MAX_CLEAN_CRN60: ' .. EgtNumToString( WD.MAX_CLEAN_CRN60 , 2) + EgtOutLog( sErr) + end + elseif nConeCut == 2 then + local sErr = 'Clean corner 30° not applid because thickness: ' .. EgtNumToString( dThick, 2) .. + ' is bigger than parameter MAX_CLEAN_CRN30: ' .. EgtNumToString( WD.MAX_CLEAN_CRN30 , 2) + EgtOutLog( sErr) + end + end + end + -- altrimenti provo con la sega a catena + elseif sSawing then + local nCsOk, sCSErr, dThick = AddSawings( sSawing, vFace, Proc, nRawId, b3Raw) + if nCsOk == 0 then return false, sCsErr end + bDone = ( dThick ~= nil) + -- se ci sono almeno due facce e lavorato almeno un angolo + if Proc.Fct >= 2 and bDone then + -- se abilitata la lavorazione corner con stop macchina e lavorazione precedente passante e spessore sotto il limite + if nConeCut == 1 and nCsOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL) then + local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw, + sCSErr, nAddGrpId, nil, nNewProc, 0, + true) + if not bMcok then return bMcok, sMcErr end + else + if nConeCut == 1 then + if nCsOk ~= 1 then + local sErr = 'Clean corner 60° not applied because Chainsawing not thru the thickness' + EgtOutLog( sErr) + else + local sErr = 'Clean corner 60° not applid because thickness: ' .. EgtNumToString( dThick, 2) .. + ' is bigger than parameter MAX_CLEAN_CRN60: ' .. EgtNumToString( WD.MAX_CLEAN_CRN60 , 2) + EgtOutLog( sErr) + end + elseif nConeCut == 2 then + local sErr = 'Not possible apply Clean corner 30° after use sawing' + EgtOutLog( sErr) + end + end + end + end + -- altrimenti provo con fresa ad affondamento ridotto + if not bDone then + local nMlOk, sMlErr, dThick = AddMillings( sMilling2, vFace, Proc, nRawId, b3Raw, nConeCut, nAddGrpId) + if nMlOk == 0 then return false, sMlErr end -- se ci sono almeno due facce e lavorato almeno un angolo if Proc.Fct >= 2 and dThick then -- se abilitata la lavorazione corner con stop macchina e lavorazione precedente passante e spessore sotto il limite @@ -1958,34 +2024,7 @@ local function MakeByCut( Proc, nRawId, b3Raw) EgtOutLog( sErr) end end - end - -- altrimenti provo con la sega a catena - else - local nCsOk, sCSErr, dThick = AddSawings( sSawing, vFace, Proc, nRawId, b3Raw) - if nCsOk == 0 then return false, sCsErr end - -- se ci sono almeno due facce e lavorato almeno un angolo - if Proc.Fct >= 2 and dThick then - -- se abilitata la lavorazione corner con stop macchina e lavorazione precedente passante e spessore sotto il limite - if nConeCut == 1 and nCsOk == 1 and dThick <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL) then - local bMcok, sMcErr = AddMillCorner( nConeCut, vFace, Proc, nRawId, b3Raw, - sCSErr, nAddGrpId, nil, nNewProc, 0, - true) - if not bMcok then return bMcok, sMcErr end - else - if nConeCut == 1 then - if nCsOk ~= 1 then - local sErr = 'Clean corner 60° not applied because Chainsawing not thru the thickness' - EgtOutLog( sErr) - else - local sErr = 'Clean corner 60° not applid because thickness: ' .. EgtNumToString( dThick, 2) .. - ' is bigger than parameter MAX_CLEAN_CRN60: ' .. EgtNumToString( WD.MAX_CLEAN_CRN60 , 2) - EgtOutLog( sErr) - end - elseif nConeCut == 2 then - local sErr = 'Not possible apply Clean corner 30° after use sawing' - EgtOutLog( sErr) - end - end + sWarn = 'Depth reduced to mill capabilities' end end return true, sWarn