- in Squaring migliorie varie

- aggiunta rimozione lavorazioni fuori dall'area di squadratura
- in WallExec squadratura suddivisa prima e dopo le altre lavorazioni
- in FreeContour aggiunta funzione IsFaceOutsideSquaring per evitare di lavorare le facce che finiscono fuori dall'area di squadratura
This commit is contained in:
luca.mazzoleni
2024-10-31 16:04:15 +01:00
parent b1dd887899
commit 4f2ffec3ab
3 changed files with 230 additions and 160 deletions
+25 -9
View File
@@ -175,6 +175,22 @@ local function IsPointOnRawLongEdges( ptCen, b3Raw)
return ( abs( ptCen:getY() - b3Raw:getMin():getY()) < 0.1 or abs( ptCen:getY() - b3Raw:getMax():getY()) < 0.1)
end
---------------------------------------------------------------------
local function IsFaceOutsideSquaring( Proc, Face, b3Squaring)
-- faccia esterna al box di squadratura
if b3Squaring then
local b3SquaringReduced = BBox3d( b3Squaring)
b3SquaringReduced:expand( -0.1)
local b3Face = EgtSurfTmGetFacetBBoxGlob( Proc.Id, Face.Fac, GDB_BB.STANDARD)
if not OverlapsXY( b3SquaringReduced, b3Face) then
EgtOutLog( 'Proc ' .. Proc.Id .. ': skipped face ' .. Face.Fac .. ' outside squaring' )
return true
end
else
return false
end
end
---------------------------------------------------------------------
local function GetOtherRegions( nPartId)
local vOthers = {}
@@ -1705,13 +1721,13 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
end
---------------------------------------------------------------------
local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick, b3Squaring)
-- verifico se ciclo chiuso
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
-- ciclo di inserimento dei tagli sulle facce del contorno in esame
for i = 1, #vFace do
-- verifico se faccia da saltare, perchè macchina travi e faccia su bordo longitudinale esterno già finito
local bToSkip = ( WD.BEAM_MACHINE and IsPointOnRawLongEdges( vFace[i].Cen, b3Raw))
-- verifico se faccia da saltare, perchè macchina travi e faccia su bordo longitudinale esterno già finito oppure se faccia fuori dal box di squadratura
local bToSkip = ( WD.BEAM_MACHINE and IsPointOnRawLongEdges( vFace[i].Cen, b3Raw)) or IsFaceOutsideSquaring( Proc, vFace[i], b3Squaring)
-- se non è faccia da saltare, inserisco il taglio di lama
if not bToSkip and vFace[i].Type ~= 4 then
-- indice del successivo
@@ -1841,7 +1857,7 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
end
---------------------------------------------------------------------
local function MakeByCut( Proc, nRawId, b3Raw)
local function MakeByCut( Proc, nRawId, b3Raw, b3Squaring)
local sWarn = ''
-- ingombro del pezzo
local Ls = EgtGetFirstNameInGroup( Proc.PartId, 'Box')
@@ -1887,9 +1903,9 @@ local function MakeByCut( Proc, nRawId, b3Raw)
-- gruppo ausiliario
local nAddGrpId = WL.GetAddGroup( Proc.PartId)
-- recupero i dati di tutte le facce
local vFace, dMaxWidth, nNewProc = GetFacesData( Proc, bOpposite, true, dSawDiam, dSawMaxDepth, dSawThick, nAddGrpId, b3Raw, nil)
local vFace, dMaxWidth, nNewProc = GetFacesData( Proc, bOpposite, true, dSawDiam, dSawMaxDepth, dSawThick, nAddGrpId, b3Raw)
-- inserimento dei tagli di lama
local bCtOk, sCtErr = AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
local bCtOk, sCtErr = AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick, b3Squaring)
if not bCtOk then return bCtOk, sCtErr end
-- se richiesta solo lama, esco
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
@@ -2426,7 +2442,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
EgtErase( nAddedBottomSurface)
end
if not nFacet then
return MakeByMill( Proc, nRawId, b3Raw)
return MakeByMill( Proc, nRawId, b3Raw, b3Squaring)
end
-- se ho creato la faccia di fondo utilizzo quella
local nSurfId = nProcTmWithAddedBottomSurfaceId or Proc.Id
@@ -2573,7 +2589,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function WPF.Make( Proc, nRawId, b3Raw, vNLO)
function WPF.Make( Proc, nRawId, b3Raw, vNLO, b3Squaring)
-- recupero la tipologia (contorno o tasca)
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
-- se svuotatura
@@ -2596,7 +2612,7 @@ function WPF.Make( Proc, nRawId, b3Raw, vNLO)
return MakeByNail( Proc, nRawId, b3Raw, vNLO)
-- altrimenti, taglio con lama e pulizia angoli con fresa
else
return MakeByCut( Proc, nRawId, b3Raw)
return MakeByCut( Proc, nRawId, b3Raw, b3Squaring)
end
end
end