From 604ffc6a35c20c3b2eebe7e3e77a0d32ce51929a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Fri, 1 Mar 2024 15:58:57 +0100 Subject: [PATCH 1/9] - in LapJoint migliorata ricerca pocket (VerifyPocket) --- LuaLibs/FeatureTopology.lua | 1 + LuaLibs/MachiningLib.lua | 5 +++-- LuaLibs/ProcessLapJoint.lua | 7 ++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/LuaLibs/FeatureTopology.lua b/LuaLibs/FeatureTopology.lua index da56d5c..f4ee53a 100644 --- a/LuaLibs/FeatureTopology.lua +++ b/LuaLibs/FeatureTopology.lua @@ -214,6 +214,7 @@ function FeatureTopology.Classify( Proc, b3Raw) elseif Proc.Fct == 2 and bAllAnglesConcave and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) then sFamily = 'Rabbet' bIsThrough = true + -- birdsmouth elseif Proc.Fct == 2 and bAllAnglesConcave then sFamily = 'Groove' bIsThrough = true diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index b63ce3d..89c9b1c 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -12,6 +12,7 @@ -- 2024/01/19 In FindSawing aggiunto parametro opzionale bConsiderCSimmEncumberance per considerare l'ingombro dell'asse C nel massimo materiale (default false). -- 2024/01/23 Nella GetMachinings vengono ora raccolti i parametri utensile necessari per i VerifyTool, scritti direttamente nella tabella Machining.Tool. -- Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest) se passato l'apposito parametro SortingCriterion in FindMachining. Al momento implementato solo per FindSawing. +-- 2024/03/01 In VerifyPocketing implementato l'ordinamento per dimensioni utensile. -- Tabella per definizione modulo local MachiningLib = {} @@ -490,8 +491,8 @@ function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotL end --------------------------------------------------------------------- -function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3) - return FindMachining( MCH_MY.POCKETING, sType, { MaxDiam = dMaxDiam, Depth = dDepth, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3) +function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) + return FindMachining( MCH_MY.POCKETING, sType, { MaxDiam = dMaxDiam, Depth = dDepth, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) end --------------------------------------------------------------------- diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 274f21a..79a5e62 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -97,6 +97,7 @@ -- Rimosso un caso di controllo per HCING/TCING -- 2024/02/29 In MakeMoreFaces passato b3Solid alla funzione ManageAntiSplintByMill -- 2024/02/29 In lapjoint 2 facce (TestTwoFacesDownHead) migliorata la scelta della lama da sotto. +-- 2024/03/01 Migliorata VerifyPocket. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -366,11 +367,7 @@ local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bP local sPocketing if dDepth then sPocketing = ML.FindPocketing( sMchFind, dDiam, dDepth, dMaxTotLen, bPocketUp, bPocketDown) or - ML.FindPocketing( sMchFind, dDiam, 0.8 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or - ML.FindPocketing( sMchFind, dDiam, 0.7 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or - ML.FindPocketing( sMchFind, dDiam, 0.6 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or - ML.FindPocketing( sMchFind, dDiam, 0.5 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or - ML.FindPocketing( sMchFind, dDiam, 0.4 * dDepth, dMaxTotLen, bPocketUp, bPocketDown) or + ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen, bPocketUp, bPocketDown, nil, nil, 'Longest') or ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen) else sPocketing = ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen) From eb401d269538e98cfa2294234f6e874787347270 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 4 Mar 2024 09:48:47 +0100 Subject: [PATCH 2/9] - Implementato attacco esterno se tasca 4 facce sulla coda ma nessun pezzo successivo --- LuaLibs/ProcessLapJoint.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 79a5e62..089f3d8 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -98,6 +98,7 @@ -- 2024/02/29 In MakeMoreFaces passato b3Solid alla funzione ManageAntiSplintByMill -- 2024/02/29 In lapjoint 2 facce (TestTwoFacesDownHead) migliorata la scelta della lama da sotto. -- 2024/03/01 Migliorata VerifyPocket. +-- 2024/03/04 Implementato attacco esterno se tasca 4 facce sulla coda ma nessun pezzo successivo. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -5044,7 +5045,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259) local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342) -- settaggio voluto da Alessandro/Fabio (per fare angoli con fresa piccola) - sMchFind = 'Pocket' + local sMchFind = 'Pocket' local dDiam = min( dH, dV) local bTailOnSide = ( Proc.Box:getMin():getX() - b3Solid:getMin():getX() < 0.1 and not Proc.Tail and not bAllWithEndCap) if ( Proc.Fct == 1) or (( Proc.Fct == 2 or Proc.Fct == 3) and bIsL) or ((( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 4 and not bTailOnSide)) and bSinglePart) then @@ -5536,6 +5537,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa dMachiningDepth = dFacElev + dCollSic end local bOk, sWarn2 + local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase) + -- se avevo escluso l'attacco da fuori per non rovinare il pezzo successivo, riverifico con il diametro fresa effettivo + if ( Proc.Fct == 4 and bTailOnSide) and ( dDistToNextPiece > dToolDiameter + 10 * GEO.EPS_SMALL) then + sMchFind = EgtIf( bMillDown, 'OpenPocket_H2', 'OpenPocket') + end bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm, nPhase, nRawId) if not bOk then return false, sWarn2 end if sWarn2 then From e25ad8e4a436453b12abcf5e0a962626d3ecce37 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 4 Mar 2024 12:16:57 +0100 Subject: [PATCH 3/9] BeamExec: Creata funzione calcolo dipendenze tra feature FeatureTopology : Feature senza topologia, calcolato in BeamExec --- LuaLibs/BeamExec.lua | 53 ++++++++++++++++++++++--------------- LuaLibs/FeatureTopology.lua | 8 +----- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 014b36d..0f122d1 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -57,6 +57,7 @@ -- Migliorata 'CompareFeatures' per ordine forature -- 2024/02/19 In Collect aggiunta la scrittura nella Proc di Width e Height delle facce. -- 2024/02/29 Migliorata 'CompareFeatures' per ordine forature +-- 2024/03/04 Creata funzione calcolo dipendenze tra feature con calcolo topologia. -- Tabella per definizione modulo local BeamExec = {} @@ -355,7 +356,6 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT) end end if Proc.Box and not Proc.Box:isEmpty() then - Proc.NeedTopology = NeedTopologyFeature( Proc) Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH) Proc.Tail, Proc.AdvTail = IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT) table.insert( vProc, Proc) @@ -795,11 +795,11 @@ local function OrderFeatures( vProc, b3Raw) return B1.Head end -- se entrambi di testa e intersecano stesse facce e primo è scasso a due facce e secondo è un profilo caudato, lo scasso è una riduzione e va fatto prima - if ( ( B1.Head and B2.Head) or ( B1.Tail and B2.Tail)) and ( LapJoint.Identify( B1) and B1.Fct == 2) and ( ProfCamb.Identify( B2)) then + if ( ( B1.Head and B2.Head) or ( B1.Tail and B2.Tail)) and B1.Topology == 'Rabbet' and ( ProfCamb.Identify( B2) or ProfConcave.Identify( B2) or ProfConvex.Identify( B2)) then return true end -- se entrambi di testa e intersecano stesse facce e primo è un profilo caudato e secondo è scasso a due facce, lo scasso è una riduzione e va lasciato dopo - if ( ( B1.Head and B2.Head) or ( B1.Tail and B2.Tail)) and ( LapJoint.Identify( B2) and B2.Fct == 2) and ( ProfCamb.Identify( B1)) then + if ( ( B1.Head and B2.Head) or ( B1.Tail and B2.Tail)) and B2.Topology == 'Rabbet' and ( ProfCamb.Identify( B1) or ProfConcave.Identify( B1) or ProfConvex.Identify( B1)) then return false end -- se entrambi di testa e primo è scasso o mortasa e secondo no va messo dopo @@ -821,12 +821,12 @@ local function OrderFeatures( vProc, b3Raw) 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 not B2.Head and + if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.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 not B1.Head and Drill.Identify(B2) and + if ( LapJoint.Identify(B1) or Mortise.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 @@ -1252,20 +1252,6 @@ local function ClassifyFeatures( vProc, b3Raw, Stats) return bAllOk, bSomeDown, bSomeSide, bSplitRot end -------------------------------------------------------------------------------------------------------------- -local function ClassifyTopology( vProc, nRawId) - local b3Raw = EgtGetRawPartBBox( nRawId) - local nRecognized = 0 - for i = 1, #vProc do - local Proc = vProc[i] - if Topology.Classify( Proc, b3Raw) then - nRecognized = nRecognized + 1 - end - end - - return nRecognized -end - ------------------------------------------------------------------------------------------------------------- local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT) local bOk = true @@ -1908,6 +1894,30 @@ local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeInt end end +------------------------------------------------------------------------------------------------------------- +function GetFeatureInfoAndDependency( vProc, b3Raw) + -- ciclo tutte le feature + for i = 1, #vProc do + -- calcolo topologia della feature + if NeedTopologyFeature( vProc[i]) then + Topology.Classify( vProc[i], b3Raw) + -- se non richiesto, setto 'SPECIAL' + else + vProc[i].Topology = 'SPECIAL' + vProc[i].TopologyLongName = vProc[i].Topology + end + + -- controllo la feature con tutte le altre per recuperare le dipendenze + for j = 1, #vProc do + local ProcB = vProc[j] + -- verifico se feature tipo LapJoint è attraversata da almeno un foro + if ( vProc[i].Topology == 'Pocket' or vProc[i].Topology == 'Tunnel' or vProc[i].Topology == 'Groove' or Mortise.Identify( vProc[i])) and Drill.Identify( ProcB) and Overlaps( vProc[i].Box, ProcB.Box) then + vProc[i].PassedByHole = true + end + end + end +end + ------------------------------------------------------------------------------------------------------------- function BeamExec.ProcessFeatures() if BD.IMPROVE_HEAD_TAIL_DRILLINGS == nil then @@ -1941,6 +1951,9 @@ function BeamExec.ProcessFeatures() local dCurrOvmT = EgtGetInfo( nRawId, 'TOVM', 'd') or 0 -- recupero le feature di lavorazione della trave local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT) + -- recupero informazioni ausiliarie feature e dipendenze tra feature stesse + GetFeatureInfoAndDependency( vProc, b3Raw) + -- verifica presenza forature influenzate da lavorazioni di testa o coda if BD.IMPROVE_HEAD_TAIL_DRILLINGS then vMachBeforeIntersDrillings = CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw) @@ -1950,8 +1963,6 @@ function BeamExec.ProcessFeatures() if BD.TWO_EQUAL_HEADS or BD.DOWN_HEAD then SetMirroredFeatures( vProc, b3Raw) end - -- classifico topologicamente le feature - ClassifyTopology( vProc, nRawId) -- le ordino lungo X OrderFeatures( vProc, b3Raw) -- le classifico diff --git a/LuaLibs/FeatureTopology.lua b/LuaLibs/FeatureTopology.lua index f4ee53a..5426c5d 100644 --- a/LuaLibs/FeatureTopology.lua +++ b/LuaLibs/FeatureTopology.lua @@ -5,6 +5,7 @@ -- 2023/10/16 In GetFacesParallelToPart rimossa Pocket e aggiunto Rabbet al check solo direzione principale -- 2023/11/03 In Classify ora si settano le AffectedFaces nella Proc, se non già presenti. -- Aggiunta groove 2 facce, differenziata da rabbet. +-- 2024/03/04 Feature senza topologia, calcolato in BeamExec -- Tabella per definizione modulo local FeatureTopology = {} @@ -173,13 +174,6 @@ function FeatureTopology.Classify( Proc, b3Raw) return false end - -- se non richiesto (default true, quindi nil vale true), esco - if Proc.NeedTopology == false then - Proc.Topology = 'SPECIAL' - Proc.TopologyLongName = Proc.Topology - return true - end - -- se già calcolato, esco if Proc.Topology then return true From 3aa7979be4264330dc2177dc0fc81f7ddc0a8fdf Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 5 Mar 2024 09:56:18 +0100 Subject: [PATCH 4/9] In FreeContour aggiunto smusso se lav. di svuotatura e corretto caso non passante --- LuaLibs/ProcessFreeContour.lua | 114 ++++++++++++++++++++++++++------- 1 file changed, 91 insertions(+), 23 deletions(-) diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index d03e8a0..4fbcdfe 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -9,6 +9,8 @@ -- 2023/03/03 Corretta MakeByMark ( non definiti b3Raw e b3Aux ). -- 2023/06/21 In CalcSpecialAdd modificato l'angolo minimo da 5 a 15 deg. -- 2023/07/28 In MakeByPocket aggiunta Q06 per specificare un eventuale offset radiale del contorno. +-- 2024/03/05 In MakebyPocket aggiunta lavorazione di smusso +-- In MakeByMill eliminata doppia lavorazione smusso se contorno non passante -- Tabella per definizione modulo local ProcessFreeContour = {} @@ -294,16 +296,18 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) local bCross = false if abs( vtExtr:getX()) < 0.707 then if abs( vtExtr:getY()) > abs( vtExtr:getZ()) then + -- se è passante if b3Aux:getDimY() > b3Raw:getDimY() - 1.0 then bCross = true dDepth = min( dDepth, b3Raw:getDimY() / abs( vtExtr:getY())) end if bDown then - nSide = -1 + nSide = -1 else - nSide = 1 + nSide = 1 end else + -- se è passante if b3Aux:getDimZ() > b3Raw:getDimZ() - 1.0 then bCross = true dDepth = min( dDepth, b3Raw:getDimZ() / abs( vtExtr:getZ())) @@ -373,28 +377,28 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham and Proc.Prc ~= 70 then local bDoubleCham = false local dExtra = 2 - local sChamferDown, sChamferUp - if nDouble > 1 and bCanDouble then - if nSide == 0 then - if BD.DOWN_HEAD then - -- recupero la lavorazione - local nChamferDown - nChamferDown, _, sChamferDown = VerifyChamfer( Proc, AuxId, nRawId, true, true) - if nChamferDown < 0 then + local sChamferDown, sChamferUp + if nDouble > 1 and bCanDouble then + if nSide == 0 then + if BD.DOWN_HEAD then + -- recupero la lavorazione + local nChamferDown + nChamferDown, _, sChamferDown = VerifyChamfer( Proc, AuxId, nRawId, true, true) + if nChamferDown < 0 then + sWarn = 'Warning : chamfer from bottom not found in library' + sChamferDown = nil + EgtOutLog( sWarn) + end + end + local nChamferUp + nChamferUp, _, sChamferUp = VerifyChamfer( Proc, AuxId, nRawId, true, false) + if nChamferUp < 0 then sWarn = 'Warning : chamfer from bottom not found in library' - sChamferDown = nil + sChamferUp = nil EgtOutLog( sWarn) end end - local nChamferUp - nChamferUp, _, sChamferUp = VerifyChamfer( Proc, AuxId, nRawId, true, false) - if nChamferUp < 0 then - sWarn = 'Warning : chamfer from bottom not found in library' - sChamferUp = nil - EgtOutLog( sWarn) - end end - end -- eseguo for i = 1, nStep do -- inserisco la lavorazione @@ -439,9 +443,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) end end if nSide == 0 then - bDoubleCham = EgtIf( sChamferDown and BD.DOWN_HEAD, true, false) + bDoubleCham = EgtIf( sChamferDown and BD.DOWN_HEAD, true, false) and bCanDouble else - bDoubleCham = true + bDoubleCham = bCanDouble end -- assegno affondamento e offset radiale EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra) @@ -734,8 +738,72 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero i dati della curva e del profilo local dDepth = abs( EgtCurveThickness( AuxId)) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) - --local bToolInv = ( vtExtr:getZ() < -0.1) - -- recupero la lavorazione + local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1) + local bToolInv = ( not bDownHead and vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5) + local dExtra = 2 + + -- verifico se servono gli smussi. Se lavorazione principale di svuotatura significa che è solo da un lato + -- generalmente sono lavorazioni non molto lunghe, quindi non si gestistono gli step + -- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva + local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true) + -- se devo inserire il chamfer + if nChamfer > 0 and Proc.Grp ~= 0 and dDepth > dDepthCham and Proc.Prc ~= 70 then + -- inserisco la lavorazione + local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMchId = EgtAddMachining( sNameCh, sChamfer) + if not nMchId then + local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ AuxId, -1}}) + -- se lavorazione da sopra o da sotto + if Proc.Grp == 3 then + if not bToolInv then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + else + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + end + end + if Proc.Grp == 4 then + if not bToolInv then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + else + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + end + end + -- assegno affondamento e offset radiale + EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra) + EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) + -- posizione braccio porta testa + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + if Proc.Head then + nSCC = MCH_SCC.ADIR_XP + elseif Proc.Tail then + nSCC = MCH_SCC.ADIR_XM + elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then + nSCC = MCH_SCC.ADIR_YP + elseif vtExtr:getY() > -0.01 then + nSCC = MCH_SCC.ADIR_YP + else + nSCC = MCH_SCC.ADIR_YM + end + end + EgtSetMachiningParam( MCH_MP.SCC, nSCC) + -- eseguo + if not ML.ApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchId, false) + return false, sErr + end + end + + -- recupero la lavorazione di svuotatura local sPocketing = ML.FindPocketing( 'Pocket', nil, dDepth) if not sPocketing then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' From c418f5b92ac3aea3437112ddf8d2aefc83620f22 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 5 Mar 2024 11:32:18 +0100 Subject: [PATCH 5/9] =?UTF-8?q?In=20Mortise.Make:=20Aggiunta=20possibilit?= =?UTF-8?q?=C3=A0=20di=20inserire=20lavorazione=20di=20smusso?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessMortise.lua | 92 +++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 1 deletion(-) diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index 5cfa542..05cbddd 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -15,6 +15,7 @@ -- 2023/08/10 Modificata scelta SCC per tasche in Y+/- in coda o quasi. -- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile. -- 2024/02/28 Forzata SPIRAL_IN se c'è anche un solo lato aperto +-- 2024/03/05 Aggiunta possibilità di inserire lavorazione di smusso -- Tabella per definizione modulo local ProcessMortise = {} @@ -30,6 +31,9 @@ EgtOutLog( ' ProcessMortise started', 1) local BD = require( 'BeamData') local ML = require( 'MachiningLib') +-- variabili assegnazione parametri Q +local Q_DEPTH_CHAMFER = 'Q02' -- d + --------------------------------------------------------------------- -- Riconoscimento della feature function ProcessMortise.Identify( Proc) @@ -277,7 +281,36 @@ function ProcessMortise.VerifyMortiseOrPocket( Proc, dDiam, dDepth, dMaxTotLen, return sPocketing, dMaxDepth, dToolDiam end - --------------------------------------------------------------------- +--------------------------------------------------------------------- +local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham, bDownHead) + local nChamfer = 0 + -- ingombro del grezzo + local b3Raw = EgtGetRawPartBBox( nRawId) + -- verifico che lo smusso sia richiesto + local dDepth = EgtGetInfo( Proc.Id, Q_DEPTH_CHAMFER, 'd') or 0 + if dDepth > 0 then + nChamfer = 1 + end + + -- recupero la lavorazione + local sMilling + if nChamfer > 0 then + if bDownHead then + sMilling = ML.FindMilling( 'Mark_H2', nil, nil, nil, nil, false, true) + else + sMilling = ML.FindMilling( 'Mark') + end + if not sMilling then + local sErr = 'Error : Mark not found in library' + EgtOutLog( sErr) + return -1, 0, sErr + end + end + + return nChamfer, dDepth, sMilling +end + +--------------------------------------------------------------------- -- Applicazione della lavorazione function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- ingombro del pezzo @@ -405,6 +438,63 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local bPockUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259) local bPockDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174) local bPockAngTrasm = ( BD.ANG_TRASM and vtExtr:getZ() < -0.1) + + -- recupero i dati della curva e del profilo + local dDepth = dMorH + local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1) + local bToolInv = ( not bDownHead and vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5) + local dExtra = 2 + + -- verifico se servono gli smussi. Se lavorazione principale di svuotatura significa che è solo da un lato + -- generalmente sono lavorazioni non molto lunghe, quindi non si gestistono gli step + -- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva + local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true) + -- se devo inserire il chamfer + if nChamfer > 0 and Proc.Grp ~= 0 and dDepth > dDepthCham then + -- inserisco la lavorazione + local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMchId = EgtAddMachining( sNameCh, sChamfer) + if not nMchId then + local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ AuxId, -1}}) + if not bToolInv then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + else + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + end + -- assegno affondamento e offset radiale + EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra - dMorH) + EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) + -- posizione braccio porta testa + local nSCC = MCH_SCC.NONE + if not BD.C_SIMM then + if Proc.Head then + nSCC = MCH_SCC.ADIR_XP + elseif Proc.Tail then + nSCC = MCH_SCC.ADIR_XM + elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then + nSCC = MCH_SCC.ADIR_YP + elseif vtExtr:getY() > -0.01 then + nSCC = MCH_SCC.ADIR_YP + else + nSCC = MCH_SCC.ADIR_YM + end + end + EgtSetMachiningParam( MCH_MP.SCC, nSCC) + -- eseguo + if not ML.ApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchId, false) + return false, sErr + end + end + -- recupero la lavorazione local sPockType = 'Mortise' local sMchExt = '' From 68921b5df5d1147f7b9f5c8b095682d63805a959 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 7 Mar 2024 15:08:57 +0100 Subject: [PATCH 6/9] - Implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket --- LuaLibs/BeamExec.lua | 134 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 107 insertions(+), 27 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 0f122d1..89eef6b 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -58,6 +58,7 @@ -- 2024/02/19 In Collect aggiunta la scrittura nella Proc di Width e Height delle facce. -- 2024/02/29 Migliorata 'CompareFeatures' per ordine forature -- 2024/03/04 Creata funzione calcolo dipendenze tra feature con calcolo topologia. +-- 2024/03/07 Implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket. -- Tabella per definizione modulo local BeamExec = {} @@ -347,9 +348,11 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT) if not Proc.Face then Proc.Face = {} for i = 1, Proc.Fct do - local _, dFaceWidth, dFaceHeight = BL.GetFaceHvRefDim( Proc.Id, i - 1, b3Raw) - Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT ), Width = dFaceWidth, Height = dFaceHeight} + Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT )} if Proc.Fct < 10 then + local _, dFaceWidth, dFaceHeight = BL.GetFaceHvRefDim( Proc.Id, i - 1, b3Raw) + Proc.Face[i].Width = dFaceWidth + Proc.Face[i].Height = dFaceHeight Proc.Face[i].Elevation = EgtSurfTmFacetElevationInBBox( Proc.Id, i - 1, b3Solid, true, GDB_ID.ROOT) end end @@ -1552,30 +1555,29 @@ local function CheckMirrorPocket( Proc, ProcMirror, b3Raw, AuxId) return false end end - -- devono avere il centro allineato, essere equidistanti dalla mezzaria trave e non essere troppo vicine + -- devono avere il centro allineato, essere equidistanti dalla mezzeria trave e non essere troppo vicine local vtDisplacement = ptBC - ptBCMirror local ptCenRaw = b3Raw:getCenter() - local dMinimumDistanceMirroredFeatures = 50 if AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) then local dYMinDistance = max( b3Proc:getMin():getY(), b3ProcMirror:getMin():getY()) - min( b3Proc:getMax():getY(), b3ProcMirror:getMax():getY()) - if not ( abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 500 * GEO.EPS_SMALL and + if not ( abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 500 * GEO.EPS_SMALL and ( abs( ptBC:getY() - ptCenRaw:getY()) - abs( ptBCMirror:getY() - ptCenRaw:getY())) < 500 * GEO.EPS_SMALL and - dYMinDistance > dMinimumDistanceMirroredFeatures + 10 * GEO.EPS_SMALL) then + dYMinDistance > MIRROR_POCKETS_MIN_DISTANCE + 10 * GEO.EPS_SMALL) then return false end elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then local dZMinDistance = max( b3Proc:getMin():getZ(), b3ProcMirror:getMin():getZ()) - min( b3Proc:getMax():getZ(), b3ProcMirror:getMax():getZ()) - if not ( abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getY()) < 500 * GEO.EPS_SMALL and + if not ( abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getY()) < 500 * GEO.EPS_SMALL and ( abs( ptBC:getZ() - ptCenRaw:getZ()) - abs( ptBCMirror:getZ() - ptCenRaw:getZ())) < 500 * GEO.EPS_SMALL and - dZMinDistance > dMinimumDistanceMirroredFeatures + 10 * GEO.EPS_SMALL) then + dZMinDistance > MIRROR_POCKETS_MIN_DISTANCE + 10 * GEO.EPS_SMALL) then return false end else return false end -- devono avere box con le stesse dimensioni - if not ( abs( b3DtMrt:getDimX() - b3DtMrtMirror:getDimX()) < 500 * GEO.EPS_SMALL and - abs( b3DtMrt:getDimY() - b3DtMrtMirror:getDimY()) < 500 * GEO.EPS_SMALL and + if not ( abs( b3DtMrt:getDimX() - b3DtMrtMirror:getDimX()) < 500 * GEO.EPS_SMALL and + abs( b3DtMrt:getDimY() - b3DtMrtMirror:getDimY()) < 500 * GEO.EPS_SMALL and abs( b3DtMrt:getDimZ() - b3DtMrtMirror:getDimZ()) < 500 * GEO.EPS_SMALL) then return false end @@ -1767,18 +1769,21 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw) if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then return end + -- verifico se foratura splittata oppure da specchiare + local bIsDrillingOkForMirror = abs( Proc.Flg) == 2 or ( Proc.Mirror ~= nil) + if not bIsDrillingOkForMirror then return end -- recupero direzione e dimensioni del foro local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local dDiam = 2 * EgtArcRadius( AuxId) local dLen = abs( EgtCurveThickness( AuxId)) - local dMachiningDepth = dLen / 2 + BD.DRILL_OVERLAP + local dMachiningDepth = EgtIf( abs( Proc.Flg) == 2, dLen / 2 + BD.DRILL_OVERLAP, dLen) -- recupero lavorazione adatta local sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, dMachiningDepth, true, false, true) if not sDrilling then sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, 0, true, false, true) dMachiningDepth = dMaxDepth or dMachiningDepth end - if not sDrilling or sType ~= 'Drill' or not EgtMdbSetCurrMachining( sDrilling) then + if not sDrilling or ( sType ~= 'Drill' and sType ~= 'Pocket') or not EgtMdbSetCurrMachining( sDrilling) then return end local dDrillingStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP) @@ -1786,7 +1791,8 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw) if not EgtTdbSetCurrTool( EgtMdbGetCurrMachiningParam( MCH_MP.TOOL) or '') then return end - -- recupero la lunghezza della parte inclinata della punta + -- recupero diametro utensile e lunghezza della parte inclinata della punta + local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd') local dToolTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN) -- recupero eventuale utensile in doppio, suo diametro e massima lavorazione local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's') @@ -1795,24 +1801,27 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw) end local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd') local dToolDoubleMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) + dMachiningDepth = min( dMachiningDepth, dToolDoubleMaxDepth) -- recupero la lunghezza della parte inclinata della punta local dToolDoubleTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN) + -- se foratura splittata, verifico che la distanza minima tra le due punte sia rispettata + if abs( Proc.Flg) == 2 and not ( ( ( 2 * dDrillingStep - dToolTipLength - dToolDoubleTipLength) - MIRROR_DRILLINGS_MIN_DISTANCE) > 10 * GEO.EPS_SMALL) then + return + end -- verifico se in doppio - local dMinimumDistanceMirroredFeatures = 40 - dMachiningDepth = min( dMachiningDepth, dToolDoubleMaxDepth) - if abs( Proc.Flg) == 2 and dToolDoubleDiam < dDiam + 10 * GEO.EPS_SMALL and dToolDoubleDiam > dDiam - BD.DRILL_TOL - 10 * GEO.EPS_SMALL and - (( 2 * dDrillingStep - dToolTipLength - dToolDoubleTipLength) - dMinimumDistanceMirroredFeatures) > 10 * GEO.EPS_SMALL then - if Proc.Fce ~= 0 then + if ( abs( dToolDiam - dToolDoubleDiam) < 10 * GEO.EPS_SMALL) then + if Proc.Fce ~= 0 or Proc.Mirror then if Proc.Flg == -2 then vtExtr = -vtExtr end + local ProcToDisable = EgtIf( abs( Proc.Flg) == 2, Proc, Proc.Mirror) if ( not BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Y_AX())) or ( BD.DOWN_HEAD and AreOppositeVectorApprox( vtExtr, Y_AX())) then Proc.Double = 2 Proc.MachDepthDouble = dMachiningDepth - DisableOtherDrilling( Proc, vProc) + DisableOtherDrilling( ProcToDisable, vProc) elseif BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Z_AX()) then Proc.Double = 3 Proc.MachDepthDouble = dMachiningDepth - DisableOtherDrilling( Proc, vProc) + DisableOtherDrilling( ProcToDisable, vProc) end end end @@ -1894,25 +1903,93 @@ local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeInt end end +------------------------------------------------------------------------------------------------------------- +local function AreDrillingsMirrored( Proc, ProcMirror, b3Raw) + if Proc.Id == ProcMirror.Id then return false end + + -- geometria ausiliaria foro principale + AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') + if AuxId then AuxId = AuxId + Proc.Id end + if not AuxId or EgtGetType( AuxId ) ~= GDB_TY.CRV_ARC then return false end + -- geometria ausiliaria foro specchiato + local AuxIdMirror = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i') + if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.Id end + if not AuxIdMirror or EgtGetType( AuxIdMirror ) ~= GDB_TY.CRV_ARC then return false end + -- dati del foro principale + local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) + local ptBC = EgtGP( AuxId, GDB_RT.GLOB) + -- dati del foro specchiato + local vtExtrMirror = EgtCurveExtrusion( AuxIdMirror, GDB_RT.GLOB) + local ptBCMirror = EgtGP( AuxIdMirror, GDB_RT.GLOB) + + -- direzione fori + local nDouble + if AreOppositeVectorApprox( vtExtr, vtExtrMirror) then + -- fori lungo Y + -- per macchine tipo PF il foro principale è sul lato back, per macchine tipo PF1250 è sul lato front + if ( BD.TWO_EQUAL_HEADS and AreSameVectorApprox( vtExtr, Y_AX())) or + ( BD.DOWN_HEAD and AreOppositeVectorApprox( vtExtr, Y_AX())) then + nDouble = 2 + -- fori lungo Z + elseif BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Z_AX()) then + nDouble = 3 + else + return false + end + else + return false + end + + -- centri allineati, equidistanti dalla mezzeria trave, non troppo vicini + local vtDisplacement = ptBC - ptBCMirror + local ptCenRaw = b3Raw:getCenter() + if nDouble == 2 then + local dYMinDistance = max( Proc.Box:getMin():getY(), ProcMirror.Box:getMin():getY()) - min( Proc.Box:getMax():getY(), ProcMirror.Box:getMax():getY()) + if not ( abs( vtDisplacement:getX()) < 100 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 100 * GEO.EPS_SMALL and + ( abs( ptBC:getY() - ptCenRaw:getY()) - abs( ptBCMirror:getY() - ptCenRaw:getY())) < 100 * GEO.EPS_SMALL and + dYMinDistance > MIRROR_DRILLINGS_MIN_DISTANCE + 10 * GEO.EPS_SMALL) then + return false + end + else + local dZMinDistance = max( Proc.Box:getMin():getZ(), ProcMirror.Box:getMin():getZ()) - min( Proc.Box:getMax():getZ(), ProcMirror.Box:getMax():getZ()) + if not ( abs( vtDisplacement:getX()) < 100 * GEO.EPS_SMALL and abs( vtDisplacement:getY()) < 100 * GEO.EPS_SMALL and + ( abs( ptBC:getZ() - ptCenRaw:getZ()) - abs( ptBCMirror:getZ() - ptCenRaw:getZ())) < 100 * GEO.EPS_SMALL and + dZMinDistance > MIRROR_DRILLINGS_MIN_DISTANCE + 10 * GEO.EPS_SMALL) then + return false + end + end + + return true +end + ------------------------------------------------------------------------------------------------------------- function GetFeatureInfoAndDependency( vProc, b3Raw) -- ciclo tutte le feature for i = 1, #vProc do + local Proc = vProc[i] -- calcolo topologia della feature - if NeedTopologyFeature( vProc[i]) then - Topology.Classify( vProc[i], b3Raw) + if NeedTopologyFeature( Proc) then + Topology.Classify( Proc, b3Raw) -- se non richiesto, setto 'SPECIAL' else - vProc[i].Topology = 'SPECIAL' - vProc[i].TopologyLongName = vProc[i].Topology + Proc.Topology = 'SPECIAL' + Proc.TopologyLongName = Proc.Topology end - -- controllo la feature con tutte le altre per recuperare le dipendenze for j = 1, #vProc do local ProcB = vProc[j] -- verifico se feature tipo LapJoint è attraversata da almeno un foro - if ( vProc[i].Topology == 'Pocket' or vProc[i].Topology == 'Tunnel' or vProc[i].Topology == 'Groove' or Mortise.Identify( vProc[i])) and Drill.Identify( ProcB) and Overlaps( vProc[i].Box, ProcB.Box) then - vProc[i].PassedByHole = true + if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove' or Mortise.Identify( Proc)) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then + Proc.PassedByHole = true + end + -- verifiche per specchiature + if BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS then + -- forature + if BD.DOUBLE_HEAD_DRILLING and Drill.Identify( Proc) and Drill.Identify( ProcB) and not Proc.Mirror then + if AreDrillingsMirrored( Proc, ProcB, b3Raw) then + Proc.Mirror = ProcB + end + end end end end @@ -1923,6 +2000,9 @@ function BeamExec.ProcessFeatures() if BD.IMPROVE_HEAD_TAIL_DRILLINGS == nil then BD.IMPROVE_HEAD_TAIL_DRILLINGS = true end + -- costanti per doppio + MIRROR_DRILLINGS_MIN_DISTANCE = 40 + MIRROR_POCKETS_MIN_DISTANCE = 50 -- verifica se possibile rotazione di 90 gradi BD.ROT90 = BD.ROT90 and Verify90DegRotation( EgtGetFirstRawPart()) -- ciclo sui pezzi From 06964c5a3429627c4730b927cb3be728dc1bc67e Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 7 Mar 2024 16:11:03 +0100 Subject: [PATCH 7/9] - rimossi simboli di debug da compile --- Compile.bat | 98 ++++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/Compile.bat b/Compile.bat index 3ee01dc..9e11c86 100644 --- a/Compile.bat +++ b/Compile.bat @@ -4,52 +4,52 @@ REM Per togliere info di debug aggiungere flag -s prima del nome del file di inp REM Compilazione 32 e 64 bit -\EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamExec.lua LuaLibs\BeamExec.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamLib.lua LuaLibs\BeamLib.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\DiceCut.lua LuaLibs\DiceCut.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\FaceByPocket.lua LuaLibs\FaceByPocket.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\FacesBySaw.lua LuaLibs\FacesBySaw.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\FeatureTopology.lua LuaLibs\FeatureTopology.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\MachiningLib.lua LuaLibs\MachiningLib.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessBlockHausFront.lua LuaLibs\ProcessBlockHausFront.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessChamfer.lua LuaLibs\ProcessChamfer.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessCut.lua LuaLibs\ProcessCut.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDecor.lua LuaLibs\ProcessDecor.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDoubleCut.lua LuaLibs\ProcessDoubleCut.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDovetail.lua LuaLibs\ProcessDovetail.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDrill.lua LuaLibs\ProcessDrill.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtMortise.lua LuaLibs\ProcessDtMortise.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtTenon.lua LuaLibs\ProcessDtTenon.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFreeContour.lua LuaLibs\ProcessFreeContour.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFrenchRidgeLap.lua LuaLibs\ProcessFrenchRidgeLap.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessHeadCut.lua LuaLibs\ProcessHeadCut.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLapJoint.lua LuaLibs\ProcessLapJoint.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongCut.lua LuaLibs\ProcessLongCut.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongDoubleCut.lua LuaLibs\ProcessLongDoubleCut.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMark.lua LuaLibs\ProcessMark.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMortise.lua LuaLibs\ProcessMortise.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfCamb.lua LuaLibs\ProcessProfCamb.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConcave.lua LuaLibs\ProcessProfConcave.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConvex.lua LuaLibs\ProcessProfConvex.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfFront.lua LuaLibs\ProcessProfFront.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfHead.lua LuaLibs\ProcessProfHead.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRidgeLap.lua LuaLibs\ProcessRidgeLap.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRoundArch.lua LuaLibs\ProcessRoundArch.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSawCut.lua LuaLibs\ProcessSawCut.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessScarfJoint.lua LuaLibs\ProcessScarfJoint.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSimpleScarf.lua LuaLibs\ProcessSimpleScarf.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSplit.lua LuaLibs\ProcessSplit.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJoint.lua LuaLibs\ProcessStepJoint.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJointNotch.lua LuaLibs\ProcessStepJointNotch.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTenon.lua LuaLibs\ProcessTenon.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua LuaLibs\ProcessText.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua LuaLibs\ProcessTyroleanDovetail.lua -\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessVariant.lua LuaLibs\ProcessVariant.lua -\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua BatchProcess.lua -\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua BatchProcessNew.lua -\EgtProg\Dll32\luac54 -o bin\GetBeamData.lua GetBeamData.lua -\EgtProg\Dll32\luac54 -o bin\NestProcess.lua NestProcess.lua -\EgtProg\Dll32\luac54 -o bin\Process.lua Process.lua -\EgtProg\Dll32\luac54 -o bin\Rotate.lua Rotate.lua -\EgtProg\Dll32\luac54 -o bin\Swap.lua Swap.lua -\EgtProg\Dll32\luac54 -o bin\Version.lua Version.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamExec.lua -s LuaLibs\BeamExec.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamLib.lua -s LuaLibs\BeamLib.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\DiceCut.lua -s LuaLibs\DiceCut.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\FaceByPocket.lua -s LuaLibs\FaceByPocket.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\FacesBySaw.lua -s LuaLibs\FacesBySaw.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\FeatureTopology.lua -s LuaLibs\FeatureTopology.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\MachiningLib.lua -s LuaLibs\MachiningLib.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessBlockHausFront.lua -s LuaLibs\ProcessBlockHausFront.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessChamfer.lua -s LuaLibs\ProcessChamfer.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessCut.lua -s LuaLibs\ProcessCut.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDecor.lua -s LuaLibs\ProcessDecor.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDoubleCut.lua -s LuaLibs\ProcessDoubleCut.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDovetail.lua -s LuaLibs\ProcessDovetail.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDrill.lua -s LuaLibs\ProcessDrill.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtMortise.lua -s LuaLibs\ProcessDtMortise.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtTenon.lua -s LuaLibs\ProcessDtTenon.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFreeContour.lua -s LuaLibs\ProcessFreeContour.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFrenchRidgeLap.lua -s LuaLibs\ProcessFrenchRidgeLap.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessHeadCut.lua -s LuaLibs\ProcessHeadCut.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLapJoint.lua -s LuaLibs\ProcessLapJoint.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongCut.lua -s LuaLibs\ProcessLongCut.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongDoubleCut.lua -s LuaLibs\ProcessLongDoubleCut.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMark.lua -s LuaLibs\ProcessMark.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMortise.lua -s LuaLibs\ProcessMortise.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfCamb.lua -s LuaLibs\ProcessProfCamb.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConcave.lua -s LuaLibs\ProcessProfConcave.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConvex.lua -s LuaLibs\ProcessProfConvex.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfFront.lua -s LuaLibs\ProcessProfFront.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfHead.lua -s LuaLibs\ProcessProfHead.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRidgeLap.lua -s LuaLibs\ProcessRidgeLap.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRoundArch.lua -s LuaLibs\ProcessRoundArch.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSawCut.lua -s LuaLibs\ProcessSawCut.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessScarfJoint.lua -s LuaLibs\ProcessScarfJoint.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSimpleScarf.lua -s LuaLibs\ProcessSimpleScarf.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSplit.lua -s LuaLibs\ProcessSplit.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJoint.lua -s LuaLibs\ProcessStepJoint.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJointNotch.lua -s LuaLibs\ProcessStepJointNotch.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTenon.lua -s LuaLibs\ProcessTenon.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua -s LuaLibs\ProcessText.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua -s LuaLibs\ProcessTyroleanDovetail.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessVariant.lua -s LuaLibs\ProcessVariant.lua +\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua -s BatchProcess.lua +\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua -s BatchProcessNew.lua +\EgtProg\Dll32\luac54 -o bin\GetBeamData.lua -s GetBeamData.lua +\EgtProg\Dll32\luac54 -o bin\NestProcess.lua -s NestProcess.lua +\EgtProg\Dll32\luac54 -o bin\Process.lua -s Process.lua +\EgtProg\Dll32\luac54 -o bin\Rotate.lua -s Rotate.lua +\EgtProg\Dll32\luac54 -o bin\Swap.lua -s Swap.lua +\EgtProg\Dll32\luac54 -o bin\Version.lua -s Version.lua From 0cfa1207ec339201a827d654f431510f3e25df69 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 11 Mar 2024 16:08:29 +0100 Subject: [PATCH 8/9] - In BeamExec -> CollectFeatures si scrive ora Width e Height della faccia sia trimmate con il grezzo che intere. --- LuaLibs/BeamExec.lua | 13 ++++++++++++- LuaLibs/ProcessLapJoint.lua | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 89eef6b..8676b0f 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -59,6 +59,7 @@ -- 2024/02/29 Migliorata 'CompareFeatures' per ordine forature -- 2024/03/04 Creata funzione calcolo dipendenze tra feature con calcolo topologia. -- 2024/03/07 Implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket. +-- 2024/03/11 In CollectFeatures si scrive ora Width e Height della faccia sia trimmate con il grezzo che intere. -- Tabella per definizione modulo local BeamExec = {} @@ -350,9 +351,19 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT) for i = 1, Proc.Fct do Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT )} if Proc.Fct < 10 then - local _, dFaceWidth, dFaceHeight = BL.GetFaceHvRefDim( Proc.Id, i - 1, b3Raw) + local frHV, dFaceWidthTrimmed, dFaceHeightTrimmed = BL.GetFaceHvRefDim( Proc.Id, i - 1, b3Raw) + -- frame OCS faccia + Proc.Face[i].FrameHV = frHV + -- larghezza OCS faccia trimmata con grezzo + Proc.Face[i].WidthTrimmed = dFaceWidthTrimmed + -- altezza OCS faccia trimmata con grezzo + Proc.Face[i].HeightTrimmed = dFaceHeightTrimmed + local _, dFaceWidth, dFaceHeight = BL.GetFaceHvRefDim( Proc.Id, i - 1) + -- larghezza OCS faccia Proc.Face[i].Width = dFaceWidth + -- altezza OCS faccia Proc.Face[i].Height = dFaceHeight + -- elevazione calcolata rispetto al box della parte Proc.Face[i].Elevation = EgtSurfTmFacetElevationInBBox( Proc.Id, i - 1, b3Solid, true, GDB_ID.ROOT) end end diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 089f3d8..08040d7 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5824,7 +5824,7 @@ local function TestTwoFacesDownHead( Proc) Proc.IsTopDownRabbet = abs( vtRes:getZ()) > 10 * GEO.EPS_SMALL for i = 1, Proc.Fct do Proc.Face[i].IsTooDownwardForTopBlade = Proc.Face[i].VtN:getZ() < ( BD.CUT_VZ_MIN or -0.484) - 10 * GEO.EPS_SMALL - Proc.Face[i].IsTooWideForTopBlade = Proc.Face[i].Width > dTopBladeMaxDepth + Proc.Face[i].IsTooWideForTopBlade = Proc.Face[i].WidthTrimmed > dTopBladeMaxDepth end -- serve la lama sotto se c'è almeno una faccia troppo inclinata verso il basso e non è un rabbet stretto lavorabile dal lato if not ( Proc.Face[1].IsTooDownwardForTopBlade or Proc.Face[2].IsTooDownwardForTopBlade) then From db5503f828d322de1053a3e8cc02c8dd492da53a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 12 Mar 2024 09:41:07 +0100 Subject: [PATCH 9/9] update log e version --- UpdateLog.txt | 11 +++++++++++ Version.lua | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index 24b9f23..3482c7c 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,16 @@ ==== Beam Update Log ==== +Versione 2.6c2 (12/03/2024) +- Added : in Mortase Aggiunta possibilità di inserire lavorazione di smusso +- Added : in FreeContour aggiunto smusso se lav. di svuotatura +- Added : in BeamExec creata funzione calcolo dipendenze tra feature +- Added : In BeamExec -> CollectFeatures si scrive ora Width e Height della faccia sia trimmate con il grezzo che intere +- Added : implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket +- Modif : in LapJoint migliorata ricerca pocket (VerifyPocket) +- Modif : implementato attacco esterno se tasca 4 facce sulla coda ma nessun pezzo successivo +- Modif : rimossi simboli di debug da compile +- Fixed : In FreeContour corretto caso di smusso non passante + Versione 2.6c1 (29/02/2024) - Modif : in FacesBySaw e LapJoint migliorato calcolo area non pinzabile in testa HCING e coda TCING - Modif : vari miglioramenti all'ordinamento delle lavorazioni diff --git a/Version.lua b/Version.lua index e53d7de..1bfb520 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.6c1' +VERSION = '2.6c2' MIN_EXE = '2.6a1'