diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index 94bfe77..ecfa8b5 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -277,6 +277,15 @@ if bToProcess then else vBeam[i].Box = b3Solid end + if BD.MAX_LENGTH and BD.MAX_LENGTH > 10 and b3Solid:getDimX() > BD.MAX_LENGTH then + local sOut = 'Piece-Length (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' .. + 'out of machine limits (' .. EgtNumToString( BD.MAX_LENGTH, 2) .. ') ' + BEAM.ERR = 17 + BEAM.MSG = sOut + WriteErrToLogFile( BEAM.ERR, BEAM.MSG) + PostErrView( BEAM.ERR, BEAM.MSG) + return + end end -- Assegno lunghezza della barra dBarLen = vBeam[1].Box:getDimX() + 10 @@ -330,6 +339,15 @@ if bToProcess then else vBeam[i].Box = b3Solid end + if BD.MAX_LENGTH and BD.MAX_LENGTH > 10 and b3Solid:getDimX() > BD.MAX_LENGTH then + local sOut = 'Piece-Length (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' .. + 'out of machine limits (' .. EgtNumToString( BD.MAX_LENGTH, 2) .. ') ' + BEAM.ERR = 17 + BEAM.MSG = sOut + WriteErrToLogFile( BEAM.ERR, BEAM.MSG) + PostErrView( BEAM.ERR, BEAM.MSG) + return + end end end diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 07a1b06..3bc1560 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1641,7 +1641,8 @@ local function SetCutsOnFrontMortises( vProc) -- verifico se i piani coincidono local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0) if bSamePlane then - vProc[i].CutFront = vProc[j].Id + --vProc[i].CutFront = vProc[j].Id + vProc[j].bSkipCut = true end -- log local sMsg = string.format( 'Cut %d meet Mortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '') @@ -1658,7 +1659,8 @@ local function SetCutsOnFrontMortises( vProc) -- verifico se i piani coincidono local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0) if bSamePlane then - vProc[i].CutFront = vProc[j].Id + --vProc[i].CutFront = vProc[j].Id + vProc[j].bSkipCut = true end -- log local sMsg = string.format( 'Cut %d meet DtMortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '') diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 7e263d9..3f3f54f 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -457,7 +457,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw -- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo entrata opportunamente if dDistPointToCenter > 0.5 * dSawDiam then dLiTang = -dAllStart * dCosAlpha - dLiPerp = dDist1 * dSinAlpha + dLiPerp = dDist1 * dSinAlpha end end -- se ho accorciato uscita, setto componente tangente e perpendicolare sul percorso di uscita diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 064e709..a80d420 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -479,12 +479,16 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b -- determino il modo di tagliare local vtOrthoO local bNoPerpCuts = false + local vtO + -- Se tagli ortogonali (indice dispari) if i % 2 == 1 then vtOrthoO = Vector3d( vtN) + -- Se tagli perpendicolari (indice pari) else - local vtO + -- Se elemento precedente contiene tagli ortogonali if #vCuts[i-1] > 0 then vtO = EgtSurfTmFacetNormVersor( vCuts[i-1][1], 0, GDB_ID.ROOT) + -- Se elemento successivo contiene tagli ortogonali elseif vCuts[i+1] and #vCuts[i+1] > 0 then -- lunghezza faccia nell'eventuale direzione ortogonale local asseX = EgtSurfTmFacetNormVersor( vCuts[i+1][1], 0, GDB_ID.ROOT) @@ -552,8 +556,51 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b end local bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw) if not bOk2 then return false, sErr2 end + -- caso standard else + -- se necessario aggiungo tagli obliqui per cubettare pezzi lunghi che potrebbero cadere sul motore + if ( i % 2) == 0 and Proc.Fct == 1 and AreSameOrOppositeVectorApprox( vtO, Z_AX()) then + local vtOrthoVert = vtN ^ vtO + -- inverte direzione superfici per corretta direzione SCC + if ( vtN:getY() > 0 and vtOrthoVert:getY() > 0) or ( vtN:getY() < 0 and vtOrthoVert:getY() < 0) then + vtOrthoVert = -vtOrthoVert + end + local Frame = Frame3d( ptC, vtN, vtO) + local b3Fac = EgtGetBBoxRef( vCuts[i][1], GDB_BB.STANDARD, Frame) + -- se cubetto più grande di MAX_DIM_DICE + if abs( b3Fac:getDimY() - BD.MAX_DIM_DICE) > 10 * GEO.EPS_SMALL then + local nVerticalCuts = ceil( b3Fac:getDimY() / ( BD.MAX_LEN_DICE)) - 1 + local dVerticalSliceDist = b3Fac:getDimY() / ( nVerticalCuts + 1) + -- selezione utensile + local dSawDiam = 400 + if EgtMdbSetCurrMachining( sCutting) then + local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then + dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam + end + end + -- crea faccia per tagli verticali e le taglia a dimensione corretta + for k = 1, nVerticalCuts do + local nFaceUse = BL.GetNearestOrthoOpposite( vtN) + local dVerticalCutOffset = dVerticalSliceDist * k + local sLeadInOutType = 'Perpendicular' + local nMergedParallelSurfId = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false) + local ptVertCut = EgtSurfTmFacetCenter( nMergedParallelSurfId, 0, GDB_ID.ROOT) + ptVertCut = ptVertCut + ( -b3Fac:getDimY()/2 + dVerticalCutOffset) * vtOrthoVert + local nSurfId = EgtSurfTmPlaneInBBox( nAddGrpId, ptVertCut, vtOrthoVert, b3Raw, GDB_RT.GLOB) + -- se non è il primo taglio parallelo taglia anche le superfici con la faccia parallela precedente + if i ~= 2 then + local nMergedPreviousParallelSurfId = EgtSurfTmBySewing( nAddGrpId, vCuts[i-2], false) + local ptOnPreviousParallelSurf = EgtSurfTmFacetCenter( nMergedPreviousParallelSurfId, 0, GDB_ID.ROOT) + EgtCutSurfTmPlane( nSurfId, ptOnPreviousParallelSurf, vtN, false, GDB_RT.GLOB) + end + EgtCutSurfTmPlane( nSurfId, ptVertCut, -vtN, false, GDB_RT.GLOB) + local bOk, sErr = Fbs.MakeOne( nSurfId, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1, BD.CUT_SIC, 0, 0, 0, '', b3Raw, nil, nil, nil, sLeadInOutType, nil, 0, nil) + if not bOk then return bOk, sErr end + end + end + end -- lavoro la faccia for j = 1, #vCuts[i] do -- se taglio dal basso diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index f797e40..e344bd3 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -594,8 +594,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local dHoleToCutDistance = vDistance[1] -- se il taglio accorcia realmente il foro if ( dHoleToCutDistance > 10 * GEO.EPS_SMALL or Proc.AffectedFaces.Right) and dHoleToCutDistance < dLen then + local dToolTipFromCenterDrill = ( ( dDiam / 2) - ( dToolDiam / 2)) + local dExtraSicDistFromThToTiltedCut = sqrt( ( dToolTipFromCenterDrill / CosB)^2 - dToolTipFromCenterDrill^2) + sqrt( ( ( dDiamTh / 2) / CosB)^2 - (dDiamTh / 2)^2) dMaxDepth = dMaxDepthOri - dMaxElev = dLen - dHoleToCutDistance + dMaxElev = dLen - ( dHoleToCutDistance - dExtraSicDistFromThToTiltedCut) bTryDrill = true local dToolAddLength = dLen - dMaxElev -- se l'utensile è comunque troppo corto lavoro il massimo possibile diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index 720c031..5a24167 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -236,7 +236,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- verifico se frontale local bFront = ( Proc.Prc == 56) -- se mortasa di fronte, eseguo il taglio della faccia - if bFront then + if bFront and not Proc.bSkipCut then -- verifico esista la faccia di taglio local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT) if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index fea7633..17646f2 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -2099,6 +2099,27 @@ local function MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3R end end +--------------------------------------------------------------------- +local function CalcInterference( nNewProc, vtExtr, ptCentr, ToolData) + -- controllo collisione tagliente - finito + local ptCentrGrid1 = ptCentr + ( vtExtr * ( 10 * GEO.EPS_SMALL)) + local frOriTool = Frame3d( ptCentrGrid1, vtExtr) + local bColl1 = EgtTestConeSurface( frOriTool, ToolData.dToolDiam/2, ToolData.dToolTotDiam/2, ToolData.dCutEdgeLen, nNewProc, 0, GDB_RT.GLOB) + if bColl1 then return true end + -- controllo collisione gambo - finito + local ptCentrGrid2 = ptCentr + ( vtExtr * ToolData.dCutEdgeLen) + frOriTool = Frame3d( ptCentrGrid2, vtExtr) + local bColl2 = EgtTestCylSurface( frOriTool, ( ToolData.dStemDiameter + ( 10 * GEO.EPS_SMALL)) / 2, ToolData.dStemLen, nNewProc, 0, GDB_RT.GLOB) + if bColl2 then return true end + -- controllo collisione TH - finito + local ptCentrGrid3 = ptCentr + ( vtExtr * ( ToolData.dCutEdgeLen + ToolData.dStemLen)) + frOriTool = Frame3d( ptCentrGrid3, vtExtr) + local bColl3 = EgtTestCylSurface( frOriTool, ToolData.dDiamTh/2, ToolData.dLenTh, nNewProc, 0, GDB_RT.GLOB) + if bColl3 then return true end + -- restituisco risultato controllo collisioni + return false +end + --------------------------------------------------------------------- local function MakeSharpCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiam) @@ -2111,6 +2132,43 @@ local function MakeSharpCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacI local sMilling local dMaxDepth = 0 + -- recupero la lavorazione non calcolando l'elevazione + sMilling = ML.FindMilling( 'CleanCorner', ( 0.5 * dDiam)) + if not sMilling then + local sErr = 'Error : CleanCorner not found in library' + EgtOutLog( sErr) + return false, sErr + end + + -- recupero i dati dell'utensile + local ToolData = { + dToolTotDiam = 20, + dToolDiam = 20, + dSideAng = 0, + dCutEdgeLen = 20, + dToolLength = 20, + dStemDiameter = 20, + dStemLen = 20, + dDiamTh = 20, + dLenTh = 20 + } + if EgtMdbSetCurrMachining( sMilling) then + local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then + ToolData.dToolTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or ToolData.dToolTotDiam + ToolData.dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or ToolData.dToolDiam + ToolData.dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or ToolData.dSideAng + ToolData.dCutEdgeLen = abs( EgtTdbGetCurrToolParam( MCH_TP.THICK)) or ToolData.dCutEdgeLen + ToolData.dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or ToolData.dToolLength + ToolData.dStemDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or ToolData.dStemDiameter + ToolData.dDiamTh = EgtTdbGetCurrToolThDiam() or ToolData.dDiamTh + ToolData.dLenTh = EgtTdbGetCurrToolThLength() or ToolData.dLenTh + -- calcolo il secondo diametro del cono + ToolData.dToolTotDiam = ToolData.dToolDiam + ( abs( ToolData.dCutEdgeLen) * tan( ToolData.dSideAng)) * 2 + ToolData.dStemLen = ToolData.dToolLength - ToolData.dCutEdgeLen - ToolData.dLenTh + end + end + -- cerco l'angolo di riferimento dove applicare il percorso di pulitura, altrimenti esco local _, nIdLine, tFacAdj = ChooseCorner( Proc, nFacInd) if #tFacAdj == 0 then @@ -2136,6 +2194,8 @@ local function MakeSharpCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacI -- versore direzione local vtExtr = tFacAdj[nIdLine][nIdIniPoint] - tFacAdj[nIdLine][nIdEndPoint] vtExtr:normalize() + -- versore direzione di uscita + local vtExtrExit -- inserisco le prime tre linee if nIdIniPoint and nIdEndPoint then -- se fresatura da sotto salto la lavorazione @@ -2144,16 +2204,24 @@ local function MakeSharpCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacI EgtOutLog( sErr) return false, sErr end - -- sommo i tre versori per avre una direzione media - vtExtr = vtN1 + vtN2 + vtN3 + -- sommo i tre versori per avere una direzione media + vtExtrExit = vtN2 + vtN3 + vtExtrExit:normalize() + -- calcolo la componente Z dipendente dall'angolo tilt + local dAlfa = EgtClamp( ToolData.dSideAng, 15, 30) + local dGamma = 90 - asin( sqrt( 2) * sin( dAlfa)) + local dTanGamma = sin( dGamma) / cos( dGamma) + vtExtr = vtExtrExit + ( vtN2 ^ vtN3) * dTanGamma vtExtr:normalize() - -- recupero la lavorazione non calcolando l'elevazione - sMilling = ML.FindMilling( 'CleanCorner', ( 0.5 * dDiam)) - if not sMilling then - local sErr = 'Error : CleanCorner not found in library' + local vtCheck = Vector3d(vtExtr) + + -- controllo se c'è collisione con le facce della superfice + if CalcInterference( Proc.Id, vtCheck, tFacAdj[nIdLine][nIdEndPoint], ToolData) then + local sErr = 'Collision detected between clean corner tool and surface' EgtOutLog( sErr) - return false, sErr + return true, '' end + -- recupero i dati dell'utensile ( temporaneo, per compensare errore nella lavorazione) if EgtMdbSetCurrMachining( sMilling) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) @@ -4732,6 +4800,16 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtN, nFacInd, local dSawThick = 0 local dMaxDepth = 200 local bAdj, dAng, dExtraOffs, sWarn2, nIdMach + -- Se faccia sulla quale cerca di applicare l'antisplint è chiusa e limitata da altre facce non lo applica + local FacetEdge = BL.GetEdgesInfo( Proc, Proc.Face[nFacet+1]) + for nEdge = 1, #FacetEdge do + if AreSameVectorApprox( FacetEdge[nEdge].ToolDirection, vtN) and ( not FacetEdge[nEdge].IsStartOpen or not FacetEdge[nEdge].IsEndOpen) and not FacetEdge[nEdge].IsOpen then + sWarn2 = 'Warning : antisplint not applicable on closed face' + if not sWarn then sWarn = '' end + sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) + return bMadeASbyBld, true, sWarn + end + end bMadeASbyBld, sWarn2, nIdMach, dSawThick, dMaxDepth, bAdj, dAng, dExtraOffs = MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDepth, bMillDown) if not bMadeASbyBld then return bMadeASbyBld, false, sWarn2 end if sWarn2 then @@ -6283,24 +6361,6 @@ local function ReorderFacesFromTab( nIdSurf, vFace) return nIdSurf end ---------------------------------------------------------------------- -local function CalcInterference( nNewProc, vtExtr, ptCentr, dDiam1, dDiam2, - dTall1, dTall2, dDiam3, dTall3) - local ptCentrGrid1 = ptCentr + ( vtExtr * 0.01) - local frOriTool = Frame3d( ptCentrGrid1, vtExtr) - local bColl1 = EgtTestConeSurface( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB) - if bColl1 then return true end - local ptCentrGrid2 = ptCentr + ( vtExtr * ( dTall1 + 0.01)) - frOriTool = Frame3d( ptCentrGrid2, vtExtr) - local bColl2 = EgtTestCylSurface( frOriTool, dDiam2/2, dTall2, nNewProc, 0, GDB_RT.GLOB) - if bColl2 then return true end - local ptCentrGrid3 = ptCentr + ( vtExtr * ( dTall2 + 0.01)) - frOriTool = Frame3d( ptCentrGrid3, vtExtr) - local bColl3 = EgtTestCylSurface( frOriTool, dDiam3/2, dTall3, nNewProc, 0, GDB_RT.GLOB) - if bColl3 then return true end - -- restituisco risultato controllo collisioni - return false -end --------------------------------------------------------------------- local function MakeLocalSurf( ptP1, ptP2, ptP3, nAddGrpId) @@ -6331,8 +6391,7 @@ end --------------------------------------------------------------------- local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nAddGrpId, dToolDiam, sMilling, dOffsAng, - dDiam1, dDiam2, dTall1, - dTall2, dDiam3, dTall3, bMakeLocSurf, vFace, vtN) + ToolData, bMakeLocSurf, vFace, vtN) -- variabili costruzione geometria local pAuxId = {} @@ -6412,8 +6471,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nAdd vtCheck:rotate( vtN, dOffsAng) end -- controllo se c'è collisione con le facce della superfice - if CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint], dDiam1, dDiam2, - dTall1, dTall2, dDiam3, dTall3) then + if CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint], ToolData) then local sErr = 'Collision detect from clean corner tool and surface' EgtOutLog( sErr) return true, '' @@ -6561,32 +6619,39 @@ local function AddMillCorner( vFace, Proc, dToolDiam, nAddGrpId, nMasterNewProc, -- se ripresa angolo con fresa cono 60° con ripresa -- recupero la lavorazione di fresatura - sMilling, dMaxDepth = ML.FindMilling( 'CleanCorner60') + sMilling, dMaxDepth = ML.FindMilling( 'CleanCorner') if not sMilling then - local sErr = 'Error : CleanCorner 60 not found in library' + local sErr = 'Error : CleanCorner not found in library' EgtOutLog( sErr) return false, sErr end -- recupero i dati dell'utensile - local dMillDiam = 20 - local dMillTotDiam = 20 - local dMillDiamTh = 20 - local dToolLength = 20 - local dThickTool = 20 - local dSideAng = 0 + local ToolData = { + dToolTotDiam = 20, + dToolDiam = 20, + dSideAng = 0, + dCutEdgeLen = 20, + dToolLength = 20, + dStemDiameter = 20, + dStemLen = 20, + dDiamTh = 20, + dLenTh = 20 + } if EgtMdbSetCurrMachining( sMilling) then local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then - dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh - dMillTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or dMillTotDiam - dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng - dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam - dThickTool = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThickTool - dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength - dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth -- qui è la distanza dal portautensile + ToolData.dToolTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or ToolData.dToolTotDiam + ToolData.dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or ToolData.dToolDiam + ToolData.dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or ToolData.dSideAng + ToolData.dCutEdgeLen = abs( EgtTdbGetCurrToolParam( MCH_TP.THICK)) or ToolData.dCutEdgeLen + ToolData.dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or ToolData.dToolLength + ToolData.dStemDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or ToolData.dStemDiameter + ToolData.dDiamTh = EgtTdbGetCurrToolThDiam() or ToolData.dDiamTh + ToolData.dLenTh = EgtTdbGetCurrToolThLength() or ToolData.dLenTh -- calcolo il secondo diametro del cono - dMillTotDiam = dMillDiam + ( abs(dThickTool) * tan(dSideAng)) * 2 + ToolData.dToolTotDiam = ToolData.dToolDiam + ( abs( ToolData.dCutEdgeLen) * tan( ToolData.dSideAng)) * 2 + ToolData.dStemLen = ToolData.dToolLength - ToolData.dCutEdgeLen - ToolData.dLenTh end end -- copio la feature nel layer di appoggio @@ -6664,21 +6729,18 @@ local function AddMillCorner( vFace, Proc, dToolDiam, nAddGrpId, nMasterNewProc, -- primo taglio local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nAddGrpId, dToolDiam, sMilling, -dAngOffs, - dMillDiam, dMillTotDiam, abs( dThickTool), - dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace, vtN) + ToolData, bMakeLocSurf, vFace, vtN) if not bOk then return bOk, sErr end -- secondo taglio bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nAddGrpId, dToolDiam, sMilling, dAngOffs, - dMillDiam, dMillTotDiam, abs( dThickTool), - dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace, vtN) + ToolData, bMakeLocSurf, vFace, vtN) if not bOk then return bOk, sErr end -- altrimenti ho un solo percorso else local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nAddGrpId, dToolDiam, sMilling, 0, - dMillDiam, dMillTotDiam, abs( dThickTool), - dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace, vtN) + ToolData, bMakeLocSurf, vFace, vtN) if not bOk then return bOk, sErr end end end diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index 83eaaf4..861820a 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -32,7 +32,7 @@ local BD = require( 'BeamData') local ML = require( 'MachiningLib') -- variabili assegnazione parametri Q -local Q_DEPTH_CHAMFER = 'Q02' -- d +local Q_DEPTH_CHAMFER = 'Q01' -- d --------------------------------------------------------------------- -- Riconoscimento della feature @@ -467,7 +467,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- se mortasa di fronte, eseguo il taglio della faccia - if bFront then + if bFront and not Proc.bSkipCut then -- verifico esista la faccia di taglio local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT) if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then diff --git a/Process.lua b/Process.lua index ea714f4..044eef4 100644 --- a/Process.lua +++ b/Process.lua @@ -89,6 +89,14 @@ local function MyProcessInputData() else vBeam[i].Box = b3Solid end + if BD.MAX_LENGTH and BD.MAX_LENGTH > 10 and b3Solid:getDimX() > BD.MAX_LENGTH then + local sOut = 'Lunghezza (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' .. + 'oltre i limiti della macchina (' .. EgtNumToString( BD.MAX_LENGTH, 2) .. ') ' + EgtOutLog( sOut) + EgtOutBox( sOut, 'Lavora Travi', 'WARNING') + EgtDraw() + return false + end end dRawW = vBeam[1].Box:getDimY() dRawH = vBeam[1].Box:getDimZ() diff --git a/UpdateLog.txt b/UpdateLog.txt index 600f921..96a8144 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,9 @@ ==== Beam Update Log ==== +Versione 3.1f1 (17/06/2026) +- Added : Tagli per dividere il cubetto in caso sia troppo lungo +- Modif : DepthChamfer su feature Mortase (050 e 051) cambio di Q. Prima era Q02, ora è Q01 + Versione 3.1e2 (01/06/2026) - Added : in Cut aggiunta Q18 per evitare di ruotare - Modif : gli smussi di testa sono in senso orario diff --git a/Version.lua b/Version.lua index f09b9a3..3cff565 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '3.1e2' +VERSION = '3.1f1' MIN_EXE = '3.1b1'