DataWall :

- in FreeContour gruppo 0 corretto orientamento superficie quando Pocket
- in generazione CN aggiunta info se programma a 64bit.
This commit is contained in:
DarioS
2022-04-28 10:22:02 +02:00
parent 906272b959
commit 874393a779
3 changed files with 44 additions and 22 deletions
+34 -14
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/04/04
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/04/26
-- Gestione calcolo profilo libero per Pareti
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
@@ -9,6 +9,7 @@
-- 2022/03/16 Ulteriore modifica per riconoscimento lato esterno (aggiunto uso vExtr a GetFacesExternalSide).
-- 2022/04/03 Correzioni e modifiche per pulitura spigoli tipo 2 e 3.
-- 2022/04/19 Aggiunta passibilita' fresatura ad affondamento ridotto quando non possibile completa o sega a catena.
-- 2022/04/26 Migliorata gestione caso pocketing.
-- Tabella per definizione modulo
local WPF = {}
@@ -54,15 +55,25 @@ function WPF.Classify( Proc, b3Raw)
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if not AuxId then return false end
AuxId = AuxId + Proc.Id
local vtN = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
-- recupero il tipo di lavorazione
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
-- se tasca
if bPocket then
local bDown = ( vtN:getZ() < - 0.5)
-- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva)
local nFacet
for i = 1, Proc.Fct do
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
if abs( vtN * vtExtr) > 0.99 then
nFacet = i - 1
vtExtr = vtN
break
end
end
local bDown = ( vtExtr:getZ() < - 0.5)
return not bDown
-- se altrimenti profilo orizzontale
elseif abs( vtN:getZ()) < 0.5 then
elseif abs( vtExtr:getZ()) < 0.5 then
return false
-- se penna o chiodatura va sempre bene (vengono sempre riportati sopra)
elseif nCntType == 10 or nCntType == 20 then
@@ -525,6 +536,7 @@ local function GetTunnelDimension( nId, nPartId, nAddGrpId)
-- ottengo i versori delle 4 facce e ottengo l'orientamento del tunnel
-- recupero il numero di facce
local nFacCnt = EgtSurfTmFacetCount( nId)
if nFacCnt < 2 then return end
-- recupero l'ingombro della trave
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- variabili dimensioni fessura e id faccia lunga
@@ -535,14 +547,14 @@ local function GetTunnelDimension( nId, nPartId, nAddGrpId)
local bOppoFace = false
-- ottengo il versore ortogonale
local ptN1, vtN1 = EgtSurfTmFacetCenter( nId, 0, GDB_ID.ROOT)
local _, vtN2 = EgtSurfTmFacetCenter( nId, 1, GDB_ID.ROOT)
local vtN2 = EgtSurfTmFacetNormVersor( nId, 1, GDB_ID.ROOT)
local vtOrtho = vtN1 ^ vtN2
if vtOrtho:isSmall() then
_, vtN2 = EgtSurfTmFacetCenter( nId, 2, GDB_ID.ROOT)
vtN2 = EgtSurfTmFacetNormVersor( nId, 2, GDB_ID.ROOT) or V_NULL()
vtOrtho = vtN1 ^ vtN2
bOppoFace = true
end
vtOrtho:normalize()
if not vtOrtho:normalize() then return end
if vtOrtho:getZ() < -0.5 then
vtOrtho = -vtOrtho
bNegFace = true
@@ -2293,13 +2305,10 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
if not EgtCurveIsClosed( AuxId) then
bPocketBotface = true
end
-- recupero i dati della curva e del profilo
local dDepth = EgtIf( bPocketBotface, 0, abs( EgtCurveThickness( AuxId)))
local dOriDepth = dDepth
-- cerco la faccia di fondo della superfice (deve avere direzione circa quella di estrusione della curva)
local nFacet
for i = 1, Proc.Fct do
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, i-1, GDB_ID.ROOT)
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
if abs( vtN * vtExtr) > 0.99 then
nFacet = i - 1
break
@@ -2308,6 +2317,17 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
if not nFacet then
return MakeByCut( Proc, nRawId, b3Raw)
end
-- se la faccia di fondo ha confini aperti, devo lavorarla direttamente
vAdj = EgtSurfTmFacetAdjacencies( Proc.Id, nFacet)[1] or {}
for i = 1, #vAdj do
if vAdj[i] == - 1 then
bPocketBotface = true
break
end
end
-- recupero i dati della curva e del profilo
local dDepth = EgtIf( bPocketBotface, 0, abs( EgtCurveThickness( AuxId)))
local dOriDepth = dDepth
-- dati della faccia di fondo
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacet, GDB_ID.ROOT)
local dDiam = min( dH, dV)
@@ -2317,7 +2337,7 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
local nNewProc, nNumFacet = RemoveBottomFaceAndReorder( Proc, nAddGrpId, nFacet)
-- se ho forma a L
local bIsL = ( nNumFacet == 2 or TestElleShape3( nNewProc, nNumFacet) or TestElleShape4( nNewProc, nNumFacet) == 2)
-- verifico se U
-- verifico se U
local bIsU = ( nNumFacet == 3 and not TestElleShape3( nNewProc, nNumFacet))
local dMiddleFacetLength = 0
if bIsU then
@@ -2416,8 +2436,8 @@ local function MakeByPocket( Proc, nRawId, b3Raw)
-- recupero i dati di tutte le facce
local vFace, dMaxWidth
vFace, dMaxWidth, nNewProc = GetFacesData( Proc, bOpposite, false, dMillDiam, dMaxDepth, (dMillDiam/2), nAddGrpId, b3Raw, nNewProc)
-- se ci sono almeno due facce
if Proc.Fct >= 2 then
-- se ci sono almeno due facce più quella di fondo
if Proc.Fct >= 3 then
-- se abilitata la lavorazione corner con stop macchina e affondamento non superiore al limite
local dDepthMach = EgtIf( bPocketBotface, dDepth, ( dDepth - dOriDepth))
if nConeCut == 1 and dDepthMach <= ( WD.MAX_CLEAN_CRN60 + 20 * GEO.EPS_SMALL) then