Test caso special3faces

This commit is contained in:
luca.bacis
2021-12-15 16:19:54 +01:00
parent bde8e81240
commit 4757b1596b
+34 -27
View File
@@ -29,9 +29,10 @@
-- 2021/10/19 Corretta gestione inversione per Tunnel. OpenPocket anche se spezzato ma 1 o 2 facce. Introdotta lunghezza minima per lamello.
-- 2021/10/21 Migliorato controllo affondamento utensile in U lavorato da 3 parti (anche da sotto).
-- 2021/10/27 Migliorato calcolo asse tunnel o similare.
-- 2021/11/02 In svuotatura con lati aperti diametro fresa non superiore al doppio del lato piccolo.
-- 2021/11/02 In svuotatura con lati aperti diametro fresa non superiore al doppio del lato piccolo.
-- 2021/11/15 Quando si usa sega a catena uso Q10 come massima elevazione.
-- 2021/11/22 Corretta segnalazione warning su foro di L20 e L25.
-- 2021/12/14 <LB> Lettura parametri Q solo all'inizio.
-- Tabella per definizione modulo
local ProcessLapJoint = {}
@@ -351,7 +352,7 @@ local function VerifyBHSideMill( Proc, bMasterIsU, bMasterIsL, bSinglePart, bPre
local dToolDiam = 0
-- 22/09/2021 Su richiesta di Alessandro Sola, si toglie la richiesta di presenza del parametro Q per poter applicare
-- la lavorazione su più features( che non hanno questo parametro Q), quindi questa lavorazione viene verificata se è abilitato il parametro utensile
-- che ooviamente tramite la lavorazione è abbinata alla lista lavorazioni con BHSideMill.
-- che ovviamente tramite la lavorazione è abbinata alla lista lavorazioni con BHSideMill.
-- Al fine di mantenere il funzionamento precedente (purtroppo non sono stati descritti i motivi del confrontare il parametro Q)
-- si elude il controllo del Q solo se la variabile del Beamdata BD.BH_MACHINE segnala che non è una macchina tipo BH (ha la fresa blockhaus al posto della lama)
@@ -1144,7 +1145,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV
end
-- Se massimo materiale utensile è molto inferiore dell'elevazione non faccio la lavorazione e do un warning
if dMaxMat > 0 and dMaxMat + 15 < dElev + dCollSic then
sWarn = 'Warning : skipped milling; elevation bigger than max tool depth'
local sWarn = 'Warning : skipped milling; elevation bigger than max tool depth'
return true, sWarn, dMaxMat
end
-- Calcolo uso faccia
@@ -1191,9 +1192,11 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV
if nFacAdj == nFacInd2 then
if not bOpenStart then
EgtSetMachiningParam( MCH_MP.LOPERP, dFacElev2)
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
end
if not bOpenEnd then
EgtSetMachiningParam( MCH_MP.LIPERP, dFacElev2)
EgtSetMachiningParam( MCH_MP.LITANG, 0)
end
end
end
@@ -3190,7 +3193,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
-- laterale sul punto medio della linea in comune
local frFc = Frame3d( ptPm, vtN) ;
local b3BoxLoc = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frFc)
dDepth = b3BoxLoc:getDimZ() or 0
local dDepth = b3BoxLoc:getDimZ() or 0
-- recupero i dati dell'utensile
local dSawDiam = 400
local dSawThick = 0
@@ -4417,8 +4420,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local bTryWithBlades = true
-- lavoro fessura con svuotature (singola o doppia contrapposta)
local sMyMchFind = 'Pocket'
local nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
nLundIdFace = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
local nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
if nOk < 0 then
return false, sErr
elseif nOk > 0 then
@@ -4607,7 +4609,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
-- verifico se lavorando la faccia principale rimane esclusa molta sezione trasversale complessiva della feature (da box)
local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
local bBoxF = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfFac)
if dH * dV < 0.9 * ( bBoxF:getDimX() * bBoxF:getDimY()) then
-- <LB> if dH * dV < 0.9 * ( bBoxF:getDimX() * bBoxF:getDimY()) then
if dH * dV < 0.99 * ( bBoxF:getDimX() * bBoxF:getDimY()) then
bSpecial3faces = true
end
-- se riconosciuta gestione 3 facce
@@ -4623,8 +4626,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
EgtOutLog( sErr)
return false, sErr
end
rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
rfFac2, dH2, dV2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd2, GDB_ID.ROOT)
-- rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
local rfFac2, dH2, dV2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd2, GDB_ID.ROOT)
-- eventuali tagli preliminari
do
local bOk, sErr = MakePreCuts( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, nChamfer)
@@ -4649,18 +4652,22 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local dCollSic2 = 2 * BD.COLL_SIC
if abs( vtN:getX()) > 0.7 or abs( vtN:getY()) > 0.7 or abs( vtN:getZ()) > 0.7 then dCollSic = 0 end
if abs( vtN2:getX()) > 0.7 or abs( vtN2:getY()) > 0.7 or abs( vtN2:getZ()) > 0.7 then dCollSic2 = 0 end
local sPocketing = ML.FindPocketing( sMchFind, dDiam2, dFacElev2 + dCollSic2)
-- <LB> local sPocketing = ML.FindPocketing( sMchFind, dDiam2, dFacElev2 + dCollSic2)
local sPocketing = ML.FindPocketing( sMchFind, dDiam, dFacElev + dCollSic)
local nPockFace = nFacInd -- <LB>
-- se non trova una svuotatura adatta provo ad assegnarla all'altra faccia
if not sPocketing then
dDiam, dDiam2 = dDiam2, dDiam
dCollSic, dCollSic2 = dCollSic2, dCollSic
nFacInd, nFacInd2 = nFacInd2, nFacInd
dH, dH2 = dH2, dH
dV, dV2 = dV2, dV
dFacElev, dFacElev2 = dFacElev2, dFacElev
rfFac, rfFac2 = rfFac2, rfFac
vtN, vtN2 = vtN2, vtN
-- <LB> dDiam, dDiam2 = dDiam2, dDiam
-- <LB> dCollSic, dCollSic2 = dCollSic2, dCollSic
-- <LB> nFacInd, nFacInd2 = nFacInd2, nFacInd
-- <LB> dH, dH2 = dH2, dH
-- <LB> dV, dV2 = dV2, dV
-- <LB> dFacElev, dFacElev2 = dFacElev2, dFacElev
-- <LB> rfFac, rfFac2 = rfFac2, rfFac
-- <LB> vtN, vtN2 = vtN2, vtN
-- <LB> sPocketing = ML.FindPocketing( sMchFind, dDiam2, dFacElev2 + dCollSic2)
sPocketing = ML.FindPocketing( sMchFind, dDiam2, dFacElev2 + dCollSic2)
nPockFace = nFacInd2 -- <LB>
if not sPocketing then
local sErr = 'Error : '..sMchFind..' not found in library'
EgtOutLog( sErr)
@@ -4687,7 +4694,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd2}})
-- <LB> EgtSetMachiningGeometry( {{ Proc.Id, nFacInd2}})
EgtSetMachiningGeometry( {{ Proc.Id, nPockFace}})
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
-- imposto posizione braccio porta testa
@@ -4785,7 +4793,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259)
local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342)
-- settaggio voluto da Alessandro/Fabio (per fare angoli con fresa piccola)
sMchFind = 'Pocket'
local sMchFind = 'Pocket'
local dDiam = min( dH, dV)
local bTailOnSide = ( Proc.Box:getMin():getX() - b3Solid:getMin():getX() < 0.1 and not Proc.Tail)
if ( Proc.Fct == 1) or (( Proc.Fct == 2 or Proc.Fct == 3) and bIsL) or ((( Proc.Fct == 3 and bIsU) or ( Proc.Fct == 4 and not bTailOnSide)) and bSinglePart) then
@@ -4881,7 +4889,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local nFaces = EgtSurfTmFacetCount( nTestId)
while not bExit and nFaces >= 3 do
local bDeleteFace
nInt = 0
local nInt = 0
while not bDeleteFace and nInt < nFaces do
nInt = nInt + 1
local b3Facet = EgtSurfTmGetFacetBBoxGlob( nTestId, nInt-1, GDB_BB.STANDARD)
@@ -4949,7 +4957,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
-- leggo parametro Q
local nQAntisplintResult = Q_ANTISPLINT_TYPE
-- se lavorazione fresa come lama disabilito eveentuale antischegggia
-- se lavorazione fresa come lama disabilito eventuale antischegggia
if bSpecialMillOnSide then nQAntisplintResult = 0 end
-- se non trova una svuotatura adatta
if not sPocketing then
@@ -4968,7 +4976,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
bOk, sWarn = MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
rfFac, dH, dV, dFacElev, bSpecialMillOnSide,
nBottomFace, nAddGrpId, b3Solid, dMaxDepthOnSide, sMillingOnSide,
dToolDiamOnSide, dThickMillOnSide)
dToolDiamOnSide, dThickMillOnSide)
if bOk then
return true, sWarn
end
@@ -5073,9 +5081,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
-- lavoro con svuotature (singola o doppia contrapposta)
local sMyMchFind = 'Pocket'
local dDiamTool = 100
local nPathInt, nSurfInt, bOneShot, nFirstMachId
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, true, b3Solid, nil, bMillDown)
local nPathInt, nSurfInt, bOneShot, nFirstMachId, bDoubleSide
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId, bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, true, b3Solid, nil, bMillDown)
if nOk == -2 then
if not sMchFind then
sMchFind = sMchFindBackUp
@@ -5210,7 +5217,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
-- eseguo la svuotatura della faccia principale, mi restituisce id utensile, il diametro utensile per il foro opzionale
local tvtNx = {}
tvtNx[2] = vtN
local bOk, sWarn2
local bOk, sWarn2, sTuuidPk, dDiamTool
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dFacElev + dCollSic)
if not bOk then return false, sWarn2 end
if sWarn2 then