|
|
|
@@ -89,6 +89,9 @@
|
|
|
|
|
-- 2023/12/06 In VerifySideMillAsSaw, se SIDEDEPTH non definita, viene calcolata.
|
|
|
|
|
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
|
|
|
|
-- 2024/01/22 Implementata gestione seghe a catena multiple.
|
|
|
|
|
-- 2024/01/31 In tagli con sega a catena ora si considera l'ingombro della testa per il calcolo della massima profondità.
|
|
|
|
|
-- Aggiunta funzione GetToolEntryAngle per determinare l'angolo di ingresso dell'utensile nella faccia.
|
|
|
|
|
-- 2024/02/08 Ora i rabbet lungo X che guardano in basso sono sempre fatti con fresatura di lato per evitare di ruotare.
|
|
|
|
|
|
|
|
|
|
-- Tabella per definizione modulo
|
|
|
|
|
local ProcessLapJoint = {}
|
|
|
|
@@ -323,7 +326,8 @@ local function VerifyChainSaw( Proc, dMinDim, dMaxDim, dDepth)
|
|
|
|
|
local dMaxMat = 0
|
|
|
|
|
local dSawCornerRad = 0
|
|
|
|
|
local dSawThick = 0
|
|
|
|
|
local dMaxDepth = 200
|
|
|
|
|
local dMaxDepth = 200
|
|
|
|
|
local dSawWidth = 0
|
|
|
|
|
-- se non trova una lavorazione di sawing esco
|
|
|
|
|
if not sSawing then
|
|
|
|
|
return bUseChainSaw
|
|
|
|
@@ -346,7 +350,7 @@ local function VerifyChainSaw( Proc, dMinDim, dMaxDim, dDepth)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
return bUseChainSaw, sSawing, dMaxMat, dSawCornerRad, dSawThick, dMaxDepth
|
|
|
|
|
return bUseChainSaw, sSawing, dMaxMat, dSawCornerRad, dSawThick, dMaxDepth, dSawWidth
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
@@ -612,7 +616,8 @@ local function UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
|
|
|
|
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
|
|
|
|
|
local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
|
|
|
|
|
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ then
|
|
|
|
|
if Proc.Head then
|
|
|
|
|
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
|
|
|
|
|
BL.UpdateHCING( nRawId, dOffs)
|
|
|
|
@@ -754,8 +759,9 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
|
|
|
|
local bDown = ( vtN[1]:getZ() < BD.NZ_MINB and vtN[2]:getZ() < BD.NZ_MINB) or
|
|
|
|
|
( vtN[1]:getZ() < BD.NZ_MINA and vtN[2]:getZ() < 0.5 and ( vtN[2]:getZ() < -0.1 or not bSmall)) or
|
|
|
|
|
( vtN[2]:getZ() < BD.NZ_MINA and vtN[1]:getZ() < 0.5 and ( vtN[1]:getZ() < -0.1 or not bSmall))
|
|
|
|
|
-- se forzata la lavorazione con fresa di lato da parametro Q03=2/3 non devo ruotare
|
|
|
|
|
local bForceSideMill = ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd') == 2 or EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd') == 3)
|
|
|
|
|
-- se forzata la lavorazione con fresa di lato da parametro Q03=2/3 non devo ruotare; se rabbet lungo X che guarda in giù sempre fresatura di lato e quindi non ruoto
|
|
|
|
|
local bIsRabbetAlongXTowardsBottom = ( Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and Proc.AffectedFaces.Bottom and Proc.AffectedFaces.Left and Proc.AffectedFaces.Right)
|
|
|
|
|
local bForceSideMill = ( bIsRabbetAlongXTowardsBottom or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd') == 2 or EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd') == 3))
|
|
|
|
|
bDown = ( bDown and not BD.DOWN_HEAD and not BD.TURN and not bForceSideMill)
|
|
|
|
|
return true, bDown
|
|
|
|
|
-- se più di 2 facce
|
|
|
|
@@ -1347,6 +1353,54 @@ local function CheckToInvert( AuxId, bPositive)
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
---
|
|
|
|
|
---@param Proc table la feature
|
|
|
|
|
---@param vtTool Vector3d il vettore direzione utensile
|
|
|
|
|
---@return number dAngle angolo tra la faccia d'ingresso e la direzione utensile
|
|
|
|
|
---@return number dSinAngle seno dell'angolo
|
|
|
|
|
---@return number dCosAngle coseno dell'angolo
|
|
|
|
|
---@return number|nil dTanAngle tangente dell'angolo
|
|
|
|
|
local function GetToolEntryAngle( Proc, vtTool)
|
|
|
|
|
|
|
|
|
|
local dSinAngle = -10 * GEO.EPS_SMALL
|
|
|
|
|
local vtNorm
|
|
|
|
|
if Proc.AffectedFaces.Top then
|
|
|
|
|
vtNorm = Z_AX()
|
|
|
|
|
dSinAngle = max( dSinAngle, vtTool * vtNorm)
|
|
|
|
|
end
|
|
|
|
|
if Proc.AffectedFaces.Bottom then
|
|
|
|
|
vtNorm = -Z_AX()
|
|
|
|
|
dSinAngle = max( dSinAngle, vtTool * vtNorm)
|
|
|
|
|
end
|
|
|
|
|
if Proc.AffectedFaces.Front then
|
|
|
|
|
vtNorm = -Y_AX()
|
|
|
|
|
dSinAngle = max( dSinAngle, vtTool * vtNorm)
|
|
|
|
|
end
|
|
|
|
|
if Proc.AffectedFaces.Back then
|
|
|
|
|
vtNorm = Y_AX()
|
|
|
|
|
dSinAngle = max( dSinAngle, vtTool * vtNorm)
|
|
|
|
|
end
|
|
|
|
|
if Proc.AffectedFaces.Left then
|
|
|
|
|
vtNorm = -X_AX()
|
|
|
|
|
dSinAngle = max( dSinAngle, vtTool * vtNorm)
|
|
|
|
|
end
|
|
|
|
|
if Proc.AffectedFaces.Right then
|
|
|
|
|
vtNorm = X_AX()
|
|
|
|
|
dSinAngle = max( dSinAngle, vtTool * vtNorm)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local dCosAngle = sqrt( 1 - sqr( dSinAngle))
|
|
|
|
|
local dAngle = acos( dCosAngle)
|
|
|
|
|
local dTanAngle
|
|
|
|
|
if dAngle ~= 0 and dAngle ~= 90 then
|
|
|
|
|
dTanAngle = sqrt( 1 - dCosAngle * dCosAngle) / dCosAngle
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return dAngle, dSinAngle, dCosAngle, dTanAngle
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
local function MakeRoundCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|
|
|
|
nFacInd, nAddGrpId, dDiam, bMillDown, bDoubleSide)
|
|
|
|
@@ -2670,6 +2724,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|
|
|
|
local b3Raw = EgtGetRawPartBBox( nRawId)
|
|
|
|
|
-- ottengo la distanza tra la fine del pezzo e il pezzo successivo
|
|
|
|
|
local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase)
|
|
|
|
|
-- angolo d'ingresso dell'utensile
|
|
|
|
|
local dToolEntryAngle, _, _, dTanToolEntryAngle = GetToolEntryAngle( Proc, rfFac:getVersZ())
|
|
|
|
|
-- verifico se fessura con 3 facce o tunnel
|
|
|
|
|
local bOrthoFaces
|
|
|
|
|
local bIs3Faces = ( Proc.Fct == 3)
|
|
|
|
@@ -2883,6 +2939,14 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|
|
|
|
if nStep > 1 then
|
|
|
|
|
dStep = ( dV - dSawThick) / ( nStep - 1)
|
|
|
|
|
end
|
|
|
|
|
-- se necessario riduco la profondità di lavoro per considerare l'ingombro della testa
|
|
|
|
|
local dChainSawTHLength = EgtIf( EgtTdbGetCurrToolThLength() > 10 * GEO.EPS_SMALL, EgtTdbGetCurrToolThLength(), 88)
|
|
|
|
|
local dChainSawExtraLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - dChainSawTHLength - dMaxDepth
|
|
|
|
|
local dMaxMatReduction = 0
|
|
|
|
|
if dToolEntryAngle > 10 * GEO.EPS_ANG_SMALL and dToolEntryAngle < 90 - 10 * GEO.EPS_ANG_SMALL then
|
|
|
|
|
dMaxMatReduction = max( ( ( 2 * BD.C_SIMM_ENC - dSawWidth) / ( 2 * dTanToolEntryAngle) - dChainSawExtraLength) - 5, 0)
|
|
|
|
|
end
|
|
|
|
|
dMaxDepth = dMaxDepth - dMaxMatReduction
|
|
|
|
|
for i = 1, nStep do
|
|
|
|
|
-- Applico la lavorazione con sega a catena a questa faccia
|
|
|
|
|
local sName = 'Csaw_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
|
|
|
|
@@ -2925,8 +2989,9 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|
|
|
|
-- imposto offset radiale
|
|
|
|
|
local dOffs = ( i - 1) * dStep
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
|
|
|
|
-- se necessario, avverto limitazioneo dell'affondamento
|
|
|
|
|
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
|
|
|
|
-- se necessario, avverto limitazione dell'affondamento
|
|
|
|
|
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth)
|
|
|
|
|
sWarn = 'Warning in LapJoint : elevation (' .. EgtNumToString( dElev, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
|
|
|
|
EgtOutLog( sWarn)
|
|
|
|
|
--local dDepth = dMaxDepth - dElev
|
|
|
|
@@ -4553,7 +4618,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
-- Se la svuotatura precedente non è stata fatta e chamfer non è mutuamente esclusivo provo con la sega-catena
|
|
|
|
|
if bTryWithBlades and nChamfer < 2 then
|
|
|
|
|
-- verifico se posso farlo con la sega-catena
|
|
|
|
|
local bMakeChainSaw, sSawing, dMaxMat, dSawCornerRad, dSawThick = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth)
|
|
|
|
|
local bMakeChainSaw, sSawing, dMaxMat, dSawCornerRad, dSawThick, _, dSawWidth = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth)
|
|
|
|
|
if bMakeChainSaw then
|
|
|
|
|
-- Ricalcolo l'affondamento tenendo conto di eventuale inclinazione
|
|
|
|
|
local dSlDepth
|
|
|
|
@@ -4587,12 +4652,20 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
dDepth = dDepth / 2 + BD.CUT_EXTRA
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
local dWorkDepth = dMaxMat
|
|
|
|
|
-- se necessario riduco la profondità di lavoro per considerare l'ingombro della testa
|
|
|
|
|
local dChainSawTHLength = EgtIf( EgtTdbGetCurrToolThLength() > 10 * GEO.EPS_SMALL, EgtTdbGetCurrToolThLength(), 88)
|
|
|
|
|
local dChainSawExtraLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - dChainSawTHLength - dMaxMat
|
|
|
|
|
local dMaxMatReduction = 0
|
|
|
|
|
local dToolEntryAngle, _, _, dTanToolEntryAngle = GetToolEntryAngle( Proc, vtOrtho)
|
|
|
|
|
if dToolEntryAngle > 10 * GEO.EPS_ANG_SMALL then
|
|
|
|
|
dMaxMatReduction = max( ( ( 2 * BD.C_SIMM_ENC - dSawWidth) / ( 2 * dTanToolEntryAngle) - dChainSawExtraLength) - 5, 0)
|
|
|
|
|
end
|
|
|
|
|
local dWorkDepth = dMaxMat - dMaxMatReduction
|
|
|
|
|
-- cerco di estendere il taglio considerando la parte arrotondata della lama
|
|
|
|
|
if dMaxMat > dDepth + dSawCornerRad + 1 then
|
|
|
|
|
if dMaxMat - dMaxMatReduction > dDepth + dSawCornerRad + 1 then
|
|
|
|
|
dWorkDepth = dDepth + dSawCornerRad + 1
|
|
|
|
|
-- se massimo affondamento utensile inferiore alla profondità da lavorare, setto la profondità di lavoro e emetto warning
|
|
|
|
|
elseif dMaxMat < dDepth then
|
|
|
|
|
elseif dMaxMat - dMaxMatReduction < dDepth then
|
|
|
|
|
sWarn = 'Warning : elevation bigger than max tool depth'
|
|
|
|
|
EgtOutLog( sWarn)
|
|
|
|
|
end
|
|
|
|
@@ -4634,8 +4707,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
local bIsU = ( Proc.Fct == 3 and not TestElleShape3( Proc))
|
|
|
|
|
-- verifico se due facce o L con una o due facce di terminazione
|
|
|
|
|
local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2)
|
|
|
|
|
-- se parametro Q03=2 forzo la fresatura di lato; con Q03=3 forzo solo se la faccia di lavoro non è rivolta verso l'alto +/-10°
|
|
|
|
|
local bForceSideMill = ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( Proc.Fct == 4 or Proc.Fct == 3 or Proc.Fct == 2)
|
|
|
|
|
-- se parametro Q03=2 forzo la fresatura di lato; con Q03=3 forzo solo se la faccia di lavoro non è rivolta verso l'alto +/-10°; se rabbet lungo X che guarda in giù sempre fresatura di lato
|
|
|
|
|
local bIsRabbetAlongXTowardsBottom = ( Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and Proc.AffectedFaces.Bottom and Proc.AffectedFaces.Left and Proc.AffectedFaces.Right)
|
|
|
|
|
local bForceSideMill = bIsRabbetAlongXTowardsBottom or ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( Proc.Fct == 4 or Proc.Fct == 3 or Proc.Fct == 2))
|
|
|
|
|
-- se fattibile con fresa BH di fianco e spessore utensile inferiore alla larghezza faccia
|
|
|
|
|
local bMakeBySideMill, bHead, bHeadDir, sMilling, dMaxMat, dToolDiam = VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
|
|
|
|
|
if bPrevBhSideMill == nil then
|
|
|
|
@@ -5895,6 +5969,8 @@ end
|
|
|
|
|
-- Applicazione della lavorazione
|
|
|
|
|
---------------------------------------------------------------------
|
|
|
|
|
function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|
|
|
|
-- inizializzazione costanti
|
|
|
|
|
if not BD.C_SIMM_ENC then BD.C_SIMM_ENC = EgtIf( BD.C_SIMM, 180, 90) end
|
|
|
|
|
-- setto a nil la variabile smussi
|
|
|
|
|
bMadeChamfer = nil
|
|
|
|
|
-- limiti di fresatura semplice
|
|
|
|
|