DataBeam :

- correzioni a LapJoint per Blockhaus
- modifiche a LapJoint per angoli limite con due facce
- modifiche a tagli con lama per angoli lama da sotto.
This commit is contained in:
DarioS
2022-03-20 18:59:52 +01:00
parent ebda8e3d29
commit 5a2e494459
4 changed files with 72 additions and 41 deletions
+58 -33
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/02/14
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/03/18
-- Gestione calcolo mezzo-legno per Travi
-- 2019/10/08 Agg. gestione OpenPocket.
-- 2021/01/24 Con sega a catena ora sempre impostato asse A.
@@ -36,6 +36,7 @@
-- 2022/01/26 Migliorato controllo uso testa da sotto nel caso due facce con lama.
-- 2022/02/07 Corretto caso con due facce che non è un LongDoubleCut ma che veniva identificato come tale.
-- 2022/02/14 Introdotto uso svuotature ZigZag ottimizzate.
-- 2022/03/18 Corretta lavorazione BH.
-- Tabella per definizione modulo
local ProcessLapJoint = {}
@@ -139,6 +140,10 @@ local function AssignQIdent( Proc)
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
Q_ANTISPLINT_TYPE = 'Q06' -- i
elseif ( Proc.Grp == 4) and Proc.Prc == 39 then
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
Q_USE_MILL = 'Q02' -- i
Q_ANTISPLINT_TYPE = 'Q06' -- i
end
-- le altre features gestite non hanno parametri Q
end
@@ -679,8 +684,8 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
local bSmall = ( ( Proc.Head or Proc.Tail) and Proc.Box:getDimX() <= BD.GetMaxLenRidgeLapFromBottom( b3Raw:getDimZ())) or
( not ( Proc.Head or Proc.Tail) and Proc.Box:getDimY() <= BD.GetMaxLenRidgeLapFromBottom( b3Raw:getDimZ()))
local bDown = ( vtN[1]:getZ() < BD.NZ_MINB and vtN[2]:getZ() < BD.NZ_MINB) or
( vtN[1]:getZ() < BD.NZ_MINA and ( vtN[2]:getZ() < -0.1 or not bSmall)) or
( vtN[2]:getZ() < BD.NZ_MINA and ( vtN[1]:getZ() < -0.1 or not bSmall))
( vtN[1]:getZ() < BD.NZ_MINA and vtN[2]:getZ() < 0.5 and ( vtN[2]:getZ() < -0.1 or not bSmall)) or
( vtN[2]:getZ() < BD.NZ_MINA and vtN[1]:getZ() < 0.5 and ( vtN[1]:getZ() < -0.1 or not bSmall))
bDown = ( bDown and not BD.DOWN_HEAD)
return true, bDown
-- se più di 2 facce
@@ -751,11 +756,17 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
return false
end
else
-- dati della faccia
local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
local nFac2Ind = EgtIf( nFacInd ~= 0, 0, 1)
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFac2Ind, GDB_ID.ROOT)
if abs( rfFac:getVersY() * vtN2) < 0.5 then
dH, dV = dV, dH
rfFac:rotate( rfFac:getOrigin(), rfFac:getVersZ(), 90)
end
-- se può essere fatto con utensile tipo lama
local bUseBHSideMill, _, _, _, dMaxMat = VerifyBHSideMill( Proc)
-- if bUseBHSideMill and ( dMaxMat <= dV + 15 * GEO.EPS_SMALL) then
if bUseBHSideMill and ( dMaxMat <= dH + 15 * GEO.EPS_SMALL) then
if bUseBHSideMill and ( dMaxMat <= dV + 15 * GEO.EPS_SMALL) then
return true, false
-- altrimenti controllo se deve essere ruotato con le altre lavorazioni
else
@@ -4508,7 +4519,23 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
else
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
-- larghezza della faccia
local dV = 0
local dH = 0
-- se due o più (recupero la larghezza della faccia perpendicolarmente alle altre)
if Proc.Fct >= 2 then
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, EgtIf( nFacInd == 0, 1, 0), GDB_ID.ROOT)
local vtX = vtN2 ^ vtN
local frRef = Frame3d( ptC, ptC + 100 * vtX, ptC + 100 * vtN2)
local b3Ref = EgtSurfTmGetFacetBBoxRef( Proc.Id, nFacInd, GDB_BB.STANDARD, frRef)
if b3Ref then
dH = b3Ref:getDimX()
dV = b3Ref:getDimY()
end
-- altrimenti una sola
else
_, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
end
-- verifico se U
local bIsU = ( Proc.Fct == 3 and not TestElleShape3( Proc))
-- verifico se due facce o L con una o due facce di terminazione
@@ -4518,23 +4545,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if bPrevBhSideMill == nil then
bPrevBhSideMill = bMakeBySideMill
end
-- if bMakeBySideMill and ( dMaxMat <= dV + 15 * GEO.EPS_SMALL) then
if bMakeBySideMill and ( dMaxMat <= dH + 15 * GEO.EPS_SMALL) then
if bMakeBySideMill and ( dMaxMat <= dV + 15 * GEO.EPS_SMALL) then
-- se smusso non è esclusivo
if nChamfer < 2 then
if Proc.Fct > 1 then
-- recupero la larghezza della faccia perpendicolarmente alle altre 2
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, EgtIf( nFacInd == 0, 1, 0), GDB_ID.ROOT)
local vtX = vtN2 ^ vtN
local frRef = Frame3d( ptC, ptC + 100 * vtX, ptC + 100 * vtN2)
local b3Ref = EgtSurfTmGetFacetBBoxRef( Proc.Id, nFacInd, GDB_BB.STANDARD, frRef)
if b3Ref then
dV = b3Ref:getDimY()
dH = b3Ref:getDimX()
end
else
dH, dV = dV, dH
end
-- se lavorazione da sotto e lunga, va divisa in due metà
local bDouble = ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200))
-- inserisco la lavorazione di fresatura
@@ -4552,12 +4565,13 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bHeadDir, MCH_MILL_FU.PARAL_LEFT, MCH_MILL_FU.PARAL_RIGHT))
-- calcolo step effettivo ed elevazione
local dVcalc = dV - dMaxMat
local dStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP) or dMaxMat
local dStep = min( EgtMdbGetCurrMachiningParam( MCH_MP.STEP), dMaxMat)
local nStep = ceil( dVcalc / dStep)
if vtN:getZ() < - 0.5 and ( nStep % 2) == 0 then
nStep = nStep + 1
if nStep > 0 then
dStep = dVcalc / nStep + 0.1
else
dStep = 0
end
dStep = dVcalc / nStep + 0.1
EgtSetMachiningParam( MCH_MP.STEP, dStep)
-- imposto elevazione e dichiaro non si generano sfridi per VMill
local sNotes = 'MaxElev=' .. EgtNumToString( dVcalc + dStep, 2) .. ';'
@@ -4567,14 +4581,23 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if vtN:getZ() > -0.5 then
EgtSetMachiningParam( MCH_MP.LITANG, 0)
EgtSetMachiningParam( MCH_MP.LIPERP, dFacElev + BD.CUT_SIC)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
else
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + BD.CUT_SIC)
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.LINEAR)
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
if ( nStep % 2) == 1 then
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.LINEAR)
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
else
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG)
EgtSetMachiningParam( MCH_MP.LOTANG, -( dToolDiam / 2 + b3Raw:getDimY() + BD.CUT_SIC))
end
EgtSetMachiningParam( MCH_MP.LOPERP, dFacElev + BD.COLL_SIC)
if bDouble then
EgtSetMachiningParam( MCH_MP.ENDADDLEN, - dH / 2)
if ( nStep % 2) == 0 then
EgtSetMachiningParam( MCH_MP.LOTANG, -( dToolDiam / 2 + b3Raw:getDimY() + dH / 2 + BD.CUT_SIC))
end
end
end
-- tipo passate multiple
@@ -5544,17 +5567,19 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtOutLog( sErr)
return false, sErr
end
-- verifico se due facce o L con una o due facce di terminazione
local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2)
-- verifico se sono presenti i parametri Q per la profondità smusso e
-- per eseguire in esclusiva solo lo smusso
-- verifiche per smusso
local nChamfer, dDepthCham, sErrCham = EvaluateQParam( Proc)
if Proc.Fct == 2 and bIsL and nChamfer > 0 then
-- se smusso da fare
if nChamfer > 0 then
local _, _, _, vtOrtho, _, nSurfInt = GetTunnelDimension( Proc, nPartId)
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
if nOk < 0 then return false, sErr end
end
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead)
-- se smusso non esclusivo
if nChamfer < 2 then
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead)
end
return true
end
end
-- tre o più facce