DataBeam :

- in LapJoint corretto caso in cui antischeggia non vengono inseriti perchè inutili.
This commit is contained in:
DarioS
2021-04-23 13:54:21 +02:00
parent 376002ed0c
commit 105c3b0051
+60 -56
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2021/04/21
-- ProcessLapJoint.lua by Egaltech s.r.l. 2021/04/23
-- Gestione calcolo mezzo-legno per Travi
-- 2019/10/08 Agg. gestione OpenPocket.
-- 2021/01/24 Con sega a catena ora sempre impostato asse A.
@@ -11,6 +11,7 @@
-- 2021/04/14 Correzioni ribasso a U con fresa da sotto.
-- 2021/04/15 Aggiunta gestione massima lunghezza fresa da sotto su svuotature.
-- 2021/04/21 Anche feature lunga con due facce con opzione lama ora si taglia con lama.
-- 2021/04/23 Corretto caso con antischeggia non inseriti perchè inutili.
-- Tabella per definizione modulo
local ProcessLapJoint = {}
@@ -3709,66 +3710,69 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local dSawThick = 0
bMadeASbyBld, sWarn, nIdMach, dSawThick = MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw)
if not bMadeASbyBld then return false, sWarn end
-- verifico se da invertire
local bInvertMach = false
if bIsU then
if abs(vtN:getZ()) > 0.63 or abs(vtN:getY()) > 0.63 then
-- if abs(vtN:getZ()) > 0.7 or abs(vtN:getY()) > 0.7 then
-- prendo il vettore normale alla faccia
local _, vtNFc = EgtSurfTmFacetCenter( Proc.Id, nFacet, GDB_ID.ROOT)
-- valuto l'angolo tra le due facce
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, nFacInd, nFacet, GDB_ID.ROOT)
-- se superficie principale parallela al piano XZ
if nPrefSide == 0 then
-- se facce inclinate \\ allora mandrino a destra (per essere verso l'alto)
if vtNFc:getX() * vtNFc:getZ() > 0 then
nPrefSide = 2
-- altrimenti facce inclinate // quindi mandrino a sinistra (per essere ancora verso l'alto)
else
nPrefSide = 1
-- se antischeggia veramente inserito perchè necessario
if nIdMach then
-- verifico se da invertire
local bInvertMach = false
if bIsU then
if abs(vtN:getZ()) > 0.63 or abs(vtN:getY()) > 0.63 then
-- if abs(vtN:getZ()) > 0.7 or abs(vtN:getY()) > 0.7 then
-- prendo il vettore normale alla faccia
local _, vtNFc = EgtSurfTmFacetCenter( Proc.Id, nFacet, GDB_ID.ROOT)
-- valuto l'angolo tra le due facce
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, nFacInd, nFacet, GDB_ID.ROOT)
-- se superficie principale parallela al piano XZ
if nPrefSide == 0 then
-- se facce inclinate \\ allora mandrino a destra (per essere verso l'alto)
if vtNFc:getX() * vtNFc:getZ() > 0 then
nPrefSide = 2
-- altrimenti facce inclinate // quindi mandrino a sinistra (per essere ancora verso l'alto)
else
nPrefSide = 1
end
end
end
-- se faccia verso X+ e mandrino verso sinistra
if vtNFc:getX() > 0 and nPrefSide == 1 then
-- se angolo interno e circa -90
if abs( dAng + 90) < 5 then
bInvertMach = true
end
-- se faccia verso X- e mandrino verso destra
elseif vtNFc:getX() < 0 and nPrefSide == 2 then
-- se angolo interno e circa -90
if abs( dAng + 90) < 5 then
bInvertMach = true
-- se faccia verso X+ e mandrino verso sinistra
if vtNFc:getX() > 0 and nPrefSide == 1 then
-- se angolo interno e circa -90
if abs( dAng + 90) < 5 then
bInvertMach = true
end
-- se faccia verso X- e mandrino verso destra
elseif vtNFc:getX() < 0 and nPrefSide == 2 then
-- se angolo interno e circa -90
if abs( dAng + 90) < 5 then
bInvertMach = true
end
end
end
end
end
-- eseguo inversione
if bInvertMach then
local bToolInvert = EgtGetMachiningParam( MCH_MP.TOOLINVERT)
local nWS = EgtGetMachiningParam( MCH_MP.WORKSIDE)
local nInvWS = EgtIf( nWS == MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT)
local nFaceUse = EgtGetMachiningParam( MCH_MP.FACEUSE)
local bOrtUp = ( nFaceUse >= MCH_MILL_FU.ORTUP_DOWN and nFaceUse <= MCH_MILL_FU.ORTUP_RIGHT)
if not bOrtUp then
-- assegno i parametri invertiti
EgtSetMachiningParam( MCH_MP.WORKSIDE, nInvWS)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, not bToolInvert)
-- setto l'offset pari allo spessore lama
EgtSetMachiningParam( MCH_MP.OFFSL, -dSawThick)
-- eseguo inversione
if bInvertMach then
local bToolInvert = EgtGetMachiningParam( MCH_MP.TOOLINVERT)
local nWS = EgtGetMachiningParam( MCH_MP.WORKSIDE)
local nInvWS = EgtIf( nWS == MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT)
local nFaceUse = EgtGetMachiningParam( MCH_MP.FACEUSE)
local bOrtUp = ( nFaceUse >= MCH_MILL_FU.ORTUP_DOWN and nFaceUse <= MCH_MILL_FU.ORTUP_RIGHT)
if not bOrtUp then
-- assegno i parametri invertiti
EgtSetMachiningParam( MCH_MP.WORKSIDE, nInvWS)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, not bToolInvert)
-- setto l'offset pari allo spessore lama
EgtSetMachiningParam( MCH_MP.OFFSL, -dSawThick)
end
end
-- posizione del braccio : se primo taglio la recupero, altrimenti la imposto
if not nPrevSCC then
nPrevSCC = EgtGetMachiningParam( MCH_MP.SCC)
else
EgtSetMachiningParam( MCH_MP.SCC, nPrevSCC)
end
-- rieseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nIdMach, false)
return false, sErr
end
end
-- posizione del braccio : se primo taglio la recupero, altrimenti la imposto
if not nPrevSCC then
nPrevSCC = EgtGetMachiningParam( MCH_MP.SCC)
else
EgtSetMachiningParam( MCH_MP.SCC, nPrevSCC)
end
-- rieseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nIdMach, false)
return false, sErr
end
end
end