- in BeamExec -> Collect aggiunta la scrittura nella Proc di Width e Height delle facce

- in lapjoint 2 facce migliorata la scelta della lama da sotto
This commit is contained in:
luca.mazzoleni
2024-02-29 15:14:54 +01:00
parent 8660ae3742
commit 8f8dc23096
3 changed files with 53 additions and 20 deletions
+47 -16
View File
@@ -95,6 +95,7 @@
-- 2024/02/13 In MakeMoreFaces escluse le Groove 2 facce dalla gestione Special3faces.
-- 2024/02/22 Migliorato calcolo area non pinzabile in testa HCING e coda TCING
-- Rimosso un caso di controllo per HCING/TCING
-- 2024/02/29 In lapjoint 2 facce (TestTwoFacesDownHead) migliorata la scelta della lama da sotto.
-- Tabella per definizione modulo
local ProcessLapJoint = {}
@@ -5791,19 +5792,49 @@ end
---------------------------------------------------------------------
local function TestTwoFacesDownHead( Proc)
-- verifico ci siano due facce
-- test valido solo per due facce
if Proc.Fct ~= 2 then return false end
local bDownHeadBlade = false
local bDownHeadMill = false
-- verifico se da lavorare con testa da sotto
local bDownHead = false
if BD.DOWN_HEAD then
local ptC = {}
local vtN = {}
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
ptC[2], vtN[2] = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
local vtNm = ( vtN[1] + vtN[2]) ; vtNm:normalize()
bDownHead = ( vtNm:getZ() < -0.5)
local vtNm = ( Proc.Face[1].VtN + Proc.Face[2].VtN)
vtNm:normalize()
bDownHeadMill = ( vtNm:getZ() < -0.5)
-- recupero il massimo materiale della lama sopra
local sCutting = ML.FindCutting( 'HeadSide', true, false)
if not sCutting then
local sErr = 'Error : cutting not found in library'
EgtOutLog( sErr)
return false, sErr
end
local dTopBladeMaxDepth = 0
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dTopBladeMaxDepth = EgtTdbGetCurrToolMaxDepth() or dTopBladeMaxDepth
end
end
-- recupero le caratteristiche della feature e delle facce
local vtRes = Proc.Face[1].VtN ^ Proc.Face[2].VtN
Proc.IsTopDownRabbet = abs( vtRes:getZ()) > 10 * GEO.EPS_SMALL
for i = 1, Proc.Fct do
Proc.Face[i].IsTooDownwardForTopBlade = Proc.Face[i].VtN:getZ() < BD.CUT_VZ_MIN - 10 * GEO.EPS_SMALL
Proc.Face[i].IsTooWideForTopBlade = Proc.Face[i].Width > dTopBladeMaxDepth
end
-- serve la lama sotto se c'è almeno una faccia troppo inclinata verso il basso e non è un rabbet stretto lavorabile dal lato
if not ( Proc.Face[1].IsTooDownwardForTopBlade or Proc.Face[2].IsTooDownwardForTopBlade) then
bDownHeadBlade = false
else
for i = 1, Proc.Fct do
if Proc.Face[i].IsTooDownwardForTopBlade and ( not Proc.IsTopDownRabbet or Proc.Face[i].IsTooWideForTopBlade) then
bDownHeadBlade = true
break
end
end
end
end
return bDownHead
return bDownHeadBlade, bDownHeadMill
end
---------------------------------------------------------------------
@@ -6067,7 +6098,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- due facce
elseif Proc.Fct == 2 then
-- verifico se da lavorare con testa da sotto
local bDownHead = TestTwoFacesDownHead( Proc)
local bDownHeadBlade = TestTwoFacesDownHead( Proc)
-- dati delle facce
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 0, GDB_BB.STANDARD)
local b3Fac2 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 1, GDB_BB.STANDARD)
@@ -6095,7 +6126,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
else
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead)
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHeadBlade, '_H2', ''), true, bDownHeadBlade)
end
else
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
@@ -6106,7 +6137,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
else
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead)
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHeadBlade, '_H2', ''), true, bDownHeadBlade)
end
else
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
@@ -6114,7 +6145,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- altrimenti
else
if bUseBlade and ( abs( vtN1:getX()) > 0.5 or abs( vtN2:getX()) > 0.5) then
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead)
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHeadBlade, '_H2', ''), true, bDownHeadBlade)
else
return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
@@ -6185,7 +6216,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- altrimenti
else
-- verifico se da lavorare con testa da sotto
local bDownHead = TestTwoFacesDownHead( Proc)
local bDownHeadblade, bDownHeadMill = TestTwoFacesDownHead( Proc)
-- determino l'angolo tra le facce
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
-- se con BH
@@ -6195,7 +6226,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
elseif not bUseBlade then
-- se piccole
if Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN) and bAdj and abs( dAng + 90) < 1 then
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHeadMill)
else
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, true)
end
@@ -6219,7 +6250,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- se smusso non esclusivo
if nChamfer < 2 then
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead or BD.TURN)
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHeadblade, '_H2', ''), true, bDownHeadblade or BD.TURN)
end
return true
end