Compare commits

...

18 Commits

Author SHA1 Message Date
andrea.villa cb1aa22e9b Merge remote-tracking branch 'origin/develop' 2026-06-17 09:15:07 +02:00
andrea.villa a275719560 Cambio versione per rilasdcio a cliente 2026-06-17 09:14:58 +02:00
daniele.nicoli 8e491efb5d Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2026-06-16 16:36:46 +02:00
daniele.nicoli e482c60775 ProcessDrill - Nei fori dritti su parete inclinata sposta la MaxElev tenendo conto di inclinazione della parete e ToolHolder 2026-06-16 16:36:39 +02:00
andrea.villa 2b9c8539de Essetre ha cambiato la Q dello smusso nella feature "Mortasa". Ora è Q01. 2026-06-16 16:25:31 +02:00
daniele.nicoli e557d57dae Aggiunti commenti ad ultima modifica 2026-06-16 08:51:14 +02:00
daniele.nicoli d377a33420 Merge branch 'test_AddVertDice_T#3031' into develop 2026-06-16 08:42:45 +02:00
daniele.nicoli f5a5350e70 ProcessCut - Aggiunti tagli verticali anche in caso di tagli inclinati su testa o coda per rendere più piccoli i pezzi che possono cadere sul motore 2026-06-16 08:16:04 +02:00
daniele.nicoli 0d7e9e09b3 Merge branch 'test_SkipMortCut_T#3005' into develop 2026-06-12 16:33:15 +02:00
daniele.nicoli 198031a3c1 ProcessMortise - Elimina i tagli del piano ed eventuale cubettatura se già presente da un'altra feature, prima eliminava quelli della feature dando problemi con l'ordinamento. 2026-06-12 16:03:49 +02:00
daniele.nicoli ce2fcf4a42 ProcessCut e FacesBySaw.MakeOne - Modifica non ancora funzionante 2026-06-12 12:09:26 +02:00
andrea.villa 2f312c5cb8 Aggiunto controllo su massima lunghezza pezzo processabile 2026-06-10 15:05:12 +02:00
daniele.nicoli c9fae12574 Merge remote-tracking branch 'origin/HEAD' into develop 2026-06-09 09:47:02 +02:00
daniele.nicoli a137794c75 Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2026-06-09 09:46:01 +02:00
daniele.nicoli dac5b40d3b LapJoint - non viene eseguito Antisplint su facce chiuse e limitate da altre facce 2026-06-09 09:45:56 +02:00
luca.mazzoleni d255d8aaa9 update log 2026-06-08 09:38:13 +02:00
daniele.nicoli ce3fbd9b93 LapJoint CleanCorner - corretto calcolo inclinazione utensile (per utensili con angoli diversi) corretta e ottimizzata funzione controllo collisioni CalcInterference() e aggiunta inclinazione utensile in caso di Proc=25 Q01=2 2026-06-05 15:53:39 +02:00
daniele.nicoli fad52a8483 Merge remote-tracking branch 'origin/master' into develop 2026-06-04 09:05:29 +02:00
11 changed files with 203 additions and 60 deletions
+18
View File
@@ -277,6 +277,15 @@ if bToProcess then
else else
vBeam[i].Box = b3Solid vBeam[i].Box = b3Solid
end 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
-- Assegno lunghezza della barra -- Assegno lunghezza della barra
dBarLen = vBeam[1].Box:getDimX() + 10 dBarLen = vBeam[1].Box:getDimX() + 10
@@ -330,6 +339,15 @@ if bToProcess then
else else
vBeam[i].Box = b3Solid vBeam[i].Box = b3Solid
end 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
end end
+4 -2
View File
@@ -1641,7 +1641,8 @@ local function SetCutsOnFrontMortises( vProc)
-- verifico se i piani coincidono -- verifico se i piani coincidono
local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0) local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0)
if bSamePlane then if bSamePlane then
vProc[i].CutFront = vProc[j].Id --vProc[i].CutFront = vProc[j].Id
vProc[j].bSkipCut = true
end end
-- log -- log
local sMsg = string.format( 'Cut %d meet Mortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '') 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 -- verifico se i piani coincidono
local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0) local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0)
if bSamePlane then if bSamePlane then
vProc[i].CutFront = vProc[j].Id --vProc[i].CutFront = vProc[j].Id
vProc[j].bSkipCut = true
end end
-- log -- log
local sMsg = string.format( 'Cut %d meet DtMortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '') local sMsg = string.format( 'Cut %d meet DtMortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '')
+48 -1
View File
@@ -479,12 +479,16 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
-- determino il modo di tagliare -- determino il modo di tagliare
local vtOrthoO local vtOrthoO
local bNoPerpCuts = false local bNoPerpCuts = false
local vtO
-- Se tagli ortogonali (indice dispari)
if i % 2 == 1 then if i % 2 == 1 then
vtOrthoO = Vector3d( vtN) vtOrthoO = Vector3d( vtN)
-- Se tagli perpendicolari (indice pari)
else else
local vtO -- Se elemento precedente contiene tagli ortogonali
if #vCuts[i-1] > 0 then if #vCuts[i-1] > 0 then
vtO = EgtSurfTmFacetNormVersor( vCuts[i-1][1], 0, GDB_ID.ROOT) 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 elseif vCuts[i+1] and #vCuts[i+1] > 0 then
-- lunghezza faccia nell'eventuale direzione ortogonale -- lunghezza faccia nell'eventuale direzione ortogonale
local asseX = EgtSurfTmFacetNormVersor( vCuts[i+1][1], 0, GDB_ID.ROOT) 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 end
local bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw) 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 if not bOk2 then return false, sErr2 end
-- caso standard -- caso standard
else 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 -- lavoro la faccia
for j = 1, #vCuts[i] do for j = 1, #vCuts[i] do
-- se taglio dal basso -- se taglio dal basso
+3 -1
View File
@@ -594,8 +594,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local dHoleToCutDistance = vDistance[1] local dHoleToCutDistance = vDistance[1]
-- se il taglio accorcia realmente il foro -- se il taglio accorcia realmente il foro
if ( dHoleToCutDistance > 10 * GEO.EPS_SMALL or Proc.AffectedFaces.Right) and dHoleToCutDistance < dLen then 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 dMaxDepth = dMaxDepthOri
dMaxElev = dLen - dHoleToCutDistance dMaxElev = dLen - ( dHoleToCutDistance - dExtraSicDistFromThToTiltedCut)
bTryDrill = true bTryDrill = true
local dToolAddLength = dLen - dMaxElev local dToolAddLength = dLen - dMaxElev
-- se l'utensile è comunque troppo corto lavoro il massimo possibile -- se l'utensile è comunque troppo corto lavoro il massimo possibile
+1 -1
View File
@@ -236,7 +236,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- verifico se frontale -- verifico se frontale
local bFront = ( Proc.Prc == 56) local bFront = ( Proc.Prc == 56)
-- se mortasa di fronte, eseguo il taglio della faccia -- 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 -- verifico esista la faccia di taglio
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT) local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then
+113 -51
View File
@@ -2099,6 +2099,27 @@ local function MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3R
end end
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) 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 sMilling
local dMaxDepth = 0 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 -- cerco l'angolo di riferimento dove applicare il percorso di pulitura, altrimenti esco
local _, nIdLine, tFacAdj = ChooseCorner( Proc, nFacInd) local _, nIdLine, tFacAdj = ChooseCorner( Proc, nFacInd)
if #tFacAdj == 0 then if #tFacAdj == 0 then
@@ -2136,6 +2194,8 @@ local function MakeSharpCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacI
-- versore direzione -- versore direzione
local vtExtr = tFacAdj[nIdLine][nIdIniPoint] - tFacAdj[nIdLine][nIdEndPoint] local vtExtr = tFacAdj[nIdLine][nIdIniPoint] - tFacAdj[nIdLine][nIdEndPoint]
vtExtr:normalize() vtExtr:normalize()
-- versore direzione di uscita
local vtExtrExit
-- inserisco le prime tre linee -- inserisco le prime tre linee
if nIdIniPoint and nIdEndPoint then if nIdIniPoint and nIdEndPoint then
-- se fresatura da sotto salto la lavorazione -- se fresatura da sotto salto la lavorazione
@@ -2144,16 +2204,24 @@ local function MakeSharpCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacI
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- sommo i tre versori per avre una direzione media -- sommo i tre versori per avere una direzione media
vtExtr = vtN1 + vtN2 + vtN3 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() vtExtr:normalize()
-- recupero la lavorazione non calcolando l'elevazione local vtCheck = Vector3d(vtExtr)
sMilling = ML.FindMilling( 'CleanCorner', ( 0.5 * dDiam))
if not sMilling then -- controllo se c'è collisione con le facce della superfice
local sErr = 'Error : CleanCorner not found in library' if CalcInterference( Proc.Id, vtCheck, tFacAdj[nIdLine][nIdEndPoint], ToolData) then
local sErr = 'Collision detected between clean corner tool and surface'
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return true, ''
end end
-- recupero i dati dell'utensile ( temporaneo, per compensare errore nella lavorazione) -- recupero i dati dell'utensile ( temporaneo, per compensare errore nella lavorazione)
if EgtMdbSetCurrMachining( sMilling) then if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
@@ -4732,6 +4800,16 @@ local function ManageAntiSplintBySaw( Proc, b3Raw, b3Solid, bIsU, vtN, nFacInd,
local dSawThick = 0 local dSawThick = 0
local dMaxDepth = 200 local dMaxDepth = 200
local bAdj, dAng, dExtraOffs, sWarn2, nIdMach 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) 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 not bMadeASbyBld then return bMadeASbyBld, false, sWarn2 end
if sWarn2 then if sWarn2 then
@@ -6283,24 +6361,6 @@ local function ReorderFacesFromTab( nIdSurf, vFace)
return nIdSurf return nIdSurf
end 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) local function MakeLocalSurf( ptP1, ptP2, ptP3, nAddGrpId)
@@ -6331,8 +6391,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nAddGrpId, local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nAddGrpId,
dToolDiam, sMilling, dOffsAng, dToolDiam, sMilling, dOffsAng,
dDiam1, dDiam2, dTall1, ToolData, bMakeLocSurf, vFace, vtN)
dTall2, dDiam3, dTall3, bMakeLocSurf, vFace, vtN)
-- variabili costruzione geometria -- variabili costruzione geometria
local pAuxId = {} local pAuxId = {}
@@ -6412,8 +6471,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nAdd
vtCheck:rotate( vtN, dOffsAng) vtCheck:rotate( vtN, dOffsAng)
end end
-- controllo se c'è collisione con le facce della superfice -- controllo se c'è collisione con le facce della superfice
if CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint], dDiam1, dDiam2, if CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint], ToolData) then
dTall1, dTall2, dDiam3, dTall3) then
local sErr = 'Collision detect from clean corner tool and surface' local sErr = 'Collision detect from clean corner tool and surface'
EgtOutLog( sErr) EgtOutLog( sErr)
return true, '' return true, ''
@@ -6561,32 +6619,39 @@ local function AddMillCorner( vFace, Proc, dToolDiam, nAddGrpId, nMasterNewProc,
-- se ripresa angolo con fresa cono 60° con ripresa -- se ripresa angolo con fresa cono 60° con ripresa
-- recupero la lavorazione di fresatura -- recupero la lavorazione di fresatura
sMilling, dMaxDepth = ML.FindMilling( 'CleanCorner60') sMilling, dMaxDepth = ML.FindMilling( 'CleanCorner')
if not sMilling then if not sMilling then
local sErr = 'Error : CleanCorner 60 not found in library' local sErr = 'Error : CleanCorner not found in library'
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
local dMillDiam = 20 local ToolData = {
local dMillTotDiam = 20 dToolTotDiam = 20,
local dMillDiamTh = 20 dToolDiam = 20,
local dToolLength = 20 dSideAng = 0,
local dThickTool = 20 dCutEdgeLen = 20,
local dSideAng = 0 dToolLength = 20,
dStemDiameter = 20,
dStemLen = 20,
dDiamTh = 20,
dLenTh = 20
}
if EgtMdbSetCurrMachining( sMilling) then if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh ToolData.dToolTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or ToolData.dToolTotDiam
dMillTotDiam = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM) or dMillTotDiam ToolData.dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or ToolData.dToolDiam
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng ToolData.dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or ToolData.dSideAng
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam ToolData.dCutEdgeLen = abs( EgtTdbGetCurrToolParam( MCH_TP.THICK)) or ToolData.dCutEdgeLen
dThickTool = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThickTool ToolData.dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or ToolData.dToolLength
dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength ToolData.dStemDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or ToolData.dStemDiameter
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth -- qui è la distanza dal portautensile ToolData.dDiamTh = EgtTdbGetCurrToolThDiam() or ToolData.dDiamTh
ToolData.dLenTh = EgtTdbGetCurrToolThLength() or ToolData.dLenTh
-- calcolo il secondo diametro del cono -- 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
end end
-- copio la feature nel layer di appoggio -- copio la feature nel layer di appoggio
@@ -6664,21 +6729,18 @@ local function AddMillCorner( vFace, Proc, dToolDiam, nAddGrpId, nMasterNewProc,
-- primo taglio -- primo taglio
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nAddGrpId, local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nAddGrpId,
dToolDiam, sMilling, -dAngOffs, dToolDiam, sMilling, -dAngOffs,
dMillDiam, dMillTotDiam, abs( dThickTool), ToolData, bMakeLocSurf, vFace, vtN)
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace, vtN)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
-- secondo taglio -- secondo taglio
bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nAddGrpId, bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nAddGrpId,
dToolDiam, sMilling, dAngOffs, dToolDiam, sMilling, dAngOffs,
dMillDiam, dMillTotDiam, abs( dThickTool), ToolData, bMakeLocSurf, vFace, vtN)
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace, vtN)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
-- altrimenti ho un solo percorso -- altrimenti ho un solo percorso
else else
local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nAddGrpId, local bOk, sErr = AddMillCornerMachining( Proc.PartId, nNewProc, nFacInd, tFacAdj, nAddGrpId,
dToolDiam, sMilling, 0, dToolDiam, sMilling, 0,
dMillDiam, dMillTotDiam, abs( dThickTool), ToolData, bMakeLocSurf, vFace, vtN)
dMaxDepth, dMillDiamTh, dToolLength, bMakeLocSurf, vFace, vtN)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
end end
+2 -2
View File
@@ -32,7 +32,7 @@ local BD = require( 'BeamData')
local ML = require( 'MachiningLib') local ML = require( 'MachiningLib')
-- variabili assegnazione parametri Q -- variabili assegnazione parametri Q
local Q_DEPTH_CHAMFER = 'Q02' -- d local Q_DEPTH_CHAMFER = 'Q01' -- d
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Riconoscimento della feature -- Riconoscimento della feature
@@ -467,7 +467,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- se mortasa di fronte, eseguo il taglio della faccia -- 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 -- verifico esista la faccia di taglio
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT) local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then
+8
View File
@@ -89,6 +89,14 @@ local function MyProcessInputData()
else else
vBeam[i].Box = b3Solid vBeam[i].Box = b3Solid
end 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 end
dRawW = vBeam[1].Box:getDimY() dRawW = vBeam[1].Box:getDimY()
dRawH = vBeam[1].Box:getDimZ() dRawH = vBeam[1].Box:getDimZ()
+4
View File
@@ -1,5 +1,9 @@
==== Beam Update Log ==== ==== 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) Versione 3.1e2 (01/06/2026)
- Added : in Cut aggiunta Q18 per evitare di ruotare - Added : in Cut aggiunta Q18 per evitare di ruotare
- Modif : gli smussi di testa sono in senso orario - Modif : gli smussi di testa sono in senso orario
+1 -1
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di Beam -- Gestione della versione di Beam
NAME = 'Beam' NAME = 'Beam'
VERSION = '3.1e2' VERSION = '3.1f1'
MIN_EXE = '3.1b1' MIN_EXE = '3.1b1'