Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d7e9e09b3 | |||
| 198031a3c1 | |||
| 2f312c5cb8 | |||
| c9fae12574 | |||
| a137794c75 | |||
| dac5b40d3b | |||
| 2c3b6030c2 | |||
| d255d8aaa9 | |||
| ce3fbd9b93 | |||
| fad52a8483 | |||
| e4f448bcf0 | |||
| bf58b58b47 | |||
| 3445fb2525 |
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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', '')
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ function ProcessCut.Classify( Proc, b3Raw)
|
|||||||
if ( BD.C_SIMM and BD.DOWN_HEAD) or BD.TURN then
|
if ( BD.C_SIMM and BD.DOWN_HEAD) or BD.TURN then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
local bForceNoBeamRotation = EgtGetInfo( Proc.Id, 'Q18', 'd') or 0 == 1
|
local bForceNoBeamRotation = ( EgtGetInfo( Proc.Id, 'Q18', 'i') == 1)
|
||||||
-- recupero i dati del taglio
|
-- recupero i dati del taglio
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||||
-- calcolo le massime estensioni lineari orizzontale e verticale della faccia
|
-- calcolo le massime estensioni lineari orizzontale e verticale della faccia
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -362,7 +362,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
dMaxMat = 30
|
dMaxMat = 30
|
||||||
dSideAng = 0
|
dSideAng = 0
|
||||||
bCW = true
|
bCW = true
|
||||||
bMillOnAggregate = sMchExt == '_AT'
|
bMillOnAggregate = ( sMchExt == '_AT')
|
||||||
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
|
||||||
@@ -424,8 +424,16 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ Aux2Id, -1}})
|
EgtSetMachiningGeometry( {{ Aux2Id, -1}})
|
||||||
-- dichiaro non si generano sfridi per VMill
|
-- recupero note utente per aggiornarle
|
||||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
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, 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1))
|
||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
@@ -537,8 +545,16 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
if nSCC then
|
if nSCC then
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
end
|
end
|
||||||
-- dichiaro non si generano sfridi per VMill
|
-- recupero note utente per aggiornarle
|
||||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
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, 'MaxElev', EgtNumToString( dAltMort, 1))
|
||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||||
-- se lavorazione in doppio
|
-- se lavorazione in doppio
|
||||||
@@ -697,12 +713,20 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
if nSCC then
|
if nSCC then
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
end
|
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
|
-- dichiaro massima elevazione e assenza sfridi per VMill
|
||||||
local dMaxElev = dMaxMat
|
local dMaxElev = dMaxMat
|
||||||
if bMultipleZPasses then
|
if bMultipleZPasses then
|
||||||
dMaxElev = dVerticalStep
|
dMaxElev = dVerticalStep
|
||||||
end
|
end
|
||||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
|
||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1))
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1))
|
||||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
|
||||||
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
|
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
|
||||||
|
|||||||
@@ -162,10 +162,11 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- smussi in testa
|
-- smussi in testa
|
||||||
local function MakeHeadChamfer( idProc, nPartId)
|
local function MakeHeadChamfer( idProc, nPartId)
|
||||||
|
|
||||||
local dDepthHeadChamfer = EgtGetInfo( idProc, 'Q08', 'd') or 0
|
local dDepthHeadChamfer = EgtGetInfo( idProc, 'Q08', 'd') or 0
|
||||||
-- se non attivo esco subito
|
-- se non attivo esco subito
|
||||||
if dDepthHeadChamfer < 100 * GEO.EPS_SMALL then
|
if dDepthHeadChamfer < 100 * GEO.EPS_SMALL then
|
||||||
return
|
return true, nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- recupero gruppo per geometria aggiuntiva
|
-- recupero gruppo per geometria aggiuntiva
|
||||||
@@ -254,7 +255,8 @@ local function MakeHeadChamfer( idProc, nPartId)
|
|||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthHeadChamfer + dExtra)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthHeadChamfer + dExtra)
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||||
-- assegno lato di lavoro
|
-- 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
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
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)
|
local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, HeadCutType, Cutting1Data, Cutting2Data, nil, dOvmHead)
|
||||||
|
|
||||||
|
|
||||||
-- alla fine del taglio si aggiungono gli smussi in testa
|
-- alla fine del taglio si aggiungono gli smussi in testa
|
||||||
local _, sErrHeadChamfer = MakeHeadChamfer( nOriId or Proc.Id, nPartId)
|
local _, sErrHeadChamfer = MakeHeadChamfer( nOriId or Proc.Id, nPartId)
|
||||||
if sErr then
|
if sErr then
|
||||||
sErr = sErr..'\n'..sErrHeadChamfer
|
if sErrHeadChamfer then
|
||||||
|
sErr = sErr..'\n'..sErrHeadChamfer
|
||||||
|
end
|
||||||
else
|
else
|
||||||
sErr = sErrHeadChamfer
|
sErr = sErrHeadChamfer
|
||||||
end
|
end
|
||||||
|
|||||||
+113
-51
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -258,7 +258,8 @@ local function MakeTailChamfer( idProc, nPartId, dDepthTailChamfer)
|
|||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthTailChamfer + dExtra)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthTailChamfer + dExtra)
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||||
-- assegno lato di lavoro
|
-- 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
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
==== Beam Update Log ====
|
==== Beam Update Log ====
|
||||||
|
|
||||||
|
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)
|
Versione 3.1e1 (05/05/2026)
|
||||||
- Modif : in LapJoint migliorate slot con sega a catena
|
- Modif : in LapJoint migliorate slot con sega a catena
|
||||||
- Fixed : in DrillPocket in doppio eliminata lavorazione aggiuntiva in caso di utensile non abbastanza lungo
|
- Fixed : in DrillPocket in doppio eliminata lavorazione aggiuntiva in caso di utensile non abbastanza lungo
|
||||||
|
|||||||
+2
-2
@@ -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
|
-- Gestione della versione di Beam
|
||||||
|
|
||||||
NAME = 'Beam'
|
NAME = 'Beam'
|
||||||
VERSION = '3.1e1'
|
VERSION = '3.1e2'
|
||||||
MIN_EXE = '3.1b1'
|
MIN_EXE = '3.1b1'
|
||||||
|
|||||||
Reference in New Issue
Block a user