diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 0d7e533..e968fca 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -1345,6 +1345,12 @@ function BeamLib.GetToolFromMachining( sMachiningName) Tool.IsCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0) Tool.Type = EgtTdbGetCurrToolParam( MCH_TP.TYPE) Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0 + Tool.HeadType = {} + Tool.PreferredSide = {} + if BD.GetSetupInfo then + Tool.HeadType = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).HeadType + Tool.PreferredSide = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).PreferredSide + end -- lama if Tool.Type == MCH_TY.SAW_STD or Tool.Type == MCH_TY.SAW_FLAT then Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or 0 diff --git a/LuaLibs/DiceCut.lua b/LuaLibs/DiceCut.lua index ce6bd85..a91a07f 100644 --- a/LuaLibs/DiceCut.lua +++ b/LuaLibs/DiceCut.lua @@ -407,7 +407,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl local dNzLimDwnUp = BL.GetNzLimDownUp( BBoxRawPart) -- se non c'è testa da sotto e normali senza componenti in Y con faccia quasi verticale e trave non alta, uso per offset i limiti dei tagli di testa e coda - if not BD.DOWN_HEAD and abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then + if not BD.TURN and not BD.DOWN_HEAD and abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then OffsetO = dOrthoMaxDim or BD.MAX_DIM_HTCUT end diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index ef952a6..2aa124b 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -373,6 +373,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp) local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp) local dLiCompLength = 0 + local dLoCompLength = 0 -- attacco tangente local dLi2Tang = 0 local dLi2Perp = 0 @@ -394,6 +395,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw end local dLenLi2 = abs( dLi2Tang) local dLenLo2 = abs( dLo2Tang) + local dBiLineaAddLength = 0 -- se il lato non lavorato della bilinea è aperto, setto entrata/uscita con la stessa direzione if bIsBiLinea then @@ -422,8 +424,9 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw local dDistPointToCenter = sqrt( dDistPtTang * dDistPtTang + dDistToCenter * dDistToCenter) -- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo uscita opportunamente if dDistPointToCenter > 0.5 * dSawDiam then + dBiLineaAddLength = dDistPointToCenter - ( 0.5 * dSawDiam) dLoTang = -dAllEnd * dCosAlpha - dLoPerp = dDist2 * dSinAlpha + dLoPerp = dDist2 * dSinAlpha end end end @@ -455,11 +458,23 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw -- dLoPerp rimane invariato end elseif BD.TURN then - bLioTang = 2 - local dMove = dist( ptP1, ptP2) dLiTang, dLiPerp = dLi2Tang, dLi2Perp - dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove) - dLoPerp = BD.COLL_SIC + -- se angolo bilinea ottuso si segue bilinea per un tratto per tagliare completamente cubetto a forma di rombo + if dCosAngleL1L2 > 0.707 and bIsBiLinea then + -- calcolo uscita per prolungare solo della parte mancante per completare il taglio + if dBiLineaAddLength > 0 then + dLoTang = dLoTang * ( dBiLineaAddLength + BD.COLL_SIC) / 100 + dLoPerp = dLoPerp * ( dBiLineaAddLength + BD.COLL_SIC) / 100 + end + -- aggiungo componente perpendicolare a percorso per ritornare dal punto di ingresso, altrimenti l'uscita viene allungata fino dall'altra parte del grezzo + dLoCompLength = 100 + -- se angolo bilinea oltre 45°, faccio movimento in retrazione + else + bLioTang = 2 + local dMove = dist( ptP1, ptP2) + dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove) + dLoPerp = BD.COLL_SIC + end else bLioTang = true dLiTang, dLiPerp, dLoTang, dLoPerp, dLiCompLength = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp, dLi2CompLength @@ -551,6 +566,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw if BD.TURN and bLioTang == 2 then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang) EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp) + EgtSetMachiningParam( MCH_MP.LOCOMPLEN, dLoCompLength) -- imposto allungamenti iniziale e finale EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 5dbde23..2da58bf 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -482,6 +482,18 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) EgtOutLog( sErr) return false, sErr end + -- eventuale inversione foro in base al lato di lavoro e al lato testa dell'utensile scelto + -- se non già richiesta inversione e foro quasi orizzontale (15deg) passante + if not bToInvert and Proc.Flg == 1 and bOpen and abs( vtExtr:getZ()) < 0.259 and abs( vtExtr:getY()) > 0.966 then + local Tool = BL.GetToolFromMachining( sDrilling) + -- lato testa e lato di lavoro devono corrispondere + if ( ( Tool.PreferredSide.bFront == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL) + or ( ( Tool.PreferredSide.bBack == true) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then + ptCen = ptCen - vtExtr * dLen + vtExtr = - vtExtr + bToInvert = true + end + end -- Determino la faccia di inizio del foro e dati correlati local nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid) -- Calcolo acciorciamento affondamento utile per evitare collisione portautensile con faccia diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index ec931bf..00c7063 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -414,7 +414,7 @@ local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bP end --------------------------------------------------------------------- -local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill) +local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill, b3Raw) -- se non feature BlockHausHalfLap e non abilitato parametro Q per lavorarlo di fianco e non macchina BH esco local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0 @@ -444,9 +444,13 @@ local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill) -- le facce devono contenere X e quelle di chiusura devono essere perpendicolari a X local bStopY, bStopZ + if not Proc.TopologyLongName then + Topology.Classify( Proc, b3Raw) + end for i = 1, Proc.Fct do local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT) - if abs( vtN:getX()) > 0.001 and abs( vtN:getX()) < 0.999962 then + -- permessa U passante non parallela agli assi principali + if abs( vtN:getX()) > 0.001 and abs( vtN:getX()) < 0.999962 and Proc.TopologyLongName ~= "Groove-Through-RightAngles-NotParallel-3" then return false end if abs( vtN:getY()) > 0.866 then bStopY = true end @@ -776,7 +780,7 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw) -- in base al tipo di feature attribuisco il significato dei parametri Q AssignQIdent( Proc) -- se può essere fatto con utensile tipo lama - local bUseBHSideMill, bHead, bHeadDir = VerifyBHSideMill( Proc) + local bUseBHSideMill, bHead, bHeadDir = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw) if bUseBHSideMill then Proc.HeadDir = bHeadDir end @@ -784,7 +788,6 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw) local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL) local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) -- verifico se è in coda - local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX() if ( dEndDist > BD.MAX_DIST_HTFEA) or bUseBHSideMill then if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then @@ -811,6 +814,10 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw) if Proc.AffectedFaces.Left and ( EgtGetInfo( Proc.Id, Q_SAW_PLUS_CHAIN, 'i') or 0) > 0 then return true end + -- se interessa la coda, e pezzo lungo, si sposta dopo separazione + if b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.AffectedFaces.Left and Proc.Fct > 2 then + return true + end -- deve avere la normale principale diretta verso la coda (oppure tunnel) Topology.Classify( Proc, b3Raw) local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId) @@ -836,7 +843,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw) -- se 2 facce elseif Proc.Fct == 2 then -- se può essere fatto con utensile tipo lama - local bUseBHSideMill = VerifyBHSideMill( Proc) + local bUseBHSideMill = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw) if bUseBHSideMill then return true, false end @@ -916,7 +923,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw) local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) -- se può essere fatto con utensile tipo lama - local bUseBHSideMill, _, _, _, _, dTDiam = VerifyBHSideMill( Proc) + local bUseBHSideMill, _, _, _, _, dTDiam = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw) if bUseBHSideMill then if vtN:getZ() > -0.5 or b3Raw:getDimZ() - Proc.Box:getDimZ() < ( BD.MAX_DIST_BH_FROM_BOTTOM or 395) - dTDiam / 2 then return true, false @@ -5946,7 +5953,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa local bIsRabbetAlongXTowardsBottom = ( Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and Proc.AffectedFaces.Bottom and Proc.AffectedFaces.Left and Proc.AffectedFaces.Right) local bForceSideMill = ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and ( bIsRabbetAlongXTowardsBottom or ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( ( Proc.Fct == 4 and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back)) or Proc.Fct == 3 or Proc.Fct == 2))) -- se fattibile con fresa BH di fianco e spessore utensile inferiore alla larghezza faccia - local bMakeBySideMill, bHead, bHeadDir, sMilling, dMaxMat, dToolDiam = VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill) + local bMakeBySideMill, bHead, bHeadDir, sMilling, dMaxMat, dToolDiam = VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill, b3Raw) if bPrevBhSideMill == nil then bPrevBhSideMill = bMakeBySideMill end @@ -6001,6 +6008,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa EgtSetMachiningParam( MCH_MP.LITANG, 0) EgtSetMachiningParam( MCH_MP.LIPERP, dFacElev + BD.CUT_SIC) EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI) + local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, EgtIf( nFacInd == 0, 1, 0), GDB_ID.ROOT) + if vtN2 then + local AddLen = sqrt( dV^2 * ( ( 1 / abs( vtN2:getX())^2) - 1)) + BD.CUT_SIC + EgtSetMachiningParam( MCH_MP.STARTADDLEN, AddLen) + EgtSetMachiningParam( MCH_MP.ENDADDLEN, AddLen) + end else EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0) EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + BD.CUT_SIC) @@ -7483,7 +7496,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- determino l'angolo tra le facce local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT) -- se con BH - if VerifyBHSideMill( Proc) then + if VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw) then return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, true) -- se ortogonali e non forzata lama, con fresa elseif not bUseBlade then diff --git a/UpdateLog.txt b/UpdateLog.txt index 4f18239..54d26d0 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,11 @@ ==== Beam Update Log ==== +Versione 2.7b3 (03/03/2025) +- Modif : in forature passanti orizzontali fatte da un solo lato, si inverte il lato di lavoro in base all'utensile scelto +- Modif : in LapJoint in lavorazione tipo BH permessa U passante non parallela agli assi principali; attacchi migliorati +- Modif : in LapJoint le feature di coda con pezzo lungo vengono spostate sempre dopo separazione +- Fixed : in macchine tipo Turn piccoli miglioramenti ai tagli di lama + Versione 2.7b2 (05/02/2025) - Modif : si consentono DrillPocket in doppio solo se foro non passante @@ -7,7 +13,9 @@ Versione 2.7b1 (04/02/2025) - Modif : in tagli di testa e coda l'utilizzo delle lame grandi (es: 1000 su 15003TMAX) è limitato ai pezzi più bassi di 300 mm e più larghi di 300 mm Versione 2.7a2 (23/01/2025) +- Added : in RidgeLap aggiunta Q05 per usare la fresa tipo LapJoint - Fixed : in BatchProcess (Ts7) piccola correzione +- Fixed : in ScarfJoint, in caso di taglio dal lato, aggiunta estensione oltre il bordo Versione 2.7a1 (21/01/2025) - Added : in FreeContour aggiunta Q09 per inversione ultima lavorazione diff --git a/Version.lua b/Version.lua index 19849bf..dc5a3f6 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.7b2' +VERSION = '2.7b3' MIN_EXE = '2.6e5'