BugFix/SideGrooveMaxElevation:

- In LapJoint MakeSideGrooveByMill sistemato il calcolo del massimo sottosquadro lavorabile dell'utensile.
This commit is contained in:
luca.mazzoleni
2022-09-30 12:50:34 +02:00
parent 53dac50505
commit 3d80ec9428
+21 -6
View File
@@ -9,6 +9,7 @@
-- 2022/01/17 ES Migliorata scelta fresa per lavorazione di fianco sotto.
-- 2022/02/03 DS Gorge larga come gambo più sicurezza.
-- 2022/02/04 DS In svuotatura aggiunta gestione WD.MAXDIAM_POCK_CORNER in presenza di almeno un angolo interno.
-- 2022/09/30 In MakeSideGrooveByMill sistemato il calcolo del massimo sottosquadro dell'utensile per determinare la fattibilità della tasca.
-- Tabella per definizione modulo
local WPL = {}
@@ -1400,13 +1401,19 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
local dMillLen = 10
local dMillTotLen = 30
local dMaxMat = 0
local dMillDiamTh = 0
local dMillDiamTh = 999
local dMillDiamThStem = 0
local dMillLenTh = 0
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dMillLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dMillLen
dMillTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) or dMillTotLen
-- di default uso il diametro "alto" del portautensile come diametro del gambo
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
dMillDiamThStem = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or dMillDiamThStem
dMillLenTh = EgtTdbGetCurrToolThLength() or dMillLenTh
if ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0 then
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dMaxMat
if not dMaxDepthOnSide or dMaxDepthOnSide < 0.1 then
@@ -1418,13 +1425,21 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd')
end
end
dMillDiamTh = EgtTdbGetCurrToolThDiam() or dMillDiamTh
local dGrooveMinZ = max( b3Raw:getMin():getZ(), Proc.Box:getMin():getZ())
local dRawMaxZ = b3Raw:getMax():getZ()
-- se riesco a lavorare il sottosquadro senza arrivare alla parte larga del portautensile uso la sidedepth o il diametro stretto del portautensile come diametro del gambo
if ( dMillTotLen - dMillLenTh) > ( abs( dRawMaxZ - dGrooveMinZ) + 1) then
if dMaxDepthOnSide and dMaxDepthOnSide > 0 then
dMillDiamTh = dMillDiam - dMaxDepthOnSide * 2
elseif dMillDiamThStem > 0 then
dMillDiamTh = dMillDiamThStem
end
end
end
end
local dMaxSideElev = EgtIf( dMaxDepthOnSide and dMaxDepthOnSide > 0, dMaxDepthOnSide, dMillDiam / 2 - 30)
-- se profondità ribasso è maggiore della capacità dichiarata nelle note o di quella netta al gambo utensile
if ( not bEnablePreMill and bMachFromDn) and ( dElev > dMaxSideElev or dElev >= ( 0.5 * ( dMillDiam - dMillDiamTh))) then
local sErr = 'Error : Side Elevation too big'
-- se profondità ribasso è maggiore della capacità di sottosquadro dell'utensile
if ( not bEnablePreMill and bMachFromDn) and ( dElev >= ( 0.5 * ( dMillDiam - dMillDiamTh))) then
local sErr = 'Error : Side Elevation (' .. dElev .. ') bigger than max tool side depth (' .. ( 0.5 * ( dMillDiam - dMillDiamTh)) ..')'
EgtOutLog( sErr)
return false, sErr
end