Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0bbec46754 | |||
| 5908f1dc10 | |||
| 57ec6b97ab | |||
| f19647b5a8 | |||
| ea5c64e82f | |||
| 010fe6999e | |||
| 5c468ee01b | |||
| 4c34f3220a | |||
| 2e626d8aa4 | |||
| a9c0b94bbe | |||
| b0136afb88 | |||
| e3078fce7e | |||
| 48ed6098ff | |||
| f38ad29d64 | |||
| c2edbddc77 | |||
| 7d61e355ef | |||
| 7448e73544 | |||
| 00941e8eb4 | |||
| db37f2c1b0 | |||
| 8bfbfb5f99 | |||
| 626aefe5a0 | |||
| e22bc6bd19 | |||
| ac4f32e516 | |||
| 33cd018a90 | |||
| 4b9c4af1b5 | |||
| ccb363f6f1 | |||
| 071389a858 | |||
| 75833d5f1c | |||
| b7f4569cf0 | |||
| b83f427a55 | |||
| 9e3aadd2a6 | |||
| 7be2911191 | |||
| 57dba9b76c | |||
| 007453337a | |||
| 0054646e78 | |||
| df4ea54347 | |||
| 83196da193 | |||
| f30a44fb63 | |||
| d5709be6b0 | |||
| 2ae06e9abf | |||
| 7dd6cf81eb | |||
| 04aed7f175 |
+101
-7
@@ -30,6 +30,8 @@
|
||||
-- 2022/06/10 Per sezioni alte e larghe modificata la gestione del sovramateriale per considerare la presenza di feature preesistenti ed
|
||||
-- eventuale parametro Q05, che determinano la presenza o meno della finitura.
|
||||
-- Create le funzioni AnalyzeHeadFeatures e AnalyzeTailFeatures. Spostate più in alto le funzioni CollectFeatures, isHeadFeature e isTailFeature.
|
||||
-- 2022/07/01 Aggiunta la gestione delle forature migliorate in presenza di feature testa/coda ad 1 faccia che tagliano tutta la sezione,
|
||||
-- controllata tramite il parametro IMPROVE_HEAD_TAIL_DRILLINGS da BeamData. Attivata di default.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamExec = {}
|
||||
@@ -123,7 +125,6 @@ local FreeContour = require( 'ProcessFreeContour')
|
||||
local Decor = require( 'ProcessDecor')
|
||||
|
||||
EgtOutLog( ' BeamExec started', 1)
|
||||
|
||||
EgtMdbSetGeneralParam( MCH_GP.MAXDEPTHSAFE, BD.COLL_SIC)
|
||||
EgtMdbSave()
|
||||
|
||||
@@ -226,13 +227,23 @@ local function IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
return false
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
|
||||
local function IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH)
|
||||
return ((abs(b3Proc:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or b3Proc:getDimY() > dRawW) and (abs(b3Proc:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or b3Proc:getDimZ() > dRawH))
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
local dRawW = b3Raw:getDimY()
|
||||
local dRawH = b3Raw:getDimZ()
|
||||
-- recupero le feature
|
||||
local vProc = {}
|
||||
local LayerId = {}
|
||||
LayerId[1] = BL.GetAddGroup( PartId)
|
||||
LayerId[2] = EgtGetFirstNameInGroup( PartId or GDB_ID.NULL, 'Processings')
|
||||
local nMachineBeforeIntersectingDrillingsIdHead, dMachineBeforeIntersectingDrillingsXHead, nMachineBeforeIntersectingDrillingsIdTail, dMachineBeforeIntersectingDrillingsXTail = nil, GEO.INFINITO, nil, -GEO.INFINITO
|
||||
local b3MachineBeforeIntersectingDrillingsBoxHead, b3MachineBeforeIntersectingDrillingsBoxTail = nil, nil
|
||||
for nInd = 1, 2 do
|
||||
local ProcId = EgtGetFirstInGroup( LayerId[nInd] or GDB_ID.NULL)
|
||||
while ProcId do
|
||||
@@ -260,6 +271,17 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
||||
Proc.Tail, Proc.AdvTail = IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
if Proc.Fct == 1 and IsFeatureCuttingEntireSection( Proc.Box , dRawW, dRawH) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
|
||||
if Proc.Head and Proc.Box:getCenter():getX() < dMachineBeforeIntersectingDrillingsXHead then
|
||||
dMachineBeforeIntersectingDrillingsXHead = Proc.Box:getCenter():getX()
|
||||
nMachineBeforeIntersectingDrillingsIdHead = Proc.Id
|
||||
b3MachineBeforeIntersectingDrillingsBoxHead = Proc.Box
|
||||
elseif Proc.Tail and Proc.Box:getCenter():getX() > dMachineBeforeIntersectingDrillingsXTail then
|
||||
dMachineBeforeIntersectingDrillingsXTail = Proc.Box:getCenter():getX()
|
||||
nMachineBeforeIntersectingDrillingsIdTail = Proc.Id
|
||||
b3MachineBeforeIntersectingDrillingsBoxTail = Proc.Box
|
||||
end
|
||||
end
|
||||
table.insert( vProc, Proc)
|
||||
-- se foro
|
||||
if Drill.Identify( Proc) then
|
||||
@@ -310,7 +332,11 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
ProcId = EgtGetNext( ProcId)
|
||||
end
|
||||
end
|
||||
return vProc
|
||||
local vMachineBeforeIntersectingDrillings = {
|
||||
Head = { Id = nMachineBeforeIntersectingDrillingsIdHead, Box = b3MachineBeforeIntersectingDrillingsBoxHead},
|
||||
Tail = { Id = nMachineBeforeIntersectingDrillingsIdTail, Box = b3MachineBeforeIntersectingDrillingsBoxTail}
|
||||
}
|
||||
return vProc, vMachineBeforeIntersectingDrillings
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -330,8 +356,7 @@ local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
end
|
||||
if Proc.Head and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 340 then
|
||||
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
|
||||
bHeadFinishingNeeded = not (( abs( Proc.Box:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or Proc.Box:getDimY() > dRawW) and
|
||||
( abs( Proc.Box:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or Proc.Box:getDimZ() > dRawH))
|
||||
bHeadFinishingNeeded = not IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||
end
|
||||
end
|
||||
return bHeadFinishingNeeded, nReplacedFeatureId
|
||||
@@ -354,8 +379,7 @@ local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
end
|
||||
if Proc.Tail and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 350 then
|
||||
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
|
||||
bTailFinishingNeeded = not (( abs( Proc.Box:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or Proc.Box:getDimY() > dRawW) and
|
||||
( abs( Proc.Box:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or Proc.Box:getDimZ() > dRawH))
|
||||
bTailFinishingNeeded = not IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||
end
|
||||
end
|
||||
return bTailFinishingNeeded, nReplacedFeatureId
|
||||
@@ -861,12 +885,18 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
|
||||
local bSplitRot = false
|
||||
local nHeading
|
||||
local nSplitting
|
||||
local vMachineBeforeIntersectingDrillingsId = {}
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
local bOk = true
|
||||
local bDown = false
|
||||
local bSide = false
|
||||
local bDownSideOnHeadOk = false
|
||||
|
||||
if Proc.MachineBeforeIntersectingDrillings then
|
||||
table.Insert ( vMachineBeforeIntersectingDrillingsId, Proc.Id)
|
||||
end
|
||||
|
||||
-- se senza geometria (già disabilitato
|
||||
if Proc.Flg == 0 then
|
||||
bOk = false
|
||||
@@ -1283,8 +1313,68 @@ local function MoveDrillsOnTenon( vProc)
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- verifica se ci sono forature da lavorare dopo tagli di testa o coda e nel caso le classifica come Head o Tail e gli assegna l'Id della rispettiva feature di taglio
|
||||
local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeIntersectingDrillings)
|
||||
for i = 1, #vProc do
|
||||
if Drill.Identify( vProc[i]) then
|
||||
-- recupero e verifico l'entità foro
|
||||
local AuxId = EgtGetInfo( vProc[i].Id, 'AUXID', 'i')
|
||||
if AuxId then AuxId = AuxId + vProc[i].Id end
|
||||
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then
|
||||
return false
|
||||
end
|
||||
-- recupero il vettore estrusione
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
local bOpen = ( vProc[i].Fcs ~= 0 and vProc[i].Fce ~= 0)
|
||||
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
|
||||
local vDistHead, vDistTail
|
||||
-- check intersezione con feature di testa
|
||||
if vMachineBeforeIntersectingDrillings.Head.Id then
|
||||
-- verifico che ci sia intersezione tra la feature foro e la feature taglio di testa
|
||||
local bIntersectionWithHead =
|
||||
vMachineBeforeIntersectingDrillings.Head.Box and vProc[i].Box:getMin():getX() < vMachineBeforeIntersectingDrillings.Head.Box:getMax():getX() + 100 * GEO.EPS_SMALL and
|
||||
vMachineBeforeIntersectingDrillings.Head.Box:getMin():getX() < vProc[i].Box:getMax():getX() + 100 * GEO.EPS_SMALL
|
||||
-- verifico che ci sia intersezione tra la direzione di estrusione e la faccia della feature taglio di testa
|
||||
if bIntersectionWithHead then
|
||||
_, _, vDistHead = EgtLineSurfTmInters( ptCen, -vtExtr, vMachineBeforeIntersectingDrillings.Head.Id, GDB_RT.GLOB)
|
||||
end
|
||||
end
|
||||
-- check intersezione con feature di coda
|
||||
if vMachineBeforeIntersectingDrillings.Tail.Id then
|
||||
-- verifico che ci sia intersezione tra la feature foro e la feature taglio di coda
|
||||
local bIntersectionWithTail =
|
||||
vMachineBeforeIntersectingDrillings.Tail.Box and vProc[i].Box:getMin():getX() < vMachineBeforeIntersectingDrillings.Tail.Box:getMax():getX() + 100 * GEO.EPS_SMALL and
|
||||
vMachineBeforeIntersectingDrillings.Tail.Box:getMin():getX() < vProc[i].Box:getMax():getX() + 100 * GEO.EPS_SMALL
|
||||
-- verifico che ci sia intersezione tra la direzione di estrusione e la faccia della feature taglio di coda
|
||||
if bIntersectionWithTail then
|
||||
_, _, vDistTail = EgtLineSurfTmInters( ptCen, -vtExtr, vMachineBeforeIntersectingDrillings.Tail.Id, GDB_RT.GLOB)
|
||||
end
|
||||
end
|
||||
-- se esiste intersezione tra il foro e la feature di testa
|
||||
if vDistHead and #vDistHead > 0 then
|
||||
-- verifico che il foro sia di testa
|
||||
if ( bOpen or ( not bOpen and vtExtr:getX() > 0 and vProc[i].Fcs ~= 0) or ( not bOpen and vtExtr:getX() < 0 and vProc[i].Fce ~= 0)) then
|
||||
vProc[i].MachineAfterHeadCutId = vMachineBeforeIntersectingDrillings.Head.Id
|
||||
vProc[i].Head = true
|
||||
end
|
||||
-- se esiste intersezione tra il foro e la feature di coda
|
||||
elseif vDistTail and #vDistTail > 0 then
|
||||
-- verifico che il foro sia di coda
|
||||
if ( bOpen or ( not bOpen and vtExtr:getX() < 0 and vProc[i].Fcs ~= 0) or ( not bOpen and vtExtr:getX() > 0 and vProc[i].Fce ~= 0)) then
|
||||
vProc[i].MachineAfterTailCutId = vMachineBeforeIntersectingDrillings.Tail.Id
|
||||
vProc[i].Tail = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamExec.ProcessFeatures()
|
||||
if BD.IMPROVE_HEAD_TAIL_DRILLINGS == nil then
|
||||
BD.IMPROVE_HEAD_TAIL_DRILLINGS = true
|
||||
end
|
||||
-- verifica se possibile rotazione di 90 gradi
|
||||
BD.ROT90 = BD.ROT90 and Verify90DegRotation( EgtGetFirstRawPart())
|
||||
-- ciclo sui pezzi
|
||||
@@ -1312,7 +1402,11 @@ function BeamExec.ProcessFeatures()
|
||||
local dCurrOvmH = EgtGetInfo( nRawId, 'HOVM', 'd') or 0
|
||||
local dCurrOvmT = EgtGetInfo( nRawId, 'TOVM', 'd') or 0
|
||||
-- recupero le feature di lavorazione della trave
|
||||
local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
local vProc, vMachineBeforeIntersectingDrillings = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
-- verifica presenza forature influenzate da lavorazioni di testa o coda
|
||||
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
|
||||
SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeIntersectingDrillings)
|
||||
end
|
||||
-- le ordino lungo X
|
||||
OrderFeatures( vProc, b3Raw)
|
||||
-- le classifico
|
||||
|
||||
+24
-5
@@ -1,4 +1,4 @@
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2022/06/25
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2022/07/12
|
||||
-- Libreria globale per Travi
|
||||
-- 2020/07/28 Corretto calcolo attacchi e uscite di lame per non uscire dalla faccia sotto.
|
||||
-- 2020/08/18 Aggiunto a GetNearestParalOpposite e GetNearestOrthoOpposite parametro opzionale vtNorm.
|
||||
@@ -13,6 +13,7 @@
|
||||
-- 2022/05/03 Ulteriore limitazione a GetNzLimDownUp per FAST.
|
||||
-- 2022/05/18 Correzioni e migliorie a PutStartNearestToEdge.
|
||||
-- 2022/06/25 Rese globali le funzioni GetChainSawBlockedAxis e GetChainSawInitAngs prima in ProcessLapJpoint.
|
||||
-- 2022/07/12 A GetFaceHvRefDim aggiunta possibilità di confronto e limitazione dimensioni con grezzo/pezzo (conta solo la sezione).
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamLib = {}
|
||||
@@ -650,7 +651,7 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetFaceHvRefDim( nSurfId, nFacet)
|
||||
function BeamLib.GetFaceHvRefDim( nSurfId, nFacet, b3Raw)
|
||||
-- recupero centro e normale della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
if not ptC or not vtN then return end
|
||||
@@ -661,8 +662,21 @@ function BeamLib.GetFaceHvRefDim( nSurfId, nFacet)
|
||||
end
|
||||
-- determino l'ingombro in questo riferimento
|
||||
local b3HV = EgtSurfTmGetFacetBBoxRef( nSurfId, nFacet, GDB_BB.STANDARD, frHV)
|
||||
local dDimH = b3HV:getDimX()
|
||||
local dDimV = b3HV:getDimY()
|
||||
-- se definito grezzo (o solido), applico eventuali limiti
|
||||
if b3Raw then
|
||||
local dCoeffY = abs( frHV:getVersX():getY())
|
||||
if dCoeffY > GEO.EPS_SMALL then
|
||||
dDimH = min( dDimH, b3Raw:getDimY() / dCoeffY)
|
||||
end
|
||||
local dCoeffZ = abs( frHV:getVersY():getZ())
|
||||
if dCoeffZ > GEO.EPS_SMALL then
|
||||
dDimV = min( dDimV, b3Raw:getDimZ() / dCoeffZ)
|
||||
end
|
||||
end
|
||||
-- restituisco i valori calcolati
|
||||
return frHV, b3HV:getDimX(), b3HV:getDimY()
|
||||
return frHV, dDimH, dDimV
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -718,10 +732,15 @@ function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
||||
if vtN and ( abs( vtN:getY()) < 0.174) then
|
||||
return -0.5
|
||||
else
|
||||
return -0.240
|
||||
return -0.24
|
||||
end
|
||||
else
|
||||
return -0.174
|
||||
-- N_HorAng < 10°
|
||||
if vtN and ( abs( vtN:getY()) < 0.174) then
|
||||
return -0.383
|
||||
else
|
||||
return -0.174
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -242,8 +242,8 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
local bConvex = ( dAngT > 0)
|
||||
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg)
|
||||
local bFaceOk = {}
|
||||
bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB or ( not bConvex and abs( vtN[1]:getY()) < 0.174))
|
||||
bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB or ( not bConvex and abs( vtN[2]:getY()) < 0.174))
|
||||
bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB or abs( vtN[1]:getY()) < 0.174)
|
||||
bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB or abs( vtN[2]:getY()) < 0.174)
|
||||
if not bDownHead and not bFaceOk[1] and not bFaceOk[2] then
|
||||
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
+14
-10
@@ -44,19 +44,21 @@ function ProcessCut.Classify( Proc, b3Raw)
|
||||
-- recupero i dati del taglio
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
if vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1 or ( vtN:getZ() <= - 0.174 and abs( vtN:getY()) > 0.866) then
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
-- calcolo le massime estensioni lineari orizzontale e verticale della faccia
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
-- confronto queste estensioni con la massima dimensione del DiceCut (impossibile lavorare se entrambe maggiori)
|
||||
if DimH > BD.MAX_DIM_DICE and DimV > BD.MAX_DIM_DICE then
|
||||
return true, true
|
||||
end
|
||||
end
|
||||
-- verifico se c'è un taglio da sotto e se è nei limiti
|
||||
-- se è un taglio da sotto, lo verifico
|
||||
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw)
|
||||
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
|
||||
if bDownCut then
|
||||
-- calcolo l'ingombro orizzontale della faccia
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
-- confronto anche qua la distanza maggiore della faccia con la massima distanza del DiceCut
|
||||
-- e se il rapporto supera il 2 (implica che genera 3 tagli) dichiaro impossibile la lavorazione
|
||||
if DimH and BD.MAX_DIM_DICE and abs( BD.MAX_DIM_DICE) > 20 * GEO.EPS_SMALL and abs( DimH / BD.MAX_DIM_DICE) > 2 then
|
||||
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli)
|
||||
if DimH > 2 * BD.MAX_DIM_DICE then
|
||||
return true, true
|
||||
end
|
||||
end
|
||||
@@ -309,8 +311,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
end
|
||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||
-- determino la direzione di taglio preferenziale
|
||||
local frFac, dCutH, dCutV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
dCutH = min( dCutH, b3Raw:getDimY() / abs( frFac:getVersX():getY()))
|
||||
local frFac, dCutH, dCutV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
local bHorizCut = ( dCutV < dMaxVertDepth - BD.CUT_EXTRA and not bDownCut)
|
||||
local bVertCutOk = ( dCutH < dMaxDepth - BD.CUT_EXTRA)
|
||||
-- recupero gruppo per geometria addizionale
|
||||
@@ -474,7 +475,11 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
elseif Proc.Head then
|
||||
vtOrthoO = EgtIf( vtN:getY() > -0.02, -Y_AX(), Y_AX())
|
||||
else
|
||||
vtOrthoO = EgtIf( vtN:getY() > 0.02, Y_AX(), -Y_AX())
|
||||
if vtN:getZ() < dVzLimDwnUp then
|
||||
vtOrthoO = EgtIf( vtN:getY() > -0.02, -Y_AX(), Y_AX())
|
||||
else
|
||||
vtOrthoO = EgtIf( vtN:getY() > 0.02, Y_AX(), -Y_AX())
|
||||
end
|
||||
end
|
||||
-- taglio
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
@@ -511,8 +516,7 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
local dMaxVertDepth = dMaxDepth
|
||||
-- determino la direzione di taglio preferenziale
|
||||
local frFac, dCutH, dCutV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
dCutH = min( dCutH, b3Raw:getDimY() / abs( frFac:getVersX():getY()))
|
||||
local frFac, dCutH, dCutV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
local bHorizCut = ( dCutV < dMaxVertDepth - BD.CUT_EXTRA) or Proc.AdvTail
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2021/11/25
|
||||
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2022/07/11
|
||||
-- Gestione calcolo doppi tagli di lama per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -28,54 +28,70 @@ end
|
||||
function ProcessDoubleCut.Classify( Proc, b3Raw)
|
||||
--se una faccia, uso la classificazione dei tagli singoli
|
||||
if Proc.Fct == 1 then return Cut.Classify( Proc, b3Raw) end
|
||||
-- se PF con testa da sotto, ammessa qualunque orientazione
|
||||
if BD.C_SIMM and BD.DOWN_HEAD then
|
||||
-- se PF con testa da sotto o TURN, ammessa qualunque orientazione
|
||||
if ( BD.C_SIMM and BD.DOWN_HEAD) or BD.TURN then
|
||||
return true
|
||||
end
|
||||
-- limite per facce da sotto
|
||||
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw)
|
||||
-- verifico se convesso
|
||||
-- determino se convesso o concavo
|
||||
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
||||
local bConvex = ( not bAdj or ( dAng > 0))
|
||||
-- se convesso
|
||||
if bConvex then
|
||||
-- recupero i dati di ogni singola faccia
|
||||
for i = 1, 2 do
|
||||
local nFac = i - 1
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFac, GDB_ID.ROOT)
|
||||
if ( vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1) or ( vtN:getZ() <= - 0.174 and abs( vtN:getY()) > 0.866) then
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, nFac)
|
||||
if DimH > BD.MAX_DIM_DICE then
|
||||
-- calcolo la massima estensione orizzontale lineare della faccia
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, nFac, b3Raw)
|
||||
-- confronto questa estensione con la massima dimensione del DiceCut (impossibile lavorare se maggiore)
|
||||
if DimH > BD.MAX_DIM_DICE and DimV > BD.MAX_DIM_DICE then
|
||||
return true, true
|
||||
end
|
||||
end
|
||||
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN)
|
||||
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
|
||||
if bDownCut then
|
||||
-- calcolo l'ingombro orizzontale della faccia
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, nFac)
|
||||
-- confronto anche qua la distanza maggiore della faccia con la massima distanza del DiceCut
|
||||
-- e se il rapporto supera il 2 (implica che genera 3 tagli) dichiaro impossibile la lavorazione
|
||||
if DimH and BD.MAX_DIM_DICE and abs( BD.MAX_DIM_DICE) > 20 * GEO.EPS_SMALL and abs( DimH / BD.MAX_DIM_DICE) > 2 then
|
||||
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli)
|
||||
if DimH > 2 * BD.MAX_DIM_DICE then
|
||||
return true, true
|
||||
end
|
||||
end
|
||||
end
|
||||
return true, false
|
||||
end
|
||||
-- altrimenti concavo, verifico le normali delle facce per tagli da sotto
|
||||
for i = 1, 2 do
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, i-1, GDB_ID.ROOT)
|
||||
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
|
||||
if bDownCut then
|
||||
-- dimensione della faccia perpendicolare alla linea di intersezione tra le facce
|
||||
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, 2-i, GDB_ID.ROOT)
|
||||
local vtX = vtN2 ^ vtN
|
||||
local frRef = Frame3d( ptC, ptC + 100 * vtX, ptC + 100 * vtN2)
|
||||
local b3Ref = EgtSurfTmGetFacetBBoxRef( Proc.Id, i-1, GDB_BB.STANDARD, frRef)
|
||||
if b3Ref:getDimY() > BD.MAX_DIM_DICE then
|
||||
return true, true
|
||||
else
|
||||
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 vtX = vtN[1] ^ vtN[2] ; vtX:normalize()
|
||||
local vtY = { vtX ^ vtN[1], - vtX ^ vtN[2]}
|
||||
for i = 1, 2 do
|
||||
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN[i], vtY[i])
|
||||
local bDownCut = ( vtN[i]:getZ() <= dNzLimDwnUp)
|
||||
if bDownCut then
|
||||
-- dimensione della faccia perpendicolarmente alla linea di intersezione tra le facce
|
||||
local frRef = Frame3d( ptC[i], ptC[i] + 100 * vtX, ptC[i] + 100 * vtY[i])
|
||||
local b3Ref = EgtSurfTmGetFacetBBoxRef( Proc.Id, i-1, GDB_BB.STANDARD, frRef)
|
||||
-- dimensione dell'altra faccia perpendicolarmente alla linea di intersezione tra le facce
|
||||
local frRef2 = Frame3d( ptC[3-i], ptC[3-i] + 100 * vtX, ptC[3-i] + 100 * vtY[3-1])
|
||||
local b3Ref2 = EgtSurfTmGetFacetBBoxRef( Proc.Id, 2-i, GDB_BB.STANDARD, frRef2)
|
||||
-- se faccia grande
|
||||
if b3Ref:getDimY() > BD.MAX_DIM_DICE then
|
||||
-- se altra faccia piccola
|
||||
if b3Ref2:getDimY() < BD.MAX_DIM_DICE then
|
||||
return true, true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return true, false
|
||||
end
|
||||
return true, false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -256,6 +272,7 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
else
|
||||
-- eseguo
|
||||
local sCutType = EgtIf( bHead, 'HeadSide', 'TailSide')
|
||||
local bDownHead = ( BD.DOWN_HEAD and vtNm:getZ() < BD.NZ_MINB)
|
||||
local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, false, bDownHead)
|
||||
if not bOk then return bOk, sErr end
|
||||
-- segnalazione ingombro di testa o coda
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
-- 2022/03/29 DS Corretta assegnazione fori molto inclinati fianco/coda a coda.
|
||||
-- 2022/04/21 DS Corretto riconoscimento fori di coda.
|
||||
-- 2022/06/22 Nel riconoscimento fori di coda si utilizza ora il reale sovramateriale di coda (dOvmTail) invece di BD.OVM_MID.
|
||||
-- 2022/07/01 Aggiunta gestione allungamento percorsi fori in caso di materiale già rimosso da lavorazioni precedenti
|
||||
-- 2022/07/07 Aggiunta la gestione delle forature migliorate in presenza di feature testa/coda che tagliano tutta la sezione; gli Id delle feature sono nelle proprietà MachineAfterHeadCutId e MachineAfterTailCutId.
|
||||
-- 2022/07/12 Aggiunto un valore minimo (10) per la distanza di sicurezza.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDrill = {}
|
||||
@@ -310,6 +313,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- conservo il valore originale di MaxDepth per poter eventualmente bypassare i check successivi
|
||||
local dMaxDepthOri = dMaxDepth
|
||||
-- verifico il massimo affondamento
|
||||
local dSubL1 = 0
|
||||
local dSubL2 = 0
|
||||
@@ -391,18 +396,67 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
nSCC = MCH_SCC.NONE
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- aggiusto l'affondamento
|
||||
-- aggiusto affondamento e MaxElev
|
||||
local dMaxElev = dDepth
|
||||
local sMyWarn
|
||||
if dDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
dDepth = dMaxDepth
|
||||
EgtOutLog( sMyWarn)
|
||||
-- se c'è un taglio precedente di testa o coda posso impostare MaxElev per allungare il percorso
|
||||
-- considero solo i fori "entranti" in testa o coda
|
||||
if (( Proc.MachineAfterHeadCutId and vtExtr:getX() > 0) or ( Proc.MachineAfterTailCutId and vtExtr:getX() < 0)) then
|
||||
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
|
||||
local bIntersectionOk, _, vDistance = EgtLineSurfTmInters( ptCen, -vtExtr, Proc.MachineAfterHeadCutId or Proc.MachineAfterTailCutId, GDB_RT.GLOB)
|
||||
dHoleToCutDistance = vDistance[1]
|
||||
-- setto MaxElev
|
||||
-- il segno della distanza data dalla funzione di intersezione mi indica dove sia la geometria del foro
|
||||
if bIntersectionOk then
|
||||
-- se MaxDepth era stato settato a 0 per disattivare la lavorazione gli riassegno il valore originale
|
||||
if dMaxDepth == 0 then
|
||||
dMaxDepth = dMaxDepthOri
|
||||
end
|
||||
if dHoleToCutDistance > 10 * GEO.EPS_SMALL then
|
||||
dMaxElev = dLen - dHoleToCutDistance
|
||||
elseif dHoleToCutDistance < -10 * GEO.EPS_SMALL then
|
||||
dMaxElev = -dHoleToCutDistance
|
||||
end
|
||||
local dToolAddLength = dLen - dMaxElev
|
||||
-- se l'utensile è comunque troppo corto lavoro il massimo possibile
|
||||
if dDepth - dToolAddLength > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth - dToolAddLength, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
dDepth = dLen
|
||||
else
|
||||
-- se è un foro splittato cerco comunque di arrivare alla massima profondità possibile, evitando di sfondare dall'altro lato.
|
||||
if Proc.Flg == 2 or Proc.Flg == -2 then
|
||||
dDepth = dLen - 10
|
||||
end
|
||||
-- se non lavoro la massima lunghezza disponibile devo correggere MaxElev
|
||||
dMaxElev = dMaxElev - dLen + dDepth
|
||||
end
|
||||
-- se per qualche motivo fallisce l'intersezione torno al caso standard
|
||||
else
|
||||
sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
dDepth = dMaxDepth
|
||||
dMaxElev = dMaxDepth
|
||||
end
|
||||
-- caso standard
|
||||
else
|
||||
sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
dDepth = dMaxDepth
|
||||
dMaxElev = dMaxDepth
|
||||
end
|
||||
if sMyWarn then
|
||||
EgtOutLog( sMyWarn)
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- imposto il valore della distanza di sicurezza per l'attacco. Se il valore del db utensili è troppo basso lo alzo a 10.
|
||||
local dToolDbStartPos = EgtGetMachiningParam( MCH_MP.STARTPOS)
|
||||
local dMinStartPos = 10
|
||||
local dStartPos = max( dMinStartPos, dToolDbStartPos)
|
||||
EgtSetMachiningParam( MCH_MP.STARTPOS, dStartPos)
|
||||
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
|
||||
local sUserNotes = 'VMRS=0;'
|
||||
-- aggiungo alle note massima elevazione (coincide con affondamento)
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dDepth, 1) .. ';'
|
||||
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';'
|
||||
-- se foro passante, aggiungo questa qualifica alle note
|
||||
if ( sType == 'Drill' or sType == 'Drill_H2') and bOpen then
|
||||
sUserNotes = sUserNotes .. 'Open=1;'
|
||||
|
||||
+29
-22
@@ -48,6 +48,7 @@
|
||||
-- 2022/06/21 Implemento di lavorazioni non passanti con fresatura di lato per L30 se parametro Q03=2. Modificate funzioni MakeMoreFaces, Classify.
|
||||
-- 2022/06/29 Migliorate lavorazioni con fresatura di lato per L30 se parametro Q03=2. Ora con 4 facce / 3 facce a L può entrare una fresa grande fino al doppio dell'altezza della tasca / doppio della dimensione minima.
|
||||
-- 2022/07/05 Modifiche per sega a catena di testa e relativa MaxElev.
|
||||
-- 2022/07/12 In MakeByChainOrSaw aggiunto check per feature L20 usata in modo improprio e, nel caso, si passa a una lavorazione tasca.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLapJoint = {}
|
||||
@@ -2846,12 +2847,15 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
local dMaxLen = 0
|
||||
for i = 1, #vAdj do
|
||||
if vAdj[i] >= 0 then
|
||||
local _, ptP1, ptP2, _ = EgtSurfTmFacetsContact( Proc.Id, nFacInd, vAdj[i], GDB_ID.ROOT)
|
||||
local dLen = dist( ptP1, ptP2)
|
||||
if dLen > dMaxLen then
|
||||
nFacAdj = vAdj[i]
|
||||
dMaxLen = dLen
|
||||
EgtOutLog( string.format( 'Adjac=%d Len=%.3f H=%.3f V=%.3f', vAdj[i], dLen, dH, dV), 3)
|
||||
local vtAdjN = EgtSurfTmFacetNormVersor( Proc.Id, vAdj[i], GDB_ID.ROOT)
|
||||
if not bIs3Faces or abs( rfFac:getVersZ():getY()) < 0.174 or abs( rfFac:getVersZ():getY()) > 0.984 or vtAdjN:getY() * rfFac:getVersZ():getY() > 0.1 then
|
||||
local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, nFacInd, vAdj[i], GDB_ID.ROOT)
|
||||
local dLen = dist( ptP1, ptP2)
|
||||
if dLen > dMaxLen then
|
||||
nFacAdj = vAdj[i]
|
||||
dMaxLen = dLen
|
||||
EgtOutLog( string.format( 'Adjac=%d Len=%.3f H=%.3f V=%.3f', vAdj[i], dLen, dH, dV), 3)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2898,6 +2902,11 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
end
|
||||
end
|
||||
end
|
||||
-- escludo caso per L20 che porterebbe ad una lavorazione con lama non corretta; ritorno anche 'MNF' in modo da forzare una lavorazione tasca
|
||||
if Proc.Prc == 20 and Proc.Fct >= 4 and bOpenStart and bOpenEnd and #vAdj >= 3 then
|
||||
local sErr = 'Error: improper use of L020 feature'
|
||||
return false, sErr, 'MNF'
|
||||
end
|
||||
-- verifico se uso lama da sotto
|
||||
local bCutDown = ( BD.DOWN_HEAD and rfFac:getVersZ():getZ() < - 0.5)
|
||||
-- Recupero il massimo affondamento possibile con la lama
|
||||
@@ -2985,7 +2994,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
-- se la lunghezza utensile non riesce ad arrivare sul fondo assegno la possibilità di lavorare di fianco (se possibile)
|
||||
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
-- continuo di testa se fessura con tre facce o non è tunnel
|
||||
bGoFromHead = ( bIs3Faces or not bOrthoFaces)
|
||||
bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces)
|
||||
end
|
||||
-- se continuo a lavorare di testa
|
||||
if bGoFromHead then
|
||||
@@ -4521,25 +4530,23 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
-- larghezza della faccia
|
||||
local dV = 0
|
||||
local dH = 0
|
||||
local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if Proc.Box:getDimX() > Proc.Box:getDimY() then
|
||||
if dH > dV then dH, dV = dV, dH end
|
||||
else
|
||||
if dH < dV then dH, dV = dV, dH end
|
||||
end
|
||||
-- se due o più facce (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 faccia
|
||||
else
|
||||
_, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if Proc.Box:getDimX() > Proc.Box:getDimY() then
|
||||
if dH > dV then dH, dV = dV, dH end
|
||||
else
|
||||
if dH < dV then dH, dV = dV, dH end
|
||||
if not vtX:isSmall() then
|
||||
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
|
||||
end
|
||||
end
|
||||
-- verifico se U
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
-- 2021/11/04 Migliorata gestione sicurezza aggiuntiva in fresate di fianco (distinzione tra larga come tutta la faccia o meno).
|
||||
-- 2021/11/08 Se con lama e flag BD.USE_LONGCUT si lavora in direzione contraria allo standard.
|
||||
-- 2022/03/07 Razionalizzata gestione casi con fresa di fianco. Aggiunta gestione Long2Cut anche con testa sotto.
|
||||
-- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw).
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLongCut = {}
|
||||
@@ -507,8 +508,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se la fine (a sinistra) non è limitata e ho un pezzo successivo meno distante di metà raggio. setto la fine come limitata
|
||||
if ( bCanUseBlade or bCanUseUnderBlade) and ( dDistToNextPiece < dToolDiam/2 or dDistToNextPiece < dToolDiamDn/2) and not bLimXmin then
|
||||
local nNextRawId = EgtGetNextRawPart( nRawId)
|
||||
-- se la fine (a sinistra) non è limitata e ho un pezzo successivo meno distante di metà raggio, oppure se grezzo finale della barra di lunghezza sufficiente, setto la fine come limitata
|
||||
if ((( bCanUseBlade or bCanUseUnderBlade) and ( dDistToNextPiece < dToolDiam/2 or dDistToNextPiece < dToolDiamDn/2)) or (nNextRawId and EgtGetPartInRawPartCount( nNextRawId) <= 0 and EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw)) and not bLimXmin then
|
||||
if bForceUseBladeOnNotThruFace then
|
||||
bForcedLim = true
|
||||
bLimXmin = true
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
-- ProcessScarfJoint.lua by Egaltech s.r.l. 2021/06/28
|
||||
-- ProcessScarfJoint.lua by Egaltech s.r.l. 2022/07/12
|
||||
-- Gestione calcolo giunto Gerber per Travi
|
||||
-- 2021/06/28 Aggiunto extra-taglio alle lamate orizzontali.
|
||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
||||
-- 2022/07/12 Aggiunta gestione PF1250 e TURN.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessScarfJoint = {}
|
||||
@@ -27,6 +28,10 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Classificazione della feature
|
||||
function ProcessScarfJoint.Classify( Proc)
|
||||
-- se PF con testa da sotto o TURN, ammessa qualunque orientazione
|
||||
if ( BD.C_SIMM and BD.DOWN_HEAD) or BD.TURN then
|
||||
return true
|
||||
end
|
||||
-- verifico le normali delle facce
|
||||
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
|
||||
for i = 1, nFacetCnt do
|
||||
@@ -127,10 +132,10 @@ end
|
||||
---------------------------------------------------------------------
|
||||
local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw, dNewDiceDim)
|
||||
|
||||
local vCuts = {}
|
||||
local bOk = true
|
||||
local sErr = ''
|
||||
|
||||
local vCuts = {}
|
||||
if nGoodFace1 and nGoodFace4 and nGoodFace1 > 0 and nGoodFace4 > 0 then
|
||||
-- lavoro solo la faccia inclinata perché la faccia tappo completa la lavoro successivamente
|
||||
-- questo evita di lavorare due volte la faccia tappo
|
||||
@@ -139,6 +144,8 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
|
||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[vFaceOrd[4]], vtN[vFaceOrd[4]], true, nil, nil, nil, dNewDiceDim)
|
||||
end
|
||||
|
||||
local dVzLimDwnUp = EgtIf( vtRef:getZ() < -0.017, -2, nil)
|
||||
|
||||
if #vCuts > 0 then
|
||||
-- sistemo posizione nel DB e nome
|
||||
for i = 1, #vCuts do
|
||||
@@ -174,7 +181,7 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
|
||||
local dExtraCut = EgtIf( i % 2 == 1, 0, BD.CUT_EXTRA)
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, dExtraCut, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
@@ -182,14 +189,14 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
|
||||
if vFaceOrd[1] ~= 0 then
|
||||
-- inserisco la lavorazione
|
||||
local vtOrthoO = Vector3d( vtRef)
|
||||
bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
-- lavoro la faccia opposta (definita dal parametro P11)
|
||||
if vFaceOrd[3] ~= 0 then
|
||||
-- inserisco la lavorazione
|
||||
local vtOrthoO = Vector3d( vtRef)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
@@ -290,8 +297,12 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOkc then return bOkc, sErrC end
|
||||
|
||||
-- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -20deg)
|
||||
local bDownHead = ( BD.DOWN_HEAD and vtRef:getZ() < -0.01)
|
||||
local bTopHead = ( BD.DOWN_HEAD and ( vtRef:getZ() > -0.01 or not bDownHead))
|
||||
|
||||
-- recupero la lavorazione
|
||||
local sCutting = ML.FindCutting( 'HeadSide')
|
||||
local sCutting = ML.FindCutting( 'HeadSide', bTopHead, bDownHead)
|
||||
if not sCutting then
|
||||
local sErr = 'Error : cutting not found in library'
|
||||
EgtOutLog( sErr)
|
||||
@@ -441,9 +452,9 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
-- recupero la lavorazione. considerando l dimensione del lato e l'affondamento
|
||||
local sPocketing
|
||||
if dDistFaces then
|
||||
sPocketing = ML.FindPocketing( 'OpenPocket', dDiamMax, dDistFaces)
|
||||
sPocketing = ML.FindPocketing( 'OpenPocket', dDiamMax, dDistFaces, nil, bTopHead, bDownHead)
|
||||
else
|
||||
sPocketing = ML.FindPocketing( 'OpenPocket', dDiamMax)
|
||||
sPocketing = ML.FindPocketing( 'OpenPocket', dDiamMax, nil, nil, bTopHead, bDownHead)
|
||||
end
|
||||
|
||||
if not sPocketing then
|
||||
|
||||
@@ -202,7 +202,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local OVERLAP_COEFF = 0.7
|
||||
-- porto inizio curva il più possibile sul bordo in alto o in basso
|
||||
local dMaxDist = OVERLAP_COEFF * dMillDiam * MAX_PASS
|
||||
local bMyShortPart = ( bShortPart and abs( vtN:getX()) < 0.999)
|
||||
local bMyShortPart = ( bShortPart and abs( vtN:getX()) < 0.999 and abs( vtN:getY()) < 0.259)
|
||||
BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, bH2 ~= bMyShortPart)
|
||||
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
||||
local sWarn
|
||||
|
||||
Reference in New Issue
Block a user