diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index ef3aa14..5a642e9 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -310,9 +310,12 @@ end local function IsTailFeature( Proc, b3Raw, dCurrOvmH) -- feature sempre di testa o coda per il gruppo (se non troppo lunga) if Proc.Grp == 1 or Proc.Grp == 2 then - -- se pezzo corto (quindi a caduta) e in coda, provo a cambiare tipo - if BD.ADVANCE_TAIL_CUT and Proc.Prc == 10 and b3Raw:getDimX() < BD.LEN_SHORT_PART and Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH then - return false, true + -- se abilitato avanzamento lavorazione feature di coda e pezzo corto (quindi a caduta) e feature in coda + if BD.ADVANCE_TAIL_CUT and b3Raw:getDimX() < BD.LEN_SHORT_PART and Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH then + -- se taglio, lo avanzo + if Proc.Prc == 10 then + return false, true + end end -- standard return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH and Proc.Box:getDimX() < BD.MAX_LEN_HTFEA) @@ -320,6 +323,30 @@ local function IsTailFeature( Proc, b3Raw, dCurrOvmH) -- feature sempre di testa o coda nonostante il gruppo if ( Proc.Grp == 3 or Proc.Grp == 4) and ( Proc.Prc == 38 or Proc.Prc == 51 or Proc.Prc == 56 or Proc.Prc == 100 or Proc.Prc == 101 or Proc.Prc == 102 or Proc.Prc == 103 or Proc.Prc == 106) then + -- se abilitato avanzamento lavorazione feature di coda e pezzo corto (quindi a caduta) e feature in coda + if BD.ADVANCE_TAIL_CUT and b3Raw:getDimX() < BD.LEN_SHORT_PART and Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH then + -- se profilo front solo con smusso, lo avanzo + if Proc.Prc == 100 and ProfFront.OnlyChamfer( Proc) then + return false, true + end + -- se profilo concavo solo con smusso, lo avanzo + if Proc.Prc == 101 and ProfConcave.OnlyChamfer( Proc) then + return false, true + end + -- se profilo convesso solo con smusso, lo avanzo + if Proc.Prc == 102 and ProfConvex.OnlyChamfer( Proc) then + return false, true + end + -- se profilo caudato solo con smusso, lo avanzo + if Proc.Prc == 103 and ProfCamb.OnlyChamfer( Proc) then + return false, true + end + -- se profilo head solo con smusso, lo avanzo + if Proc.Prc == 106 and ProfHead.OnlyChamfer( Proc) then + return false, true + end + end + -- standard return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH) end -- gestioni speciali diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index bcdfc97..2a03fb9 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -1,4 +1,4 @@ --- ProcessCut.lua by Egaltech s.r.l. 2022/01/26 +-- ProcessCut.lua by Egaltech s.r.l. 2022/02/02 -- Gestione calcolo singoli tagli di lama per Travi -- 2021/05/18 I due tagli con testa da sotto di un cubetto sono fatti di seguito. -- 2021/06/06 Correzioni per tagli con testa da sotto. @@ -6,6 +6,7 @@ -- 2021/09/19 Tagli da sotto non sbiechi favorita posizione da sopra di testa. -- 2021/10/06 Piccola correzione a tagli di cubetti con testa da sotto. -- 2022/01/26 Taglio da sotto orizzontale deve avere direzione di riferimento ortogonale -Z. +-- 2022/02/02 Modifiche per tagli di coda spostati avanti come lavorazione su pezzi a caduta. -- Tabella per definizione modulo local ProcessCut = {} @@ -237,7 +238,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b if not BD.C_SIMM and abs( vtN:getX()) < 0.5 then dNzLimDwnUp = -0.707 end local bDownCut = ( vtN:getZ() <= dNzLimDwnUp) if bFromBottom == nil then - bFromBottom = ( vtN:getZ() > 0.25 and ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtN:getX() < 0)) + bFromBottom = ( vtN:getZ() > 0.25 and b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and vtN:getX() < 0) end -- verifico se da considerare taglio lungo ( non da sotto, inclinato non più di 30deg, largo come la trave e abbastanza lungo) local bLongCut = ( not bDownCut and vtN:getZ() > 0.865 and @@ -317,7 +318,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b -- verifico se necessari tagli supplementari EgtOutLog( string.format( 'MaxDepth=%.1f MaxVertDepth=%.1f CutH=%.1f CutV=%.1f', dMaxDepth, dMaxVertDepth, dCutH, dCutV), 3) local vCuts = {} - if not Proc.AdvTail and dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC then + if not Proc.AdvTail and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then local ptExtra, vtExtra local bAutoCalcSurf = true if bFillAreaPiece or bFillTail then @@ -455,9 +456,10 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b local vtOrthoO if bFromBottom and dCutV < dMaxVertDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then vtOrthoO = -Z_AX() - elseif bHorizCut and ( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or vtN:getX() > 0) then + elseif bHorizCut and ( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or vtN:getX() > 0) then vtOrthoO = Z_AX() - elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and abs( vtN:getY()) > 0.259 and vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then + elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and + vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then if Proc.Head then vtOrthoO = X_AX() else @@ -479,7 +481,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b local dCutExtra = BD.CUT_EXTRA if Proc.AdvTail then dVzLimDwnUp = 0 - dCutExtra = -10 + dCutExtra = -BD.ADVANCE_TAIL_OFFS end local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) if not bOk then @@ -526,11 +528,11 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead) local dMaxVertDepth = dMaxDepth -- determino la direzione di taglio preferenziale local _, dCutH, dCutV = BL.GetFaceHvRefDim( Proc.Id, 0) - local bHorizCut = ( dCutV < dMaxVertDepth - BD.CUT_EXTRA) + local bHorizCut = ( dCutV < dMaxVertDepth - BD.CUT_EXTRA) or Proc.AdvTail -- verifico se necessari tagli supplementari EgtOutLog( string.format( 'MaxDepth=%.1f MaxVertDepth=%.1f CutH=%.1f CutV=%.1f', dMaxDepth, dMaxVertDepth, dCutH, dCutV), 3) local vCuts = {} - if not Proc.AdvTail and dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC then + if not Proc.AdvTail and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then local ptExtra, vtExtra local bAutoCalcSurf = true if bFillAreaPiece or bFillTail then @@ -643,9 +645,9 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead) else -- lavoro la faccia local vtOrthoO - if bHorizCut and ( b3Solid:getDimX() > BD.LEN_SHORT_PART or vtN:getX() > 0) then + if bHorizCut and ( b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or vtN:getX() > 0) then vtOrthoO = -Z_AX() - elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and abs( vtN:getY()) > 0.259 and vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then + elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then if Proc.Head then vtOrthoO = X_AX() else @@ -673,7 +675,7 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead) -- taglio (limite Vz Down Up messo a -2 per non farlo mai intervenire) local dCutExtra = BD.CUT_EXTRA if Proc.AdvTail then - dCutExtra = -10 + dCutExtra = min( -BD.ADVANCE_TAIL_OFFS, dMaxVertDepth - dCutV) end local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, -2, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) if not bOk then diff --git a/LuaLibs/ProcessProfCamb.lua b/LuaLibs/ProcessProfCamb.lua index 9f17dbe..a894ebd 100644 --- a/LuaLibs/ProcessProfCamb.lua +++ b/LuaLibs/ProcessProfCamb.lua @@ -1,10 +1,11 @@ --- ProcessProfCamb.lua by Egaltech s.r.l. 2022/01/26 +-- ProcessProfCamb.lua by Egaltech s.r.l. 2022/02/02 -- Gestione calcolo profilo caudato per Travi -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. -- 2021/10/12 Estesa gestione di testa da sotto, se presente. -- 2021/10/12 Portato a 30deg l'angolo limite per fare l'antischeggia. -- 2022/01/26 Migliorato controllo lavorazione con fresa su testa da sotto. +-- 2022/02/02 Aggiunta funzione OnlyChamfer. -- Tabella per definizione modulo local ProcessProfCamb = {} @@ -62,6 +63,12 @@ function ProcessProfCamb.Classify( Proc, b3Raw) end end +--------------------------------------------------------------------- +-- Verifico se richiesto il solo smusso +function ProcessProfCamb.OnlyChamfer( Proc) + return (( EgtGetInfo( Proc.Id, sDepthChamferMill, 'd') or 0) > 0.1 and EgtGetInfo( Proc.Id, sPreemptiveChamfer, 'i') == 1) +end + --------------------------------------------------------------------- local function GetSawCutData( AuxId, vtNF) -- comincio con la normale a 45deg @@ -140,12 +147,12 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly local b3Raw = EgtGetRawPartBBox( nRawId) -- verifico che lo smusso sia richiesto local dDepth = EgtGetInfo( Proc.Id, sDephtCham, 'd') or 0 - if dDepth > 0 then + if dDepth > 0.1 then nChamfer = 1 end -- verifico se posso fare solo lo smusso if EgtGetInfo( Proc.Id, sOnlyCham, 'i') == 1 then - if dDepth > 0 then + if nChamfer == 1 then nChamfer = nChamfer + 1 -- altrimenti se non ho l'affondamento esco else diff --git a/LuaLibs/ProcessProfConcave.lua b/LuaLibs/ProcessProfConcave.lua index f8f5f89..d8fd375 100644 --- a/LuaLibs/ProcessProfConcave.lua +++ b/LuaLibs/ProcessProfConcave.lua @@ -1,7 +1,8 @@ --- ProcessProfConcave.lua by Egaltech s.r.l. 2021/06/28 +-- ProcessProfConcave.lua by Egaltech s.r.l. 2022/02/02 -- Gestione calcolo profilo concavo per Travi -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. +-- 2022/02/02 Aggiunta funzione OnlyChamfer. -- Tabella per definizione modulo local ProcessProfConcave = {} @@ -55,6 +56,12 @@ function ProcessProfConcave.Classify( Proc, b3Raw) end end +--------------------------------------------------------------------- +-- Verifico se richiesto il solo smusso +function ProcessProfConcave.OnlyChamfer( Proc) + return (( EgtGetInfo( Proc.Id, sDepthChamferMill, 'd') or 0) > 0.1 and EgtGetInfo( Proc.Id, sPreemptiveChamfer, 'i') == 1) +end + --------------------------------------------------------------------- local function GetSawCutData( AuxId, vtN) -- comincio con la normale a 45deg @@ -127,12 +134,12 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly local b3Raw = EgtGetRawPartBBox( nRawId) -- verifico che lo smusso sia richiesto local dDepth = EgtGetInfo( Proc.Id, sDephtCham, 'd') or 0 - if dDepth > 0 then + if dDepth > 0.1 then nChamfer = 1 end -- verifico se posso fare solo lo smusso if EgtGetInfo( Proc.Id, sOnlyCham, 'i') == 1 then - if dDepth > 0 then + if nChamfer == 1 then nChamfer = nChamfer + 1 -- altrimenti se non ho l'affondamento esco else diff --git a/LuaLibs/ProcessProfConvex.lua b/LuaLibs/ProcessProfConvex.lua index 00492e7..7664e1c 100644 --- a/LuaLibs/ProcessProfConvex.lua +++ b/LuaLibs/ProcessProfConvex.lua @@ -1,7 +1,8 @@ --- ProcessProfConvex.lua by Egaltech s.r.l. 2021/06/28 +-- ProcessProfConvex.lua by Egaltech s.r.l. 2022/02/02 -- Gestione calcolo profilo convesso per Travi -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. +-- 2022/02/02 Aggiunta funzione OnlyChamfer. -- Tabella per definizione modulo local ProcessProfConvex = {} @@ -55,6 +56,12 @@ function ProcessProfConvex.Classify( Proc, b3Raw) end end +--------------------------------------------------------------------- +-- Verifico se richiesto il solo smusso +function ProcessProfConvex.OnlyChamfer( Proc) + return (( EgtGetInfo( Proc.Id, sDepthChamferMill, 'd') or 0) > 0.1 and EgtGetInfo( Proc.Id, sPreemptiveChamfer, 'i') == 1) +end + --------------------------------------------------------------------- local function GetSawCutData( AuxId, vtN) -- comincio con la normale a 45deg @@ -127,12 +134,12 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly local b3Raw = EgtGetRawPartBBox( nRawId) -- verifico che lo smusso sia richiesto local dDepth = EgtGetInfo( Proc.Id, sDephtCham, 'd') or 0 - if dDepth > 0 then + if dDepth > 0.1 then nChamfer = 1 end -- verifico se posso fare solo lo smusso if EgtGetInfo( Proc.Id, sOnlyCham, 'i') == 1 then - if dDepth > 0 then + if nChamfer == 1 then nChamfer = nChamfer + 1 -- altrimenti se non ho l'affondamento esco else diff --git a/LuaLibs/ProcessProfFront.lua b/LuaLibs/ProcessProfFront.lua index 156ea0a..93cc78c 100644 --- a/LuaLibs/ProcessProfFront.lua +++ b/LuaLibs/ProcessProfFront.lua @@ -1,7 +1,8 @@ --- ProcessProfFront.lua by Egaltech s.r.l. 2021/06/28 +-- ProcessProfFront.lua by Egaltech s.r.l. 2022/02/02 -- Gestione calcolo profilo frontale per Travi -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. +-- 2022/02/02 Aggiunta funzione OnlyChamfer. -- Tabella per definizione modulo local ProcessProfFront = {} @@ -55,6 +56,12 @@ function ProcessProfFront.Classify( Proc, b3Raw) end end +--------------------------------------------------------------------- +-- Verifico se richiesto il solo smusso +function ProcessProfFront.OnlyChamfer( Proc) + return (( EgtGetInfo( Proc.Id, sDepthChamferMill, 'd') or 0) > 0.1 and EgtGetInfo( Proc.Id, sPreemptiveChamfer, 'i') == 1) +end + --------------------------------------------------------------------- local function GetSawCutData( AuxId, vtN) local vtNP = Vector3d( vtN) @@ -99,12 +106,12 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly local b3Raw = EgtGetRawPartBBox( nRawId) -- verifico che lo smusso sia richiesto local dDepth = EgtGetInfo( Proc.Id, sDephtCham, 'd') or 0 - if dDepth > 0 then + if dDepth > 0.1 then nChamfer = 1 end -- verifico se posso fare solo lo smusso if EgtGetInfo( Proc.Id, sOnlyCham, 'i') == 1 then - if dDepth > 0 then + if nChamfer == 1 then nChamfer = nChamfer + 1 -- altrimenti se non ho l'affondamento esco else diff --git a/LuaLibs/ProcessProfHead.lua b/LuaLibs/ProcessProfHead.lua index 3adc3ac..4f841b0 100644 --- a/LuaLibs/ProcessProfHead.lua +++ b/LuaLibs/ProcessProfHead.lua @@ -1,8 +1,9 @@ --- ProcessProfHead.lua by Egaltech s.r.l. 2021/10/12 +-- ProcessProfHead.lua by Egaltech s.r.l. 2022/02/02 -- Gestione calcolo profilo di testa per Travi -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa sotto. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. -- 2021/10/12 Estesa gestione di testa da sotto, se presente. +-- 2022/02/02 Aggiunta funzione OnlyChamfer. -- Tabella per definizione modulo local ProcessProfHead = {} @@ -56,6 +57,12 @@ function ProcessProfHead.Classify( Proc, b3Raw) end end +--------------------------------------------------------------------- +-- Verifico se richiesto il solo smusso +function ProcessProfHead.OnlyChamfer( Proc) + return (( EgtGetInfo( Proc.Id, sDepthChamferMill, 'd') or 0) > 0.1 and EgtGetInfo( Proc.Id, sPreemptiveChamfer, 'i') == 1) +end + --------------------------------------------------------------------- local function GetSawCutData( AuxId, vtN) -- assegno la normale @@ -120,12 +127,12 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly local b3Raw = EgtGetRawPartBBox( nRawId) -- verifico che lo smusso sia richiesto local dDepth = EgtGetInfo( Proc.Id, sDephtCham, 'd') or 0 - if dDepth > 0 then + if dDepth > 0.1 then nChamfer = 1 end -- verifico se posso fare solo lo smusso if EgtGetInfo( Proc.Id, sOnlyCham, 'i') == 1 then - if dDepth > 0 then + if nChamfer == 1 then nChamfer = nChamfer + 1 -- altrimenti se non ho l'affondamento esco else