From a61b27f29288af33391510145bdb6ac7ecde3ad1 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 4 Nov 2025 09:05:13 +0100 Subject: [PATCH 01/11] =?UTF-8?q?-=20Aggiunta=20tolleranza=20nel=20calcolo?= =?UTF-8?q?=20tipo=20di=20taglio=20-=20In=20BeamLib,=20la=20funzione=20Get?= =?UTF-8?q?FaceHvRefDim=20non=20tiene=20pi=C3=B9=20in=20considerazione=20i?= =?UTF-8?q?l=20limite=20del=20grezzo,=20ma=20sempre=20il=20rettangolo=20mi?= =?UTF-8?q?nimo=20che=20racchiude=20la=20faccia.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/BeamLib.lua | 22 ++++++++++++---------- LuaLibs/ProcessCut.lua | 4 +++- LuaLibs/ProcessSplit.lua | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 25e85e1..ee66572 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -698,17 +698,19 @@ function BeamLib.GetFaceHvRefDim( nSurfId, nFacet, b3Raw) local b3HV = EgtSurfTmGetFacetBBoxRef( nSurfId, nFacet, GDB_BB.STANDARD, frHV) local dDimH = b3HV:getDimX() local dDimV = b3HV:getDimY() + + -- Si mantiene rettangolo minimo perchè in alcuni casi andava in collisione. Lascio il calcolo in caso si debba ripristinare. -- se definito grezzo (o solido), applico eventuali limiti - if b3Raw then - local dCoeffY = abs( frHV:getVersX():getY()) - if dCoeffY > GEO.EPS_SMALL then - dDimH = min( dDimH, b3Raw:getDimY() / dCoeffY) - end - local dCoeffZ = abs( frHV:getVersY():getZ()) - if dCoeffZ > GEO.EPS_SMALL then - dDimV = min( dDimV, b3Raw:getDimZ() / dCoeffZ) - end - end + -- if b3Raw then + -- local dCoeffY = abs( frHV:getVersX():getY()) + -- if dCoeffY > GEO.EPS_SMALL then + -- dDimH = min( dDimH, b3Raw:getDimY() / dCoeffY) + -- end + -- local dCoeffZ = abs( frHV:getVersY():getZ()) + -- if dCoeffZ > GEO.EPS_SMALL then + -- dDimV = min( dDimV, b3Raw:getDimZ() / dCoeffZ) + -- end + -- end -- restituisco i valori calcolati return frHV, dDimH, dDimV end diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 1777de0..1cb7a62 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -379,7 +379,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b local vCuts = {} local dDicingOffsetP local dDicingOffsetO - if ( ( not Proc.AdvTail) or bForceDicing) 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) or bForceDicing) and + ( dCutH - 100 * GEO.EPS_SMALL > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or + dCutV - 100 * GEO.EPS_SMALL > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then local ptExtra, vtExtra local bAutoCalcSurf = true if Proc.AdvTail then diff --git a/LuaLibs/ProcessSplit.lua b/LuaLibs/ProcessSplit.lua index d50cbca..8f68f7b 100644 --- a/LuaLibs/ProcessSplit.lua +++ b/LuaLibs/ProcessSplit.lua @@ -662,7 +662,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt local dMinTailScrapForAdditionalCuts = 10.123 local bNeedVerticalAddedCuts = not bSplit and ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) local bNeedHorizontalAddedCuts = not bSplit and not bBigSectionCut and - ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and + ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE) + 100 * GEO.EPS_SMALL) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) and dOffsL < BD.MAX_DIM_DICE -- dati lavorazioni sopra e sotto From e5265021778e3b845a7a7c7fb3986a6e53712312 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 4 Nov 2025 15:28:09 +0100 Subject: [PATCH 02/11] In LapJoint, se applicazione svuotatura non andata a buon fine e si prova ad allargare tasca, allora si cambia anche il tipo in SPIRALIN --- LuaLibs/ProcessLapJoint.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 9b4c6f1..5a3f28c 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -3565,6 +3565,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin if not ML.ApplyMachining( true, false) then -- provo ad allargare leggermente la tasca EgtSetMachiningParam( MCH_MP.OFFSR, -0.1) + -- se percorso a Zig-Zag, provo a cambiarlo in spirale + local nPocketSubType = EgtGetMachiningParam( MCH_MP.SUBTYPE) + if nPocketSubType == MCH_POCK_SUB.ZIGZAG then + EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN) + end if not ML.ApplyMachining( true, false) then local _, sErr = EgtGetLastMachMgrError() EgtSetOperationMode( nMchFId, false) From 0d5dd4d348654ea8aa7b203fecb9ffcdd3dd927a Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Thu, 6 Nov 2025 08:38:34 +0100 Subject: [PATCH 03/11] Aggiunta gestione Q14 per settare lavorazione discorde in caso di MillAsBlade --- LuaLibs/ProcessLapJoint.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 5a3f28c..b35d75c 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -146,7 +146,7 @@ local Q_MAX_ELEVATION = '' -- d local Q_SAW_PLUS_CHAIN = '' -- i local Q_FORCE_CHAINSAW = '' -- i local Q_CHAINSAW_FROM_SIDE = '' -- i - +local Q_MILL_AS_BLADE_CONVENTIONAL = '' -- i -- variabile smussi local bMadeChamfer @@ -195,11 +195,13 @@ local function AssignQIdent( Proc) Q_FORCE_CHAINSAW = 'Q12' -- TODO da riportare a Q13 quando è sistemata la gestione del movimento in macchina nell'attacco laterale Q_CHAINSAW_FROM_SIDE = 'Q999' + Q_MILL_AS_BLADE_CONVENTIONAL = '' if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then Q_FORCE_BLADE = 'Q01' -- i Q_DEPTH_CHAMFER = 'Q04' -- d Q_ONLY_CHAMFER = 'Q05' -- i + Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17 then Q_DEPTH_CHAMFER = 'Q01' -- d Q_ONLY_CHAMFER = 'Q02' -- i @@ -220,6 +222,7 @@ local function AssignQIdent( Proc) Q_BLADE_ON_ALONG_FACE = 'Q04' -- i Q_ANTISPLINT_TYPE = 'Q06' -- i Q_DEPTH_CHAMFER = 'Q07' -- d + Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i elseif ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 30 then Q_BLADE_ON_ALONG_FACE = 'Q04' -- i elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then @@ -228,19 +231,23 @@ local function AssignQIdent( Proc) Q_ANTISPLINT_TYPE = 'Q06' -- i elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33 then Q_ANTISPLINT_TYPE = 'Q06' -- i + Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then Q_CONTOUR_SMALL_TOOL = 'Q01' -- i Q_USE_MILL = 'Q02' -- i Q_ANTISPLINT_TYPE = 'Q06' -- i elseif ( Proc.Grp == 4) and Proc.Prc == 37 then Q_ANTISPLINT_TYPE = 'Q06' -- i + Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i elseif ( Proc.Grp == 4) and Proc.Prc == 39 then Q_CONTOUR_SMALL_TOOL = 'Q01' -- i Q_USE_MILL = 'Q02' -- i Q_ANTISPLINT_TYPE = 'Q06' -- i + Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90 then Q_ANTISPLINT_TYPE = 'Q03' -- i Q_SIDE_ROUGH_TOOL = 'Q04' -- i + Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i end -- le altre features gestite non hanno parametri Q end @@ -2856,7 +2863,10 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd, for i = 1, nStep do local dOffs = ( i - 1) * dStep if vtN:getZ() < dVzLimDwnUp then dOffs = dOffs + dSawThick end - local bOk, sErr, nMchId = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, 0, BD.CUT_SIC, dOffs, dStartDist, dEndDist, nil, b3Raw) + -- forzatura lavorazione discorde in base a parametro Q su feature + local nQ14Param = EgtGetInfo( Proc.Id, Q_MILL_AS_BLADE_CONVENTIONAL, 'd') or 0 + local bForceInvert = nQ14Param == 1 or ( nQ14Param == 2 and vtN:getX() < 0.1) + local bOk, sErr, nMchId = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, 0, BD.CUT_SIC, dOffs, dStartDist, dEndDist, nil, b3Raw, bForceInvert) if not bOk then return bOk, sErr end -- setto l'elevazione local sNotes = 'MaxElev=' .. EgtNumToString( 0, 1) .. ';' From fef5db604683c940bb0e3298446a0fb82cda6928 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Fri, 7 Nov 2025 10:02:16 +0100 Subject: [PATCH 04/11] =?UTF-8?q?In=20SplitCut=20e=20HeadCut=20aggiunti=20?= =?UTF-8?q?smussi=20con=20possibilit=C3=A0=20di=20raccordare=20o=20smussar?= =?UTF-8?q?e=20spigoli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessHeadCut.lua | 109 +++++++++++++++++++++++++++++++ LuaLibs/ProcessSplit.lua | 130 +++++++++++++++++++++++++++++++++++++ 2 files changed, 239 insertions(+) diff --git a/LuaLibs/ProcessHeadCut.lua b/LuaLibs/ProcessHeadCut.lua index 85ac1f5..d38e615 100644 --- a/LuaLibs/ProcessHeadCut.lua +++ b/LuaLibs/ProcessHeadCut.lua @@ -159,6 +159,105 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead) return true, nil end +--------------------------------------------------------------------- +-- smussi in testa +local function MakeHeadChamfer( idProc, nPartId) + local dDepthHeadChamfer = EgtGetInfo( idProc, 'Q08', 'd') or 0 + -- se non attivo esco subito + if dDepthHeadChamfer < 100 * GEO.EPS_SMALL then + return + end + + -- recupero gruppo per geometria aggiuntiva + local AddGrpId = BL.GetAddGroup( nPartId) + if not AddGrpId then + local sErr = 'Error on process StartFace impossible to find AddGroup' + EgtOutLog( sErr) + return false, sErr + end + + -- recupero la lavorazione + local sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error : milling not found in library' + EgtOutLog( sErr) + return false, sErr + end + + local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( idProc, 0, AddGrpId) + if not nLoopId or nLoopCnt > 1 then + local sErr = 'Error MakeHeadChamfer : too many loops' + EgtOutLog( sErr) + return false, sErr + end + + -- setto direzione estrusione corretta + EgtModifyCurveExtrusion( nLoopId, X_AX()) + EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.RIGHT)) + + local dQ09Value = EgtGetInfo( idProc, 'Q09', 'd') + local bChamferedEdge = dQ09Value > 0 + + local nIdFirstEntity, nEntityCnt = EgtExplodeCurveCompo( nLoopId) + local p3MidPoint = EgtMP( nIdFirstEntity, GDB_ID.GRID) + + for i = 0, nEntityCnt - 1 do + if EgtCurveLength( nIdFirstEntity + i) - 10 < abs( dQ09Value) * 2 then + local sErr = 'Error MakeHeadChamfer : Q09 too high' + EgtOutLog( sErr) + return false, sErr + end + end + + -- creo raccordo o fillet + for i = 0, nEntityCnt - 1 do + local idFirst = nIdFirstEntity + i + local idSecond = EgtIf( i == nEntityCnt - 1, nIdFirstEntity, idFirst + 1) + local ptEndPointFirst = EgtEP( idFirst, GDB_ID.GRID) - ( abs( dQ09Value) * EgtEV( idFirst, GDB_ID.GRID)) + local ptStartPointSecond = EgtSP( idSecond, GDB_ID.GRID) + ( abs( dQ09Value) * EgtEV( idSecond, GDB_ID.GRID)) + + if bChamferedEdge then + EgtCurveChamfer( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID) + else + EgtCurveFillet( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID) + end + end + + EgtSelectPathObjs( nIdFirstEntity, true) + local idGeom, idGeomCnt = EgtCurveCompoByChain( AddGrpId, GDB_ID.SEL, {0,0,0}, true) + if not idGeom or idGeomCnt > 1 then + local sErr = 'Error MakeHeadChamfer : too many loops' + EgtOutLog( sErr) + return false, sErr + end + EgtChangeClosedCurveStartPoint( idGeom, p3MidPoint, GDB_RT.GRID) + + -- Inserisco la lavorazione del lato standard + local dExtra = 2 + local sName1 = 'HeadCham_' .. ( EgtGetName( idProc) or tostring( idProc)) + local nMch1Id = EgtAddMachining( sName1, sMilling) + if not nMch1Id then + local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ idGeom, -1}}) + -- assegno affondamento e offset radiale + EgtSetMachiningParam( MCH_MP.DEPTH, dDepthHeadChamfer + dExtra) + EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) + -- assegno lato di lavoro + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + -- eseguo + if not ML.ApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMch1Id, false) + return false, sErr + end + + return true, nil +end + --------------------------------------------------------------------- -- tagli verticali aggiuntivi local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, dOffsetBetweenCuts) @@ -533,6 +632,16 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, HeadCutType, Cutting1Data, Cutting2Data, nil, dOvmHead) + + -- alla fine del taglio si aggiungono gli smussi in testa + local _, sErrHeadChamfer = MakeHeadChamfer( nOriId or Proc.Id, nPartId) + if sErr then + sErr = sErr..'\n'..sErrHeadChamfer + else + sErr = sErrHeadChamfer + end + + return bOk, sErr end diff --git a/LuaLibs/ProcessSplit.lua b/LuaLibs/ProcessSplit.lua index 8f68f7b..18979b6 100644 --- a/LuaLibs/ProcessSplit.lua +++ b/LuaLibs/ProcessSplit.lua @@ -167,6 +167,99 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmTail) return true, nil end +--------------------------------------------------------------------- +-- smussi in coda +local function MakeTailChamfer( idProc, nPartId, dDepthTailChamfer) + -- recupero gruppo per geometria aggiuntiva + local AddGrpId = BL.GetAddGroup( nPartId) + if not AddGrpId then + local sErr = 'Error on process StartFace impossible to find AddGroup' + EgtOutLog( sErr) + return false, sErr + end + + -- recupero la lavorazione + local sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error : milling not found in library' + EgtOutLog( sErr) + return false, sErr + end + + local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( idProc, 0, AddGrpId) + if not nLoopId or nLoopCnt > 1 then + local sErr = 'Error MakeHeadChamfer : too many loops' + EgtOutLog( sErr) + return false, sErr + end + + -- setto direzione estrusione corretta + EgtModifyCurveExtrusion( nLoopId, -X_AX()) + EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.LEFT)) + + local dQ09Value = EgtGetInfo( idProc, 'Q09', 'd') + local bChamferedEdge = dQ09Value > 0 + + local nIdFirstEntity, nEntityCnt = EgtExplodeCurveCompo( nLoopId) + local p3MidPoint = EgtMP( nIdFirstEntity, GDB_ID.GRID) + + for i = 0, nEntityCnt - 1 do + if EgtCurveLength( nIdFirstEntity + i) - 10 < abs( dQ09Value) * 2 then + local sErr = 'Error MakeTailChamfer : Q09 too high' + EgtOutLog( sErr) + return false, sErr + end + end + + -- creo raccordo o fillet + for i = 0, nEntityCnt - 1 do + local idFirst = nIdFirstEntity + i + local idSecond = EgtIf( i == nEntityCnt - 1, nIdFirstEntity, idFirst + 1) + local ptEndPointFirst = EgtEP( idFirst, GDB_ID.GRID) - ( abs( dQ09Value) * EgtEV( idFirst, GDB_ID.GRID)) + local ptStartPointSecond = EgtSP( idSecond, GDB_ID.GRID) + ( abs( dQ09Value) * EgtEV( idSecond, GDB_ID.GRID)) + + if bChamferedEdge then + EgtCurveChamfer( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID) + else + EgtCurveFillet( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID) + end + end + + EgtSelectPathObjs( nIdFirstEntity, true) + local idGeom, idGeomCnt = EgtCurveCompoByChain( AddGrpId, GDB_ID.SEL, {0,0,0}, true) + if not idGeom or idGeomCnt > 1 then + local sErr = 'Error MakeTailChamfer : too many loops' + EgtOutLog( sErr) + return false, sErr + end + EgtChangeClosedCurveStartPoint( idGeom, p3MidPoint, GDB_RT.GRID) + + -- Inserisco la lavorazione del lato standard + local dExtra = 2 + local sName1 = 'TailCham_' .. ( EgtGetName( idProc) or tostring( idProc)) + local nMch1Id = EgtAddMachining( sName1, sMilling) + if not nMch1Id then + local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ idGeom, -1}}) + -- assegno affondamento e offset radiale + EgtSetMachiningParam( MCH_MP.DEPTH, dDepthTailChamfer + dExtra) + EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) + -- assegno lato di lavoro + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) + -- eseguo + if not ML.ApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMch1Id, false) + return false, sErr + end + + return true, nil +end + --------------------------------------------------------------------- -- lavorazione con sega a catena per sezioni alte e larghe local function MakeCutByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes, dRadialOffset, bExtendStartEnd, bInvert) @@ -819,6 +912,43 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, TailCutType, Cutting1Data, Cutting2Data, nil, dLenEndRaw) + -- se smussi in coda da aggiungere + local dDepthTailChamfer = EgtGetInfo( nOriId or Proc.Id, 'Q08', 'd') or 0 + if dDepthTailChamfer > 100 * GEO.EPS_SMALL then + -- creo subito nuova fase qui, a meno che non sia stata già creata + if nNewPhase == 0 then + BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET) + nNewPhase = EgtGetCurrPhase() + local nDispId = EgtGetPhaseDisposition( nNewPhase) + if sDownOrSideOrStd == 'down' then + EgtRotateRawPart( nRawId, X_AX(), 180) + EgtSetInfo( nDispId, 'TYPE', 'MID2') + EgtSetInfo( nDispId, 'ROT', -2) + elseif sDownOrSideOrStd == 'side' then + if bPreMove then EgtMoveRawPart( nRawId, vtMove) end + EgtRotateRawPart( nRawId, X_AX(), EgtIf( BD.RIGHT_LOAD, -90, 90)) + if not bPreMove then EgtMoveRawPart( nRawId, vtMove) end + EgtSetInfo( nDispId, 'TYPE', 'MID2') + EgtSetInfo( nDispId, 'ROT', -1) + else + EgtSetInfo( nDispId, 'TYPE', 'END') + end + EgtSetInfo( nDispId, 'ORD', nOrd) + -- se grezzo successivo senza pezzi e finale, va tolto + local nNextRawId = EgtGetNextRawPart( nRawId) + if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then + EgtRemoveRawPartFromCurrPhase( nNextRawId) + end + end + -- alla fine del taglio si aggiungono gli smussi in testa + local _, sErrHeadChamfer = MakeTailChamfer( nOriId or Proc.Id, nPartId, dDepthTailChamfer) + if sErr then + sErr = sErr..'\n'..sErrHeadChamfer + else + sErr = sErrHeadChamfer + end + end + return bOk, sErr, nNewPhase end From 919b32ca8def62c27940f8cbda4cbc4199167e30 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Wed, 12 Nov 2025 15:48:10 +0100 Subject: [PATCH 05/11] In ProcessCut, se taglio rivolto verso il basso, si controlla che non sia troppo profondo, cercando di evitare collisione tra pezzo e carro Z --- LuaLibs/ProcessCut.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 1cb7a62..8689717 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -65,11 +65,14 @@ function ProcessCut.Classify( Proc, b3Raw) end -- recupero i dati del taglio local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) - if vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1 or ( vtN:getZ() <= - 0.174 and abs( vtN:getY()) > 0.866) then - -- calcolo le massime estensioni lineari orizzontale e verticale della faccia - local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw) + -- calcolo le massime estensioni lineari orizzontale e verticale della faccia + local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw) + if ( vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1) or + ( vtN:getZ() <= - 0.174 and abs( vtN:getY()) > 0.866) or + ( vtN:getZ() <= - 0.174 and abs( vtN:getZ()) * DimV > BD.MAX_DIM_DICE) + then -- confronto queste estensioni con la massima dimensione del DiceCut (impossibile lavorare se entrambe maggiori) - if DimH > BD.MAX_DIM_DICE and DimV > BD.MAX_DIM_DICE then + if DimH > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL and DimV > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL then return true, true end end @@ -90,7 +93,7 @@ function ProcessCut.Classify( Proc, b3Raw) end end -- calcolo l'ingombro orizzontale della faccia - local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0) + _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0) -- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale) if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and ( abs( vtN:getY()) > 0.1) and dMaxMat < DimH + BD.CUT_EXTRA) then return true, true From dd7a1e80b2d53226eb01c55099753e7851218c2b Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 13 Nov 2025 12:23:28 +0100 Subject: [PATCH 06/11] - in ProcessDrill rimossa la variazione di step nel caso di foratura in doppio: le librerie Egt gestiscono ora correttamente questi casi - aggiornata versione minima Cam5 --- LuaLibs/ProcessDrill.lua | 10 ---------- Version.lua | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index 509bd77..5dd095e 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -638,16 +638,6 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) end -- se lavorazione in doppio if Proc.Double and Proc.Double > 0 then - -- calcolo gli step reali - local dStep = EgtGetMachiningParam( MCH_MP.STEP) - local nNumStep = ceil( dDepth/dStep) - local dRealStep = dDepth / nNumStep - -- Se foro passante e nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno - if bOpen and ( nNumStep > 1) and ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then - dRealStep = ceil( dDepth / (nNumStep - 1)) - EgtSetMachiningParam( MCH_MP.STEP, dRealStep) - sMyWarn ='Warning in drill-double : step changed to ' .. tostring(dRealStep) .. 'mm' - end sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double) if Proc.Double ~= Proc.PrevDouble then sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2) diff --git a/Version.lua b/Version.lua index c3c5547..fca3057 100644 --- a/Version.lua +++ b/Version.lua @@ -3,4 +3,4 @@ NAME = 'Beam' VERSION = '2.7j2' -MIN_EXE = '2.7f2' +MIN_EXE = '2.7k2' From 9e284d509b6e40f62adcbb7c7c21ef6958247176 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 13 Nov 2025 13:07:27 +0100 Subject: [PATCH 07/11] - in BeamExec se foratura in doppio non possibile per distanza punte troppo bassa si restituisce messaggio in Log Cam5 --- LuaLibs/BeamExec.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 478d107..5ac34d2 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1944,7 +1944,9 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw) -- 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 + local dTipDistance = 2 * dDrillingStep - dToolTipLength - dToolDoubleTipLength + if abs( Proc.Flg) == 2 and not ( ( dTipDistance - MIRROR_DRILLINGS_MIN_DISTANCE) > 10 * GEO.EPS_SMALL) then + EgtOutLog( 'Double drilling skipped, tip distance too small ( ' .. dTipDistance .. ' mm) ') return end -- verifico se in doppio From b77561012523e5a84ba5a91f33f7d30b4c86ebfd Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Tue, 18 Nov 2025 13:11:24 +0100 Subject: [PATCH 08/11] - In ProcessCut, se taglio rivolto verso il basso, si controlla che non sia troppo profondo, cercando di evitare collisione tra pezzo e carro Z - Il Q14 ha effetto solo su lati longitudinali che si trovano in faccia bottom --- LuaLibs/ProcessLapJoint.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index b35d75c..e431417 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -2865,7 +2865,10 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd, if vtN:getZ() < dVzLimDwnUp then dOffs = dOffs + dSawThick end -- forzatura lavorazione discorde in base a parametro Q su feature local nQ14Param = EgtGetInfo( Proc.Id, Q_MILL_AS_BLADE_CONVENTIONAL, 'd') or 0 - local bForceInvert = nQ14Param == 1 or ( nQ14Param == 2 and vtN:getX() < 0.1) + local bForceInvert = nQ14Param == 1 or ( nQ14Param == 2 and vtN:getX() < 0.1 and Proc.AffectedFaces.Bottom) + if bForceInvert and i == 1 then + dStartDist, dEndDist = dEndDist, dStartDist + end local bOk, sErr, nMchId = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, 0, BD.CUT_SIC, dOffs, dStartDist, dEndDist, nil, b3Raw, bForceInvert) if not bOk then return bOk, sErr end -- setto l'elevazione From b05d1aa7b87e06541964a63a80f484bad0fcee87 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Thu, 20 Nov 2025 09:19:20 +0100 Subject: [PATCH 09/11] Spostata creazione del gruppo ausiliario prima della collect. Altrimenti andava in crash quando aggiungeva i prefori. --- LuaLibs/BeamExec.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 5ac34d2..a9a10c6 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -608,6 +608,11 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b local b3Part = EgtGetBBoxGlob( Pz or GDB_ID.NULL, GDB_BB.EXACT) local b3Solid = vBeam[i].Box if b3Part:isEmpty() or b3Solid:isEmpty() then break end + -- creo o pulisco gruppo geometrie aggiuntive + if not BL.CreateOrEmptyAddGroup( Pz) then + local sOut = 'Error creating Additional Group in Part ' .. tostring( Pz) + return false, sOut + end -- analizzo le features per valutare l'esistenza di feature head/tail che renderebbero inutili le rispettive finiture o di tagli di testa/coda sostituiti da cui leggere il parametro Q05 local vProc = CollectFeatures( Pz, b3Solid, 0) local bSFinishingNeeded, nReplacedHeadCutFeatureId, nHeadCuttingFeatureId = AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH) @@ -677,11 +682,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b -- assegno ordine in lavorazione Cnt = Cnt + 1 EgtSetInfo( nRaw, 'ORD', Cnt) - -- creo o pulisco gruppo geometrie aggiuntive - if not BL.CreateOrEmptyAddGroup( Pz) then - local sOut = 'Error creating Additional Group in Part ' .. tostring( Pz) - return false, sOut - end + -- aggiungo faccia per taglio iniziale al pezzo BL.AddPartStartFace( Pz, b3Solid) -- se sovramateriale di testa, lo notifico From d4b7fe1910d82952eb31c12bbfe4ed47579a8636 Mon Sep 17 00:00:00 2001 From: "andrea.villa" Date: Mon, 24 Nov 2025 13:29:50 +0100 Subject: [PATCH 10/11] =?UTF-8?q?Per=20DtMortise,=20si=20considera=20che?= =?UTF-8?q?=20attraversa=20un=20LapJoint=20solo=20se=20DtMortise=20=C3=A8?= =?UTF-8?q?=20affondata=20nel=20grezzo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/BeamExec.lua | 3 ++- LuaLibs/ProcessDtMortise.lua | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index a9a10c6..f23070a 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -2141,7 +2141,8 @@ function GetFeatureInfoAndDependency( vProc, b3Raw, nPartId) end end -- verifico se feature tipo LapJoint è attraversata da almeno una mortasa a coda di rondine - if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove') and DtMortise.SideIdentify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then + if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove') + and DtMortise.SideIdentify( ProcB) and Overlaps( Proc.Box, ProcB.Box) and DtMortise.IsDeeper( ProcB, b3Raw) then Proc.PassedByDtMortise = true end -- se tenone è attraversato da foro allora il foro deve essere fatto prima diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index d0d22e7..d95279e 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -51,6 +51,23 @@ function ProcessDtMortise.FrontIdentify( Proc) return (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 56) end +--------------------------------------------------------------------- +-- Riconoscimento della feature profonda, non sulla faccia della trave +function ProcessDtMortise.IsDeeper( Proc, b3Raw) + -- recupero i dati della curva di contorno della faccia di fondo + local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') + if not AuxId then return false end + AuxId = AuxId + Proc.Id + local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) + if ( AreSameVectorApprox( vtExtr, -Y_AX()) and Proc.Box:getMin():getY() > b3Raw:getMin():getY() + 100 * GEO.EPS_SMALL) or + ( AreSameVectorApprox( vtExtr, Y_AX()) and Proc.Box:getMax():getY() < b3Raw:getMax():getY() - 100 * GEO.EPS_SMALL) or + ( AreSameVectorApprox( vtExtr, -Z_AX()) and Proc.Box:getMin():getZ() > b3Raw:getMin():getZ() + 100 * GEO.EPS_SMALL) or + ( AreSameVectorApprox( vtExtr, Z_AX()) and Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 100 * GEO.EPS_SMALL) then + return true + end + return false +end + --------------------------------------------------------------------- -- Verifica se feature di coda function ProcessDtMortise.IsTailFeature( Proc, b3Raw) From bd956281e2aecfeec5926bed592a6a25a1b011b7 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 25 Nov 2025 08:47:36 +0100 Subject: [PATCH 11/11] update log e version --- UpdateLog.txt | 7 +++++++ Version.lua | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index 1108c23..f7eaa6e 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,12 @@ ==== Beam Update Log ==== +Versione 2.7k1 (25/11/2024) +- Added : in tagli di testa e coda aggiunti smussi con possibilità di raccordare o smussare spigoli +- Added : in Lapjoint aggiunto Q14 per settare lavorazione discorde se longitudinale su faccia sotto +- Modif : migliorati i tagli +- Modif : migliorata lavorazione mortasa a coda di rondine +- Fixed : in Lapjoint alcune svuotature forzate a spirale + Versione 2.7j2 (30/10/2025) - Fixed : in DoubleCut gestito il caso in cui si ha una terza faccia piccola da non lavorare diff --git a/Version.lua b/Version.lua index fca3057..b1465e5 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.7j2' -MIN_EXE = '2.7k2' +VERSION = '2.7k1' +MIN_EXE = '2.7f2'