diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 9f27ab7..36ee5d0 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -1,4 +1,4 @@ --- BeamLib.lua by Egaltech s.r.l. 2020/06/16 +-- BeamLib.lua by Egaltech s.r.l. 2020/06/18 -- Libreria globale per Travi -- Tabella per definizione modulo @@ -515,12 +515,8 @@ function BeamLib.GetFaceHvRefDim( nSurfId, nFacet) if frHV:getVersY():getZ() < 0 then frHV:rotate( ptC, vtN, 180) end - -- estraggo la faccia temporaneamente - local FacId = EgtCopySurfTmFacet( nSurfId, nFacet, EgtGetParent( nSurfId)) -- determino l'ingombro in questo riferimento - local b3HV = EgtGetBBoxRef( FacId, GDB_BB.STANDARD, frHV) - -- cancello la faccia temporanea - EgtErase( FacId) + local b3HV = EgtSurfTmGetFacetBBoxRef( nSurfId, nFacet, GDB_BB.STANDARD, frHV) -- restituisco i valori calcolati return frHV, b3HV:getDimX(), b3HV:getDimY() end diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 6950eb5..fa5fd7f 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -61,7 +61,7 @@ function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth) local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() if ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and ( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) then - return Pocketing.Name + return Pocketing.Name, dTDiam, dTMaxDepth end end end diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index cd927b6..e35663e 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2020/06/09 +-- ProcessDrill.lua by Egaltech s.r.l. 2020/06/18 -- Gestione calcolo forature per Travi -- Tabella per definizione modulo @@ -114,7 +114,8 @@ function ProcessDrill.Split( Proc, b3Raw) -- restituisco se va fatto in doppio (solo fori orizzontali) local bHoriz = ( abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and ( abs( vtExtr:getY()) * b3Raw:getDimZ() > abs( vtExtr:getZ()) * b3Raw:getDimY() or Proc.Fce == 5 or Proc.Fce == 6)) - return ( bOpen and ( bHoriz or BD.ROT90)) + local bSlant = ( abs( vtExtr:getX()) > BD.DRILL_VX_MAX) + return ( bOpen and ( bHoriz or BD.ROT90) and not bSlant) end --------------------------------------------------------------------- diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index c314230..2a39dc1 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2020/06/16 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/06/18 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. @@ -291,7 +291,7 @@ local function GetTunnelDimension( Proc, nPartId) -- recupero gruppo per geometria addizionale local nAddGrpId = BL.GetAddGroup( nPartId) if not nAddGrpId then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup' + local sErr = 'Error : missing AddGroup' EgtOutLog( sErr) return false, sErr end @@ -541,7 +541,7 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId) -- recupero l'ingombro della trave local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) if not b3Solid then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + local sErr = 'Error : part box not found' EgtOutLog( sErr) return false, sErr end @@ -556,7 +556,7 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId) -- recupero la lavorazione local sMilling = ML.FindMilling( 'BirdsMouth') if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling not found in library' EgtOutLog( sErr) return false, sErr end @@ -614,7 +614,7 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId) -- recupero l'ingombro della trave local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) if not b3Solid then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + local sErr = 'Error : part box not found' EgtOutLog( sErr) return false, sErr end @@ -632,7 +632,7 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId) bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB) bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB) if not bFaceOk[1] and not bFaceOk[2] then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' LapJoint from bottom impossible' + local sErr = 'Error : LapJoint from bottom impossible' EgtOutLog( sErr) return false, sErr end @@ -675,7 +675,7 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId) -- recupero la lavorazione local sMilling = ML.FindMilling( 'BirdsMouth') if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling not found in library' EgtOutLog( sErr) return false, sErr end @@ -733,7 +733,7 @@ local function MakePreCuts( Proc, nPhase, nRawId, nPartId, b3Raw, nChamfer) -- recupero gruppo per geometria addizionale local nAddGrpId = BL.GetAddGroup( nPartId) if not nAddGrpId then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup' + local sErr = 'Error : missing AddGroup' EgtOutLog( sErr) return false, sErr end @@ -760,7 +760,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV -- Recupero le facce adiacenti alla principale local vAdj = EgtSurfTmFacetAdjacencies( Proc.Id, nFacInd)[1] if not vAdj or #vAdj == 0 then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' main face without adjacencies' + local sErr = 'Error : main face without adjacencies' EgtOutLog( sErr) return false, sErr end @@ -782,11 +782,16 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV end end end + if not nFacAdj then + local sErr = 'Error : main face without long adjacent face' + EgtOutLog( sErr) + return false, sErr + end -- Determino se estremi aperti o chiusi e faccia adiacente da aggiungere alla lavorazione local bOpenStart = false local bOpenEnd = false local vAdj2 = EgtSurfTmFacetAdjacencies( Proc.Id, nFacAdj)[1] - EgtOutLog( 'Adj2=' .. table.concat( vAdj2, ' ,')) + EgtOutLog( 'Adj2=' .. table.concat( vAdj2, ' ,'), 3) local _, dH2, dV2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacAdj, GDB_ID.ROOT) -- Riordino le dimensioni per avere dH > dV if dH2 < dV2 then @@ -824,7 +829,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV else sMilling = ML.FindMilling( 'LongSmallCut') if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling not found in library' EgtOutLog( sErr) return false, sErr end @@ -960,7 +965,7 @@ local function MakeContourCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, -- se fresatura da sotto salto la lavorazione if vtN1:getZ() < BD.DRILL_VZ_MIN then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling from bottom ' + local sErr = 'Error : milling from bottom ' EgtOutLog( sErr) return false, sErr end @@ -1157,7 +1162,7 @@ local function MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, n if nIdIniPoint and nIdEndPoint then -- se fresatura da sotto salto la lavorazione if vtExtr:getZ() < BD.DRILL_VZ_MIN then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' clean corner milling from bottom impossible' + local sErr = 'Error : clean corner milling from bottom impossible' EgtOutLog( sErr) return false, sErrLX end @@ -1167,7 +1172,7 @@ local function MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, n -- recupero la lavorazione non calcolando l'elevazione sMilling = ML.FindMilling( 'CleanCorner', (dDiam*0.5)) if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' clean corner milling/tool not found in library' + local sErr = 'Error : clean corner milling/tool not found in library' EgtOutLog( sErr) return false, sErr end @@ -1179,7 +1184,7 @@ local function MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, n -- l'altezza di taglio del tagliente corrisponde al raggio del raccordo che si riesce a coprire -- quindi confronto l'elevazione con il raggio utensile utilizzato per la svuotatura if dMaxDepth < (dDiam * 0.5) - 100 * GEO.EPS_SMALL then - sMyWarn = 'Warning on process ' .. tostring( Proc.Id) .. ' skip clean corner: the cut heigth is smaller to machine the corner radius' + sMyWarn = 'Warning : skip clean corner (the cut heigth is smaller to machine the corner radius)' EgtOutLog( sMyWarn) return false, sMyWarn end @@ -1236,7 +1241,7 @@ local function MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, n end -- se non c'é il percorso do errore if not AuxId then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' impossible make clean corner path' + local sErr = 'Error : impossible make clean corner path' EgtOutLog( sErr) return false, sErr end @@ -1324,14 +1329,14 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, vtExtr:normalize() -- se foratura da sotto salto la lavorazione if vtExtr:getZ() < BD.DRILL_VZ_MIN then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' drilling from bottom impossible' + local sErr = 'Error : drilling from bottom impossible' EgtOutLog( sErr) return false, sErr end -- recupero la lavorazione local sDrilling, nType = ML.FindDrilling( dDiam) if not sDrilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' drilling not found in library' + local sErr = 'Error : drilling not found in library' EgtOutLog( sErr) return false, sErr end @@ -1410,7 +1415,7 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, if dDepth > dMaxDepth + 10 * GEO.EPS_SMALL then sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' dDepth = dMaxDepth - EgtOutLog( sMyWarn .. ' (process ' .. tostring( Proc.Id) .. ')') + EgtOutLog( sMyWarn) end end EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) @@ -1443,7 +1448,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, -- Recupero le facce adiacenti alla principale local vAdj = EgtSurfTmFacetAdjacencies( Proc.Id, nFacInd)[1] if not vAdj or #vAdj == 0 then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' main face without adjacencies' + local sErr = 'Error : main face without adjacencies' EgtOutLog( sErr) return false, sErr end @@ -1463,7 +1468,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, end end if not nFacAdj then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' long adjacent face not found' + local sErr = 'Error : long adjacent face not found' EgtOutLog( sErr) return false, sErr end @@ -1512,7 +1517,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, -- Recupero la lavorazione di lama local sCutting = ML.FindCutting( 'HeadSide') if not sCutting then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' + local sErr = 'Error : cutting not found in library' EgtOutLog( sErr) return false, sErr, 'MNF' end @@ -1527,7 +1532,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, end end if dSawThick > dV + 10 * GEO.EPS_SMALL then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' sawblade too thick' + local sErr = 'Error : sawblade too thick' EgtOutLog( sErr) return false, sErr end @@ -1551,7 +1556,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, -- Recupero la lavorazione local sSawing = ML.FindSawing( 'Sawing') if not sSawing then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chainsawing not found in library' + local sErr = 'Error : chainsawing not found in library' EgtOutLog( sErr) return false, sErr, 'MNF' end @@ -1568,7 +1573,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, end end if dSawThick > dV + 10 * GEO.EPS_SMALL then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chainsaw too thick' + local sErr = 'Error : chainsaw too thick' EgtOutLog( sErr) return false, sErr end @@ -1619,7 +1624,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then sWarn = 'Warning in LapJoint : elevation (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')' dDepth = dMaxDepth - dElev - EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')') + EgtOutLog( sWarn) EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH '..EgtNumToString( dDepth, 1)) end -- imposto elevazione @@ -1686,7 +1691,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, -- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning elseif dMaxMat2 < dDepth then EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat2) - sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : elevation bigger than max tool depth' + sWarn = 'Warning : elevation bigger than max tool depth' EgtOutLog( sWarn) end -- eseguo @@ -1711,7 +1716,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw) -- Recupero la lavorazione di lama local sCutting = ML.FindCutting( 'HeadSide') if not sCutting then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' + local sErr = 'Error : cutting not found in library' EgtOutLog( sErr) return false, sErr end @@ -1743,7 +1748,7 @@ local function EvaluateQParam( Proc, bMakeVertCham, sDephtCham, sOnlyCham, sUseB nChamfer = nChamfer + 1 -- altrimenti se non ho l'affondamento esco else - sErr = 'Error on process ' .. tostring( Proc.Id) .. ' no chamfer depth' + sErr = 'Error : no chamfer depth' EgtOutLog( sErr) return -1, dDepth, sErr end @@ -1789,7 +1794,7 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo sPocketing = ML.FindPocketing( sMchFind, dFaceDiamTool, dElev + dCollSic) end if not sPocketing then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' + local sErr = 'Error : pocketing not found in library' EgtOutLog( sErr) return false, sErr end @@ -1834,7 +1839,7 @@ local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRo if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dElev) dElev = dMaxDepth - sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : elevation bigger than max tool depth' + sWarn = 'Warning : elevation bigger than max tool depth' EgtOutLog( sWarn) end -- imposto elevazione e dichiaro non si generano sfridi per VMill @@ -1875,7 +1880,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas -- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura if cos( dDiffFromSqAng) < cos( dAngLimit) then -- applico la svuotatura - local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng) + local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng) if not bOk then -- se ho id utensile e diametro è perchè non ha fatto svuotatura perchè la faccia è più stretta del diametro utensile -- e provo ad inserire singola passata di testa @@ -1883,7 +1888,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas -- recupero la lavorazione local sMilling = ML.FindMilling( 'Long2Cut', dElev, sTuuidPk) if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling not found in library' EgtOutLog( sErr) return false, sErr end @@ -1959,7 +1964,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk) end if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling not found in library' EgtOutLog( sErr) return false, sErr end @@ -2378,6 +2383,8 @@ local function CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, dElev) if not vAdj or #vAdj == 0 then return false end + -- Normale della faccia + local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT) -- Cerco le facce adiacenti alla principale con angolo concavo >= 90 local tWidth = {} for i = 1, #vAdj do @@ -2388,10 +2395,12 @@ local function CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, dElev) return false end -- larghezza della faccia ortogonalmente alla adiacente - local vtN = EgtSurfTmFacetNormVersor( Proc.Id, vAdj[i], GDB_ID.ROOT) - _, _, _, _, _, _, dW = EgtSurfTmFacetOppositeSide( Proc.Id, nFacInd, vtN , GDB_ID.ROOT) - if dW then - table.insert( tWidth, dW) + local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, vAdj[i], GDB_ID.ROOT) + local vtX = vtN2 ^ vtN + local frRef = Frame3d( ptC, ptC + 100 * vtX, ptC + 100 * vtN2) + local b3Ref = EgtSurfTmGetFacetBBoxRef( Proc.Id, nFacInd, GDB_BB.STANDARD, frRef) + if b3Ref then + table.insert( tWidth, b3Ref:getDimY()) end end end @@ -2428,7 +2437,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha if nFacInd == -1 then bOrthoFaces = nFacInd2 else - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MakeByPockets could not find reference face' + local sErr = 'Error : MakeByPockets could not find reference face' EgtOutLog( sErr) return -1, sErr end @@ -2447,7 +2456,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha -- recupero la lavorazione local sMilling = ML.FindMilling( 'Mark') if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' + local sErr = 'Error : chamfer not found in library' EgtOutLog( sErr) return -1, sErr end @@ -2534,12 +2543,12 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha end -- se non perpendicolare emetto un warning -- else - -- sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : chamfer skipped because not perpendicular to face or from bottom' + -- sWarn = 'Warning : chamfer skipped because not perpendicular to face or from bottom' -- EgtOutLog( sWarn) end --emetto un warning -- else - -- sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : chamfer skipped because not perpendicular to face' + -- sWarn = 'Warning : chamfer skipped because not perpendicular to face' -- EgtOutLog( sWarn) end end @@ -2572,7 +2581,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha if abs(vtOrtho:getZ()) >= 0.707 then dMachDepth = dMaxMat - (dDepth / 2) dElev = dMaxMat - sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : elevation bigger than max tool depth' + sWarn = 'Warning : elevation bigger than max tool depth' EgtOutLog( sWarn) -- altrimenti setto il flag per fare la svuotatura da due parti else @@ -2649,7 +2658,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha if dMaxMat*2 < dDepth then dMachDepth = dMaxMat - (dDepth / 2) dElev = dMaxMat - sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : elevation bigger than max tool depth' + sWarn = 'Warning : elevation bigger than max tool depth' EgtOutLog( sWarn) end -- inserisco la lavorazione di svuotatura @@ -2709,14 +2718,14 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) -- recupero l'ingombro della trave local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) if not b3Solid then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + local sErr = 'Error : part box not found' EgtOutLog( sErr) return false, sErr end -- recupero gruppo per geometria addizionale local nAddGrpId = BL.GetAddGroup( nPartId) if not nAddGrpId then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup' + local sErr = 'Error : missing AddGroup' EgtOutLog( sErr) return false, sErr end @@ -2729,7 +2738,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) if nFacInd == -1 then bClosedOrthoFaces = nFacInd2 else - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MakeMoreFaces could not find reference face' + local sErr = 'Error : MakeMoreFaces could not find reference face' EgtOutLog( sErr) return false, sErr end @@ -2751,7 +2760,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) break else EgtErase( nNewProc) - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MakeMoreFaces could not find reference face' + local sErr = 'Error : MakeMoreFaces could not find reference face' EgtOutLog( sErr) return false, sErr end @@ -2829,7 +2838,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) -- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning elseif dMaxMat < dDepth then EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat) - sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : elevation bigger than max tool depth' + sWarn = 'Warning : elevation bigger than max tool depth' EgtOutLog( sWarn) end -- eseguo @@ -2906,7 +2915,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) local _, vtN2 = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT) -- se orientata verso il basso, verifico l'alternativa if vtN:getZ() < BD.NZ_MINA and vtN2:getZ() < BD.NZ_MINA then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' special LapJoint from bottom impossible' + local sErr = 'Error : special LapJoint from bottom impossible' EgtOutLog( sErr) return false, sErr end @@ -2920,7 +2929,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) -- Recupero la lavorazione di fresa local sMilling = ML.FindMilling( 'LongSmallCut') if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling not found in library' EgtOutLog( sErr) return false, sErr end @@ -2949,7 +2958,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) vtN, vtN2 = vtN2, vtN sPocketing = ML.FindPocketing( sMchFind, dDiam2, dFacElev2 + dCollSic2) if not sPocketing then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' + local sErr = 'Error : pocketing not found in library' EgtOutLog( sErr) return false, sErr end @@ -2961,7 +2970,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) bOk, sWarn, dDiamTool = MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, true, sMilling, nFacInd2, dFacElev2) if not bOk then return bOk, sWarn end else - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Impossible mill special LapJoint' + local sErr = 'Error : Impossible mill special LapJoint' EgtOutLog( sErr) return false, sErr end @@ -3019,7 +3028,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) -- verifico non sia orientata verso il basso local bFaceOk = ( vtN:getZ() >= BD.NZ_MINA) if not bFaceOk then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' LapJoint from bottom impossible' + local sErr = 'Error : LapJoint from bottom impossible' EgtOutLog( sErr) return false, sErr end @@ -3061,6 +3070,13 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) end --EgtOutLog( 'Mortise Find Diam =' .. EgtNumToString( dDiam)) local sPocketing = ML.FindPocketing( sMchFind, dDiam, dFacElev + dCollSic) + -- se non trovata verifico affondamento + if not sPocketing then + local sMyPocketing, dMyTDiam, dMyTMaxDepth = ML.FindPocketing( sMchFind, dDiam) + if sMyPocketing and dMyTMaxDepth > 0.8 * dFacElev + dCollSic then + sPocketing = sMyPocketing + end + end -- se non trova una svuotatura adatta if not sPocketing then -- se forma a L provo con contornatura @@ -3092,7 +3108,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) if not bOk and sStat == 'MNF' then sPocketing = ML.FindPocketing( sMchFind, dDiam) if not sPocketing then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' + local sErr = 'Error : pocketing not found in library' EgtOutLog( sErr) return false, sErr end @@ -3126,7 +3142,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) local tvtNx = {} tvtNx[2] = vtN local bOk - bOk, sWarn, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dFacElev) + bOk, sWarn, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dFacElev + dCollSic) if not bOk then return false, sWarn end -- se ho più di 3 facce e non di forma ad u oppure ho 3 facce e di forma ad u -- e non sono stati inseriti antischeggia di lama @@ -3135,7 +3151,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart) -- Recupero le facce adiacenti alla principale local vAdj = EgtSurfTmFacetAdjacencies( Proc.Id, nFacInd)[1] if not vAdj or #vAdj == 0 then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' main face without adjacencies' + local sErr = 'Error : main face without adjacencies' EgtOutLog( sErr) return false, sErr end @@ -3190,7 +3206,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId) -- recupero gruppo per geometria addizionale local nAddGrpId = BL.GetAddGroup( nPartId) if not nAddGrpId then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup' + local sErr = 'Error : missing AddGroup' EgtOutLog( sErr) return false, sErr end