diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 09300ba..89c159f 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -835,13 +835,13 @@ local function OrderFeatures( vProc, b3Raw) if B2.AdvTail and ( not Split.Identify( B1) or not B1.Tail) then return true end - -- se primo è foro e secondo è un ribasso, il foro va sempre prima a meno che il ribasso non sia di testa - if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2)) and B2.PassedByHole and + -- se primo è foro e secondo è un ribasso o tenone, il foro va sempre prima a meno che il ribasso non sia di testa + if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2) or Tenon.Identify(B2)) and B2.PassedByHole and B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then return true end - -- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo a meno che il ribasso non sia di testa - if ( LapJoint.Identify(B1) or Mortise.Identify(B1))and B1.PassedByHole and Drill.Identify(B2) and + -- se primo è un ribasso e secondo è un foro o tenone, il ribasso va sempre dopo a meno che il ribasso non sia di testa + if ( LapJoint.Identify(B1) or Mortise.Identify(B1) or Tenon.Identify(B1)) and B1.PassedByHole and Drill.Identify(B2) and B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then return false end @@ -1221,7 +1221,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats) bOk, bDown, bSide = ProfHead.Classify( Proc, b3Raw) -- se contorno libero elseif FreeContour.Identify( Proc) then - bOk, bDown, bSide = FreeContour.Classify( Proc, b3Raw) + bOk, bDown, bSide, bDownSideOnHeadOk = FreeContour.Classify( Proc, b3Raw) -- se decorazione elseif Decor.Identify( Proc) then bOk, bDown = Decor.Classify( Proc) @@ -1231,7 +1231,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats) end -- assegno risultato if bOk then - -- non ammessa feature di testa da lavorare ribaltata o ruotata + -- non ammessa feature di testa da lavorare ribaltata o ruotata (lettura laser) if Proc.Head and ( bDown or bSide) and not bDownSideOnHeadOk then Proc.Flg = 0 Proc.Down = true @@ -2034,6 +2034,10 @@ function GetFeatureInfoAndDependency( vProc, b3Raw) if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove') and DtMortise.SideIdentify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then Proc.PassedByDtMortise = true end + -- se tenone è attraversato da foro allora il foro deve essere fatto prima + if Tenon.Identify( Proc) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then + Proc.PassedByHole = true + end -- se tenone di coda è attraversato da foro allora anche il foro deve essere di coda if Tenon.Identify( Proc) and Proc.Tail and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then ProcB.Tail = true @@ -2111,6 +2115,17 @@ function BeamExec.ProcessFeatures() PrintFeatures( vProc, b3Raw) end EgtOutLog( ' *** AddMachinings ***', 1) + -- scrivo nel RawPart se ci sono feature lavorate con trave ruotata a 90 o 180 deg + if bSomeSide then + EgtSetInfo( nRawId, 'ROTATE90', 1) + else + EgtSetInfo( nRawId, 'ROTATE90', 0) + end + if bSomeDown then + EgtSetInfo( nRawId, 'ROTATE180', 1) + else + EgtSetInfo( nRawId, 'ROTATE180', 0) + end -- verifico se comunque necessario taglio di testa local bNeedHCut = VerifyNeedForHeadCut( vProc, bSomeDown, bSomeSide) -- inserisco corrispondenze di tagli coincidenti con mortase normali o a coda di rondine di testa diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index 4fbcdfe..87d91bd 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -31,6 +31,8 @@ local Q_DEPTH_CHAMFER = 'Q02' -- d local Q_OVERMAT_FOR_FINISH = 'Q03' -- d local Q_ONLY_CHAMFER = 'Q00' -- i local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket +local Q_IGNORE_LASER_PROBLEMS = 'Q07' +local Q_FORCE_CLAMPABLE_AREA = 'Q08' --------------------------------------------------------------------- -- Riconoscimento della feature @@ -99,6 +101,8 @@ end function ProcessFreeContour.Classify( Proc, b3Raw) -- verifico se di tipo pocket local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1) + -- verifico se forzata esecuzione anche se di testa e ribaltata o ruotata (lettura laser) + local bDownSideOnHeadOk = ( EgtGetInfo( Proc.Id, Q_IGNORE_LASER_PROBLEMS, 'd') or 0) == 1 -- recupero la curva associata local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if not AuxId then return false end @@ -107,23 +111,23 @@ function ProcessFreeContour.Classify( Proc, b3Raw) -- se tasca if bPocket then local bDown = ( vtN:getZ() < - 0.5) - return true, bDown, false + return true, bDown, false, bDownSideOnHeadOk -- se altrimenti profilo orizzontale elseif abs( vtN:getZ()) < 0.5 then - return true, false, false + return true, false, false, bDownSideOnHeadOk -- se altrimenti profilo verticale che non interessa tutta la sezione elseif Proc.Box:getDimZ() < 0.9 * b3Raw:getDimZ() then local bDown = ( vtN:getZ() < - 0.5) - return true, bDown, false + return true, bDown, false, bDownSideOnHeadOk -- altrimenti è profilo verticale che interessa tutta la sezione else -- recupero la massima capacità di lavoro dell'utensile da utilizzare local sMilling, dMaxDepth = ML.FindMilling( 'FreeContour') if not sMilling then dMaxDepth = 0 end if Proc.Box:getDimZ() > dMaxDepth and BD.ROT90 then - return true, false, true + return true, false, true, bDownSideOnHeadOk else - return true, false, false + return true, false, false, bDownSideOnHeadOk end end end @@ -713,7 +717,13 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) -- eventuale segnalazione ingombro di testa o coda local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ()) local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ()) - if Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ then + local bRawPartHas90Rotation = ( ( EgtGetInfo( nRawId, 'ROTATE90', 'd') or 0) == 1) + -- eventuale forzatura area feature pinzabile + local bForceClampableArea = ( ( EgtGetInfo( Proc.Id, Q_FORCE_CLAMPABLE_AREA, 'd') or 0) == 1) + -- se la feature è passante top/down oppure se è passante e si ruota di 90deg considero sempre non pinzabile; in alternativa si valuta in base all'ingombro + if not bForceClampableArea and ( ( Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ) or + ( Proc.AffectedFaces.Top and Proc.AffectedFaces.Bottom and ( AreSameOrOppositeVectorApprox( vtExtr, Z_AX()))) or + ( Proc.AffectedFaces.Front and Proc.AffectedFaces.Back and bRawPartHas90Rotation)) then if Proc.Head then local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() BL.UpdateHCING( nRawId, dOffs) @@ -722,6 +732,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) BL.UpdateTCING( nRawId, dOffs) end end + return true, sWarn end