Merge branch 'release/2.6l1'

This commit is contained in:
luca.mazzoleni
2024-12-11 14:35:59 +01:00
4 changed files with 61 additions and 49 deletions
+19 -17
View File
@@ -777,9 +777,9 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
-- creo superfice locale o esco
local nSurfToAdd = MakeLocalSurf( tFacAdj[7], tFacAdj[8], tFacAdj[9], nAddGrpId)
if nSurfToAdd then
local nFacCntPre = EgtSurfTmFacetCount( nNewProc)
local nFacCntPre = EgtSurfTmFacetCount( nNewProc.Id)
-- creo copia del percorso principale e gli aggiungo la nuova faccia
nNewProcLoc = EgtCopyGlob( nNewProc, nAddGrpId)
nNewProcLoc = EgtCopyGlob( nNewProc.Id, nAddGrpId)
nNewProcLoc = EgtSurfTmBySewing( nAddGrpId, {nNewProcLoc,nSurfToAdd} , true)
-- riordino le facce
ReorderFacesFromTab( nNewProcLoc, vFace)
@@ -790,7 +790,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
return true, ''
end
else
nNewProcLoc = nNewProc
nNewProcLoc = nNewProc.Id
end
-- prendo il primo versore
local _, vtN1 = EgtSurfTmFacetCenter( nNewProcLoc, nFacInd, GDB_ID.ROOT)
@@ -847,7 +847,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
vtCheck:rotate( Z_AX(), dOffsAng)
end
-- controllo se c'è collisione con le facce della superfice
if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
dTall1, dTall2, dDiam3, dTall3) then
local sErr = 'Collision detect from clean corner tool and surface'
EgtOutLog( sErr)
@@ -944,6 +944,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
-- trasformo in percorso
if #pAuxId > 0 then
AuxId = EgtCurveCompo( nAddGrpId, pAuxId, true)
EgtSetInfo( AuxId, 'TASKID', nNewProc.TaskId)
EgtSetInfo( AuxId, 'CUTID', nNewProc.CutId)
end
-- se non c'é il percorso do errore
if not AuxId then
@@ -958,8 +960,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
EgtRotate( AuxId, tFacAdj[nIdEndPoint], Z_AX(), dOffsAng, GDB_RT.GLOB)
end
-- inserisco la lavorazione
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
local nMchId = WM.AddMachining( nNewProc, sName, sMilling)
local sName = 'Clean_' .. ( EgtGetName( nNewProc.Id) or tostring( nNewProc.Id))
local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling)
if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr)
@@ -1052,26 +1054,26 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
-- verifico se ciclo chiuso
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
-- copio la feature nel layer di appoggio
local nNewProc
local nNewProc = { CutId = Proc.CutId, TaskId = Proc.TaskId}
if nMasterNewProc then
nNewProc = nMasterNewProc
nNewProc.Id = nMasterNewProc
else
nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
nNewProc.Id = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
end
local nFacCnt = EgtSurfTmFacetCount( nNewProc)
local nFacCnt = EgtSurfTmFacetCount( nNewProc.Id)
local nFacInd, dDepth, nSurfInt
local bMakeLocSurf
-- RIMUOVERE
if false and nFacCnt <= 4 then
-- recupero profondità e faccia di fondo
_, _, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId, bClosed)
_, _, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc.Id, Proc.PartId, nAddGrpId, bClosed)
if nSurfInt then
-- aggiungo la faccia di fondo appena calcolata
nNewProc = EgtSurfTmBySewing( nAddGrpId, { nNewProc, nSurfInt}, true)
nNewProc.Id = EgtSurfTmBySewing( nAddGrpId, { nNewProc.Id, nSurfInt}, true)
-- riordino le facce
ReorderFacesFromTab( nNewProc, vFace)
ReorderFacesFromTab( nNewProc.Id, vFace)
-- aggiorno numero di facce e assegno indice di quella di fondo (sempre ultima)
nFacCnt = EgtSurfTmFacetCount( nNewProc)
nFacCnt = EgtSurfTmFacetCount( nNewProc.Id)
nFacInd = nFacCnt - 1
else
return true
@@ -1119,7 +1121,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
ptLoc2 = vFace[k].PPrev
end
-- ricavo i punti e l'angolo interno
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT)
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc.Id, nFace1, nFace2, GDB_ID.ROOT)
-- se punti validi e angolo è interno e non è quasi piatto e >= 90 creo istanza
local tFacAdj = {}
if ptP1 and ptP2 and dAng < 0 and dAng < -6 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then
@@ -1157,8 +1159,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
i = i + 1
end
-- cancello la copia della superfice
if nNewProc then
EgtErase( nNewProc)
if nNewProc.Id then
EgtErase( nNewProc.Id)
end
return true
end
+35 -31
View File
@@ -692,15 +692,15 @@ local function CalcInterference( nNewProc, vtExtr, ptCentr, dDiam1, dDiam2,
local ptCentrGrid1 = ptCentr + ( vtExtr * 0.01)
local frOriTool = Frame3d( ptCentrGrid1, vtExtr)
local bColl1 = EgtCDeConeSolid( frOriTool, dDiam1/2, dDiam2/2, dTall1, nNewProc, 0, GDB_RT.GLOB)
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 = EgtCDeCylSolid( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB)
local bColl2 = EgtTestCylSurface( frOriTool, dDiam2/2, (dTall2-dTall1), nNewProc, 0, GDB_RT.GLOB)
if bColl2 then return true end
local ptCentrGrid3 = ptCentr + ( vtExtr * ( dTall2 + 0.01))
frOriTool = Frame3d( ptCentrGrid3, vtExtr)
local bColl3 = EgtCDeCylSolid( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB)
local bColl3 = EgtTestCylSurface( frOriTool, dDiam3/2, (dTall3-dTall2), nNewProc, 0, GDB_RT.GLOB)
if bColl3 then return true end
-- restituisco risultato controllo collisioni
return false
@@ -760,9 +760,9 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
-- creo superfice locale o esco
local nSurfToAdd = MakeLocalSurf( tFacAdj[7], tFacAdj[8], tFacAdj[9], nAddGrpId)
if nSurfToAdd then
local nFacCntPre = EgtSurfTmFacetCount( nNewProc)
local nFacCntPre = EgtSurfTmFacetCount( nNewProc.Id)
-- creo copia del percorso principale e gli aggiungo la nuova faccia
nNewProcLoc = EgtCopyGlob( nNewProc, nAddGrpId)
nNewProcLoc = EgtCopyGlob( nNewProc.Id, nAddGrpId)
nNewProcLoc = EgtSurfTmBySewing( nAddGrpId, {nNewProcLoc,nSurfToAdd} , true)
-- riordino le facce
nNewProcLoc = ReorderFacesFromTab( nNewProcLoc, vFace)
@@ -775,7 +775,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
return true, ''
end
else
nNewProcLoc = nNewProc
nNewProcLoc = nNewProc.Id
end
-- prendo il primo versore
local _, vtN1 = EgtSurfTmFacetCenter( nNewProcLoc, nFacInd, GDB_ID.ROOT)
@@ -829,7 +829,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
vtCheck:rotate( Z_AX(), dOffsAng)
end
-- controllo se c'è collisione con le facce della superfice
if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
if nTypeConeCut == 1 and CalcInterference( nNewProc.Id, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
dTall1, dTall2, dDiam3, dTall3) then
local sErr = 'Collision detect from clean corner tool and surface'
EgtOutLog( sErr)
@@ -926,6 +926,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
-- trasformo in percorso
if #pAuxId > 0 then
AuxId = EgtCurveCompo( nAddGrpId, pAuxId, true)
EgtSetInfo( AuxId, 'TASKID', nNewProc.TaskId)
EgtSetInfo( AuxId, 'CUTID', nNewProc.CutId)
end
-- se non c'é il percorso do errore
if not AuxId then
@@ -940,8 +942,8 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
EgtRotate( AuxId, tFacAdj[nIdEndPoint], Z_AX(), dOffsAng, GDB_RT.GLOB)
end
-- inserisco la lavorazione
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
local nMchId = WM.AddMachining( nNewProc, sName, sMilling)
local sName = 'Clean_' .. ( EgtGetName( nNewProc.Id) or tostring( nNewProc.Id))
local nMchId = WM.AddMachining( nNewProc.Id, sName, sMilling)
if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr)
@@ -1035,27 +1037,27 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
end
end
-- copio la feature nel layer di appoggio
local nNewProc
local nNewProc = { CutId = Proc.CutId, TaskId = Proc.TaskId}
if nMasterNewProc then
nNewProc = nMasterNewProc
nNewProc.Id = nMasterNewProc
else
nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
nNewProc.Id = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
end
local nFacCnt = EgtSurfTmFacetCount( nNewProc)
local nFacCnt = EgtSurfTmFacetCount( nNewProc.Id)
local nFacInd, dDimMin, dDimMax, dDepth, nSurfInt
local bMakeLocSurf
-- RIMUOVERE
if false and nFacCnt <= 4 then
-- ottengo le dimensioni apertura, la normale e la faccia inferiore
dDimMin, dDimMax, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId)
dDimMin, dDimMax, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc.Id, Proc.PartId, nAddGrpId)
if nSurfInt then
-- uso la dimensione minima anche nel caso che la cava sborda perchè la lavorazione potrebbe collidere con un pezzo limitrofo
local dMinWidth = dDimMin
nNewProc = EgtSurfTmBySewing( nAddGrpId, {nNewProc,nSurfInt} , true)
nNewProc.Id = EgtSurfTmBySewing( nAddGrpId, {nNewProc.Id,nSurfInt} , true)
-- riordino le facce
nNewProc = ReorderFacesFromTab( nNewProc, vFace)
nNewProc.Id = ReorderFacesFromTab( nNewProc.Id, vFace)
-- acquisisco il numero della faccia
nFacCnt = EgtSurfTmFacetCount( nNewProc)
nFacCnt = EgtSurfTmFacetCount( nNewProc.Id)
nFacInd = nFacCnt - 1
else
local sErr = 'Error : cannot create base surface'
@@ -1107,7 +1109,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
ptLoc2 = vFace[k].PPrev
end
-- ricavo i punti e l'angolo interno
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT)
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc.Id, nFace1, nFace2, GDB_ID.ROOT)
-- se punti validi e angolo è interno e non è quasi piatto e >= 90 creo istanza
local tFacAdj = {}
if ptP1 and ptP2 and dAng < 0 and dAng < -6 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then
@@ -1145,8 +1147,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
i = i + 1
end
-- cancello la copia della superfice
if nNewProc then
EgtErase(nNewProc)
if nNewProc.Id then
EgtErase( nNewProc.Id)
end
return true
end
@@ -1691,13 +1693,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
dExtraLongEnd = 0
end
-- se ho abilitato la lavorazione di fresatura per garantire passaggio gambo utensile, inserisco la lavorazione
local bThroughRaw = false
if bEnablePreMill then
-- verifico se feature e' passante
if ((Proc.Box:getMin():getX() < ( b3Raw:getMin():getX() + 50)) and (Proc.Box:getMax():getX() > ( b3Raw:getMax():getX() - 50))) or
((Proc.Box:getMin():getY() < ( b3Raw:getMin():getY() + 50)) and (Proc.Box:getMax():getY() > ( b3Raw:getMax():getY() - 50))) then
bThroughRaw = true
end
-- recupero la lavorazione di taglio
local sCuttingGorge = WM.FindCutting( 'Standard')
@@ -1745,7 +1741,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
local bSawInvertSE = false
-- se non passante, aggiungo fresatura area della fresa
if not bThroughRaw and nNumStep - 1 > 0 then
if not Proc.IsThrough and nNumStep - 1 > 0 then
local SquareId -- Id della composita da fresare
local dSawShortening = sqrt( b3Raw:getDimZ() * ( dSawDiam - b3Raw:getDimZ())) -- da calcolare in base a raggio lama e spessore grezzo
-- gruppo ausiliario
@@ -2015,6 +2011,10 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
local nStep = ceil( ( dThick - dMaxMat) / dStep)
dStep = max( ( dThick - dMaxMat) / max( nStep, 1), 0)
local dMaxElev = max( ( nStep + 1) * dStep - GEO.EPS_SMALL, 0)
-- tasca aperta sopra non necessita di MaxElev
if Proc.Fct == 2 and Proc.AffectedFaces.Top then
dMaxElev = nil
end
if nSinglePass and nSinglePass > 0 then
dStep = 0
if nSinglePass == 1 then
@@ -2028,7 +2028,9 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
-- leggo eventuali note esistenti della lavorazione
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
-- aggiungo alle note massima elevazione
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3))
if dMaxElev then
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 3))
end
-- se lavorazione in doppio aggiungo le rispettive note
if Proc.Double and Proc.Double == 2 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
@@ -2880,13 +2882,15 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
-- se ho abilitata lavorazione di fresa di fianco
if Proc.Fct >= 3 and sMillOnSide and nUseMillOnSide >= 1 and not bIsSmallSlot then
-- cerco nei parametri utensili la nota di affondamento di fianco SIDEDEPTH
local dMaxDepthOnSide = 0
local dMaxDepthOnSide = 999
local dMillDiam = 0
local dMillDiamTh = EgtTdbGetCurrToolThDiam() or 60
if EgtMdbSetCurrMachining( sMillOnSide) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or dMaxDepthOnSide
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
dMaxDepthOnSide = min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or dMaxDepthOnSide, 0.5 * ( dMillDiam - dMillDiamTh))
end
end
local bMakeFirstGroove
@@ -2975,7 +2979,7 @@ local function MakeMoreFaces( Proc, nRawId, b3Raw)
else
local sErr = 'Side milling not possible'
EgtOutLog( sErr)
return true, sErr
return false, sErr
end
-- fessura verticale
elseif Proc.Stype == 3 then
+6
View File
@@ -1,5 +1,11 @@
==== Wall Update Log ====
Versione 2.6l1 (11/12/2024)
- Modif : modificato il calcolo feature passante per gorge
- Modif : in pulizia spigoli si riporta correttamente la collisione sulla feature specifica
- Fixed : in pulizia spigoli correzioni varie
- Fixed : in LapJoint correzioni varie
Versione 2.6k3 (27/11/2024)
- Modif : migliorato calcolo approccio e retrazione in Sidemill/Sidegroove
+1 -1
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di Wall
NAME = 'Wall'
VERSION = '2.6k3'
VERSION = '2.6l1'
MIN_EXE = '2.6k1'