Compare commits

..

43 Commits

Author SHA1 Message Date
daniele.nicoli d756e4c44d LapJoint - CleanCorner ora funziona anche su tasche a 3 facce a U. 2026-06-23 08:53:15 +02:00
daniele.nicoli d2a9e9e189 LapJoint - migliorata gestione BirdsMouth con più di 3 facce 2026-06-19 09:31:19 +02:00
andrea.villa 8925c73639 Merge branch 'master' into develop 2026-06-18 16:50:32 +02:00
andrea.villa a083405552 Merge remote-tracking branch 'origin/develop' 2026-06-18 16:50:12 +02:00
andrea.villa 287a5b118f Aggiornato versione e log per rilascio a cliente 2026-06-18 16:49:04 +02:00
andrea.villa a6a61a8980 In Drill, gestione delle svuotature in doppio tipo NT 2026-06-18 16:48:11 +02:00
andrea.villa e82f03f191 Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2026-06-17 09:39:39 +02:00
andrea.villa efdbe5c001 Merge remote-tracking branch 'origin/master' into develop 2026-06-17 09:39:34 +02:00
daniele.nicoli e3057a1e53 Merge branch 'master' into develop 2026-06-17 09:20:12 +02:00
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 2c3b6030c2 update log 2026-06-08 09:41:34 +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
Dario Sassi e4f448bcf0 Merge commit 'bf58b58b478d65f06e3e14e6de47d58bd21be7e5' 2026-06-01 07:48:26 +02:00
Dario Sassi bf58b58b47 DataBeam 3.1e2 :
- piccoli aggiustamenti
- sistemazioni a DtMortise per macchina Oikos XL.
2026-06-01 07:47:20 +02:00
andrea.villa 3445fb2525 Smussi di testa in senso orario 2026-05-22 14:08:01 +02:00
daniele.nicoli 723713707f ProcessCut.Classify - Aggiunta Q18 che evita che la trave ruoti in caso di taglio di testa se la dimensione del taglio richiede dicecut. 2026-05-20 13:36:03 +02:00
luca.mazzoleni fd0a52ad6b Merge tag '3.1e1' into develop
3.1e1
2026-05-05 13:32:31 +02:00
luca.mazzoleni 3e2ae92adc Merge branch 'release/3.1e1' 2026-05-05 13:32:11 +02:00
luca.mazzoleni c746a11e45 update log e version 2026-05-05 13:32:02 +02:00
luca.mazzoleni d337e4cc18 Merge remote-tracking branch 'origin/Test_DrillDouble_NoLastStep' into develop 2026-05-05 13:28:46 +02:00
daniele.nicoli 5fcaf823a0 ProcessDrill - lavorazioni in doppio: tolto foro singolo di sfondamento se utensile non è abbastanza lungo.
In tal caso profondità lavorazione in doppio aumentata al massimo della possibilità dell'utensile.
2026-04-28 16:25:38 +02:00
daniele.nicoli 6b76dd2f4f Merge branch 'Test_Tick#2925' into develop 2026-04-28 11:01:39 +02:00
andrea.villa cc7f5abf40 Merge branch 'master' into develop 2026-04-22 14:33:58 +02:00
Dario Sassi 389e722f7c DataBean 3.1d3 :
- prime aggiunte per nuova gestione tipo robot di macchina con tre assi rotanti (Scm Oikos).
2026-04-21 08:20:09 +02:00
daniele.nicoli 946f5e8bf6 LapJoint - Tolto controllo nella BeamLib (situazione precedente) e inserito controllo direttamente nella MakeByChainOrSaw() 2026-04-17 15:29:14 +02:00
daniele.nicoli a5cd84172e LapJoint - Aggiunto caso di Slot su testa o coda con lato di fondo inclinato e lati aperti sui fianchi. 2026-04-17 12:54:35 +02:00
luca.mazzoleni 895740feff Merge tag '3.1d2' into develop
3.1d2
2026-04-10 09:42:55 +02:00
14 changed files with 444 additions and 98 deletions
+18
View File
@@ -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
+7 -2
View File
@@ -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', '')
@@ -1991,6 +1993,9 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
end
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
local dToolDoubleMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
if ( sType == 'Pocket_AT' or sType == 'Pocket') then
dToolDoubleMaxDepth = EgtTdbGetCurrToolMaxDepth()
end
dMachiningDepth = min( dMachiningDepth, dToolDoubleMaxDepth)
-- recupero la lunghezza della parte inclinata della punta
local dToolDoubleTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN)
+19
View File
@@ -883,6 +883,25 @@ function BeamLib.GetBlockedAxis( sMachining, sBlockedAxis, b3Raw, vtTool, vtOut)
return ''
end
---------------------------------------------------------------------
function BeamLib.GetAuxDir( sMachining, sBlockedAxis, b3Raw, vtTool, vtOut)
-- informazioni sull'utensile della lavorazione
local nToolType, sHead
if EgtMdbSetCurrMachining( sMachining) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
nToolType = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
end
end
-- se presente funzione specifica nella macchina, la richiamo
if BD.GetAuxDir then
return BD.GetAuxDir( sHead, nToolType, sBlockedAxis, b3Raw, vtTool, vtOut)
end
-- niente
return nil
end
---------------------------------------------------------------------
-- Trova l'Ind (0 based) della faccia meglio orientata come l'asse vtAx. Restituisce anche vtN e ptC della faccia stessa. La faccia di indice (0 based) fctExclude non viene considerata nella ricerca.
function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
+13 -1
View File
@@ -170,6 +170,12 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
end
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtTool, vtOut))
local sAuxDir, sInitAngs = BL.GetAuxDir( sCutting, 'perpendicular', b3Raw, vtTool, vtOut)
if sAuxDir then
sNotes = EgtSetValInNotes( sNotes, 'VtAuxDir', sAuxDir)
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
end
-- eventuali note
if ( sLeadInOutType == 'PerpendicularOutraw') then
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
@@ -451,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
@@ -631,6 +637,12 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
-- imposto angolo 3° asse rot
local sBlockedAxis = EgtIf( bMaximizeVerticalDepth, 'parallel', 'perpendicular')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO))
local sAuxDir, sInitAngs = BL.GetAuxDir( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO)
if sAuxDir then
sNotes = EgtSetValInNotes( sNotes, 'VtAuxDir', sAuxDir)
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
end
-- eventuali note
if ( sLeadInOutType == 'PerpendicularOutraw') then
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
+51 -3
View File
@@ -63,6 +63,7 @@ function ProcessCut.Classify( Proc, b3Raw)
if ( BD.C_SIMM and BD.DOWN_HEAD) or BD.TURN then
return true
end
local bForceNoBeamRotation = ( EgtGetInfo( Proc.Id, 'Q18', 'i') == 1)
-- recupero i dati del taglio
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
-- calcolo le massime estensioni lineari orizzontale e verticale della faccia
@@ -73,7 +74,7 @@ function ProcessCut.Classify( Proc, b3Raw)
then
-- confronto queste estensioni con la massima dimensione del DiceCut (impossibile lavorare se entrambe maggiori)
if DimH > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL and DimV > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL then
return true, true
return true, not bForceNoBeamRotation
end
end
-- se è un taglio da sotto, lo verifico
@@ -96,7 +97,7 @@ function ProcessCut.Classify( Proc, b3Raw)
_, 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
return true, not bForceNoBeamRotation
end
end
return true, false
@@ -478,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)
@@ -551,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
+18 -7
View File
@@ -348,6 +348,11 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if EgtGetInfo( Proc.Id, 'Q04', 'i') == 1 then
return FreeContour.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
-- verifico se macchina configurata per avere le nuove svuotature in doppio
local sIniMachFile = EgtGetCurrMachineDir()..'\\'..EgtGetCurrMachineName()..'.ini'
local dPockDoubleNTActive = ( EgtGetStringFromIni( 'Machinings', 'PocketingDoubleNT', '0', sIniMachFile) == '1')
-- default per costanti
BD.DRILL_VX_MAX_ANGLEDRILL = ( BD.DRILL_VX_MAX_ANGLEDRILL or 0.928)
-- ingombro del pezzo
@@ -594,8 +599,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
@@ -613,6 +620,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
end
end
local dDepthOri = dDepth
-- se foro da saltare per eccessiva inclinazione
if not bTryDrill then
sMyWarn = 'Warning in drill : too slant hole'
@@ -650,10 +658,13 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local dLastStepDepth
if Proc.Double and Proc.Double > 0 then
if ( sType == 'Pocket_AT' or sType == 'Pocket') then
if bOpen then
if not dPockDoubleNTActive and bOpen then
local dReduceDepth = MIRROR_POCKETS_MIN_DISTANCE / 2 + 10
dLastStepDepth = dDepth + dReduceDepth
dDepth = dDepth - dReduceDepth
if ( dLastStepDepth > dMaxDepth + 10 * GEO.EPS_SMALL) and ( dMaxDepth <= ( dLen / 2) - dReduceDepth) and ( dDepthOri ~= dDepth) then
dDepth = dMaxDepth
end
end
else
sUserNotes = EgtSetValInNotes( sUserNotes, 'LastStep', MIRROR_DRILLINGS_MIN_DISTANCE / 2 + 15)
@@ -717,13 +728,13 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sWarn
else
-- se DrillPocket passante in doppio si fa lavorazione aggiuntiva dell'ultimo step
if Proc.Double and Proc.Double > 0 and ( sType == 'Pocket_AT' or sType == 'Pocket') and bOpen then
if not dPockDoubleNTActive and Proc.Double and Proc.Double > 0 and ( sType == 'Pocket_AT' or sType == 'Pocket') and bOpen then
if dLastStepDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
sMyWarn = 'Warning in drill pocket last step: depth (' .. EgtNumToString( dLastStepDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
return false, sMyWarn
end
local idMachiningLastStep = EgtCopyMachining( EgtIf( EgtStartsWith( sType, 'Predrill'), 'Predrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)), sName)
EgtSetCurrMachining( idMachiningLastStep)
if dLastStepDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
sMyWarn = 'Warning in drill pocket last step: depth (' .. EgtNumToString( dLastStepDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
dLastStepDepth = dMaxDepth
end
local dMaxElevLastStep = dLastStepDepth - dDepth
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElevLastStep, 1))
EgtSetMachiningParam( MCH_MP.DEPTH, dLastStepDepth)
+29 -5
View File
@@ -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
@@ -362,7 +362,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
dMaxMat = 30
dSideAng = 0
bCW = true
bMillOnAggregate = sMchExt == '_AT'
bMillOnAggregate = ( sMchExt == '_AT')
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
@@ -424,8 +424,16 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Aux2Id, -1}})
-- dichiaro non si generano sfridi per VMill
-- recupero note utente per aggiornarle
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
-- eventuali impostazioni per 3° asse rot
local sAuxDir, sInitAngs = BL.GetAuxDir( sPocketing, "", b3Solid, vtExtr, vtExtr)
if sAuxDir then
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtAuxDir', sAuxDir)
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
end
-- dichiaro non si generano sfridi per VMill
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
@@ -537,8 +545,16 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if nSCC then
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end
-- dichiaro non si generano sfridi per VMill
-- recupero note utente per aggiornarle
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
-- eventuali impostazioni per 3° asse rot
local sAuxDir, sInitAngs = BL.GetAuxDir( sMilling, "", b3Solid, vtExtr, vtExtr)
if sAuxDir then
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtAuxDir', sAuxDir)
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
end
-- dichiaro non si generano sfridi per VMill
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dAltMort, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
-- se lavorazione in doppio
@@ -697,12 +713,20 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if nSCC then
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end
-- recupero note utente per aggiornarle
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
-- eventuali impostazioni per 3° asse rot
local sAuxDir, sInitAngs = BL.GetAuxDir( sMilling, "", b3Solid, vtExtr, vtExtr)
if sAuxDir then
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtAuxDir', sAuxDir)
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
end
-- dichiaro massima elevazione e assenza sfridi per VMill
local dMaxElev = dMaxMat
if bMultipleZPasses then
dMaxElev = dVerticalStep
end
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
+7 -4
View File
@@ -162,10 +162,11 @@ 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
return true, nil
end
-- recupero gruppo per geometria aggiuntiva
@@ -254,7 +255,8 @@ local function MakeHeadChamfer( idProc, nPartId)
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthHeadChamfer + dExtra)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -639,11 +641,12 @@ 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
if sErrHeadChamfer then
sErr = sErr..'\n'..sErrHeadChamfer
end
else
sErr = sErrHeadChamfer
end
+252 -71
View File
@@ -1004,7 +1004,7 @@ end
---------------------------------------------------------------------
-- Lavorazione con fresa
---------------------------------------------------------------------
local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId, nForcedFacInd, nSideInd)
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
-- recupero l'ingombro della trave
@@ -1015,13 +1015,16 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
return false, sErr
end
-- verifico il numero di facce della tacca
assert( ( Proc.Fct == 1), 'Error : MakeOneFaceByMill in LapJoint with ' .. tostring( Proc.Fct) .. ' faces')
if not nForcedFacInd then
assert( ( Proc.Fct == 1), 'Error : MakeOneFaceByMill in LapJoint with ' .. tostring( Proc.Fct) .. ' faces')
nForcedFacInd = 0
end
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nForcedFacInd, GDB_ID.ROOT)
-- verifico se orientata verso l'alto
local bUp = ( vtN:getZ() >= BD.NZ_MINA)
-- scelta faccia da lavorare
local nFacInd = 0
local nFacInd = nForcedFacInd
-- recupero la lavorazione
local sMilling = ML.FindMilling( 'BirdsMouth')
if not sMilling then
@@ -1029,6 +1032,16 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
local dTDiam = 50
local dMaxMat = 0
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
end
end
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
-- inserisco la lavorazione di fresatura
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling)
@@ -1039,8 +1052,17 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd}})
-- imposto uso faccia e lato correzione
if vtN:getX() > 0 then
-- imposto uso faccia e lato correzione se forzate da fuori forzo lavorazione della faccia
if nSideInd and nForcedFacInd then
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.NONE)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dTDiam / 2)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dTDiam / 2)
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'EdgesFaceUse', EgtNumToString( nSideInd))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
EgtSetMachiningParam( MCH_MP.LIPERP, dTDiam / 2)
EgtSetMachiningParam( MCH_MP.LOPERP, dTDiam / 2)
elseif vtN:getX() > 0 then
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bUp, MCH_MILL_FU.ORTHO_LEFT, MCH_MILL_FU.PARAL_LEFT))
else
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bUp, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.PARAL_RIGHT))
@@ -2099,6 +2121,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 +2154,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 +2216,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 +2226,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)
@@ -3408,7 +3498,9 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
bGoFromHead = false
-- continuo di testa se fessura con tre facce o non è tunnel
else
bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces)
bGoFromHead = (( bIs3Faces and ( dMaxElev
or ( Proc.Topology == 'Groove' and Proc.IsThrough and (Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and not Proc.IsParallel)))
or not bOrthoFaces)
end
end
-- se continuo a lavorare di testa
@@ -3473,17 +3565,35 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
-- imposto offset radiale
local dOffs = ( i - 1) * dStep
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
local bElevAdj
local dToolEntryAngle, _, _, dTanToolEntryAngle = GetToolEntryAngle( Proc, rfFac:getVersZ())
-- se necessario, avverto limitazione dell'affondamento
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth)
sWarn = 'Warning in LapJoint : elevation (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
EgtOutLog( sWarn)
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
if Proc.Fct == 3 and Proc.Topology == 'Groove' and Proc.IsThrough and (Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and not Proc.IsParallel then
local Edges = BL.GetEdgesInfo( Proc, Proc.Face[nFacAdj+1])
local dWorkEdgeWidth
for i = 1, #Edges do
if Edges[i].AdjacentFaceId == nFacInd then
dWorkEdgeWidth = Edges[i].Length
break
end
end
local dDeltaDepth = dWorkEdgeWidth * cos( dToolEntryAngle)
bElevAdj = true
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dDeltaDepth)
else
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth)
sWarn = 'Warning in LapJoint : elevation (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
EgtOutLog( sWarn)
end
--local dDepth = dMaxDepth - dElev
--EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH '..EgtNumToString( dDepth, 1))
end
-- imposto massima elevazione
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 2))
local dElevAdj = EgtIf( bElevAdj, dElev / sin( dToolEntryAngle), dElev)
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElevAdj, 2))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
@@ -4679,7 +4789,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
end
end
end
return 1, sWarn, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId
return 1, sWarn, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId, nil, sPocketing
end
end
end
@@ -4712,6 +4822,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
@@ -6263,24 +6383,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)
@@ -6311,8 +6413,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 = {}
@@ -6392,8 +6493,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, ''
@@ -6541,32 +6641,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
@@ -6644,21 +6751,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
@@ -7429,14 +7533,34 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
-- provo con contornatura
local dDiamTool = 20
local nChoosenFacInd = nFacInd2
local dChoosenFacElev = dFacElev2
if bIsL then
local bOk, sErr
bOk, sWarn, dDiamTool = MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, dCollSic, true, sMilling, nFacInd2, dFacElev2)
if not bOk then return bOk, sWarn end
else
local sErr = 'Error : Impossible mill special LapJoint'
EgtOutLog( sErr)
return false, sErr
-- provo ancora con la pocketing dell'altra faccia
local sPocketing = ML.FindPocketing( sMchFind, dDiam, dFacElev + dCollSic)
if sPocketing then
nChoosenFacInd = nFacInd
dChoosenFacElev = dFacElev
local Edges = BL.GetEdgesInfo( Proc, Proc.Face[nFacInd+1])
local nSideInd
for i = 1, #Edges do
if Edges[i].AdjacentFaceId == nFacInd2 then
nSideInd = i - 1
break
end
end
-- se pocketing ok forza facet e spigolo di lavoro
bOk, sWarn = MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId, nFacInd2, nSideInd)
if not bOk then return bOk, sWarn end
else
local sErr = 'Error : Impossible mill special LapJoint'
EgtOutLog( sErr)
return false, sErr
end
end
-- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
@@ -7447,7 +7571,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd2}})
EgtSetMachiningGeometry( {{ Proc.Id, nChoosenFacInd}})
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
-- imposto posizione braccio porta testa
@@ -7462,7 +7586,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
-- imposto elevazione
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dFacElev2, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dChoosenFacElev, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
@@ -7986,7 +8110,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
bSetOpenBorders = true
end
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
bOrthoFaces, sPocketing = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
if nOk == -3 then
bTryWithBlades = true
elseif nOk == -2 then
@@ -8020,6 +8144,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
-- se abilitato dal parametro Q inserisco pulitura spigoli o contorno con fresa più piccola
local nContourSmallTool = EgtGetInfo( Proc.Id, Q_CONTOUR_SMALL_TOOL, 'i') or 0
local nCleanCorner = EgtGetInfo( Proc.Id, Q_CLEAN_CORNER, 'i') or 0
if nContourSmallTool > 0 then
local bOk, sWarn2 = MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3Raw,
nFacInd, nAddGrpId, dDiamTool, nContourSmallTool, bMillDown,
@@ -8031,6 +8156,43 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
end
end
-- se richiesta pulizia spigoli con fresa a V
if nCleanCorner > 0 then
local dMaxToolMaterial = 0
if EgtMdbSetCurrMachining( sPocketing) then
local sTuuidPk = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then
dMaxToolMaterial = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxToolMaterial
end
end
local nNewProc
local vtSpec = vtN
if not ( Proc.Fct == 3 and bIsU) then
nNewProc = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacInd, vtN)
-- se U passante ricavo vettore da "sopra" con componente Z forzata in positivo
else
nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
local nNumFacet = EgtSurfTmFacetCount( nNewProc)
-- vettore normale ad una delle facce adiacenti
local vtOther = EgtSurfTmFacetNormVersor( Proc.Id, Proc.Face[nFacInd+1].Adjacencies[1], GDB_ID.ROOT)
-- ricavo vettore verso l'alto (simulo faccia di fondo)
vtSpec = vtN ^ vtOther
-- se negativo in Z forzo positivo
if vtSpec:getZ() < 0 then
vtSpec:mirror(vtSpec)
end
ReorderFaces( nNewProc, nNumFacet, vtSpec)
-- normale della lavorazione clean corner
vtN = vtSpec
end
local vFace, dDepth = GetFacesData( nNewProc, dDiamTool, dMaxToolMaterial, ( dDiamTool/2), nAddGrpId, Proc.PartId, vtN)
local bCleanCornerOk, sCleanCornerWarn = AddMillCorner( vFace, Proc, dDiamTool, nAddGrpId, nNewProc, vtN)
if not bCleanCornerOk then return false, sCleanCornerWarn end
if sCleanCornerWarn then
if not sWarn then sWarn = '' end
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sCleanCornerWarn, sCleanCornerWarn)
end
end
end
end
bOk = true
@@ -8246,7 +8408,26 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
-- se richiesta pulizia spigoli con fresa a V
if nCleanCorner > 0 then
local dThElev = dToolThDiameter / 2 * sqrt( vtN:getX() * vtN:getX() + vtN:getY() * vtN:getY())
local nNewProc = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacInd, vtN)
local nNewProc
local vtSpec = vtN
if not ( Proc.Fct == 3 and bIsU) then
nNewProc = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacInd, vtN)
-- se U passante ricavo vettore da "sopra" con componente Z forzata in positivo
else
nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
local nNumFacet = EgtSurfTmFacetCount( nNewProc)
-- vettore normale ad una delle facce adiacenti
local vtOther = EgtSurfTmFacetNormVersor( Proc.Id, Proc.Face[nFacInd+1].Adjacencies[1], GDB_ID.ROOT)
-- ricavo vettore verso l'alto (simulo faccia di fondo)
vtSpec = vtN ^ vtOther
-- se negativo in Z forzo positivo
if vtSpec:getZ() < 0 then
vtSpec:mirror(vtSpec)
end
ReorderFaces( nNewProc, nNumFacet, vtSpec)
-- normale della lavorazione clean corner
vtN = vtSpec
end
local vFace, dDepth = GetFacesData( nNewProc, dToolDiameter, dMaxToolMaterial, ( dToolDiameter/2), nAddGrpId, Proc.PartId, vtN)
local bCleanCornerOk, sCleanCornerWarn = AddMillCorner( vFace, Proc, dToolDiameter, nAddGrpId, nNewProc, vtN)
if not bCleanCornerOk then return false, sCleanCornerWarn end
+2 -2
View File
@@ -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
+2 -1
View File
@@ -258,7 +258,8 @@ local function MakeTailChamfer( idProc, nPartId, dDepthTailChamfer)
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthTailChamfer + dExtra)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
+8
View File
@@ -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()
+16
View File
@@ -1,5 +1,21 @@
==== Beam Update Log ====
Versione 3.1f2 (18/06/2026)
- Added : Gestione svuotature in doppio tipo NT
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
- Modif : in mortasa coda di rondine piccole correzioni
Versione 3.1e1 (05/05/2026)
- Modif : in LapJoint migliorate slot con sega a catena
- Fixed : in DrillPocket in doppio eliminata lavorazione aggiuntiva in caso di utensile non abbastanza lungo
Versione 3.1d2 (10/04/2026)
- Added : in StepJoint aggiunto Q02=1 per forzare fresa
- Added : in DtMortise aggiunto Q01=1 per disabilitare antischeggia
+2 -2
View File
@@ -1,6 +1,6 @@
-- Version.lua by Egaltech s.r.l. 2026/02/09
-- Version.lua by Egaltech s.r.l. 2026/05/31
-- Gestione della versione di Beam
NAME = 'Beam'
VERSION = '3.1d2'
VERSION = '3.1f2'
MIN_EXE = '3.1b1'