DataBeam :

- modifiche Filippo.
This commit is contained in:
Dario Sassi
2020-11-16 16:43:07 +00:00
parent 0c0ebfa762
commit 4c79eb18c2
3 changed files with 104 additions and 11 deletions
+49 -7
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/11/08
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/11/13
-- Gestione calcolo mezzo-legno per Travi
-- 2019/10/08 Agg. gestione OpenPocket.
@@ -559,7 +559,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
-- se può essere fatto con utensile tipo lama
local bUseBHSideMill, _, _, dMaxMat = VerifyIfByBHSideMill( Proc)
if bUseBHSideMill and ( dMaxMat <= dV) then
if bUseBHSideMill and ( dMaxMat <= dV + 15 * GEO.EPS_SMALL) then
return true, false
-- altrimenti controllo se deve essere ruotato con le altre lavorazioni
else
@@ -2740,6 +2740,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
local sWarn
local sMchFind = 'Pocket'
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
local bBadMach = false
if sMchFindMaster and #sMchFindMaster > 0 then
sMchFind = sMchFindMaster
end
@@ -2801,16 +2802,28 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
EgtOutLog( sWarn)
-- altrimenti setto il flag per fare la svuotatura da due parti
else
-- se l'altezza utensile riesce a lavorare completamente da due parti
if dMaxMat > (dDepth / 2) then
dMachDepth = 1
dElev = (dDepth / 2) + 1
-- altrimenti non si riesce in due passate, limito la profondità e setto l'elevazione
else
dMachDepth = dMaxMat - (dDepth / 2)
dElev = dMaxMat
-- se sono in questo caso verifico la direzione, se le componenti x,y e z deviano molto
-- allora considero la lavorazione no idonea perchè potrebbe avere anche delle collisioni
if abs(vtOrtho:getX()) > 0.5 or abs(vtOrtho:getY()) > 0.5 or abs(vtOrtho:getZ()) > 0.5 then
bBadMach = true
end
end
bDoubleSide = true
end
end
-- se lavorazione non idonea esco
if b3FacesUsed and bBadMach then
local sErr = 'Impossible apply perpendicular pocketing: ' .. sPocketing
return -2, sErr
end
-- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing)
@@ -2948,6 +2961,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local bClosedOrthoFaces
local nFacInd, dFacElev, nFacInd2, dFacElev2
local nBottomFace
local sMchFindBackUp
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
if not nFacInd or nFacInd < 0 then
@@ -3081,7 +3095,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2)
-- se fattibile con fresa BH di fianco e spessore utensile inferiore alla larghezza faccia
local bMakeBySideMill, bHead, sMilling, dMaxMat = VerifyIfByBHSideMill( Proc)
if bMakeBySideMill and ( dMaxMat <= dV) then
if bMakeBySideMill and ( dMaxMat <= dV + 15 * GEO.EPS_SMALL) then
-- se smusso non è esclusivo
if nChamfer < 2 then
-- inserisco la lavorazione di fresatura
@@ -3294,6 +3308,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
-- settaggio voluto da Alessandro
local sMchFind = EgtIf( bSinglePart, 'Pocket', 'OpenPocket')
sMchFindBackUp = sMchFind
local nUseRoughTool = EgtIf( bSinglePart, 0, 1)
-- fino a che nelle svuotature non si può decidere il punto di inizio faccio delle valutazioni
-- se ho passi multipli controllo il numero delle facce
@@ -3322,6 +3337,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
-- verifico dalla forma se non posso prendere utensile grande
if ( Proc.Fct == 3 and bIsU and bSinglePart) or ( Proc.Fct == 2 and bIsL) or Proc.Fct == 1 then
sMchFindBackUp = sMchFind
--ottengo un diametro utensile opportuno
dDiam, sMchFind, nUseRoughTool, dDiamMax = CheckDiamToolByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic), nUseRoughTool)
if not dDiam and nUseRoughTool == 0 then
@@ -3389,7 +3405,18 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if Proc.Fct == 3 and bIsU then
-- lavoro con svuotature (singola o doppia contrapposta)
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFind, true, b3Solid)
if nOk < 0 then
-- se lavorazione non idonee ( asse della feature troppo inclinato e impossibile lavorare completamente da due parti)
if nOk == -2 then
if not sMchFind then
sMchFind = sMchFindBackUp
end
sPocketing = ML.FindPocketing( sMchFind, dDiam)
if not sPocketing then
local sErr = 'Error : '..sMchFind..' not found in library'
EgtOutLog( sErr)
return false, sErr
end
elseif nOk < 0 then
return false, sErr
elseif nOk == 0 then
if sStat == 'MNF' then
@@ -3435,7 +3462,19 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU then
-- lavoro con svuotature (singola o doppia contrapposta)
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFind, true, b3Solid)
if nOk < 0 then
if nOk == -2 then
if not sMchFind then
sMchFind = sMchFindBackUp
end
sPocketing = ML.FindPocketing( sMchFind, dDiam)
if not sPocketing then
local sErr2 = 'Error : '..sMchFind..' not found in library'
EgtOutLog( sErr2)
return false, sErr2
end
bTryWithBlades = false
sWarn = sErr
elseif nOk < 0 then
return false, sErr
elseif nOk > 0 then
bTryWithBlades = false
@@ -3465,9 +3504,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
else
return bOk, sWarn
end
-- altrimenti ho già svuotato dal fianco, esco
-- altrimenti verifico se ho già svuotato dal fianco, se si esco
else
return bOk, sWarn
-- se non ho annullato la/le svuotatura/e dal fianco
if nOk ~= -2 then
return bOk, sWarn
end
end
end
end