Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7b484d6bf | |||
| 4a8576bcb2 | |||
| a2854beb8d | |||
| aa9f7c577c | |||
| 6fb5c3803f | |||
| 7d11c76bef | |||
| 8f8dc23096 | |||
| 2e2c897b47 | |||
| 2c98483de0 | |||
| 8660ae3742 | |||
| 3c0d1c9593 | |||
| 005bb0a384 | |||
| 897fa66d33 | |||
| 3069366ef2 | |||
| ec485c1c62 | |||
| 4acaab29f7 | |||
| 9b35408ef9 | |||
| d420e630ce | |||
| 8a9e198c43 | |||
| d1f1429eb5 | |||
| 9184fa23ac | |||
| 0950eac628 | |||
| 1f730989b3 | |||
| 63169a3859 | |||
| f59dac3029 | |||
| 5a089a737c | |||
| 2ed2e28e8a | |||
| 21144825dc | |||
| 2aba85f3c9 |
+40
-19
@@ -47,12 +47,16 @@
|
||||
-- 2023/03/31 Corretto ordinamento per fori di coda da lasciare in coda.
|
||||
-- 2023/07/31 Corretto errore nelle mortase in doppio.
|
||||
-- 2023/09/13 Aggiunta ClassifyTopology per la classificazione topologica delle feature. In CollectFeatures aggiunta la raccolta preliminare di alcune informazioni.
|
||||
-- 2022/09/26 Funzione IsFeatureCuttingEntireSection spostata in BeamLib
|
||||
-- 2022/09/26 In ClassifyTopology aggiunto passaggio del parametro nRawId
|
||||
-- 2023/09/26 Funzione IsFeatureCuttingEntireSection spostata in BeamLib
|
||||
-- 2023/09/26 In ClassifyTopology aggiunto passaggio del parametro nRawId
|
||||
-- 2023/10/24 Aggiunta scrittura parametro BARLEN nelle info del mach group
|
||||
-- 2023/11/08 Aggiunta gestione processi Variant.
|
||||
-- 2023/11/30 Migliorato il calcolo elevazione con l'utilizzo della nuova funzione EgtSurfTmFacetElevationInBBox.
|
||||
-- 2023/12/26 Modifiche per centrare i pezzi in Y sulla tavola.
|
||||
-- 2024/02/26 Migliorata 'CompareFeatures' per ordine lavorazioni
|
||||
-- Migliorata 'CompareFeatures' per ordine forature
|
||||
-- 2024/02/19 In Collect aggiunta la scrittura nella Proc di Width e Height delle facce.
|
||||
-- 2024/02/29 Migliorata 'CompareFeatures' per ordine forature
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamExec = {}
|
||||
@@ -342,7 +346,8 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
if not Proc.Face then
|
||||
Proc.Face = {}
|
||||
for i = 1, Proc.Fct do
|
||||
Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT )}
|
||||
local _, dFaceWidth, dFaceHeight = BL.GetFaceHvRefDim( Proc.Id, i - 1, b3Raw)
|
||||
Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT ), Width = dFaceWidth, Height = dFaceHeight}
|
||||
if Proc.Fct < 10 then
|
||||
Proc.Face[i].Elevation = EgtSurfTmFacetElevationInBBox( Proc.Id, i - 1, b3Solid, true, GDB_ID.ROOT)
|
||||
end
|
||||
@@ -785,10 +790,18 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
if Hcut.Identify( B2) then
|
||||
return false
|
||||
end
|
||||
-- se uno di testa e non l'altro, privilegio quello di testa
|
||||
if B1.Head ~= B2.Head then
|
||||
-- se uno di testa e non l'altro, privilegio quello di testa (a meno che non siano dei fori)
|
||||
if B1.Head ~= B2.Head and not Drill.Identify(B1) and not Drill.Identify(B2) then
|
||||
return B1.Head
|
||||
end
|
||||
-- se entrambi di testa e intersecano stesse facce e primo è scasso a due facce e secondo è un profilo caudato, lo scasso è una riduzione e va fatto prima
|
||||
if ( ( B1.Head and B2.Head) or ( B1.Tail and B2.Tail)) and ( LapJoint.Identify( B1) and B1.Fct == 2) and ( ProfCamb.Identify( B2)) then
|
||||
return true
|
||||
end
|
||||
-- se entrambi di testa e intersecano stesse facce e primo è un profilo caudato e secondo è scasso a due facce, lo scasso è una riduzione e va lasciato dopo
|
||||
if ( ( B1.Head and B2.Head) or ( B1.Tail and B2.Tail)) and ( LapJoint.Identify( B2) and B2.Fct == 2) and ( ProfCamb.Identify( B1)) then
|
||||
return false
|
||||
end
|
||||
-- se entrambi di testa e primo è scasso o mortasa e secondo no va messo dopo
|
||||
if B1.Head and B2.Head and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) and
|
||||
not ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) then
|
||||
@@ -807,6 +820,16 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
if B2.AdvTail and ( not Split.Identify( B1) or not B1.Tail) then
|
||||
return true
|
||||
end
|
||||
-- se primo è foro e secondo è un ribasso, il foro va sempre prima a meno che il ribasso non sia di testa
|
||||
if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2)) and not B2.Head and
|
||||
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
||||
return true
|
||||
end
|
||||
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo a meno che il ribasso non sia di testa
|
||||
if ( LapJoint.Identify(B1) or Mortise.Identify(B1))and not B1.Head and Drill.Identify(B2) and
|
||||
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
||||
return false
|
||||
end
|
||||
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
|
||||
if B1.Tail and ( Split.Identify( B2) or not B2.Tail) then
|
||||
return false
|
||||
@@ -817,14 +840,22 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
end
|
||||
-- se primo è scasso o mortasa di coda e secondo no, sempre dopo
|
||||
if B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) and
|
||||
not ( B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2))) then
|
||||
not B2.Tail and ( ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2))) then
|
||||
return false
|
||||
end
|
||||
-- se secondo è scasso o mortasa di coda e primo no, va lasciato dopo
|
||||
if B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) and
|
||||
not ( B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1))) then
|
||||
not B1.Tail and ( ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1))) then
|
||||
return true
|
||||
end
|
||||
-- se entrambi di coda e il primo è una feature taglio di lama e il secondo no, feature taglio lama sempre prima
|
||||
if B1.Tail and B2.Tail and ( Cut.Identify( B1) or DoubleCut.Identify( B1)) and ( not Cut.Identify( B2) and not DoubleCut.Identify( B2)) then
|
||||
return true
|
||||
end
|
||||
-- se entrambi di coda e il secondo è una feature taglio di lama e il primo no, feature taglio lama sempre prima
|
||||
if B1.Tail and B2.Tail and ( Cut.Identify( B2) or DoubleCut.Identify( B2)) and ( not Cut.Identify( B1) and not DoubleCut.Identify( B1)) then
|
||||
return false
|
||||
end
|
||||
-- se primo è taglio longitudinale completo o altra lav. lunga, dopo tutte le altre feature non di coda
|
||||
if abs( B1.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then
|
||||
-- se anche l'altra è lunga, faccio prima quello piccolo in YZ
|
||||
@@ -842,22 +873,12 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
if abs( B2.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then
|
||||
return not ( B1.Tail or B2.Box:getMin():getX() + 20 > B1.Box:getCenter():getX())
|
||||
end
|
||||
-- se primo è foro e secondo è un ribasso, il foro va sempre prima
|
||||
if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2)) and
|
||||
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
||||
return true
|
||||
end
|
||||
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo
|
||||
if (LapJoint.Identify(B1) or Mortise.Identify(B1)) and Drill.Identify(B2) and
|
||||
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
||||
return false
|
||||
end
|
||||
-- se primo è foro e l'altro no, lo penalizzo
|
||||
if B1.Prc == 40 and B2.Prc ~= 40 then
|
||||
if Drill.Identify(B1) and not Drill.Identify(B2) then
|
||||
return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty)
|
||||
end
|
||||
-- se primo è altro e secondo è foro, lo premio
|
||||
if B1.Prc ~= 40 and B2.Prc == 40 then
|
||||
if not Drill.Identify(B1) and Drill.Identify(B2) then
|
||||
return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX())
|
||||
end
|
||||
-- se prima è mortasa coda di rondine sul fianco e secondo taglio longitudinale, la coda di rondine va sempre prima
|
||||
|
||||
+1
-1
@@ -860,7 +860,7 @@ function BeamLib.GetBlockedAxis( sMachining, sBlockedAxis, b3Raw, vtTool, vtOut)
|
||||
end
|
||||
-- se presente funzione specifica nella macchina, la richiamo
|
||||
if BD.GetBlockedAxis then
|
||||
return BD.GetBlockedAxis( sHead, nToolType, sBlockedAxis, b3Raw, vtTool, vtOut)
|
||||
return BD.GetBlockedAxis( sHead, nToolType, sBlockedAxis, b3Raw, vtTool, vtOut) or ''
|
||||
-- sezione mantenuta per retrocompatibilità con GetChainSawBlockedAxis
|
||||
elseif nToolType == MCH_TY.MORTISE_STD then
|
||||
local nInd = EgtIf( sBlockedAxis == 'parallel', 0, 1)
|
||||
|
||||
+35
-3
@@ -26,6 +26,7 @@
|
||||
-- 2024/01/07 Modifiche per OikosX (BD.TURN == 2).
|
||||
-- 2024/01/18 Gestita lama con aggregato con asse bloccato per massimizzare capacità di taglio verticale, se da sotto.
|
||||
-- Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||
-- 2024/02/22 Migliorato calcolo area non pinzabile in testa HCING e coda TCING
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FacesBySaw = {}
|
||||
@@ -528,7 +529,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
local bFaceOk = {}
|
||||
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
|
||||
if not bDownHead and ( not bFaceOk[1] or not bFaceOk[2]) then
|
||||
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
@@ -713,13 +714,44 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
||||
end
|
||||
-- eventuale segnalazione ingombro di testa o coda
|
||||
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
|
||||
if bUpdateIng and Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng and
|
||||
not ( abs( vtN[nBigInd]:getX()) < 0.05 and vtN[nBigInd]:getY() < 0 and Proc.Box:getDimX() > 500 and Proc.Box:getDimY() < 40) then
|
||||
local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
|
||||
-- calcolo punto massimo in Z fino a dove considerare il pinzaggio. Minimo tra pinzaggio massimo e altezza pezzo
|
||||
local dMaxHZ = b3Raw:getMin():getZ() + min( BD.VICE_MAXH or BD.MAX_HEIGHT, b3Raw:getDimZ())
|
||||
-- punto massimo in Z considerando anche la Z della feature
|
||||
local dMaxHZFeat = min( dMaxHZ, Proc.Box:getMax():getZ())
|
||||
-- dimensione Z del pinzaggio (differenza massima Z pinzabile e box feature)
|
||||
local dDeltaZClamp = ( ( dMaxHZ - b3Raw:getMin():getZ()) - max( 0, dMaxHZFeat - Proc.Box:getMin():getZ()))
|
||||
-- se pinzaggio minimo è come il massimo (oppure come l'altezza massima del pezzo) significa che è verticale
|
||||
local bIsVertClamps = BD.VICE_MINH > BD.MAX_HEIGHT - 100 * GEO.EPS_SMALL
|
||||
|
||||
-- condizioni per limitare pinzaggio testa/coda
|
||||
-- se dimensione del box della feature maggiore di metà pinzaggio minimo o metà spessore pezzo
|
||||
bUpdateIng = bUpdateIng and Proc.Box:getDimZ() > dMinHIng
|
||||
-- se la feature si trova più in basso del minimo pinzabile in Z o il 35% dello spessore pezzo
|
||||
bUpdateIng = bUpdateIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ
|
||||
-- riportata condizione, ma poco chiara
|
||||
bUpdateIng = bUpdateIng and not ( abs( vtN[nBigInd]:getX()) < 0.05 and vtN[nBigInd]:getY() < 0 and Proc.Box:getDimX() > 500 and Proc.Box:getDimY() < 40)
|
||||
-- se feature è al di sotto del pinzaggio massimo
|
||||
bUpdateIng = bUpdateIng and Proc.Box:getMin():getZ() < dMaxHZ
|
||||
-- se ho le morse verticali, o se la feature è in centro o verso alto, controllo se non prendo abbastanza.
|
||||
if bIsVertClamps or ( Proc.Box:getMin():getZ() - b3Raw:getMin():getZ()) > BD.MIN_HEIGHT then
|
||||
bUpdateIng = bUpdateIng and dDeltaZClamp < BD.VICE_MINH
|
||||
end
|
||||
|
||||
if bUpdateIng then
|
||||
if Proc.Head then
|
||||
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
|
||||
-- se pinze a 45° e pinza abbastanza materiale, compenso comunque, ma solo inclinazione morse
|
||||
if not bIsVertClamps and dDeltaZClamp > BD.VICE_MINH and BD.VICE_MAXH then
|
||||
dOffs = min( dOffs, BD.VICE_MAXH - BD.VICE_MINH)
|
||||
end
|
||||
BL.UpdateHCING( nRawId, dOffs)
|
||||
elseif Proc.Tail then
|
||||
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
-- se pinze a 45° e pinza abbastanza materiale, compenso comunque, ma solo inclinazione morse
|
||||
if not bIsVertClamps and dDeltaZClamp > BD.VICE_MINH and BD.VICE_MAXH then
|
||||
dOffs = min( dOffs, BD.VICE_MAXH - BD.VICE_MINH)
|
||||
end
|
||||
BL.UpdateTCING( nRawId, dOffs)
|
||||
elseif Proc.Box:getCenter():getX() > b3Solid:getCenter():getX() then
|
||||
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
|
||||
|
||||
@@ -225,7 +225,8 @@ end
|
||||
local function UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
|
||||
-- eventuale segnalazione ingombro di testa o coda (se non chiamata da altre feature)
|
||||
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 = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
if vtN:getZ() > 0.5 then
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
-- 2023/02/08 Aumentato il range per cui i tenoni vengono lavorati in sottosquadro.
|
||||
-- 2023/03/27 Migliorate condizioni scelta pretaglio con lama o fresa; gestione unificata con ProcessTenon.
|
||||
-- 2023/03/28 Corretta gestione faccia di base quando divisa in più parti per distanza massima da lavorare.
|
||||
-- 2024/02/29 Aumentato numero passaggi CR su tenone. Massimo 8
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDtTenon = {}
|
||||
@@ -268,8 +269,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
dMaxDist = 2 * ( b3DtTen:getRadius() - b3DtAux:getRadius())
|
||||
end
|
||||
EgtOutLog( 'MaxDist=' .. EgtNumToString( dMaxDist, 3), 3)
|
||||
-- Cicli di lavorazione (max 6)
|
||||
local MAX_PASS = 6
|
||||
-- Cicli di lavorazione (max 8)
|
||||
local MAX_PASS = 8
|
||||
local nStep = min( ceil( dMaxDist / ( 0.7 * dTDiam)), MAX_PASS)
|
||||
local dStep = min( dMaxDist, 0.7 * dTDiam * MAX_PASS) / nStep
|
||||
for i = nStep, 1, -1 do
|
||||
|
||||
@@ -708,7 +708,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- eventuale segnalazione ingombro di testa o coda
|
||||
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
|
||||
if Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then
|
||||
local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
|
||||
if Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ then
|
||||
if Proc.Head then
|
||||
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
BL.UpdateHCING( nRawId, dOffs)
|
||||
|
||||
@@ -281,7 +281,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
local dLastCutOffset = i * dOffsL
|
||||
local vtMoveLimitingSurf = Vector3d( dLastCutOffset - 10 * GEO.EPS_SMALL, 0, 0)
|
||||
EgtMove( nLimitingSurf, vtMoveLimitingSurf, GDB_RT.GLOB)
|
||||
local vtNLimitingSurf = EgtSurfTmFacetNormVersor( nLimitingSurf, 0)
|
||||
local vtNLimitingSurf = EgtSurfTmFacetNormVersor( nLimitingSurf, 0, GDB_ID.ROOT)
|
||||
if AreSameVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
|
||||
end
|
||||
-- tagli verticali
|
||||
|
||||
+191
-49
@@ -89,6 +89,14 @@
|
||||
-- 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.
|
||||
-- 2024/02/13 In MakeMoreFaces escluse le Groove 2 facce dalla gestione Special3faces.
|
||||
-- 2024/02/22 Migliorato calcolo area non pinzabile in testa HCING e coda TCING
|
||||
-- Rimosso un caso di controllo per HCING/TCING
|
||||
-- 2024/02/29 In MakeMoreFaces passato b3Solid alla funzione ManageAntiSplintByMill
|
||||
-- 2024/02/29 In lapjoint 2 facce (TestTwoFacesDownHead) migliorata la scelta della lama da sotto.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLapJoint = {}
|
||||
@@ -323,7 +331,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 +355,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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -610,20 +619,52 @@ 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
|
||||
local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
|
||||
-- calcolo punto massimo in Z fino a dove considerare il pinzaggio. Minimo tra pinzaggio massimo e altezza pezzo
|
||||
local dMaxHZ = b3Raw:getMin():getZ() + min( BD.VICE_MAXH or BD.MAX_HEIGHT, b3Raw:getDimZ())
|
||||
-- punto massimo in Z considerando anche la Z della feature
|
||||
local dMaxHZFeat = min( dMaxHZ, Proc.Box:getMax():getZ())
|
||||
-- dimensione Z del pinzaggio (differenza massima Z pinzabile e box feature)
|
||||
local dDeltaZClamp = ( ( dMaxHZ - b3Raw:getMin():getZ()) - max( 0, dMaxHZFeat - Proc.Box:getMin():getZ()))
|
||||
-- se pinzaggio minimo è come il massimo (oppure come l'altezza massima del pezzo) significa che è verticale
|
||||
local bIsVertClamps = BD.VICE_MINH > BD.MAX_HEIGHT - 100 * GEO.EPS_SMALL
|
||||
|
||||
-- condizioni per limitare pinzaggio testa/coda
|
||||
local bUpdateIng = true
|
||||
-- se dimensione del box della feature maggiore di metà pinzaggio minimo o metà spessore pezzo
|
||||
bUpdateIng = bUpdateIng and Proc.Box:getDimZ() > dMinHIng
|
||||
-- se la feature si trova più in basso del minimo pinzabile in Z o il 35% dello spessore pezzo
|
||||
bUpdateIng = bUpdateIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ
|
||||
-- se feature è al di sotto del pinzaggio massimo
|
||||
bUpdateIng = bUpdateIng and Proc.Box:getMin():getZ() < dMaxHZ
|
||||
-- se ho le morse verticali, o se la feature è in centro o verso alto, controllo se non prendo abbastanza.
|
||||
if bIsVertClamps or ( Proc.Box:getMin():getZ() - b3Raw:getMin():getZ()) > BD.MIN_HEIGHT then
|
||||
bUpdateIng = bUpdateIng and dDeltaZClamp < BD.VICE_MINH
|
||||
end
|
||||
|
||||
if bUpdateIng then
|
||||
if Proc.Head then
|
||||
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
|
||||
-- se pinze a 45° e pinza abbastanza materiale, compenso comunque, ma solo inclinazione morse
|
||||
if not bIsVertClamps and dDeltaZClamp > BD.VICE_MINH and BD.VICE_MAXH then
|
||||
dOffs = min( dOffs, BD.VICE_MAXH - BD.VICE_MINH)
|
||||
end
|
||||
BL.UpdateHCING( nRawId, dOffs)
|
||||
elseif Proc.Tail then
|
||||
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
-- se pinze a 45° e pinza abbastanza materiale, compenso comunque, ma solo inclinazione morse
|
||||
if not bIsVertClamps and dDeltaZClamp > BD.VICE_MINH and BD.VICE_MAXH then
|
||||
dOffs = min( dOffs, BD.VICE_MAXH - BD.VICE_MINH)
|
||||
end
|
||||
BL.UpdateTCING( nRawId, dOffs)
|
||||
elseif Proc.Fct > 1 and Proc.Box:getCenter():getX() > b3Solid:getCenter():getX() then
|
||||
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
|
||||
-- se concavo aumento la distanza (rimane una punta...)
|
||||
--if dAngT < 0 then dDist = dDist + 10 end
|
||||
BL.UpdateHCING( nRawId, dOffs, dDist)
|
||||
end
|
||||
end
|
||||
@@ -754,8 +795,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 +1389,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 +2760,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 +2975,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 +3025,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 +4654,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 +4688,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 and dTanToolEntryAngle 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 +4743,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
|
||||
@@ -4756,7 +4866,7 @@ 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()) and nFacInd2 and dFacElev2 < 1.5 * dFacElev then
|
||||
if dH * dV < 0.9 * ( bBoxF:getDimX() * bBoxF:getDimY()) and nFacInd2 and dFacElev2 < 1.5 * dFacElev and not ( Proc.Topology == 'Groove' and Proc.Fct == 2) then
|
||||
bSpecial3faces = true
|
||||
end
|
||||
-- se riconosciuta gestione 3 facce (limitatamente per ora alla feature 20)
|
||||
@@ -5181,8 +5291,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
dCollSic = BL.CalcCollisionSafety( tvtNx[2])
|
||||
local dMachDepth = dFacElev + dCollSic
|
||||
local frFacRec, dFacDim1, dFacDim2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
-- limito il diametro utensile massimo a 100 per queste lavorazioni
|
||||
dToolTargetDiam = min( BD.MAXDIAM_POCK_CORNER, 100)
|
||||
-- limito il diametro utensile massimo a 201 per queste lavorazioni
|
||||
dToolTargetDiam = min( BD.MAXDIAM_POCK_CORNER, 201)
|
||||
-- se è 4 facce devo capire quale è il lato libero e settare dH e dV di conseguenza
|
||||
if Proc.Fct == 4 then
|
||||
local vAdj = {}
|
||||
@@ -5216,7 +5326,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
dToolMaxDiam = min ( ( min( dFacDim1, dFacDim2) * 2) - 1, dToolTargetDiam)
|
||||
-- in tutti gli altri casi l'utensile dovrà essere grande al massimo come il lato più piccolo
|
||||
else
|
||||
dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam)
|
||||
dToolMaxDiam = dToolTargetDiam
|
||||
end
|
||||
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap, nil, nPhase, nRawId)
|
||||
@@ -5392,9 +5502,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if not bOk then return false, sWarn end
|
||||
end
|
||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||
local bOk, sWarn2
|
||||
bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacInd, nAddGrpId, bMillDown)
|
||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||
nil, nil, nil, b3Solid)
|
||||
if not bOk then return false, sWarn2 end
|
||||
end
|
||||
-- se smusso non esclusivo
|
||||
@@ -5409,17 +5519,17 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
local dToolTotalLength = 0
|
||||
local dToolThDiameter = 999
|
||||
local dToolDiameter = 0
|
||||
if EgtMdbSetCurrMachining( sPocketing) then
|
||||
local sTuuidPk = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then
|
||||
dMaxToolCutDepth = EgtTdbGetCurrToolMaxDepth() or dMaxToolCutDepth
|
||||
dMaxToolMaterial = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxToolMaterial
|
||||
dToolDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiameter
|
||||
dToolThLength = EgtTdbGetCurrToolThLength() or dToolThLength
|
||||
dToolThDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or dToolThDiameter
|
||||
dToolTotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) or dToolTotalLength
|
||||
end
|
||||
if EgtMdbSetCurrMachining( sPocketing) then
|
||||
local sTuuidPk = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then
|
||||
dMaxToolCutDepth = EgtTdbGetCurrToolMaxDepth() or dMaxToolCutDepth
|
||||
dMaxToolMaterial = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxToolMaterial
|
||||
dToolDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiameter
|
||||
dToolThLength = EgtTdbGetCurrToolThLength() or dToolThLength
|
||||
dToolThDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or dToolThDiameter
|
||||
dToolTotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) or dToolTotalLength
|
||||
end
|
||||
end
|
||||
local dMachiningDepth = 0
|
||||
-- se il gambo è più largo dell'utensile verifico se la lunghezza del gambo è maggiore della distanza di sicurezza calcolata
|
||||
local dShankLength = dToolTotalLength - dToolThLength - dMaxToolCutDepth
|
||||
@@ -5683,19 +5793,49 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function TestTwoFacesDownHead( Proc)
|
||||
-- verifico ci siano due facce
|
||||
-- test valido solo per due facce
|
||||
if Proc.Fct ~= 2 then return false end
|
||||
local bDownHeadBlade = false
|
||||
local bDownHeadMill = false
|
||||
-- verifico se da lavorare con testa da sotto
|
||||
local bDownHead = false
|
||||
if BD.DOWN_HEAD then
|
||||
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 vtNm = ( vtN[1] + vtN[2]) ; vtNm:normalize()
|
||||
bDownHead = ( vtNm:getZ() < -0.5)
|
||||
local vtNm = ( Proc.Face[1].VtN + Proc.Face[2].VtN)
|
||||
vtNm:normalize()
|
||||
bDownHeadMill = ( vtNm:getZ() < -0.5)
|
||||
-- recupero il massimo materiale della lama sopra
|
||||
local sCutting = ML.FindCutting( 'HeadSide', true, false)
|
||||
if not sCutting then
|
||||
local sErr = 'Error : cutting not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local dTopBladeMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dTopBladeMaxDepth = EgtTdbGetCurrToolMaxDepth() or dTopBladeMaxDepth
|
||||
end
|
||||
end
|
||||
-- recupero le caratteristiche della feature e delle facce
|
||||
local vtRes = Proc.Face[1].VtN ^ Proc.Face[2].VtN
|
||||
Proc.IsTopDownRabbet = abs( vtRes:getZ()) > 10 * GEO.EPS_SMALL
|
||||
for i = 1, Proc.Fct do
|
||||
Proc.Face[i].IsTooDownwardForTopBlade = Proc.Face[i].VtN:getZ() < ( BD.CUT_VZ_MIN or -0.484) - 10 * GEO.EPS_SMALL
|
||||
Proc.Face[i].IsTooWideForTopBlade = Proc.Face[i].Width > dTopBladeMaxDepth
|
||||
end
|
||||
-- serve la lama sotto se c'è almeno una faccia troppo inclinata verso il basso e non è un rabbet stretto lavorabile dal lato
|
||||
if not ( Proc.Face[1].IsTooDownwardForTopBlade or Proc.Face[2].IsTooDownwardForTopBlade) then
|
||||
bDownHeadBlade = false
|
||||
else
|
||||
for i = 1, Proc.Fct do
|
||||
if Proc.Face[i].IsTooDownwardForTopBlade and ( not Proc.IsTopDownRabbet or Proc.Face[i].IsTooWideForTopBlade) then
|
||||
bDownHeadBlade = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return bDownHead
|
||||
return bDownHeadBlade, bDownHeadMill
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -5895,6 +6035,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
|
||||
@@ -5957,7 +6099,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- due facce
|
||||
elseif Proc.Fct == 2 then
|
||||
-- verifico se da lavorare con testa da sotto
|
||||
local bDownHead = TestTwoFacesDownHead( Proc)
|
||||
local bDownHeadBlade = TestTwoFacesDownHead( Proc)
|
||||
-- dati delle facce
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 0, GDB_BB.STANDARD)
|
||||
local b3Fac2 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 1, GDB_BB.STANDARD)
|
||||
@@ -5985,7 +6127,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
|
||||
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
|
||||
else
|
||||
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead)
|
||||
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHeadBlade, '_H2', ''), true, bDownHeadBlade)
|
||||
end
|
||||
else
|
||||
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
@@ -5996,7 +6138,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0 then
|
||||
return LongCut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nForceUseBladeOnNotContinueFace)
|
||||
else
|
||||
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead)
|
||||
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHeadBlade, '_H2', ''), true, bDownHeadBlade)
|
||||
end
|
||||
else
|
||||
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
@@ -6004,7 +6146,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- altrimenti
|
||||
else
|
||||
if bUseBlade and ( abs( vtN1:getX()) > 0.5 or abs( vtN2:getX()) > 0.5) then
|
||||
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead)
|
||||
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHeadBlade, '_H2', ''), true, bDownHeadBlade)
|
||||
else
|
||||
return MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
@@ -6075,7 +6217,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- altrimenti
|
||||
else
|
||||
-- verifico se da lavorare con testa da sotto
|
||||
local bDownHead = TestTwoFacesDownHead( Proc)
|
||||
local bDownHeadblade, bDownHeadMill = TestTwoFacesDownHead( Proc)
|
||||
-- determino l'angolo tra le facce
|
||||
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
||||
-- se con BH
|
||||
@@ -6085,7 +6227,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
elseif not bUseBlade then
|
||||
-- se piccole
|
||||
if Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN) and bAdj and abs( dAng + 90) < 1 then
|
||||
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead)
|
||||
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHeadMill)
|
||||
else
|
||||
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, true)
|
||||
end
|
||||
@@ -6109,7 +6251,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- se smusso non esclusivo
|
||||
if nChamfer < 2 then
|
||||
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHead, '_H2', ''), true, bDownHead or BD.TURN)
|
||||
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, 'HeadSide' .. EgtIf( bDownHeadblade, '_H2', ''), true, bDownHeadblade or BD.TURN)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -879,8 +879,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- imposto posizione braccio porta testa per non ingombrare agli estremi
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto angolo 3° asse rot
|
||||
local bDownHead = not bIsTopBladeCurrent
|
||||
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
|
||||
local vtOut = EgtIf( vtN[vOrd[j]]:getX() > 0, X_AX(), -X_AX())
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtN, vtOut))
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
@@ -1072,7 +1071,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- determino e imposto l'utilizzo della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse[vOrd[j]])
|
||||
-- imposto angolo 3° asse rot
|
||||
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
|
||||
local vtOut = EgtIf( vtN[vOrd[j]]:getX() > 0, X_AX(), -X_AX())
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtN, vtOut))
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
-- 2023/07/21 Correzioni per mortise passanti con curva Aux che guarda in basso.
|
||||
-- 2023/08/10 Modificata scelta SCC per tasche in Y+/- in coda o quasi.
|
||||
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||
-- 2024/02/28 Forzata SPIRAL_IN se c'è anche un solo lato aperto
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessMortise = {}
|
||||
@@ -463,6 +464,13 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if bRevertSide then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
end
|
||||
|
||||
-- se ho anche solo un lato aperto, forzo SPIRAL-IN
|
||||
local vOpen = EgtGetInfo( AuxId, 'OPEN', 'vi')
|
||||
if vOpen and #vOpen > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
end
|
||||
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- sistemo la direzione di lavoro
|
||||
|
||||
@@ -513,7 +513,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
local dLastCutOffset = i * dOffsL
|
||||
local vtMoveLimitingSurf = Vector3d( -dLastCutOffset + 10 * GEO.EPS_SMALL, 0, 0)
|
||||
EgtMove( nLimitingSurf, vtMoveLimitingSurf, GDB_RT.GLOB)
|
||||
local vtNLimitingSurf = EgtSurfTmFacetNormVersor( nLimitingSurf, 0)
|
||||
local vtNLimitingSurf = EgtSurfTmFacetNormVersor( nLimitingSurf, 0, GDB_ID.ROOT)
|
||||
if AreOppositeVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
|
||||
end
|
||||
-- tagli verticali
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 2.6c1 (29/02/2024)
|
||||
- Modif : in FacesBySaw e LapJoint migliorato calcolo area non pinzabile in testa HCING e coda TCING
|
||||
- Modif : vari miglioramenti all'ordinamento delle lavorazioni
|
||||
- Modif : in Mortise forzata SPIRAL_IN se c'è almeno un lato aperto
|
||||
- Modif : in tenone a coda di rondine aumentato a 8 il numero massimo di passate (era 6)
|
||||
- Modif : in lapjoint a due facce migliorata la scelta della lama da sotto
|
||||
- Fixed : in LapJoint corretto bug che impediva l'esecuzione della lavorazion con antischeggia attivo
|
||||
|
||||
Versione 2.6b1 (14/02/2024)
|
||||
- Fixed : corretto bug in Split in cui si chiamava la EgtSurfTmFacetNormVersor senza riferimento
|
||||
- Fixed : in L20 corretta gestione 2 facce
|
||||
- Modif : modifiche per limiti pinzaggio con pinze con fronte verticale (ONE, PF) anzichè inclinato (FAST) quindi parametro BD.VICE_MINH grande
|
||||
- Modif : nei tagli con sega a catena ora si considera l'ingombro della testa per il calcolo della massima profondità
|
||||
- Modif : in LapJoint ora i rabbet lungo X che guardano in basso sono sempre fatti con fresatura di lato per evitare di ruotare.
|
||||
|
||||
Versione 2.6a1 (24/01/2024)
|
||||
- Added : in HeadCut e Split aggiunti tagli verticali addizionali per travi di larghezza elevata
|
||||
- Added : in Split gestita separazione con sega a catena + lama
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
-- Version.lua by Egaltech s.r.l. 2024/01/24
|
||||
-- Version.lua by Egaltech s.r.l. 2024/01/30
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.6a1'
|
||||
VERSION = '2.6c1'
|
||||
MIN_EXE = '2.6a1'
|
||||
|
||||
Reference in New Issue
Block a user