DataBeam :

- migliorata scelta punto di attacco lavorazione tenoni (meglio gestita testa sopra/sotto)
- corretta scelta lavorazione tenoni per macchine con testa da sotto
- corretta scelta lavorazione BH per feature BH (ora si tiene conto anche dell'affondamento).
This commit is contained in:
DarioS
2022-05-20 15:52:56 +02:00
parent c9b0f1e90d
commit 1b86003ed8
4 changed files with 91 additions and 56 deletions
+60 -37
View File
@@ -382,7 +382,7 @@ local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
-- le facce devono contenere X e quelle di chiusura devono essere perpendicolari a X
local bStopY, bStopZ
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:getX()) > 0.001 and abs( vtN:getX()) < 0.999962 then
return false
end
@@ -412,20 +412,35 @@ local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
-- recupero i dati dell'utensile
local dToolLength = 0
local dToolDiam = 0
local dMaxDepth = 0
local dThickTool = 0
local dToolMaxDepth = 0
local dToolThick = 0
local dToolFreeLen = 0
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolLength = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dToolLength
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
dThickTool = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThickTool
local dToolThDiam = EgtTdbGetCurrToolThDiam() or 150
if ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0 then
dToolMaxDepth = EgtTdbGetCurrToolMaxDepth() or dToolMaxDepth
dToolThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dToolThick
dToolFreeLen = dToolLength
else
dToolMaxDepth = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 0.5 * ( dToolDiam - dToolThDiam)
dToolThick = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
dToolFreeLen = EgtTdbGetCurrToolMaxDepth() or dToolFreeLen
end
end
end
-- verifico se abbastanza larga (oppure L) rispetto all'utensile
if Proc.Box:getDimX() < dThickTool - 15 * GEO.EPS_SMALL and not bIsL then
if Proc.Box:getDimX() < dToolThick - 15 * GEO.EPS_SMALL and not bIsL then
return false
end
-- limiti trasversali
local dDepth = min( Proc.Box:getDimY(), Proc.Box:getDimZ())
if dDepth > dToolMaxDepth then
return false
end
@@ -440,14 +455,14 @@ local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
local bHead = bHeadDir
-- verifico se raggiungibile con la testa senza collisioni
local bUseBHSideMill = EgtIf( bHead, ( dMaxT - dMinXF), ( dMaxXF - dMinT)) < dMaxDepth
local bUseBHSideMill = EgtIf( bHead, ( dMaxT - dMinXF), ( dMaxXF - dMinT)) < dToolFreeLen
-- se diametro utensile maggiore della testa
if BD.HEAD_DIM_FOR_BH and dToolDiam > BD.HEAD_DIM_FOR_BH then
if BD.HEAD_DIM_FOR_BH and dToolDiam - 2 * dDepth > BD.HEAD_DIM_FOR_BH then
bHead = true
bUseBHSideMill = true
end
return bUseBHSideMill, bHead, bHeadDir, sMilling, dThickTool, dToolDiam
return bUseBHSideMill, bHead, bHeadDir, sMilling, dToolThick, dToolDiam
end
---------------------------------------------------------------------
@@ -557,6 +572,29 @@ local function CalcCollisionSafety( vtDir)
return dCollSic
end
---------------------------------------------------------------------
local function UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
-- verifico siano una o due facce
if Proc.Fct > 2 then return end
-- eventuale segnalazione ingombro di testa o coda
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then
if Proc.Head then
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
BL.UpdateHCING( nRawId, dOffs)
elseif Proc.Tail then
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
BL.UpdateTCING( nRawId, dOffs)
elseif Proc.Fct > 1 and Proc.Box:getCenter():getX() > b3Solid:getCenter():getX() then
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
local dDist = b3Solid:getMax():getX() - Proc.Box:getMax():getX()
-- sempre concavo aumento la distanza (rimane una punta...)
dDist = dDist + 10
BL.UpdateHCING( nRawId, dOffs, dDist)
end
end
end
---------------------------------------------------------------------
-- Verifica se feature di testa
function ProcessLapJoint.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
@@ -863,16 +901,7 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
return false, sErr
end
-- eventuale segnalazione ingombro di testa o coda
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then
if Proc.Head then
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
BL.UpdateHCING( nRawId, dOffs)
elseif Proc.Tail then
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
BL.UpdateTCING( nRawId, dOffs)
end
end
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
return true
end
@@ -1040,22 +1069,7 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
return false, sErr
end
-- eventuale segnalazione ingombro di testa o coda
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then
if Proc.Head then
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
BL.UpdateHCING( nRawId, dOffs)
elseif Proc.Tail then
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
BL.UpdateTCING( nRawId, dOffs)
elseif Proc.Box:getCenter():getX() > b3Solid:getCenter():getX() then
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
local dDist = b3Solid:getMax():getX() - Proc.Box:getMax():getX()
-- sempre concavo aumento la distanza (rimane una punta...)
dDist = dDist + 10
BL.UpdateHCING( nRawId, dOffs, dDist)
end
end
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
return true
end
@@ -2664,7 +2678,6 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
return false, sErr
end
end
if bOrthoFaces then
-- ottengo le dimensioni del tunnel
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId)
@@ -4531,6 +4544,14 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if bMakeBySideMill then
-- se smusso non è esclusivo
if nChamfer < 2 then
-- verifico che la faccia non sia diretta come X, altrimenti cerco di cambiarla
if abs( vtN:getX()) > 0.866 and nFacInd2 then
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd2, GDB_ID.ROOT)
if vtN2 and abs( vtN2:getX()) < 0.866 then
nFacInd, nFacInd2 = nFacInd2, nFacInd
vtN, vtN2 = vtN2, vtN
end
end
-- se lavorazione da sotto e lunga, va divisa in due metà
local bDouble = ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200))
-- inserisco la lavorazione di fresatura
@@ -4573,7 +4594,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG)
EgtSetMachiningParam( MCH_MP.LOTANG, -( dToolDiam / 2 + b3Raw:getDimY() + BD.CUT_SIC))
EgtSetMachiningParam( MCH_MP.LOPERP, dFacElev + BD.COLL_SIC)
EgtSetMachiningParam( MCH_MP.LOPERP, EgtIf( vtN:getZ() > -0.5, dFacElev + BD.COLL_SIC, BD.COLL_SIC))
if bDouble then
EgtSetMachiningParam( MCH_MP.ENDADDLEN, - dH / 2)
EgtSetMachiningParam( MCH_MP.LOTANG, -( dToolDiam / 2 + dH / 2 + BD.CUT_SIC))
@@ -5298,6 +5319,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
end
end
-- eventuale segnalazione ingombro di testa o coda
UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
end
return true, sWarn, bPrevBhSideMill