Compare commits

...

74 Commits

Author SHA1 Message Date
luca.mazzoleni 23c31aa0be Merge remote-tracking branch 'origin/master' into MultipleChainsawsAndMachiningLibImprovements 2024-01-24 14:38:12 +01:00
luca.mazzoleni 4ba4ddb698 - Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest). Al momento implementato solo per FindSawing.
- Nello split con sega a catena ora si cerca di preferenza una lavorazione di tipo 'SawingForSplitting'. Se non trovata si cerca il tipo 'Sawing' come in precedenza.
- In split con sega a catena aggiunta estensione start/end del percorso se utensile lungo, per evitare collisioni con il pezzo durante rotazione.
2024-01-24 14:37:58 +01:00
Dario Sassi 4a408e3f61 DataBeam 2.6a1 :
- modifiche per poter impostare offset intermedio anche se lanciato da EgtCam5
- corretto calcolo cubetti con superficie limitante parallela e opposta a quella di base
- modifiche a Split per tagli a cubetti su grandi sezioni.
2024-01-24 11:46:13 +01:00
Dario Sassi c3c767b839 Merge remote-tracking branch 'origin/MultipleChainsawsAndMachiningLibImprovements' 2024-01-24 09:43:18 +01:00
luca.mazzoleni 0400878279 update commenti 2024-01-23 10:42:17 +01:00
luca.mazzoleni 418fb4e284 - correzione in MachiningLib per gestire il caso in cui una lavorazione sia attiva ma non ha alcun utensile collegato 2024-01-23 10:39:40 +01:00
luca.mazzoleni 337e13dbde In Split con sega a catena ora si cerca di preferenza una lavorazione di tipo 'SawingForSplitting'. Se non trovata si cerca il tipo 'Sawing' come in precedenza. 2024-01-22 18:14:18 +01:00
luca.mazzoleni 8d80f389d3 - In MachiningLib -> FindSawing aggiunto parametro opzionale bConsiderCSimmEncumberance per considerare l'ingombro dell'asse C nel massimo materiale (default false).
- In MachiningLib -> GetMachinings vengono ora raccolti i parametri utensile necessari per i VerifyTool, scritti direttamente nella tabella Machining.Tool.
- Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest) se passato l'apposito parametro SortingCriterion in FindMachining. Al momento implementato solo per FindSawing.
- In HeadCut e Split, nei tagli verticali aggiuntivi, si usa ora BD.MAX_LEN_DICE come dimensione (era BD.MAX_DIM_DICE).
- In LapJoint e LongCut implementata gestione seghe a catena multiple.
2024-01-22 16:34:39 +01:00
luca.mazzoleni 91608ce3f0 Merge branch 'Feature/BigSectionForWideBeams' into develop 2024-01-18 16:17:58 +01:00
luca.mazzoleni dbf0d3cf01 update commenti 2024-01-18 16:17:16 +01:00
luca.mazzoleni e5bab7f1ab - piccola correzione a split 2024-01-18 12:37:40 +01:00
luca.mazzoleni b8fb6816a6 correzione minore 2024-01-16 18:21:06 +01:00
luca.mazzoleni ffb7580a65 - implementata funzione GetBlockedAxis, in BeamLib, che sostituisce le altre specifiche per sega a catena e lama; modificate le relative chiamate 2024-01-16 15:51:59 +01:00
luca.mazzoleni 6255b4c1cb Merge branch 'develop' into Feature/BigSectionForWideBeams 2024-01-12 14:41:42 +01:00
luca.mazzoleni 3ae3bcf1d3 Merge remote-tracking branch 'origin/master' into develop 2024-01-12 14:41:28 +01:00
Dario Sassi a01733defd DataBeam :
- piccola correzione per tagli lama con doppia inclinazione su macchina OikosX.
2024-01-12 12:51:36 +01:00
luca.mazzoleni ba9df21ab1 Merge branch 'develop' into Feature/BigSectionForWideBeams 2024-01-11 16:30:51 +01:00
luca.mazzoleni 6a58e94af0 Merge remote-tracking branch 'origin/master' into develop 2024-01-11 16:30:40 +01:00
luca.mazzoleni eb93769055 - in Split gestiti i tagli aggiuntivi verticali in tutti i casi 2024-01-11 16:22:39 +01:00
luca.mazzoleni 0acffe8d52 - in HeadCut gestiti i tagli aggiuntivi verticali in tutti i casi
- in Cut gestito il passaggio di superficie limitante alla GetDice
- in Split manca la gestione dei tagli aggiuntivi verticali in caso di BigSection
2024-01-11 12:25:28 +01:00
Dario Sassi f2c28f3810 DataBeam :
- correzione a posizionamento barre centrate su tavola da nuova interfaccia.
2024-01-10 23:34:46 +01:00
luca.mazzoleni 0a830c7f4b correzioni alle chiamate a GetSawBlockedAxis per Oikos 2024-01-09 11:43:07 +01:00
luca.mazzoleni 0778516765 Merge branch 'develop' into Feature/BigSectionForWideBeams 2024-01-09 10:07:38 +01:00
luca.mazzoleni 334d8d369e Merge remote-tracking branch 'origin/master' into develop 2024-01-09 09:51:12 +01:00
Dario Sassi 4a6b3accb1 DataBeam :
- alcune modifiche per macchine OikosX e similari.
2024-01-08 19:10:57 +01:00
luca.mazzoleni e22db4a989 Merge branch 'develop' into Feature/BigSectionForWideBeams 2024-01-08 18:09:53 +01:00
luca.mazzoleni 6021a50136 Merge tag '2.5l3' into develop
Finish Release: 2.5l3
2024-01-08 18:07:45 +01:00
luca.mazzoleni 748a6e295a Merge branch 'release/2.5l3' 2024-01-08 18:07:44 +01:00
luca.mazzoleni 2bd563293c update log e version 2024-01-08 18:07:03 +01:00
luca.mazzoleni cc099fb54c - Correzione a Is3EdgesApprox per casi in cui nAddGroup non esista ancora. 2024-01-08 17:19:41 +01:00
luca.mazzoleni 22c74c3252 - in headcut e split varie correzioni a tagli aggiuntivi per trave larga; rimangono da implementare per BigSection
- test annotations @param, #return in funzione GetFaceHvRefDim del BeamLib
2024-01-08 16:55:31 +01:00
luca.mazzoleni 3acebbd892 in split -> bigSection piccola correzione al sormonto tra sega a catena e lama 2024-01-04 18:33:07 +01:00
luca.mazzoleni bc04b680d4 - aggiunta GetSawBlockedAxis per scegliere asse bloccato aggregato lama 2024-01-04 17:29:42 +01:00
luca.mazzoleni 6e8cd5f3bb Merge branch 'develop' into Feature/BigSectionForWideBeams 2024-01-04 11:45:17 +01:00
luca.mazzoleni 91aa9d049f Merge remote-tracking branch 'origin/HEAD' into develop 2024-01-04 11:44:59 +01:00
luca.mazzoleni 5f7f988552 - in split -> bigSection primo implemento sega a catena da sopra e lama da sotto
- in split -> bigSection scelta sega a catena in base a lunghezza
2024-01-04 11:44:44 +01:00
Dario Sassi 7d65813c32 DataBeam 2.5l4 :
- modifiche per centrare i pezzi in Y sulla tavola (da flag BeamData.CENTER_BEAM)
- modifiche per rendere più veloci i calcoli di FeatureTopology
- scorporata CalcHeadTailMachBeforeIntersDrillings da CollectFeatures
- migliorato calcolo attacco/uscite lame in FacesBySaw.
2024-01-02 16:07:40 +01:00
luca.mazzoleni 42d68d968d Merge branch 'develop' into Feature/BigSectionForWideBeams 2023-12-21 11:39:20 +01:00
luca.mazzoleni 01f0182ef5 Merge tag '2.5l2' into develop
Finish Release: 2.5l2
2023-12-20 17:42:28 +01:00
luca.mazzoleni e0f27b9abe Merge branch 'release/2.5l2' 2023-12-20 17:42:28 +01:00
luca.mazzoleni c8b29241ca update log 2023-12-20 17:41:39 +01:00
luca.mazzoleni b0dea42f31 primi test 2023-12-20 17:17:28 +01:00
luca.mazzoleni a9462e189c Merge branch 'master' into develop 2023-12-15 17:57:26 +01:00
Dario Sassi 27ee10d1ec DataBeam :
- piccola miglioria alla precedente correzione, rimanevano non cancellate delle regioni di uso temporaneo.
2023-12-15 17:29:01 +01:00
luca.mazzoleni d73f535a55 Merge remote-tracking branch 'origin/master' into develop 2023-12-15 10:04:02 +01:00
Dario Sassi 5ae487cb20 DataBeam 2.5l2 :
- correzione a GetFaceWithMostAdj per calcoli con facce che fanno ombra.
2023-12-15 09:53:48 +01:00
luca.mazzoleni a3dcabf860 Merge remote-tracking branch 'origin/master' into develop 2023-12-11 09:04:41 +01:00
Dario Sassi 7b854c87c0 DataBeam :
- altra correzione a RoundArch per senso rotazione fresa e modalità climb.
2023-12-08 16:14:06 +01:00
luca.mazzoleni d2fc60b7f1 Merge branch 'master' into develop 2023-12-07 12:53:32 +01:00
Dario Sassi 286816e8e9 DataBeam :
- in ProcessRoundArch aggiunta gestione senso di rotazione della fresa per lavorare sempre in concordanza (climb milling).
2023-12-07 11:16:11 +01:00
luca.mazzoleni 01fbcbbd01 Merge branch 'CutAvoidCollisionsWhenDownUp' into develop 2023-12-07 09:56:49 +01:00
luca.mazzoleni d1c014e20c In ProcessCut e DoubleCut correzione in scelta ribaltamento trave quando si è in condizioni downUp. 2023-12-07 09:55:19 +01:00
luca.mazzoleni 92a924dde1 Merge branch 'develop' into CutAvoidCollisionsWhenDownUp 2023-12-06 18:38:56 +01:00
luca.mazzoleni d033fee929 Merge branch 'SideMillAsSawImprovement' into develop 2023-12-06 18:12:21 +01:00
luca.mazzoleni 1070910b8c - In ProcessLapJoint -> VerifySideMillAsSaw, se SIDEDEPTH non definita, viene calcolata
- update commenti
2023-12-06 17:50:26 +01:00
luca.mazzoleni 306b5b6dff in ProcessCut -> Classify si forza la rotazione della trave se inclinata in Y e la lama non riesce a lavorare solo da un lato, come per doublecut 2023-12-06 15:12:08 +01:00
luca.mazzoleni d2a6d7e75c in ProcessDoubleCut -> Classify si forza la rotazione della trave se inclinata in Y e la lama non riesce a lavorare solo da un lato 2023-12-06 10:44:21 +01:00
luca.mazzoleni 6309092689 In FacesBySaw -> CalcLeadInOutPerpGeom gestito caso in cui la geometria della feature esce dal grezzo 2023-12-05 18:37:28 +01:00
luca.mazzoleni 2ec0d8162e in LapJoint->MakeMoreFaces, nelle OpenPocket, ammesso utensile con diametro fino a 3 volte la dimensione della tasca (era 2) 2023-12-01 10:40:15 +01:00
luca.mazzoleni 60919c595d Merge tag '2.5l1' into develop
Finish Release: 2.5l1
2023-12-01 09:33:29 +01:00
luca.mazzoleni 0638e3c6f3 Merge branch 'release/2.5l1' 2023-12-01 09:33:28 +01:00
luca.mazzoleni de80902a86 update log e versione 2023-12-01 09:33:10 +01:00
luca.mazzoleni 9fbd4a5156 - in MakeTwo di FacesBySaw raffinamento calcolo vtRef per casi dubbi. 2023-11-30 09:23:12 +01:00
luca.mazzoleni 6bd2e5ffb4 - nelle chiamate a EgtSurfTmFacetElevationInBBox aggiunto parametro per forzare calcolo anche se la faccia è esterna al grezzo
- update commenti
2023-11-30 09:12:49 +01:00
luca.mazzoleni f89129d2e8 Merge branch 'ElevationCalculationRefactoring' into develop 2023-11-29 16:50:17 +01:00
luca.mazzoleni e0e2f630d2 Merge remote-tracking branch 'origin/master' into develop 2023-11-29 16:07:49 +01:00
luca.mazzoleni 1664513c8f Ottimizzate le chiamate al calcolo elevazione. Si evita di calcolarla più volte inutilmente perchè calcolata inizialmente nel CollectFeatures. 2023-11-29 16:07:18 +01:00
Dario Sassi c701d4132f DataBeam :
- in MakeTwo di FacesBySaw raffinamento calcolo vtRef per casi dubbi.
2023-11-28 15:56:10 +01:00
Dario Sassi a9052c1d72 Merge commit 'b3bb386ec776ad753e1d9042d90ecd9834c2abd2' 2023-11-28 15:54:49 +01:00
luca.mazzoleni 593fdcfc24 Merge branch 'develop' into ElevationCalculationRefactoring 2023-11-28 15:44:43 +01:00
luca.mazzoleni b9c8921cb2 Merge tag '2.5k5' into develop
Finish Release: 2.5k5
2023-11-28 15:40:00 +01:00
luca.mazzoleni b3bb386ec7 Merge branch 'release/2.5k5' 2023-11-28 15:40:00 +01:00
luca.mazzoleni c69f80a903 update log e versione 2023-11-28 15:39:33 +01:00
luca.mazzoleni d8de7467b0 - tutte le chiamate alle funzioni GetFaceElevation e GetOtherFaceElevation sostituiti con la nuova funzione EgtSurfTmFacetElevationInBBox 2023-11-28 09:55:41 +01:00
29 changed files with 1008 additions and 553 deletions
+1 -1
View File
@@ -357,7 +357,7 @@ if bToProcess then
local dOvmHead = vBeam[1].PosX or 0
-- Sistemo le travi nel grezzo
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, nil, vBeam)
if not bPbOk then
BEAM.ERR = 18
BEAM.MSG = sPbErr
+9 -6
View File
@@ -1,4 +1,4 @@
-- BatchProcessNew.lua by Egaltech s.r.l. 2022/08/01
-- BatchProcessNew.lua by Egaltech s.r.l. 2024/01/10
-- Gestione calcolo batch disposizione e lavorazioni per Travi
-- 2021/01/07 Per nuova interfaccia Egt.
-- 2021/01/15 CREATE_BAR ora FLAG = 6 (prima 5).
@@ -12,6 +12,7 @@
-- 2022/04/28 In info generazione aggiunta indicazione se 64bit.
-- 2022/07/24 Modifica per cancellare lavorazioni con ricalcolo e barra già definita.
-- 2022/08/01 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL).
-- 2024/01/10 Modifiche per centrare i pezzi in Y sulla tavola (come in BeamExec).
-- Intestazioni
require( 'EgtBase')
@@ -209,10 +210,7 @@ if bToProcess then
EgtSetCurrMachGroup()
-- Area tavola
local b3Tab = EgtGetTableArea()
-- Calcolo posizione estremo TR o BR della tavola rispetto a sua origine in BL
BD.OriXR = Point3d( b3Tab:getDimX(), EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()), 0)
BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
-- Calcolo minimo grezzo scaricabile
-- Sezione del grezzo
local nRawId = EgtGetFirstRawPart()
if not nRawId then
BEAM.ERR = 14
@@ -222,6 +220,11 @@ if bToProcess then
return
end
local b3Raw = EgtGetRawPartBBox( nRawId)
-- Calcolo posizione estremo TR o BR della tavola rispetto a sua origine in BL
local dPosY = EgtIf( BD.CENTER_BEAM, ( b3Tab:getDimY() + b3Raw:getDimY() * EgtIf( BD.RIGHT_LOAD, -1, 1)) / 2, EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()))
BD.OriXR = Point3d( b3Tab:getDimX(), dPosY, 0)
BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
-- Calcolo minimo grezzo scaricabile
BE.CalcMinUnloadableRaw( b3Raw:getDimY(), b3Raw:getDimZ())
-- altrimenti devo recuperare i pezzi per creare la barra
else
@@ -402,7 +405,7 @@ if bToProcess then
end
-- Sistemo le travi nel grezzo
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, BEAM.FLAG == 6)
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, nil, vBeam, BEAM.FLAG == 6)
if not bPbOk then
BEAM.ERR = 18
BEAM.MSG = sPbErr
+101 -31
View File
@@ -1,4 +1,4 @@
-- BeamExec.lua by Egaltech s.r.l. 2023/11/08
-- BeamExec.lua by Egaltech s.r.l. 2023/12/26
-- Libreria esecuzione lavorazioni per Travi
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
@@ -51,6 +51,8 @@
-- 2022/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.
-- Tabella per definizione modulo
local BeamExec = {}
@@ -255,6 +257,40 @@ local function IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
return false
end
-------------------------------------------------------------------------------------------------------------
local function NeedTopologyFeature( Proc)
-- richiedono calcolo topologia
if Cut.Identify( Proc) then
return true
end
if DoubleCut.Identify( Proc) then
return true
end
if LongCut.Identify( Proc) then
return true
end
if Long2Cut.Identify( Proc) then
return true
end
if SawCut.Identify( Proc) then
return true
end
if RidgeLap.Identify( Proc) then
return true
end
if LapJoint.Identify( Proc) then
return true
end
if FrenchRidgeLap.Identify( Proc) then
return true
end
if Chamfer.Identify( Proc) then
return true
end
-- tutte le altre non richiedono calcolo topologia
return false
end
-------------------------------------------------------------------------------------------------------------
local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
local dRawW = b3Raw:getDimY()
@@ -264,8 +300,6 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
local LayerId = {}
LayerId[1] = BL.GetAddGroup( PartId)
LayerId[2] = EgtGetFirstNameInGroup( PartId or GDB_ID.NULL, 'Processings')
local nMachineBeforeIntersectingDrillingsIdHead, dMachineBeforeIntersectingDrillingsXHead, nMachineBeforeIntersectingDrillingsIdTail, dMachineBeforeIntersectingDrillingsXTail = nil, GEO.INFINITO, nil, -GEO.INFINITO
local b3MachineBeforeIntersectingDrillingsBoxHead, b3MachineBeforeIntersectingDrillingsBoxTail = nil, nil
for nInd = 1, 2 do
local ProcId = EgtGetFirstInGroup( LayerId[nInd] or GDB_ID.NULL)
while ProcId do
@@ -301,28 +335,24 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
end
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
if b3Raw then
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- recupero l'elenco delle facce della parte interessate dalla feature
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
-- recupero informazioni sulle facce della feature
Proc.Face = {}
for i = 1, Proc.Fct do
Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT ), Elevation = BL.GetFaceElevation( Proc.Id, i - 1, PartId)}
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 )}
if Proc.Fct < 10 then
Proc.Face[i].Elevation = EgtSurfTmFacetElevationInBBox( Proc.Id, i - 1, b3Solid, true, GDB_ID.ROOT)
end
end
end
end
if Proc.Box and not Proc.Box:isEmpty() then
Proc.NeedTopology = NeedTopologyFeature( Proc)
Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH)
Proc.Tail, Proc.AdvTail = IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
if Proc.Head and Proc.Box:getCenter():getX() < dMachineBeforeIntersectingDrillingsXHead then
dMachineBeforeIntersectingDrillingsXHead = Proc.Box:getCenter():getX()
nMachineBeforeIntersectingDrillingsIdHead = Proc.Id
b3MachineBeforeIntersectingDrillingsBoxHead = Proc.Box
elseif Proc.Tail and Proc.Box:getCenter():getX() > dMachineBeforeIntersectingDrillingsXTail then
dMachineBeforeIntersectingDrillingsXTail = Proc.Box:getCenter():getX()
nMachineBeforeIntersectingDrillingsIdTail = Proc.Id
b3MachineBeforeIntersectingDrillingsBoxTail = Proc.Box
end
end
table.insert( vProc, Proc)
-- se foro
if Drill.Identify( Proc) then
@@ -376,11 +406,38 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
ProcId = EgtGetNext( ProcId)
end
end
local vMachineBeforeIntersectingDrillings = {
Head = { Id = nMachineBeforeIntersectingDrillingsIdHead, Box = b3MachineBeforeIntersectingDrillingsBoxHead},
Tail = { Id = nMachineBeforeIntersectingDrillingsIdTail, Box = b3MachineBeforeIntersectingDrillingsBoxTail}
return vProc
end
-------------------------------------------------------------------------------------------------------------
local function CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
local nHeadId
local dHeadX = GEO.INFINITO
local nTailId
local dTailX = -GEO.INFINITO
local b3HeadBox
local b3TailBox
for i = 1, #vProc do
local Proc = vProc[i]
if Proc.Box and not Proc.Box:isEmpty() then
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then
dHeadX = Proc.Box:getCenter():getX()
nHeadId = Proc.Id
b3HeadBox = Proc.Box
elseif Proc.Tail and Proc.Box:getCenter():getX() > dTailX then
dTailX = Proc.Box:getCenter():getX()
nTailId = Proc.Id
b3TailBox = Proc.Box
end
end
end
end
local vMachBeforeIntersDrillings = {
Head = { Id = nHeadId, Box = b3HeadBox},
Tail = { Id = nTailId, Box = b3TailBox}
}
return vProc, vMachineBeforeIntersectingDrillings
return vMachBeforeIntersDrillings
end
-------------------------------------------------------------------------------------------------------------
@@ -460,12 +517,15 @@ local function VerifyBigSectionCut( dRawW, dRawH)
end
-------------------------------------------------------------------------------------------------------------
function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroupOk)
function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, bMachGroupOk)
-- default per nuove costanti qualora non definite
BD.OVM_BLADE_HBEAM = ( BD.OVM_BLADE_HBEAM or 11)
BD.OVM_CHAIN_HBEAM = ( BD.OVM_CHAIN_HBEAM or 8)
-- sovramateriale intermedio nullo se non definito
dOvmMid = ( dOvmMid or 0)
-- Determinazione minimo grezzo scaricabile
BeamExec.CalcMinUnloadableRaw( dRawW, dRawH)
@@ -494,7 +554,8 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup
-- Area tavola
local b3Tab = EgtGetTableArea()
-- Calcolo posizione estremo TR/BR della tavola rispetto a sua origine in BL
BD.OriXR = Point3d( b3Tab:getDimX(), EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()), 0)
local dPosY = EgtIf( BD.CENTER_BEAM, ( b3Tab:getDimY() + dRawW * EgtIf( BD.RIGHT_LOAD, -1, 1)) / 2, EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()))
BD.OriXR = Point3d( b3Tab:getDimX(), dPosY, 0)
BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
-- Impostazione dell'attrezzaggio di default
@@ -521,8 +582,12 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup
local lastB3Solid = nil
local dOffset = dOvmHead
if i > 1 then
lastB3Solid = vBeam[i-1].Box
dOffset = vBeam[i].PosX - vBeam[i-1].PosX - lastB3Solid:getDimX()
if vBeam[i].PosX then
lastB3Solid = vBeam[i-1].Box
dOffset = vBeam[i].PosX - vBeam[i-1].PosX - lastB3Solid:getDimX()
else
dOffset = dOvmMid
end
end
-- analizzo le features per valutare l'esistenza di feature head/tail che renderebbero inutili le rispettive finiture o di tagli di testa/coda sostituiti da cui leggere il parametro Q05
local vProc = CollectFeatures( Pz, b3Solid, 0)
@@ -557,8 +622,12 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup
( abs( PartHeight - dRawW) < 100 * GEO.EPS_SMALL and abs( PartWidth - dRawH) < 100 * GEO.EPS_SMALL)) and
NextLen + DeltaE >= 0 then
-- eventuale sovramateriale di testa
if i > 1 and vBeam[i].PosX then
DeltaS = max( vBeam[i].PosX - ( dRawL - Len), DeltaSMin)
if i > 1 then
if vBeam[i].PosX then
DeltaS = max( vBeam[i].PosX - ( dRawL - Len), DeltaSMin)
else
DeltaS = max( dOvmMid - DeltaE, 0)
end
end
-- dimensioni del grezzo
local CrawLen = min( PartLen + DeltaS + DeltaE, Len)
@@ -1172,7 +1241,7 @@ local function ClassifyTopology( vProc, nRawId)
nRecognized = nRecognized + 1
end
end
return nRecognized
end
@@ -1850,10 +1919,11 @@ function BeamExec.ProcessFeatures()
local dCurrOvmH = EgtGetInfo( nRawId, 'HOVM', 'd') or 0
local dCurrOvmT = EgtGetInfo( nRawId, 'TOVM', 'd') or 0
-- recupero le feature di lavorazione della trave
local vProc, vMachineBeforeIntersectingDrillings = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
-- verifica presenza forature influenzate da lavorazioni di testa o coda
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeIntersectingDrillings)
vMachBeforeIntersDrillings = CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachBeforeIntersDrillings)
end
-- verifica presenza di feature specchiate per eventuali lavorazioni simultanee
if BD.TWO_EQUAL_HEADS or BD.DOWN_HEAD then
+81 -67
View File
@@ -1,4 +1,4 @@
-- BeamLib.lua by Egaltech s.r.l. 2023/03/22
-- BeamLib.lua by Egaltech s.r.l. 2023/12/15
-- Libreria globale per Travi
-- 2020/07/28 Corretto calcolo attacchi e uscite di lame per non uscire dalla faccia sotto.
-- 2020/08/18 Aggiunto a GetNearestParalOpposite e GetNearestOrthoOpposite parametro opzionale vtNorm.
@@ -26,6 +26,10 @@
-- 2023/09/25 In GetFaceWithMostAdj aggiunta verifica sottosquadro anche per facce non adiacenti.
-- 2023/09/26 In GetFaceWithMostAdj gestito primo parametro anche come Proc; gestito caso strip con facce tutte in sottosquadro.
-- 2023/09/26 Spostata qui funzione IsFeatureCuttingEntireSection da BeamExec.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation. Se l'elevazione è già calcolata la recupera da Proc, altrimenti la calcola al momento.
-- 2023/12/15 Correzione a GetFaceWithMostAdj per calcoli con facce che fanno ombra.
-- 2024/01/08 Correzione a Is3EdgesApprox per casi in cui nAddGroup non esista ancora.
-- 2024/01/18 Aggiunta funzione GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- Tabella per definizione modulo
local BeamLib = {}
@@ -440,54 +444,22 @@ function BeamLib.GetBoxFaceNorm( b3Box, ptP, vtV)
end
---------------------------------------------------------------------
function BeamLib.GetFaceElevation( nSurfId, nFac, nPartId)
-- centro e normale della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFac, GDB_ID.ROOT)
if not ptC or not vtN then return 0 end
-- riferimento OCS della faccia per ricavare elevazione rispetto alla faccia della superficie
local frOCS = Frame3d( ptC, vtN)
local b3Box = EgtGetBBoxRef( nSurfId, GDB_BB.STANDARD, frOCS)
local dElev = b3Box:getMax():getZ()
-- se definito identificativo di pezzo
if nPartId then
-- se superficie con più facce
if EgtSurfTmFacetCount( nSurfId) > 1 then
-- determino elevazione del centro faccia rispetto al box del pezzo
local _, dCenElev = BeamLib.GetPointDirDepth( nPartId, ptC, vtN)
if dCenElev and dCenElev > dElev then
dElev = dCenElev
end
-- altrimenti superficie ad una sola faccia
else
-- determino elevazione box del pezzo rispetto alla faccia
local b3Solid = EgtGetBBoxRef( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD, frOCS)
local dSolidElev = b3Solid:getMax():getZ()
if b3Solid and dSolidElev > dElev then
dElev = dSolidElev
end
end
function BeamLib.GetFaceElevation( procOrProcId, nFacet, b3Solid)
local Proc, nProcId
if type( procOrProcId) == "table" then
Proc = procOrProcId
nProcId = Proc.Id
else
nProcId = procOrProcId
end
local dElevation
if not Proc or not Proc.Face or not Proc.Face[nFacet + 1].Elevation then
dElevation = EgtSurfTmFacetElevationInBBox( nProcId, nFacet, b3Solid, true, GDB_ID.ROOT)
else
dElevation = Proc.Face[nFacet + 1].Elevation
end
return dElev
end
---------------------------------------------------------------------
function BeamLib.GetOtherFaceElevation( nSurfId, nOtherSurfId, nOtherFac, nPartId)
-- centro e normale della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nOtherSurfId, nOtherFac, GDB_ID.ROOT)
if not ptC or not vtN then return 0 end
-- riferimento OCS della faccia per ricavare elevazione rispetto alla faccia della superficie
local frOCS = Frame3d( ptC, vtN)
local b3Box = EgtGetBBoxRef( nSurfId, GDB_BB.STANDARD, frOCS)
local dElev = b3Box:getMax():getZ()
-- se definito identificativo di pezzo
if nPartId then
-- determino elevazione del centro faccia rispetto al box del pezzo
local _, dCenElev = BeamLib.GetPointDirDepth( nPartId, ptC, vtN)
if dCenElev and dCenElev > dElev then
dElev = dCenElev
end
end
return dElev
return dElevation
end
---------------------------------------------------------------------
@@ -515,6 +487,7 @@ end
---------------------------------------------------------------------
function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
local nSurfId = Proc.Id
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- verifica che la superficie non sia chiusa e quindi non lavorabile
if EgtSurfIsClosed( nSurfId) then
return
@@ -590,14 +563,19 @@ function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
local frOCSMaster = Frame3d( vPtC[i], vvtN[i])
EgtScale( nShadowContourId, frOCSMaster, 1, 1, 0, GDB_RT.GLOB)
EgtModifyCurveExtrusion( nShadowContourId, vvtN[i], GDB_RT.GLOB)
local nShadowSurfFlatId
-- se non troppo ortogonale (almeno 0.5deg di delta)
local dResV = vvtN[i] * vvtN[j]
EgtOffsetCurve( nShadowContourId, EgtIf( dResV > GEO.EPS_SMALL, - 50, 50) * GEO.EPS_SMALL)
local nShadowSurfFlatId = EgtSurfFlatRegion( nAddGrpId, nShadowContourId)
local bShadowSurfIsExternal = EgtSurfFrTestExternal( nMasterSurfFlatId, nShadowSurfFlatId)
if not bShadowSurfIsExternal then
bUcut = true
if abs( dResV) > 0.087 then
EgtOffsetCurve( nShadowContourId, EgtIf( dResV > GEO.EPS_SMALL, - 50, 50) * GEO.EPS_SMALL)
local nShadowSurfFlatId = EgtSurfFlatRegion( nAddGrpId, nShadowContourId)
local bShadowSurfIsExternal = EgtSurfFrTestExternal( nMasterSurfFlatId, nShadowSurfFlatId)
if not bShadowSurfIsExternal then
bUcut = true
end
EgtErase( nShadowSurfFlatId)
end
EgtErase( { nMasterSurfFlatId, nShadowSurfFlatId})
EgtErase( nMasterSurfFlatId)
end
EgtErase( { nMasterContourId, nShadowContourId, nShadowFacetId})
end
@@ -645,7 +623,7 @@ function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
local dMinElev, dMinElev2 = GEO.INFINITO, GEO.INFINITO
local dtElev = {}
for i = 1, #nFacInd do
local dElev = BeamLib.GetFaceElevation( nSurfId, nFacInd[i], nPartId)
local dElev = BeamLib.GetFaceElevation( Proc, nFacInd[i], b3Solid)
table.insert( dtElev, dElev)
if dElev < dMinElev then
if dMinElev < dMinElev2 then
@@ -700,6 +678,13 @@ function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
end
---------------------------------------------------------------------
--- ritorna il riferimento di tipo OCS della faccia *nFacet* della trimesh *nSurfId* e le dimensioni orizzontale e verticale, eventualmente limitate dal grezzo *b3Raw*
---@param nSurfId integer Id della trimesh
---@param nFacet integer Indice 0-based della faccia della trimesh di cui restituire le informazioni
---@param b3Raw? BBox3d Eventuale box del grezzo per limitare le dimensioni
---@return Frame3d frHv riferimento faccia OCS
---@return number dDimH dimensione orizzontale OCS
---@return number dDmiV dimensione verticale OCS
function BeamLib.GetFaceHvRefDim( nSurfId, nFacet, b3Raw)
-- recupero centro e normale della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
@@ -838,19 +823,6 @@ function BeamLib.GetDistanceToNextPart( nRawId, nPhase)
return dDistToNextPiece
end
---------------------------------------------------------------------
function BeamLib.GetChainSawBlockedAxis( nInd)
if BD.GetChainSawBlockedAxis then
return BD.GetChainSawBlockedAxis( nInd)
else
if nInd == 1 then
return EgtIf( BD.C_SIMM, 'A=90', 'A=90')
else
return EgtIf( BD.C_SIMM, 'A=0', 'A=0')
end
end
end
---------------------------------------------------------------------
function BeamLib.GetChainSawInitAngs( vtN, vtO, nInd)
if BD.GetChainSawInitAngs then
@@ -868,6 +840,44 @@ function BeamLib.GetChainSawInitAngs( vtN, vtO, nInd)
end
end
---------------------------------------------------------------------
---
---@param sMachining string nome della lavorazione di cui bloccare l'asse
---@param sBlockedAxis string rappresenta lo stato desiderato dell'asse bloccato, parallelo o perpendicolare all'asse rotante da cui dipende (*parallel* o *perpendicular*)
---@param b3Raw? BBox3d
---@param vtTool? Vector3d
---@param vtOut? Vector3d
---@return string # testo contenente il valore dell'asse rotante bloccato da scrivere nel parametro *MCH_MP.BLOCKEDAXIS* della lavorazione (es: 'A2=90')
function BeamLib.GetBlockedAxis( sMachining, sBlockedAxis, b3Raw, vtTool, vtOut)
-- informazioni sull'utensile della lavorazione
local nToolType, sHead
if EgtMdbSetCurrMachining( sMachining) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
nToolType = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
end
end
-- se presente funzione specifica nella macchina, la richiamo
if BD.GetBlockedAxis then
return BD.GetBlockedAxis( sHead, nToolType, sBlockedAxis, b3Raw, vtTool, vtOut)
-- sezione mantenuta per retrocompatibilità con GetChainSawBlockedAxis
elseif nToolType == MCH_TY.MORTISE_STD then
local nInd = EgtIf( sBlockedAxis == 'parallel', 0, 1)
if BD.GetChainSawBlockedAxis then
return BD.GetChainSawBlockedAxis( nInd)
else
if nInd == 1 then
return EgtIf( BD.C_SIMM, 'A=90', 'A=90')
else
return EgtIf( BD.C_SIMM, 'A=0', 'A=0')
end
end
end
return ''
end
---------------------------------------------------------------------
-- Trova l'Ind (0 based) della faccia meglio orientata come l'asse vtAx. Restituisce anche vtN e ptC della faccia stessa. La faccia di indice (0 based) fctExclude non viene considerata nella ricerca.
function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
@@ -1096,6 +1106,10 @@ end
-- Funzione per determinare se la faccia ha lati molto corti (trascurabili) ed è quindi approssimabile ad una 3 facce
function BeamLib.Is3EdgesApprox( Proc, nFacet, nAddGrpId)
nAddGrpId = nAddGrpId or BeamLib.GetAddGroup( Proc.PartId)
if not nAddGrpId then
local nEdges = #(EgtSurfTmFacetAdjacencies( Proc.Id, nFacet)[1])
return ( nEdges == 3)
end
local bResult = false
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
if not nContourId then return false end
+2 -2
View File
@@ -1,4 +1,4 @@
-- DiceCut.lua by Egaltech s.r.l. 2023/06/29
-- DiceCut.lua by Egaltech s.r.l. 2024/01/23
-- Gestione dei piano paralleli nei tagli lunghi: equidistanziamento dei piani paralleli
-- Tabella per definizione modulo
@@ -396,7 +396,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
end
local dElevP = DistanzaMassima( nParent, ptCPlanes, vtNPlanes, ptCBond, vtNBond, BBoxRawPart, TBoxPoint)
local dElevO
if ptCBond and vtNBond then
if ptCBond and vtNBond and not AreOppositeVectorApprox( vtNBond, vtNPlanes) then
dElevO = DistanzaMassima( nParent, ptCBond, vtNBond, ptCPlanes, vtNPlanes, BBoxRawPart, TBoxPoint)
end
+2 -1
View File
@@ -1,5 +1,6 @@
-- FaceByPocket.lua by Egaltech s.r.l. 2023/04/04
-- Gestione svuotatura di feature con una faccia
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo
local FaceByPocket = {}
@@ -78,7 +79,7 @@ function FaceByPocket.Make( Proc, nSurfId, nFacet, sPocketing, nPartId, b3Solid,
end
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
local dElev = BL.GetFaceElevation( nSurfId, nFacet, nPartId)
local dElev = BL.GetFaceElevation( nSurfId, nFacet, b3Solid)
-- determino numero e valore degli step di lavorazione
local nSurfStep = ceil( dElev / dMaxDepth)
local dSurfStep = dElev / nSurfStep
+139 -171
View File
@@ -1,4 +1,4 @@
-- FacesBySaw.lua by Egaltech s.r.l. 2023/09/26
-- FacesBySaw.lua by Egaltech s.r.l. 2024/01/07
-- Gestione taglio con lama di feature con una o due facce
-- 2021/01/06 Cambiato limite per attacco Tg con lama e CalcLeadInOutGeom rinominata in CalcLeadInOutPerpGeom.
-- 2021/02/03 In taglio lama si accettano anche due lati con deviazione minore di 20deg.
@@ -20,6 +20,12 @@
-- 2023/09/26 Piccola modifica per Turn su bInvert di MakeOne.
-- 2023/10/24 In MakeOne migliorata gestione taglio con percorso bilinea. Aggiunta funzione GetNameSolidFaceIncludingLine.
-- 2023/11/14 In MakeOne migliorato calcolo scelta soluzione per macchina TURN
-- 2023/11/28 In MakeTwo raffinamento calcolo vtRef per casi dubbi.
-- 2023/12/06 In CalcLeadInOutPerpGeom gestito caso in cui la geometria della feature esce dal grezzo.
-- 2023/12/30 Modifiche in CalcLeadInOutPerpGeom e CalcLeadInOutTangGeom con uso di EgtCAvToolPosBox.
-- 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.
-- Tabella per definizione modulo
local FacesBySaw = {}
@@ -37,6 +43,7 @@ local ML = require( 'MachiningLib')
---------------------------------------------------------------------
function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
EgtOutLog( 'FacesBySaw.MakeParallelOne', 3)
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
-- accetto solo facce perpendicolari all'asse X della trave
@@ -131,6 +138,20 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
-- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dAccEnd)
-- imposto angolo 3° asse rot
local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5)
local vtTool
if nFaceUse == MCH_MILL_FU.PARAL_FRONT then
vtTool = Y_AX()
elseif nFaceUse == MCH_MILL_FU.PARAL_BACK then
vtTool = -Y_AX()
elseif nFaceUse == MCH_MILL_FU.PARAL_DOWN then
vtTool = Z_AX()
else
vtTool = -Z_AX()
end
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtTool, vtOut))
-- eventuali note
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
-- eseguo
@@ -168,7 +189,7 @@ local function GetNameSolidFaceIncludingLine( b3Solid, ptP1Comp, ptP2Comp)
end
---------------------------------------------------------------------
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth)
-- se lama con asse parallelo alla faccia, passo alla apposita funzione
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
Par5 == MCH_MILL_FU.PARAL_TOP or
@@ -179,6 +200,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
end
-- la lama ha asse perpendicolare alla faccia
EgtOutLog( 'FacesBySaw.MakeOne', 3)
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
-- risolvo parametro ambiguo
@@ -191,6 +213,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
nOrthoOpposite = Par5
vtOrthO = BL.GetVersRef( Par5)
end
EgtOutLog( 'VtOrthO='..tostring( vtOrthO)..' FaceUse='..tostring( nOrthoOpposite), 3)
-- verifico se testa da sotto oppure se lavorazione sotto con testa da sopra
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5)
@@ -230,7 +253,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
local dAllStart = 0
local dAllEnd = 0
local bIsBiLinea = false
local bCosAngleL1L2 = 0
local dCosAngleL1L2 = 0
local dDist1 = dist( ptP1, ptPm)
local dDist2 = dist( ptP2, ptPm)
-- verifico se la bilinea si trova sul bordo del solido, quindi è una geometria aperta
@@ -249,10 +272,8 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
local dCosMax = 0.951 -- cos( 18°)
local dLenMin = 30
local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin)
--if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then
bCosAngleL1L2 = vtTg1 * vtTg2
if bCosAngleL1L2 < dCosMax then
dCosAngleL1L2 = vtTg1 * vtTg2
if dCosAngleL1L2 < dCosMax then
local dOrtho1 = abs( vtTg1 * vtOrthO)
local dOrtho2 = abs( vtTg2 * vtOrthO)
if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then
@@ -299,43 +320,46 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
-- parametri di attacco/uscita
local b3Box = BBox3d( b3Raw)
b3Box:expand( dCutSic)
local ptPa1 = ptP1 + dAccStart * vtTg
local ptPa2 = ptP2 + dAccEnd * vtTg
-- attacco perpendicolare
local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptPa1, ptPa2, vtV1, vtV2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box)
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
-- attacco tangente
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptP1, ptP2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptPa1, ptPa2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box)
local dLenLi2 = abs( dLi2Tang)
local dLenLo2 = abs( dLo2Tang)
-- se il lato non lavorato della bilinea è aperto, setto entrata/uscita con la stessa direzione
if bIsBiLinea then
-- angolo tra le due linee
local dAlpha = acos( abs( bCosAngleL1L2))
local dCosAlpha = dCosAngleL1L2
local dSinAlpha = sqrt( max( 1 - dCosAlpha * dCosAlpha, 0))
-- se ho accorciato ingresso, setto componente tangente e perpendicolare sul percorso di entrata
if abs( dAllStart) > 100 * GEO.EPS_SMALL and bIsL1OnFace then
-- controllo prima che il secondo lato non sia già incluso nella lavorazione del primo
local dDistPtTang = cos( dAlpha) * dDist1
local dDistPtPerp = abs( sin( dAlpha) * dDist1)
local dDistPtTang = dCosAlpha * dDist1
local dDistPtPerp = dSinAlpha * dDist1
local dDistToCenter = 0.5 * dSawDiam - dDistPtPerp
local dDistPointToCenter = sqrt( dDistPtTang * dDistPtTang + dDistToCenter * dDistToCenter)
-- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo entrata opportunamente
if dDistPointToCenter > 0.5 * dSawDiam then
dLiTang = -dAllStart * cos( dAlpha)
dLiPerp = sin( dAlpha) * dDist1
dLiTang = -dAllStart * dCosAlpha
dLiPerp = dDist1 * dSinAlpha
end
end
-- se ho accorciato uscita, setto componente tangente e perpendicolare sul percorso di uscita
if abs( dAllEnd) > 100 * GEO.EPS_SMALL and bIsL2OnFace then
-- controllo prima che il secondo lato non sia già incluso nella lavorazione del primo
local dDistPtTang = cos( dAlpha) * dDist2
local dDistPtPerp = abs( sin( dAlpha) * dDist2)
local dDistPtTang = dCosAlpha * dDist2
local dDistPtPerp = dSinAlpha * dDist2
local dDistToCenter = 0.5 * dSawDiam - dDistPtPerp
local dDistPointToCenter = sqrt( dDistPtTang * dDistPtTang + dDistToCenter * dDistToCenter)
-- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo uscita opportunamente
if dDistPointToCenter > 0.5 * dSawDiam then
dLoTang = -dAllEnd * cos( dAlpha)
dLoPerp = sin( dAlpha) * dDist2
dLoTang = -dAllEnd * dCosAlpha
dLoPerp = dDist2 * dSinAlpha
end
end
end
@@ -349,13 +373,32 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
abs( vtTg:getX()) < 0.9848 and
( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5) and not bDownHead) or
( abs( vtTg:getZ()) < 0.51 and b3Box:getDimZ() > 300 and BD.C_SIMM and BD.MAX_HEIGHT > 450 and b3Box:getDimX() > BD.LEN_SHORT_PART) or
( abs( vtTg:getZ()) < 0.51 and ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) or Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) then
bLioTang = true
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
if BD.TURN then
( abs( vtTg:getZ()) < 0.51 and ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) or
Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo) or
( BD.TURN == 2 and vtRef:getZ() < -0.1)) then
if BD.TURN == 2 then
if vtTg:getY() < -0.1 then
bLioTang = 1
local dMove = dist( ptP1, ptP2)
dLiTang = -( dLi2Tang - dAccStart - dAccEnd + dMove)
-- dLiPerp rimane invariato
dLoTang, dLoPerp = dLo2Tang, dLo2Perp
else
bLioTang = 2
local dMove = dist( ptP1, ptP2)
dLiTang, dLiPerp = dLi2Tang, dLi2Perp
dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove)
-- dLoPerp rimane invariato
end
elseif BD.TURN then
bLioTang = 2
local dMove = dist( ptP1, ptP2)
dLoTang = -( dLiTang + dAllStart - dAccStart + dAllEnd - dAccEnd + dMove)
dLiTang, dLiPerp = dLi2Tang, dLi2Perp
dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove)
dLoPerp = BD.COLL_SIC
else
bLioTang = true
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
end
end
-- posizione braccio
@@ -368,8 +411,13 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
else
if bLioTang then
--local vtTest = EgtIf( bInvert, vtTg, -vtTg)
if BD.TURN == 2 then
if vtOrthO:getZ() > -0.01 then
nSCC = MCH_SCC.ADIR_ZP
else
nSCC = MCH_SCC.ADIR_ZM
end
elseif bLioTang then
local vtTest = -vtTg
if abs( vtTest:getY()) > abs( vtTest:getZ()) then
-- calcolo direzione risultante da versore utensile e direzione di lavorazione inverso
@@ -417,14 +465,18 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
-- offset longitudinale
EgtSetMachiningParam( MCH_MP.OFFSL, EgtIf( bDownUp, -dCutOffset, dCutOffset))
-- imposto attacco/uscita
if BD.TURN and bLioTang == 1 then EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TG_PERP) end
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
if BD.TURN and bLioTang then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
if BD.TURN and bLioTang == 2 then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
-- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
-- imposto angolo 3° asse rot
local sBlockedAxis = EgtIf( bMaximizeVerticalDepth, 'parallel', 'perpendicular')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO))
-- eventuali note
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
-- eseguo
@@ -438,6 +490,7 @@ end
---------------------------------------------------------------------
function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, bUpdateIng, bDownHead)
EgtOutLog( 'FacesBySaw.MakeTwo', 3)
-- bUpdateIng : parametro opzionale con default true
if bUpdateIng == nil then bUpdateIng = true end
-- recupero l'ingombro del grezzo di appartenenza
@@ -485,14 +538,14 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
vtRef[1] = vtN[1] ^ vtTg
if vtRef[1] * vtN[2] < 0 then vtRef[1] = - vtRef[1] end
vtRef[1]:normalize()
if abs( vtTg:getZ()) < 0.708 and abs( vtRef[1]:getZ()) < 0.577 and abs( abs( vtRef[1]:getX()) - abs( vtRef[1]:getY())) < 0.1 then
if abs( vtTg:getZ()) < 0.708 and abs( vtRef[1]:getZ()) < 0.577 and abs( abs( vtRef[1]:getX()) - abs( vtRef[1]:getY())) < 0.05 then
vtRef[1] = ptC[1] - ptM
vtRef[1]:normalize()
end
vtRef[2] = vtN[2] ^ vtTg
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
vtRef[2]:normalize()
if abs( vtTg:getZ()) < 0.708 and abs( vtRef[2]:getZ()) < 0.577 and abs( abs( vtRef[2]:getX()) - abs( vtRef[2]:getY())) < 0.1 then
if abs( vtTg:getZ()) < 0.708 and abs( vtRef[2]:getZ()) < 0.577 and abs( abs( vtRef[2]:getX()) - abs( vtRef[2]:getY())) < 0.05 then
vtRef[2] = ptC[2] - ptM
vtRef[2]:normalize()
end
@@ -690,97 +743,49 @@ function FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dRad, vt
-- Sistema di riferimento intrinseco al taglio
local vtX = vtTg ^ vtN
local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
EgtOutLog( 'Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
local bRight = ( vtX * vtRef > 0)
EgtOutLog( 'LioPerp --> Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
-- Versore di attacco e uscita
local dCos1 = vtV1 * vtRef
local dCos2 = vtV2 * vtRef
local vtLio
if abs( dCos1 - dCos2) < 0.001 then
if abs( vtV1:getZ()) < abs( vtV2:getZ()) then
vtLio = vtV1
else
vtLio = vtV2
end
vtLio = EgtIf( abs( vtV1:getZ()) < abs( vtV2:getZ()), vtV1, vtV2)
elseif dCos1 > dCos2 then
vtLio = vtV1
else
vtLio = vtV2
end
local bRight = ( vtX * vtLio > 0)
-- Versore di attacco e uscita nel riferimento intrinseco al taglio
local vtLioL = Vector3d( vtLio) ; vtLioL:toLoc( frFace)
-- Spostamento punti per effetto dell'extra o della deficienza di taglio
ptP1 = ptP1 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra))
ptP2 = ptP2 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra))
-- Non va considerata l'uscita dalla faccia sotto, pertanto va abbassata
-- 2021/02/26 Abilito anche uscita sotto
local b3MyBox = BBox3d( b3Box) ; --b3MyBox:Add( b3MyBox:getMin() - 1000 * Z_AX())
-- Attacco
local dLiTang = 10000
local dLiPerp = 10000
local bLiOk, _, vLiPar = EgtLineBoxInters( ptP1, vtLio, b3MyBox)
if bLiOk and #vLiPar > 0 then
-- con la prima faccia di uscita
local dLen = vLiPar[#vLiPar]
local ptInt = ptP1 + vtLio * dLen
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtLio)
EgtOutLog( 'LiFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLio * vtFN)
local dLiLen = dLen + dAddLen
EgtOutLog( 'LeadIn Dist=' .. EgtNumToString( dLiLen), 3)
dLiTang = - dLiLen * vtLioL:getY()
dLiPerp = EgtIf( bRight, dLiLen, - dLiLen) * vtLioL:getX()
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLiOk2, _, vLiPar2 = EgtLineBoxInters( ptP1, vtLio, b3Mod)
if bLiOk2 and #vLiPar2 > 0 then
local dLen2 = vLiPar2[#vLiPar2]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP1 + vtLio * dLen2, vtLio)
EgtOutLog( 'LiFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLio * vtFN2)
local dLiLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadIn Dist2=' .. EgtNumToString( dLiLen2), 3)
local dLiTang2 = - dLiLen2 * vtLioL:getY()
local dLiPerp2 = EgtIf( bRight, dLiLen2, - dLiLen2) * vtLioL:getX()
if dLiLen2 < dLiLen then
dLiTang = dLiTang2
dLiPerp = dLiPerp2
end
end
end
-- Lunghezza di uscita
local dLoTang = 10000
local dLoPerp = 10000
local bLoOk, _, vLoPar = EgtLineBoxInters( ptP2, vtLio, b3MyBox)
if bLoOk and #vLoPar > 0 then
-- con la prima faccia di uscita
local dLen = vLoPar[#vLoPar]
local ptInt = ptP2 + vtLio * dLen
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtLio)
EgtOutLog( 'LoFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLio * vtFN)
local dLoLen = dLen + dAddLen
EgtOutLog( 'LeadOut Dist=' .. EgtNumToString( dLoLen), 3)
dLoTang = dLoLen * vtLioL:getY()
dLoPerp = EgtIf( bRight, dLoLen, - dLoLen) * vtLioL:getX()
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLoOk2, _, vLoPar2 = EgtLineBoxInters( ptP2, vtLio, b3Mod)
if bLoOk2 and #vLoPar2 > 0 then
local dLen2 = vLoPar2[#vLoPar2]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP2 + vtLio * dLen2, vtLio)
EgtOutLog( 'LoFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLio * vtFN2)
local dLoLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadOut Dist2=' .. EgtNumToString( dLoLen2), 3)
local dLoTang2 = dLoLen2 * vtLioL:getY()
local dLoPerp2 = EgtIf( bRight, dLoLen2, - dLoLen2) * vtLioL:getX()
if dLoLen2 < dLoLen then
dLoTang = dLoTang2
dLoPerp = dLoPerp2
end
end
end
-- Centro lama a inizio fine percorso
local dOffs = ( -dCutExtra + dRad) * EgtIf( bRight, 1, -1)
local ptCen1 = ptP1 + dOffs * vtX
local ptCen2 = ptP2 + dOffs * vtX
-- Box del pezzo espansi ortogonalmente alle tre direzioni canoniche X, Y e Z
local b3BoxX = BBox3d( b3Box) ; b3BoxX:expand( 0, 1000, 1000)
local b3BoxY = BBox3d( b3Box) ; b3BoxY:expand( 1000, 0, 1000)
local b3BoxZ = BBox3d( b3Box) ; b3BoxZ:expand( 1000, 1000, 0)
-- Calcolo elevazione dei due centri
local dSawThick = 6
EgtCAvSetSawTool( dSawThick, 2 * dRad, dSawThick, 0, 0)
local dElev1 = min( EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxX, vtLio),
EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxY, vtLio),
EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxZ, vtLio))
EgtOutLog( 'Elev1=' .. EgtNumToString( dElev1), 3)
local dLiTang = -dElev1 * vtLioL:getY()
local dLiPerp = EgtIf( bRight, dElev1, -dElev1) * vtLioL:getX()
local dElev2 = min( EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxX, vtLio),
EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxY, vtLio),
EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxZ, vtLio))
EgtOutLog( 'Elev2=' .. EgtNumToString( dElev2), 3)
local dLoTang = dElev2 * vtLioL:getY()
local dLoPerp = EgtIf( bRight, dElev2, -dElev2) * vtLioL:getX()
return dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio
end
@@ -792,72 +797,35 @@ function FacesBySaw.CalcLeadInOutTangGeom( ptP1, ptP2, vtN, dRad, vtRef, dCutExt
-- Sistema di riferimento intrinseco al taglio
local vtX = vtTg ^ vtN
local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
if ( vtX * vtRef < 0) then
vtX = - vtX
end
EgtOutLog( 'Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
-- Spostamento punti per effetto dell'extra o della deficienza di taglio
ptP1 = ptP1 - vtX * dCutExtra
ptP2 = ptP2 - vtX * dCutExtra
-- Non va considerata l'uscita dalla faccia sotto, pertanto va abbassata
-- 2021/02/26 Abilito anche uscita sotto
local b3MyBox = BBox3d( b3Box) ; --b3MyBox:Add( b3MyBox:getMin() - 1000 * Z_AX())
-- Attacco
local dLiTang = 10000
local bRight = ( vtX * vtRef > 0)
EgtOutLog( 'LioTang --> Vref=' .. tostring( vtRef), 3)
-- Centro lama a inizio fine percorso
local dOffs = ( -dCutExtra + dRad) * EgtIf( bRight, 1, -1)
local ptCen1 = ptP1 + dOffs * vtX
local ptCen2 = ptP2 + dOffs * vtX
-- Box del pezzo espansi ortogonalmente alle tre direzioni canoniche X, Y e Z
local b3BoxX = BBox3d( b3Box) ; b3BoxX:expand( 0, 1000, 1000)
local b3BoxY = BBox3d( b3Box) ; b3BoxY:expand( 1000, 0, 1000)
local b3BoxZ = BBox3d( b3Box) ; b3BoxZ:expand( 1000, 1000, 0)
-- Calcolo elevazione dei due centri
local dSawThick = 6
EgtCAvSetSawTool( dSawThick, 2 * dRad, dSawThick, 0, 0)
local dElev1 = min( EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxX, -vtTg),
EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxY, -vtTg),
EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxZ, -vtTg))
EgtOutLog( 'Elev1=' .. EgtNumToString( dElev1), 3)
local dLiTang = dElev1
local dLiPerp = 0
local bLiOk, _, vLiPar = EgtLineBoxInters( ptP1, vtTg, b3MyBox)
if bLiOk and #vLiPar > 0 then
local dLen = vLiPar[1]
local ptInt = ptP1 + vtTg * dLen
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, -vtTg)
EgtOutLog( 'LiFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - ( vtX * vtFN)) / ( vtTg * vtFN)
local dLiLen = dLen + dAddLen
EgtOutLog( 'LeadIn Dist=' .. EgtNumToString( dLiLen), 3)
dLiTang = - dLiLen
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLiOk2, _, vLiPar2 = EgtLineBoxInters( ptP1, vtTg, b3Mod)
if bLiOk2 and #vLiPar2 > 0 then
local dLen2 = vLiPar2[1]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP1 + vtTg * dLen2, -vtTg)
EgtOutLog( 'LiFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - ( vtX * vtFN2)) / ( vtTg * vtFN2)
local dLiLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadIn Dist2=' .. EgtNumToString( dLiLen2), 3)
if -dLiLen2 < -dLiLen then
dLiTang = - dLiLen2
end
end
end
-- Lunghezza di uscita
local dLoTang = 10000
local dElev2 = min( EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxX, vtTg),
EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxY, vtTg),
EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxZ, vtTg))
EgtOutLog( 'Elev2=' .. EgtNumToString( dElev2), 3)
local dLoTang = dElev2
local dLoPerp = 0
local bLoOk, _, vLoPar = EgtLineBoxInters( ptP2, vtTg, b3MyBox)
if bLoOk and #vLoPar > 0 then
local dLen = vLoPar[#vLoPar]
local ptInt = ptP2 + vtTg * dLen
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtTg)
EgtOutLog( 'LoFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - ( vtX * vtFN)) / ( vtTg * vtFN)
local dLoLen = dLen + dAddLen
EgtOutLog( 'LeadOut Dist=' .. EgtNumToString( dLoLen), 3)
dLoTang = dLoLen
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLoOk2, _, vLoPar2 = EgtLineBoxInters( ptP2, vtTg, b3Mod)
if bLoOk2 and #vLoPar2 > 0 then
local dLen2 = vLoPar2[#vLoPar2]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP2 + vtTg * dLen2, vtTg)
EgtOutLog( 'LoFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - ( vtX * vtFN2)) / ( vtTg * vtFN2)
local dLoLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadOut Dist2=' .. EgtNumToString( dLoLen2), 3)
if dLoLen2 < dLoLen then
dLoTang = dLoLen2
end
end
end
return dLiTang, dLiPerp, dLoTang, dLoPerp
end
+60 -50
View File
@@ -21,30 +21,33 @@ EgtOutLog( ' FeatureTopology started', 1)
-- restituisce la matrice delle adiacenze di Proc dove i e j sono le facce e a(ij) è l'angolo tra di esse; 0 se nessuna adiacenza
local function GetAdjacencyMatrix( Proc)
local vAdj = {}
-- essendo la matrice simmetrica a diagonale nulla, ne calcolo solo la metà superiore
for i = 1, Proc.Fct do
vAdj[i] = {}
for j = 1, Proc.Fct do
if i == j then
vAdj[i][j] = 0
else
_, _, _, vAdj[i][j] = EgtSurfTmFacetsContact( Proc.Id, i - 1, j - 1, GDB_ID.ROOT)
if not vAdj[i][j] then vAdj[i][j] = 0 end
end
j = j + 1
for j = i + 1, Proc.Fct do
_, _, _, vAdj[i][j] = EgtSurfTmFacetsContact( Proc.Id, i - 1, j - 1, GDB_ID.ROOT)
if not vAdj[i][j] then vAdj[i][j] = 0 end
end
end
-- riempio di conseguenza il resto della matrice
for i = 1, Proc.Fct do
vAdj[i][i] = 0
for j = i + 1, Proc.Fct do
vAdj[j][i] = vAdj[i][j]
end
i = i + 1
end
return vAdj
end
---------------------------------------------------------------------
-- restituisce gli id delle facce di Proc che hanno il numero di adiacenze nAdj
function FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, nAdj)
local vAdj = GetAdjacencyMatrix( Proc)
function FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, nAdj)
if not vAdj then vAdj = GetAdjacencyMatrix( Proc) end
local nFct = #( vAdj or {})
local vFacesWithGivenAdj = {}
for i = 1, Proc.Fct do
for i = 1, nFct do
local nAdjCount = 0
for j = 1, Proc.Fct do
for j = 1, nFct do
if vAdj[i][j] and vAdj[i][j] ~= 0 then
nAdjCount = nAdjCount + 1
end
@@ -58,11 +61,11 @@ end
---------------------------------------------------------------------
-- restituisce true se Proc ha tutti gli angoli concavi (bAllConcave) e, nei casi in cui ha senso, se questi sono esattamente 90 deg (bAllRight)
local function AreAllAnglesConcaveOrRight( Proc)
local vAdj = GetAdjacencyMatrix( Proc)
local function AreAllAnglesConcaveOrRight( vAdj)
local bAllConcave, bAllRight = true, true
for i = 1, Proc.Fct do
for j = 1, Proc.Fct do
local nFct = #( vAdj or {})
for i = 1, nFct do
for j = 1, nFct do
-- se trovo un angolo convesso restituisco falso e esco subito
if vAdj[i][j] and vAdj[i][j] > 0 then
bAllConcave = false
@@ -74,7 +77,7 @@ local function AreAllAnglesConcaveOrRight( Proc)
end
end
-- se 1 faccia oppure 2 facce con angolo convesso non ha senso ritornare valori per bAllRight
if Proc.Fct < 2 or ( Proc.Fct == 2 and vAdj[1][2] > 0) then
if nFct < 2 or ( nFct == 2 and vAdj[1][2] > 0) then
return bAllConcave
else
return bAllConcave, bAllRight
@@ -165,36 +168,42 @@ end
-- riconosce se Proc è una delle topologie standard e, in caso positivo, ne scrive le caratteristiche in campi specifici della Proc stessa restituendo true
function FeatureTopology.Classify( Proc, b3Raw)
if not Proc.AffectedFaces then Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc) end
-- la feature deve avere geometria
if not Proc.Box or Proc.Box:isEmpty() then
return false
end
local bRecognized = false
local sFamily
local bIsThrough
local bAllRightAngles
local bIsParallel
local sLongName = ''
-- se non richiesto (default true, quindi nil vale true), esco
if Proc.NeedTopology == false then
Proc.Topology = 'SPECIAL'
Proc.TopologyLongName = Proc.Topology
return true
end
-- SE NON HA TUTTE LE FACCE PIANE RITORNARE NIL!!
-- se già calcolato, esco
if Proc.Topology then
return true
end
local bAllAnglesConcave
bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( Proc)
-- calcoli
if not Proc.AffectedFaces then Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc) end
local vAdj = GetAdjacencyMatrix( Proc)
local bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( vAdj)
local vTriangularFaces = GetTriangularFaces( Proc)
local bIsAnyDimensionLongAsPart = IsAnyDimensionLongAsPart( Proc)
local vFacesWithOneAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 1)
local vFacesWithTwoAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 2)
local vFacesWithThreeAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 3)
local vFacesWithFourAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 4)
local dRawW, dRawH = b3Raw:getDimY(), b3Raw:getDimZ()
local vFacesWithOneAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 1)
local vFacesWithTwoAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 2)
local vFacesWithThreeAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 3)
local vFacesWithFourAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 4)
local dRawW = b3Raw:getDimY()
local dRawH = b3Raw:getDimZ()
local bIsFeatureCuttingEntireSection = BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
if Proc.IsOutline then
sFamily = 'OUTLINE'
elseif Proc.Prc == 40 then
sFamily = 'DRILLING'
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
-- assegnazione tipologia
local sFamily
local bIsThrough
if Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
sFamily = 'Cut'
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart then
sFamily = 'Bevel'
@@ -233,23 +242,24 @@ function FeatureTopology.Classify( Proc, b3Raw)
sFamily = 'Pocket'
bIsThrough = false
end
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily, bIsThrough)
bIsParallel = ( #vFacesParallelToPart == Proc.Fct)
if sFamily == 'OUTLINE' or sFamily == 'DRILLING' then
-- verifico se facce parallele a quelle della trave
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily, bIsThrough)
local bIsParallel = ( #vFacesParallelToPart == Proc.Fct)
-- assegnazioni
if sFamily then
Proc.Topology = sFamily
Proc.TopologyLongName = sFamily
bRecognized = true
elseif sFamily then
sLongName = GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, Proc.Fct)
Proc.Topology, Proc.IsThrough, Proc.AllRightAngles, Proc.IsParallel, Proc.TopologyLongName = sFamily, bIsThrough, bAllRightAngles, bIsParallel, sLongName
bRecognized = true
Proc.TopologyLongName = GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, Proc.Fct)
Proc.IsThrough = bIsThrough
Proc.AllRightAngles = bAllRightAngles
Proc.IsParallel = bIsParallel
return true
else
Proc.Topology = 'OTHER'
Proc.TopologyLongName = 'OTHER'
Proc.TopologyLongName = Proc.Topology
return false
end
return bRecognized
end
-------------------------------------------------------------------------------------------------------------
+157 -71
View File
@@ -8,6 +8,10 @@
-- 2023/01/31 Per FindPocketing implementata la possibilità di escludere le teste H2 o H3 dalla ricerca utensile.
-- 2023/07/28 Aggiunta gestione del tipo di foratura "Drill_AT".
-- 2023/11/06 Migliorie e correzioni alle forature con AngularTransmission ("_AT").
-- 2024/01/18 In FindSawing aggiunto il parametro opzionale dDepth.
-- 2024/01/19 In FindSawing aggiunto parametro opzionale bConsiderCSimmEncumberance per considerare l'ingombro dell'asse C nel massimo materiale (default false).
-- 2024/01/23 Nella GetMachinings vengono ora raccolti i parametri utensile necessari per i VerifyTool, scritti direttamente nella tabella Machining.Tool.
-- Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest) se passato l'apposito parametro SortingCriterion in FindMachining. Al momento implementato solo per FindSawing.
-- Tabella per definizione modulo
local MachiningLib = {}
@@ -103,112 +107,192 @@ local function SetNextMachining( sToolName, nHead, bFixed)
end
---------------------------------------------------------------------
local function SetCurrMachiningAndTool( sMachName)
if not EgtMdbSetCurrMachining( sMachName) then return false end
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
local sTool = EgtTdbGetToolFromUUID( sTuuid)
if not sTool then return false end
if not EgtTdbSetCurrTool( sTool) then return false end
local bActive = EgtFindToolInCurrSetup( sTool)
local function SetCurrMachiningAndTool( Machining)
EgtMdbSetCurrMachining( Machining.Name)
EgtTdbSetCurrTool( Machining.Tool.Name)
local bActive = EgtFindToolInCurrSetup( Machining.Tool.Name)
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local nHead = tonumber( sHead:sub( 2, #sHead))
local bH2 = ( nHead >= 21 and nHead <= 29)
local bH3 = ( nHead >= 31 and nHead <= 39)
local bH3 = ( nHead >= 31 and nHead <= 39)
local bFixed = ( vFixedHeads[nHead])
return bActive, sTool, bH2, bFixed, bH3
return bActive, Machining.Tool.Name, bH2, bFixed, bH3
end
---------------------------------------------------------------------
function VerifyDrill( dDiam, dDepth, bH2)
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
local dMaxToolLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dDiamTh = EgtTdbGetCurrToolThDiam()
local dLenTh = 72
if EgtTdbGetCurrToolThLength then dLenTh = EgtTdbGetCurrToolThLength() end
local dFreeLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) - dLenTh - EgtMdbGetGeneralParam( MCH_GP.MAXDEPTHSAFE)
if dTDiam < dDiam + 10 * GEO.EPS_SMALL and
dTDiam > dDiam - BD.DRILL_TOL - 10 * GEO.EPS_SMALL and
( not dDepth or dTMaxMat > dDepth - GEO.EPS_SMALL) then
return true, { TMaxMat = dTMaxMat, MaxToolLength = dMaxToolLength, ToolDiam = dToolDiam, DiamTh = dDiamTh, FreeLen = dFreeLen, H2 = bH2}
function VerifyDrill( Machining, dDiam, dDepth, bH2)
local dFreeLen = Machining.Tool.Length - Machining.Tool.ToolHolderLength - EgtMdbGetGeneralParam( MCH_GP.MAXDEPTHSAFE)
if Machining.Tool.Diameter < dDiam + 10 * GEO.EPS_SMALL and
Machining.Tool.Diameter > dDiam - BD.DRILL_TOL - 10 * GEO.EPS_SMALL and
( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) then
return true, { TMaxMat = Machining.Tool.MaxMat, MaxToolLength = Machining.Tool.TotalLength, ToolDiam = Machining.Tool.Diameter, DiamTh = Machining.Tool.ToolHolderDiameter, FreeLen = dFreeLen, H2 = bH2}
end
end
---------------------------------------------------------------------
function VerifyDrillPocket( dDiam, dDepth, bH2)
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth()
local dMaxToolLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dDiamTh = EgtTdbGetCurrToolThDiam()
local dFreeLen = dTMaxDepth
if dTDiam < dDiam - 10 * GEO.EPS_SMALL and
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) then
return true, { TMaxDepth = dTMaxDepth, MaxToolLength = dMaxToolLength, ToolDiam = dToolDiam, DiamTh = dDiamTh, FreeLen = dFreeLen, H2 = bH2}
function VerifyDrillPocket( Machining, dDiam, dDepth, bH2)
if Machining.Tool.Diameter < dDiam - 10 * GEO.EPS_SMALL and
( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) then
return true, { TMaxDepth = Machining.Tool.MaxMat, MaxToolLength = Machining.Tool.TotalLength, ToolDiam = Machining.Tool.Diameter, DiamTh = Machining.Tool.ToolHolderDiameter, FreeLen = Machining.Tool.MaxMat, H2 = bH2}
end
end
---------------------------------------------------------------------
function VerifyMill( dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2)
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth()
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
if ( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
( not sTuuidMstr or sTuuidMstr == sTuuid) and
( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
( not dMaxTotLen or dTTotLen < dMaxTotLen + GEO.EPS_SMALL) then
return true, { TMaxDepth = dTMaxDepth, TDiam = dTDiam, H2 = bH2}
function VerifyMill( Machining, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2)
if ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) and
( not sTuuidMstr or sTuuidMstr == Machining.Tool.UUID) and
( not dMaxDiam or Machining.Tool.Diameter < dMaxDiam + GEO.EPS_SMALL) and
( not dMaxTotLen or Machining.Tool.TotalLength < dMaxTotLen + GEO.EPS_SMALL) then
return true, { TMaxDepth = Machining.Tool.MaxMat, TDiam = Machining.Tool.Diameter, H2 = bH2}
end
end
---------------------------------------------------------------------
function VerifyPocket( dMaxDiam, dDepth, dMaxTotLen, bH2)
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth()
local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
if ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
( not dMaxTotLen or dTTotLen < dMaxTotLen + GEO.EPS_SMALL) then
return true, { TDiam = dTDiam, TMaxDepth = dTMaxDepth, H2 = bH2}
function VerifyPocket( Machining, dMaxDiam, dDepth, dMaxTotLen, bH2)
if ( not dMaxDiam or Machining.Tool.Diameter < dMaxDiam + GEO.EPS_SMALL) and
( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) and
( not dMaxTotLen or Machining.Tool.TotalLength < dMaxTotLen + GEO.EPS_SMALL) then
return true, { TDiam = Machining.Tool.Diameter, TMaxDepth = Machining.Tool.MaxMat, H2 = bH2}
end
end
---------------------------------------------------------------------
function VerifyTool( MachiningType, sType, Params, bH2)
function VerifyChainSaw( Machining, dDepth, CSimmEncumberance, bH2)
-- riduco il massimo materiale dell'ingombro asse C. Se non richiesto, arriverà un valore di CSimmEncumberance nullo
Machining.Tool.MaxMat = min( Machining.Tool.MaxMat, Machining.Tool.TotalLength - CSimmEncumberance)
if not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL then
return true, { H2 = bH2}
end
end
---------------------------------------------------------------------
function VerifyTool( Machining, MachiningType, Params, bH2)
if MachiningType == MCH_MY.DRILLING then
if EgtStartsWith( sType, 'Drill') or EgtStartsWith( sType, 'AngleDrill') then
return VerifyDrill( Params.Diam, Params.Depth, bH2)
elseif EgtStartsWith( sType, 'Pocket') then
return VerifyDrillPocket( Params.Diam, Params.Depth, bH2)
if Machining.SubType == 'Drill' or Machining.SubType == 'AngleDrill' then
return VerifyDrill( Machining, Params.Diam, Params.Depth, bH2)
elseif Machining.SubType == 'DrillPocket' then
return VerifyDrillPocket( Machining, Params.Diam, Params.Depth, bH2)
end
elseif MachiningType == MCH_MY.SAWING then
return true, { H2 = bH2}
elseif MachiningType == MCH_MY.MILLING then
return VerifyMill( Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2)
return VerifyMill( Machining, Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2)
elseif MachiningType == MCH_MY.POCKETING then
return VerifyPocket( Params.MaxDiam, Params.Depth, Params.MaxTotLen, bH2)
return VerifyPocket( Machining, Params.MaxDiam, Params.Depth, Params.MaxTotLen, bH2)
elseif MachiningType == MCH_MY.MORTISING then
return true, { H2 = bH2}
return VerifyChainSaw( Machining, Params.Depth, Params.CSimmEncumberance, bH2)
else
return false
end
end
---------------------------------------------------------------------
function GetMachinings( MachiningType)
function GetMachinings( MachiningType, sType)
local Machinings
-- leggo le lavorazioni disponibili
if MachiningType == MCH_MY.DRILLING then
return Drillings
Machinings = Drillings
elseif MachiningType == MCH_MY.SAWING then
return Cuttings
Machinings = Cuttings
elseif MachiningType == MCH_MY.MILLING then
return Millings
Machinings = Millings
elseif MachiningType == MCH_MY.POCKETING then
return Pocketings
Machinings = Pocketings
elseif MachiningType == MCH_MY.MORTISING then
return Sawings
Machinings = Sawings
end
-- scrivo i parametri utensile nella lavorazione
local validMachinings = {}
for i = 1, #Machinings do
local Machining = Machinings[i]
if EgtMdbSetCurrMachining( Machining.Name) then
Machining.Tool = {}
Machining.Tool.UUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
Machining.Tool.Name = EgtTdbGetToolFromUUID( Machining.Tool.UUID)
if Machining.Tool.Name then
if EgtTdbSetCurrTool( Machining.Tool.Name) then
table.insert( validMachinings, Machining)
if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then
Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth()
else
Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
end
if MachiningType == MCH_MY.DRILLING then
if EgtStartsWith( Machining.Type, 'Drill') then
Machining.SubType = 'Drill'
elseif EgtStartsWith( Machining.Type, 'AngleDrill') then
Machining.SubType = 'AngleDrill'
elseif EgtStartsWith( Machining.Type, 'Pocket') then
Machining.SubType = 'DrillPocket'
end
end
Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
Machining.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN)
Machining.Tool.TotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
Machining.Tool.ToolHolderDiameter = EgtTdbGetCurrToolThDiam()
Machining.Tool.ToolHolderLength = EgtTdbGetCurrToolThLength() or 72
end
end
end
end
-- ritorno la lista delle sole lavorazioni valide
return validMachinings
end
---------------------------------------------------------------------
---restituisce la lista delle lavorazioni ordinata secondo il criterio *sCriterion*
---@param Machinings table lista della lavorazioni da riordinare
---@param sCriterion string criterio di ordinamento ('Longest', 'Shortest', 'Biggest', 'Smallest')
function ReorderMachinings( Machinings, sCriterion)
-- funzioni di ordinamento
local function SortMachiningsByLongestTool( Machining1, Machining2)
if Machining1.Tool.MaxMat > Machining2.Tool.MaxMat + 10 * GEO.EPS_SMALL then
return true
else
return false
end
end
local function SortMachiningsByShortestTool( Machining1, Machining2)
if Machining1.Tool.MaxMat < Machining2.Tool.MaxMat - 10 * GEO.EPS_SMALL then
return true
else
return false
end
end
local function SortMachiningsByBiggestTool( Machining1, Machining2)
if Machining1.Tool.Diameter > Machining2.Tool.Diameter + 10 * GEO.EPS_SMALL then
return true
else
return false
end
end
local function SortMachiningsBySmallestTool( Machining1, Machining2)
if Machining1.Tool.Diameter < Machining2.Tool.Diameter - 10 * GEO.EPS_SMALL then
return true
else
return false
end
end
-- ordinamento in base al criterio
-- ordine di default, ossia quello che arriva dal database
if not sCriterion then
return
-- prima gli utensili più lunghi
elseif sCriterion == 'Longest' then
table.sort( Machinings, SortMachiningsByLongestTool)
-- prima gli utensili più corti
elseif sCriterion == 'Shortest' then
table.sort( Machinings, SortMachiningsByShortestTool)
-- prima gli utensili con diametro più grande
elseif sCriterion == 'Biggest' then
table.sort( Machinings, SortMachiningsByBiggestTool)
-- prima gli utensili con diametro più piccolo
elseif sCriterion == 'Smallest' then
table.sort( Machinings, SortMachiningsBySmallestTool)
end
end
---------------------------------------------------------------------
@@ -228,7 +312,7 @@ function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
end
---------------------------------------------------------------------
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
if bTopHead == nil and bDownHead == nil then
bTopHead = true
bDownHead = false
@@ -255,11 +339,12 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
local sH2Mach = ''
local sH2Tool = ''
local sH2Param
-- ricerca sulle forature, dal diametro maggiore al minore
local Machinings = GetMachinings( MachiningType)
local Machinings = GetMachinings( MachiningType, sType)
ReorderMachinings( Machinings, sSortingCriterion)
local ForStart = 1
local ForEnd = #Machinings
local ForStep = 1
-- le forature vanno scorse dal diametro maggiore al minore
if MachiningType == MCH_MY.DRILLING then
ForStart = #Machinings
ForEnd = 1
@@ -289,9 +374,9 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
end
-- recupero dati utensile
local bToolActive, sToolName, bH2, bFixed, bH3 = SetCurrMachiningAndTool( Machining.Name)
local bToolActive, sToolName, bH2, bFixed, bH3 = SetCurrMachiningAndTool( Machining)
if Machining.On and sMachiningType == sType and bToolActive and ( not bH2 or bH2 == not bExcludeH2) and ( not bH3 or bH3 == not bExcludeH3) then
local bOk, ToolParams = VerifyTool( MachiningType, sType, Params, bH2)
local bOk, ToolParams = VerifyTool( Machining, MachiningType, Params, bH2)
if bOk then
if MachineHeadUse == ONE_HEAD then
SetNextMachining( sToolName, 1, bFixed)
@@ -410,8 +495,9 @@ function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen, bTopHe
end
---------------------------------------------------------------------
function MachiningLib.FindSawing( sType)
return FindMachining( MCH_MY.MORTISING, sType)
function MachiningLib.FindSawing( sType, dDepth, bConsiderCSimmEncumberance, sSortingCriterion)
if not BD.C_SIMM_ENC then BD.C_SIMM_ENC = EgtIf( BD.C_SIMM, 180, 90) end
return FindMachining( MCH_MY.MORTISING, sType, { Depth = dDepth, CSimmEncumberance = EgtIf( bConsiderCSimmEncumberance, BD.C_SIMM_ENC, 0)}, nil, nil, nil, nil, sSortingCriterion)
end
-------------------------------------------------------------------------------------------------------------
+26 -9
View File
@@ -23,6 +23,8 @@
-- 2023/08/01 In caso di pezzi alti su macchina tipo PF i tagli doppi di lato non vengono usati, si usa il metodo standard.
-- 2023/09/12 In MakeFromTop abbassato a 590 mm il limite per convertire in LongCut.
-- 2023/10/27 In MakeFromTop corretto massimo materiale in caso di lavorazione da sotto.
-- 2023/12/07 Correzione in Classify in scelta ribaltamento trave quando si è in condizioni downUp.
-- 2024/01/18 Gestita superficie limitante opzionale da passare a diceCut.
-- Tabella per definizione modulo
local ProcessCut = {}
@@ -67,10 +69,22 @@ function ProcessCut.Classify( Proc, b3Raw)
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw)
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
if bDownCut then
-- recupero i dati della lama
local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide')
local sCutting = ML.FindCutting( sCutType, true, false)
local dMaxDepth = 0
local dMaxMat = 0
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
end
end
-- calcolo l'ingombro orizzontale della faccia
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli)
if DimH > 2 * BD.MAX_DIM_DICE then
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale)
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and abs( vtN:getY()) > 0.1 and dMaxMat < DimH + BD.CUT_EXTRA) then
return true, true
end
end
@@ -238,7 +252,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione con testa da sopra
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes)
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf)
-- ingombro del grezzo
b3Raw = b3Raw or EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
@@ -348,7 +362,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
EgtOutLog( sErr)
return false, sErr
end
-- verifico se necessari tagli supplementari
-- verifico se necessari tagli supplementari o se presente superficie limitante
EgtOutLog( string.format( 'MaxDepth=%.1f MaxVertDepth=%.1f CutH=%.1f CutV=%.1f', dMaxDepth, dMaxVertDepth, dCutH, dCutV), 3)
local vCuts = {}
if not Proc.AdvTail and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
@@ -359,6 +373,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
ptExtra = Point3d( b3Solid:getMin():getX() + 5*GEO.EPS_SMALL, ptMiddle:getY(), ptMiddle:getZ())
vtExtra = X_AX()
bAutoCalcSurf = false
-- superficie limitante
elseif nLimitingSurf then
ptExtra, vtExtra = EgtSurfTmFacetCenter( nLimitingSurf, 0, GDB_ID.ROOT)
end
-- verifico elevazione max del materiale tagliato
local dMaxElev
@@ -375,9 +392,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
dMaxElev = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
end
end
-- per macchina TURN aggiusto massima dimensione cubetto
-- per macchina TURN (ma non OikosX) aggiusto massima dimensione cubetto
local dNewDiceDim
if BD.TURN then
if BD.TURN and BD.TURN ~= 2 then
local dDimRef = GEO.INFINITO
if abs( vtN:getZ()) < 0.003 then
dDimRef = b3Raw:getDimZ()
@@ -778,7 +795,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng)
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf)
-- sovramateriale di coda
dOvmTail = dOvmTail or BD.OVM_MID
-- ingombro del grezzo
@@ -830,12 +847,12 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
local bNoDicing = false
-- se taglio con testa da sopra
if not bDownHead and not bDownTurn then
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes)
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf)
bNoDicing = bNoDicing2
if not bOk then return false, sErr end
-- altrimenti taglio con testa da sotto
else
local bOk, sErr = MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut)
local bOk, sErr = MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return false, sErr end
end
-- Aggiornamento ingombro (se vero taglio o richiesto)
+16 -3
View File
@@ -2,6 +2,7 @@
-- Gestione calcolo doppi tagli di lama per Travi
-- 2022/08/29 Implementata la fresatura dal lato per tagli problematici per PF1250.
-- 2023/03/22 Eliminata SetOpenSide locale, si usa quella di libreria.
-- 2023/12/07 Correzione in Classify in scelta ribaltamento trave quando si è in condizioni downUp
-- Tabella per definizione modulo
local ProcessDoubleCut = {}
@@ -54,10 +55,22 @@ function ProcessDoubleCut.Classify( Proc, b3Raw)
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN)
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
if bDownCut then
-- recupero i dati della lama
local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide')
local sCutting = ML.FindCutting( sCutType, true, false)
local dMaxDepth = 0
local dMaxMat = 0
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
end
end
-- calcolo l'ingombro orizzontale della faccia
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, nFac)
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli)
if DimH > 2 * BD.MAX_DIM_DICE then
local _, DimH = BL.GetFaceHvRefDim( Proc.Id, nFac)
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale)
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and abs( vtN:getY()) > 0.1 and dMaxMat < DimH + BD.CUT_EXTRA) then
return true, true
end
end
+1
View File
@@ -35,6 +35,7 @@ local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket
function ProcessFreeContour.Identify( Proc)
return ( ( Proc.Grp == 0 or Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 250)
end
---------------------------------------------------------------------
-- Verifica se feature di testa
function ProcessFreeContour.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
+79 -8
View File
@@ -9,6 +9,8 @@
-- 2023/04/20 Per travi alte aggiunti tagli orizzontali per ridurre le dimensioni degli scarti
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
-- 2024/01/18 Gestiti tagli verticali aggiuntivi per travi larghe.
-- 2024/01/22 Nei tagli verticali aggiuntivi si usa ora BD.MAX_LEN_DICE come dimensione (era BD.MAX_DIM_DICE).
-- Tabella per definizione modulo
local ProcessHeadCut = {}
@@ -19,6 +21,7 @@ local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local Cut = require( 'ProcessCut')
local Pocket = require( 'FaceByPocket')
local Topology = require( 'FeatureTopology')
EgtOutLog( ' ProcessHeadCut started', 1)
@@ -151,6 +154,31 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
return true, nil
end
---------------------------------------------------------------------
-- tagli verticali aggiuntivi
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw )
local _, dimH = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local nVerticalCuts = ceil( dimH / ( BD.MAX_LEN_DICE)) - 1
local dVerticalSliceHeight = dimH / ( nVerticalCuts + 1)
-- recupero il diametro dell'utensile
local dSawDiam = 400
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
end
end
local bOk, sErr
-- tagli orizzontali
for j = nVerticalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
local dVerticalCutOffset = dVerticalSliceHeight * -j
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw)
if not bOk then return bOk, sErr end
end
return bOk, sErr
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut)
@@ -162,6 +190,8 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
if not bOkc then return bOkc, sErrC end
end
-- eventuali informazioni sul tipo di finitura
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
-- recupero la lavorazione
local sCutting = ML.FindCutting( 'HeadSide')
if not sCutting then
@@ -209,15 +239,16 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
if not bNeedHCut and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL then
return true
end
-- determino se più tagli con offset
-- determino se lo spessore del materiale da rimuovere è eccessivo e quindi vanno fatti più tagli con offset
local nCuts = max( ceil( dOvmHead / (( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP) + 0.5)), 1)
local dOffsL = dOvmHead / nCuts
local _, dimH, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local dMinOvmHeadForAddeddCuts = 10.123
-- se taglio per sezioni alte e larghe
if bBigSectionCut then
if dOvmHead > 0 then
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
-- se finitura con lama
if nQ05 == 1 or nQ05 == 0 then
if nQ05 < 2 then
local dSawThickCheck = dSawThick
if dSawThick2 > 0 and bDoubleHorizCut then
dSawThickCheck = min( dSawThick, dSawThick2)
@@ -230,7 +261,39 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
end
-- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard
if dMaxElev > dSawThickCheck then
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT)
local bOk, sErr
-- se trave larga effettuo tagli verticali aggiuntivi
if ( dimH > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) then
-- ad ogni offset di taglio dovrò fare prima i tagli verticali e poi i cubetti
for i = nCuts, 1, -1 do
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
-- faccia di taglio all'offset corrente
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
local AddProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId}
Topology.Classify( AddProc, b3Raw)
local dCutOffset = ( i - 1) * dOffsL
local vtMove = Vector3d( dCutOffset, 0, 0)
EgtMove( AddId, vtMove, GDB_RT.GLOB)
-- eventuale faccia di taglio all'offset precedente, per limitare il dicing e evitare di tagliare i cubetti nel vuoto
local nLimitingSurf
if nCuts > 1 then
nLimitingSurf = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
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)
if AreSameVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
end
-- tagli verticali
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw)
if not bOk then return bOk, sErr end
-- tagli a cubetti con eventuale superficie limitante
bOk, sErr = Cut.Make( AddProc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT, nil, nLimitingSurf)
end
-- tagli aggiuntivi non necessari
else
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT)
end
return bOk, sErr
end
-- se finitura con truciolatore
@@ -286,9 +349,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
end
-- per travi alte faccio dei tagli orizzontali aggiuntivi
local _, _, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local dMinOvmHeadForHorizontalCuts = 10.123
local bAreHorizontalCutsNeeded = ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForHorizontalCuts - 10 * GEO.EPS_SMALL)
local bAreHorizontalCutsNeeded = ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL)
if bAreHorizontalCutsNeeded then
local nHorizontalCuts = ceil( dimV / BD.MAX_DIM_DICE) - 1
local dHorizontalSliceHeight = dimV / ( nHorizontalCuts + 1)
@@ -328,6 +389,11 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
-- se trave larga effettuo tagli verticali aggiuntivi
if ( dimH > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) then
local bOk, sErr = AddVerticalPreCuts( Proc, sCutting, dCutOffset, b3Raw)
if not bOk then return bOk, sErr end
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
if not bOk then return false, sErr end
end
@@ -356,12 +422,17 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
-- eseguo i tagli da sotto necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw, nil, true)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
-- se trave larga effettuo tagli verticali aggiuntivi
if ( dimH > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) then
local bOk, sErr = AddVerticalPreCuts( Proc, sCutting, dCutOffset, b3Raw)
if not bOk then return bOk, sErr end
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
if not bOk then return false, sErr end
end
+47 -29
View File
@@ -84,6 +84,11 @@
-- 2023/11/03 Aggiunta MakeStaircaseStep per lavorazione con fresa + lama di gradini scala. Smusso opzionale.
-- 2023/11/06 In MakeStaircaseStep gestito ritorno.
-- 2023/11/06 Migliorie per lavorazione con AngularTransmission con FAST.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- 2023/12/01 In MakeMoreFaces, nelle OpenPocket, ammesso utensile con diametro fino a 3 volte la dimensione della tasca (era 2).
-- 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.
-- Tabella per definizione modulo
local ProcessLapJoint = {}
@@ -306,10 +311,15 @@ local function TestElleShape4( Proc)
end
---------------------------------------------------------------------
local function VerifyChainSaw( Proc, dMinDim, dMaxDim)
local function VerifyChainSaw( Proc, dMinDim, dMaxDim, dDepth)
local bUseChainSaw = false
local sMchFind = 'Sawing'
local sSawing = ML.FindSawing( sMchFind)
-- prendo la prima sega a catena lunga a sufficienza
local sSawing = ML.FindSawing( sMchFind, dDepth, true)
-- se non trovo alcuna sega a catena lunga a sufficienza, accetto di non arrivare sul fondo della tasca
if not sSawing then
sSawing = ML.FindSawing( sMchFind, nil, nil, 'Longest')
end
local dMaxMat = 0
local dSawCornerRad = 0
local dSawThick = 0
@@ -547,12 +557,14 @@ local function VerifySideMillAsSaw( Proc, nAddGrpId, vtN, dDiam, dFacElev)
local dToolDiamOnSide = 0
local dThickMillOnSide = 0
local dMaxDepthOnSide = 0
local dTDiamStem = 50
if EgtMdbSetCurrMachining( sMillingOnSide) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolDiamOnSide = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiamOnSide
dThickMillOnSide = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dThickMillOnSide
dMaxDepthOnSide = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or dMaxDepthOnSide
dTDiamStem = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or dTDiamStem
dMaxDepthOnSide = min( EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDEDEPTH', 'd') or 999, 0.5 * ( dToolDiamOnSide - dTDiamStem)) or dMaxDepthOnSide
end
end
local bSpecialMillOnSide = ( dDiam > dThickMillOnSide - 10 * GEO.EPS_SMALL and dFacElev < dMaxDepthOnSide + 10 * GEO.EPS_SMALL)
@@ -770,7 +782,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
end
-- se scanalatura chiusa lavoro la faccia di fondo
if Proc.Topology == 'Pocket' and ( Proc.IsParallel or Proc.AllRightAngles) and not bClosedOrthoFaces then
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, 4)[1]
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, nil, 4)[1]
nFacInd2 = nil
dElev = Proc.Face[ nFacInd + 1].Elevation
end
@@ -1589,7 +1601,7 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
-- distanza di sicurezza per evitare collisioni
dCollSic = BL.CalcCollisionSafety( vtN1)
-- elevazione massima della faccia
dMaxElev = BL.GetFaceElevation( Proc.Id, nFacInd, nPartId)
dMaxElev = BL.GetFaceElevation( Proc, nFacInd, b3Solid)
-- ciclo tutta la tabella
local tPaths = {}
local ptIniPath
@@ -1634,7 +1646,7 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
-- distanza di sicurezza per evitare collisioni
dCollSic = BL.CalcCollisionSafety( vtOrtho)
-- calcolo elevazione dalla faccia trasversale aggiunta
local dSurfIntElev = BL.GetOtherFaceElevation( Proc.Id, nSurfInt, 0)
local dSurfIntElev = BL.GetFaceElevation( nSurfInt, 0, b3Solid)
if bDoubleSide then
dMaxElev = dSurfIntElev
else
@@ -1645,13 +1657,13 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
-- se non è possibile svuotare completamente da una sola parte
if dTMaxDepth <= ( dMaxElev + BD.CUT_EXTRA + dCollSic) then
bDoubleSide = true
dMaxElev = BL.GetOtherFaceElevation( Proc.Id, nSurfInt, 0)
dMaxElev = BL.GetFaceElevation( nSurfInt, 0, b3Solid)
else
dExtraDepth = dMaxElev - BL.GetOtherFaceElevation( Proc.Id, nSurfInt, 0)
dExtraDepth = dMaxElev - BL.GetFaceElevation( nSurfInt, 0, b3Solid)
end
-- altrimenti non è stata fatta completamente calcolo la distanza tra faccia aggiunta e profondità superficie
else
dExtraDepth = dMaxElev - BL.GetOtherFaceElevation( Proc.Id, nSurfInt, 0)
dExtraDepth = dMaxElev - BL.GetFaceElevation( nSurfInt, 0, b3Solid)
end
end
-- normale alla faccia aggiunta
@@ -2691,6 +2703,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
if nOk < 0 then return false, sErr end
end
end
if not dDepth then dDepth = dElev end
-- Recupero le facce adiacenti alla principale
local vAdj = EgtSurfTmFacetAdjacencies( Proc.Id, nFacInd)[1]
if not vAdj or #vAdj == 0 then
@@ -2824,7 +2837,12 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
-- altrimenti con sega a catena
else
-- Recupero la lavorazione
local sSawing = ML.FindSawing( 'Sawing')
local sSawing = ML.FindSawing( 'Sawing', dDepth, true)
-- se non trovo alcuna sega a catena lunga a sufficienza, accetto di non arrivare sul fondo della tasca
if not sSawing then
sSawing = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
end
-- se non trova una lavorazione di sawing esco
if not sSawing then
local sErr = 'Error : Sawing not found in library'
EgtOutLog( sErr)
@@ -2902,7 +2920,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, 0, - dSawWidth / 2))
end
-- imposto angolo 3° asse rot e eventuale angolo suggerito per inizio
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'perpendicular'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, rfFac:getVersZ(), 1))
-- imposto offset radiale
local dOffs = ( i - 1) * dStep
@@ -2925,7 +2943,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
return false, sErr
end
-- impostazione alternativa angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'parallel'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, rfFac:getVersZ(), 2))
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -2942,7 +2960,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
-- altrimenti sega a catena di fianco
else
-- verifico se posso farlo con la sega-catena
local bMakeChainSaw, sSawing2, dMaxMat2, dSawCornerRad2, dSawThick2 = VerifyChainSaw( Proc, dDimMin, dDimMax)
local bMakeChainSaw, sSawing2, dMaxMat2, dSawCornerRad2, dSawThick2 = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth)
if bMakeChainSaw then
-- Calcolo normale faccia da lavorare
local vtNL = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT)
@@ -2970,7 +2988,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
-- imposto uso del lato faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'perpendicular'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtNL, vtOrtho, 1))
-- imposto offset radiale
local dOffs = ( i - 1) * dStep
@@ -2999,7 +3017,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
return false, sErr
end
-- impostazione alternativa angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'parallel'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtNL, vtOrtho, 2))
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -4240,7 +4258,7 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
dCheckDepth = 0.5 * dDepth
else
if not nPathInt then
dCheckDepth = BL.GetFaceElevation( Proc.Id, nFacInd)
dCheckDepth = BL.GetFaceElevation( Proc, nFacInd, b3Solid)
else
dCheckDepth = dDepth
end
@@ -4289,7 +4307,7 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
end
local ptIniPath
local nMaxLen = 0
dMaxElevMaster = BL.GetFaceElevation( Proc.Id, nFacInd)
dMaxElevMaster = BL.GetFaceElevation( Proc, nFacInd, b3Solid)
-- ciclo tutta la tabella
for i = 1, #tFacAdjMain do
-- le 2 facce di contatto devono essere perpendicolari o non sottosquadra rispetto alla faccia di fondo
@@ -4348,13 +4366,13 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
-- se non è possibile svuotare completamente da una sola parte
if dMaxDepth <= ( dMaxElevMaster + BD.CUT_EXTRA + dCollSic) then
bDoubleSide = true
dMaxElevMaster = BL.GetOtherFaceElevation( Proc.Id, nSurfInt, 0)
dMaxElevMaster = BL.GetFaceElevation( nSurfInt, 0, b3Solid)
else
dExtraDepth = dMaxElevMaster - BL.GetOtherFaceElevation( Proc.Id, nSurfInt, 0)
dExtraDepth = dMaxElevMaster - BL.GetFaceElevation( nSurfInt, 0, b3Solid)
end
-- altrimenti non è stata fatta completamente calcolo la distanza tra faccia aggiunta e profondità superficie
else
dExtraDepth = dMaxElevMaster - BL.GetOtherFaceElevation( Proc.Id, nSurfInt, 0)
else
dExtraDepth = dMaxElevMaster - BL.GetFaceElevation( nSurfInt, 0, b3Solid)
end
end
vtN1 = Vector3d(vtOrtho)
@@ -4430,7 +4448,7 @@ local function MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkD
EgtSetMachiningGeometry( {{ Proc.Id, nLundIdFace}})
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT)
-- imposto angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'perpendicular'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
-- imposto offset radiale
local dOffs = ( i - 1) * dStep
@@ -4446,7 +4464,7 @@ local function MakeTunnelByChainSaw( Proc, sSawing, nLundIdFace, vtOrtho, dWorkD
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'parallel'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2))
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -4502,7 +4520,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
-- se scanalatura chiusa lavoro la faccia di fondo
if Proc.Topology == 'Pocket' and ( Proc.IsParallel or Proc.AllRightAngles) and not bClosedOrthoFaces then
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, 4)[1]
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, nil, 4)[1]
nFacInd2 = nil
dFacElev = Proc.Face[ nFacInd + 1].Elevation
end
@@ -4535,7 +4553,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)
local bMakeChainSaw, sSawing, dMaxMat, dSawCornerRad, dSawThick = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth)
if bMakeChainSaw then
-- Ricalcolo l'affondamento tenendo conto di eventuale inclinazione
local dSlDepth
@@ -4897,7 +4915,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
return false, sErr
end
nFacInd = nFacAdj
dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd)
dFacElev = BL.GetFaceElevation( Proc, nFacInd, b3Solid)
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
end
@@ -4935,7 +4953,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
-- per rifinire gli angoli premio utensile diam 25 o da BD
dDiam = min( 2 * dDiam + 10 * GEO.EPS_SMALL, BD.MAXDIAM_POCK_CORNER)
else
dDiam = 2 * dDiam
dDiam = 3 * dDiam
end
end
sMchFindBackUp = sMchFind
@@ -5159,7 +5177,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local tvtNx = {}
tvtNx[2] = vtN
local ptPs = ptC
dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd)
dFacElev = BL.GetFaceElevation( Proc, nFacInd, b3Solid)
dCollSic = BL.CalcCollisionSafety( tvtNx[2])
local dMachDepth = dFacElev + dCollSic
local frFacRec, dFacDim1, dFacDim2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
@@ -5181,7 +5199,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
vAdj[i] = nCount
if vAdj[i] == Proc.Fct - 1 and i ~= nFacInd + 1 then
dV = BL.GetFaceElevation( Proc.Id, i - 1)
dV = BL.GetFaceElevation( Proc, i - 1, b3Solid)
vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT)
end
end
+16 -6
View File
@@ -31,6 +31,9 @@
-- 2023/08/01 Ammesso uso lama da sotto fino a N +3deg in verticale.
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
-- 2023/10/24 Migliorata spezzatura taglio passante con due spezzoni
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- 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.
-- Tabella per definizione modulo
local ProcessLongCut = {}
@@ -498,7 +501,11 @@ end
-- lavorazione faccia laterale con sega a catena
local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal, bShortenStart, bShortenEnd)
-- Recupero i dati dell'utensile
local sSawing = ML.FindSawing( 'Sawing')
local sSawing = ML.FindSawing( 'Sawing', dDepth, true)
-- se non trovo alcuna sega a catena lunga a sufficienza, accetto di non arrivare sul fondo
if not sSawing then
sSawing = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
end
local dMaxMat = 0
local dSawCornerRad = 0
local dSawThick = 0
@@ -533,7 +540,7 @@ local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal, bShor
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'perpendicular'))
local vtN = EgtSurfTmFacetNormVersor( nSurfId, 0, GDB_ID.ROOT)
local vtOrtho = BL.GetVersRef( nFaceUse)
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
@@ -571,7 +578,7 @@ local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal, bShor
return false, sErr
end
-- impostazione alternativa angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'parallel'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2))
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -959,7 +966,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
if bForceUseBladeOnNotThruFace and ( bLimXmin or bLimXmax) then
local nCountMilHead = 0
-- determino la massima elevazione
local dElev = BL.GetFaceElevation( Proc.Id, 0, nPartId)
local dElev = BL.GetFaceElevation( Proc, 0, b3Solid)
-- recupero la lavorazione
local sMilling = ML.FindMilling( 'Long2Cut_H2', dElev, nil, nil, nil, not bCanUseUnderBlade, bCanUseUnderBlade)
if not sMilling then
@@ -1177,6 +1184,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
-- imposto posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto angolo 3° asse rot
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( EgtIf( bIsTopBladeCurrent, sCutting, sCuttingDn), 'perpendicular', b3Raw, vtN, vtOut))
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -1209,7 +1219,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
-- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut
elseif ( nSide ~= - 1 or BD.DOWN_HEAD) and nUseMillOnSide == 0 then
-- determino la massima elevazione
local dElev = BL.GetFaceElevation( Proc.Id, 0, nPartId)
local dElev = BL.GetFaceElevation( Proc, 0, b3Solid)
-- recupero la lavorazione
local bDownHead = ( nSide == - 1)
sMchType = EgtIf( bDownHead, 'Long2Cut_H2', 'Long2Cut')
@@ -1553,7 +1563,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
local dDistToEnd = dToolDiam / 2
local dDistToEndDn = dToolDiamDn / 2
-- calcolo l'elevazione della faccia principale
local dFacElev = BL.GetFaceElevation( Proc.Id, 0, nPartId)
local dFacElev = BL.GetFaceElevation( Proc, 0, b3Solid)
-- se fresa di fianco o da sotto calcolo quanto l'utensile può andare vicino all'estremo con l'elevazione della faccia minore del raggio utensile
if ( nUseMillOnSide <= 1 or nSide == -1) and dFacElev < dToolDiam / 2 then
dDistToEnd = sqrt( dFacElev * ( dToolDiam - dFacElev))
+15 -6
View File
@@ -21,6 +21,8 @@
-- 2023/10/24 Migliorata spezzatura taglio passante con due spezzoni
-- 2023/10/25 Se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco.
-- 2023/11/24 Aggiunta Q05 per utilizzo lama anche in feature cieche conme per LongCut.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- Tabella per definizione modulo
local ProcessLong2Cut = {}
@@ -876,6 +878,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
-- 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())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtN, vtOut))
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -903,8 +909,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
if bForceUseBladeOnNotThruFace then
-- determino la massima elevazione
local dElev = 0
local dFacElev1 = EgtSurfTmFacetElevationInBBox( Proc.Id, tFaceLong[1], b3Solid, GDB_ID.ROOT)
local dFacElev2 = EgtSurfTmFacetElevationInBBox( Proc.Id, tFaceLong[2], b3Solid, GDB_ID.ROOT)
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[1], b3Solid)
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[2], b3Solid)
dElev = max( dFacElev1, dFacElev2)
-- recupero la lavorazione
local sMilling
@@ -1065,6 +1071,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- 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())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtN, vtOut))
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -1079,8 +1088,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
elseif ( nSide ~= -1 or BD.DOWN_HEAD or BD.TURN) and nUseMillOnSide == 0 then
-- determino la massima elevazione
local dElev = 0
local dFacElev1 = EgtSurfTmFacetElevationInBBox( Proc.Id, tFaceLong[1], b3Solid, GDB_ID.ROOT)
local dFacElev2 = EgtSurfTmFacetElevationInBBox( Proc.Id, tFaceLong[2], b3Solid, GDB_ID.ROOT)
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[1], b3Solid)
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[2], b3Solid)
-- se facce concave e a 90 gradi, prendo l'elevazione minima
if bOrtho then
dElev = min( dFacElev1, dFacElev2)
@@ -1450,8 +1459,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local dDistToEnd = dToolDiam / 2
local dDistToEndDn = dToolDiamDn / 2
-- calcolo l'elevazione della faccia principale
local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[vOrd[1]], nPartId)
local dFacElev2 = BL.GetFaceElevation( Proc.Id, tFaceLong[vOrd[2]], nPartId)
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[1]], b3Solid)
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[2]], b3Solid)
-- se fresa di fianco o da sotto calcolo quanto l'utensile può andare vicino al limite se l'elevazione della faccia è minore del raggio utensile
if nUseMillOnSide <= 1 or nSide == -1 then
local dFacElev = max( dFacElev1, dFacElev2)
+3 -2
View File
@@ -13,6 +13,7 @@
-- 2023/06/27 Esclusa la ricerca lati aperti per le mortase passanti, per le quali il contorno finisce sulla faccia e il riconoscimento sbaglia.
-- 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.
-- Tabella per definizione modulo
local ProcessMortise = {}
@@ -126,7 +127,7 @@ end
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
-- imposto angolo 3° asse rot
local vtOrtho = BL.GetVersRef( nFaceUse)
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sMortising, 'perpendicular'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
-- calcolo la lavorazione
if not ML.ApplyMachining( true, false) then
@@ -136,7 +137,7 @@ end
return false, sErr
end
-- impostazione alternativa angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sMortising, 'parallel'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2))
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
+2 -1
View File
@@ -9,6 +9,7 @@
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo
local ProcessProfCamb = {}
@@ -285,7 +286,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( AuxId, vtNF)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then
if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
+2 -1
View File
@@ -7,6 +7,7 @@
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
-- 2023/05/25 Sistemazione SCC per TURN.
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo
local ProcessProfConcave = {}
@@ -289,7 +290,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( AuxId, vtN)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then
if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
+2 -1
View File
@@ -7,6 +7,7 @@
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
-- 2023/05/25 Sistemazione SCC per TURN.
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo
local ProcessProfConvex = {}
@@ -289,7 +290,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( AuxId, vtN)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then
if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
+2 -1
View File
@@ -5,6 +5,7 @@
-- 2022/02/02 Aggiunta funzione OnlyChamfer.
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo
local ProcessProfFront = {}
@@ -236,7 +237,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( AuxId, vtN)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then
if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
+2 -1
View File
@@ -7,6 +7,7 @@
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo
local ProcessProfHead = {}
@@ -271,7 +272,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( AuxId, vtN)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then
if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
+16 -10
View File
@@ -1,4 +1,4 @@
-- ProcessRoundArch.lua by Egaltech s.r.l. 2023/05/18
-- ProcessRoundArch.lua by Egaltech s.r.l. 2023/12/07
-- Gestione calcolo archi per Travi
-- Tabella per definizione modulo
@@ -118,10 +118,13 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- recupero i dati dell'utensile
local dMaxDepth = 0
local bCW = true
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
bCW = ( dSpeed >= 0)
end
end
-- ne verifico la lunghezza per eventuale spezzatura e lavorazione in doppio
@@ -180,6 +183,10 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
end
-- se lavorazione in doppio senza codolo, aggiungo sovrapposizione
if nDouble == 2 and dDimStrip < 10 * GEO.EPS_SMALL then
dDepth = dDepth + BD.MILL_OVERLAP / 2
end
-- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y-
if vtExtr:getY() > 0.707 and nDouble == 1 and bStripOnSide then
bToolInv = true
@@ -188,7 +195,7 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
for i = 1, nStep do
for j = 1, nDouble do
-- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local sName = 'Arch_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sMilling)
if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
@@ -212,20 +219,19 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
end
-- se seconda passata, inverto direzione di lavoro
if j == 2 then
EgtSetMachiningParam( MCH_MP.INVERT, true)
if ( j == 1 and not bToolInv) or ( j == 2 and bToolInv) then
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
else
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
end
-- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- assegno lato di lavoro
if bToolInv then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
-- assegno lato di lavoro (per avere lavorazione climb)
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
-- posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM and not BD.TURN then
nSCC = MCH_SCC.ADIR_XP
if Proc.Head then
nSCC = MCH_SCC.ADIR_XP
elseif Proc.Tail then
+4
View File
@@ -2,6 +2,7 @@
-- Gestione calcolo taglio di lama per Travi
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe).
-- 2022/12/19 Aggiunta gestione testa da sotto.
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- Tabella per definizione modulo
local ProcessSawCut = {}
@@ -229,6 +230,9 @@ function ProcessSawCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTail)
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto angolo 3° asse rot
local vtOut = EgtIf( vtN: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
local _, sErr = EgtGetLastMachMgrError()
+173 -56
View File
@@ -13,7 +13,13 @@
-- 2023/05/09 Aggiunta richiesta risalita preliminare a Zmax per tagli da sopra su macchine PF e ONE.
-- 2023/06/13 Corrette note Precut e Cut per tagli aggiuntivi orizzontali.
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo.
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative.
-- 2024/01/18 Gestita lama con aggregato con asse bloccato per massimizzare capacità di taglio verticale, se da sotto
-- Implementato split per pezzi molto alti con mix sega a catena + lama
-- Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- 2024/01/22 Nei tagli verticali aggiuntivi si usa ora BD.MAX_LEN_DICE come dimensione (era BD.MAX_DIM_DICE).
-- 2024/01/23 Nello split con sega a catena ora si cerca di preferenza una lavorazione di tipo 'SawingForSplitting'. Se non trovata si cerca il tipo 'Sawing' come in precedenza.
-- In split con sega a catena aggiunta estensione start/end del percorso se utensile lungo, per evitare collisioni con il pezzo durante rotazione.
-- Tabella per definizione modulo
local ProcessSplit = {}
@@ -24,6 +30,7 @@ local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local Cut = require( 'ProcessCut')
local Pocket = require( 'FaceByPocket')
local Topology = require( 'FeatureTopology')
EgtOutLog( ' ProcessSplit started', 1)
@@ -158,9 +165,8 @@ end
---------------------------------------------------------------------
-- lavorazione con sega a catena per sezioni alte e larghe
local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
local function MakeSplitByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes, dOffs, bExtendStartEnd)
-- Recupero i dati dell'utensile
local sSawing = ML.FindSawing( 'Sawing')
local dMaxMat = 0
local dSawCornerRad = 0
local dSawThick = 0
@@ -194,15 +200,21 @@ local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
-- imposto uso del lato faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1))
local _, vtN = EgtSurfTmFacetCenter( nSurfId, 0, GDB_ID.ROOT)
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'perpendicular'))
local vtN = EgtSurfTmFacetNormVersor( nSurfId, 0, GDB_ID.ROOT)
local vtOrtho = BL.GetVersRef( nFaceUse)
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
-- imposto offset radiale per mantenere il materiale in coda per la finitura
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
-- imposto allungamento percorso iniziale e finale a zero
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
-- imposto eventuale allungamento percorso iniziale
local dStartAddLen = 0
local dEndAddLen = 0
if bExtendStartEnd then
dStartAddLen = 100
dEndAddLen = 100
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
-- faccio in modo che l'attacco della lama sia dal lato opposto rispetto al corpo macchina
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
@@ -224,7 +236,7 @@ local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
return false, sErr
end
-- impostazione alternativa angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2))
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'parallel'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2))
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -241,6 +253,31 @@ local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
return true, sName, nMchFId
end
---------------------------------------------------------------------
-- tagli verticali aggiuntivi
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes)
local _, dimH = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local nVerticalCuts = ceil( dimH / ( BD.MAX_LEN_DICE)) - 1
local dVerticalSliceHeight = dimH / ( nVerticalCuts + 1)
-- recupero il diametro dell'utensile
local dSawDiam = 400
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
end
end
local bOk, sErr
-- tagli verticali
for j = nVerticalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
local dVerticalCutOffset = dVerticalSliceHeight * -j
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw)
if not bOk then return bOk, sErr end
end
return bOk, sErr
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dOvmTail)
@@ -264,35 +301,35 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
end
-- recupero i dati dell'utensile
local dSawDiam = 400
local dMaxDepth = 50
local dSawMaxDepth = 50
local dSawThick = 2
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
dSawMaxDepth = EgtTdbGetCurrToolMaxDepth() or dSawMaxDepth
dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick
end
end
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
local dMaxVertDepth = dSawMaxDepth - ( BD.DECR_VERT_CUT or 0)
-- recupero la eventuale lavorazione con lama da sotto
local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true)
-- recupero i dati della eventuale seconda lama
local dSawDiam2 = 0
local dMaxDepth2 = 0
local dSawMaxDepth2 = 0
local dSawThick2 = 0
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
dSawMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dSawMaxDepth2
dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2
end
end
-- caratteristiche taglio
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dSawMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dSawMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA))
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
@@ -307,12 +344,14 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
local dLenEndRaw = dOvmTail
local nCuts = 1
local dOffsL = 0
local _, dimH, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local dMinTailScrapForAdditionalCuts = 10.123
if not bSplit then
-- cerco grezzo successivo che sia nella fase
if nNextRawId and EgtVerifyRawPartPhase( nNextRawId, nPhase) then
local b3NextRaw = EgtGetRawPartBBox( nNextRawId)
dLenEndRaw = ptC:getX() - b3NextRaw:getMin():getX()
nCuts = ceil( dLenEndRaw / ( BD.MAX_LEN_SCRAP + 0.5))
nCuts = ceil( dLenEndRaw / ( EgtIf( bBigSectionCut, BD.MAX_DIM_DICE - 0.1, BD.MAX_LEN_SCRAP + 0.5)))
dOffsL = dLenEndRaw / nCuts
-- aggiorno ingombro del grezzo corrente con quello del successivo
b3Raw:Add( b3NextRaw)
@@ -323,56 +362,93 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
if bBigSectionCut then
local bFinishingNeeded = false
if bSplit then
-- recupero lunghezza massima di lavoro della sega a catena
local sSawing = ML.FindSawing( 'Sawing')
local dMaxMat = 0
local dTLen = 0
-- recupero dati utensile della sega a catena più lunga a disposizione
local sSawing = ML.FindSawing( 'SawingForSplitting', nil, nil, 'Longest')
if not sSawing then
sSawing = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
end
local dChainSawMaxMat = 0
local dChainSawLen = 0
if EgtMdbSetCurrMachining( sSawing or '') then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
dTLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dTLen
dChainSawMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dChainSawMaxMat
dChainSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dChainSawLen
end
end
local bigSectionSplitType
-- se pezzo non troppo alto, taglio singolo da sopra
if b3Raw:getDimZ() + BD.CUT_EXTRA_MIN < dChainSawMaxMat + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "single horizontal"
-- se pezzo non troppo largo, taglio singolo da davanti
elseif b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( dChainSawMaxMat, dChainSawLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "single vertical"
-- se pezzo non troppo largo, tagli dai due fianchi (dietro e davanti)
elseif 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( dChainSawMaxMat, dChainSawLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "double vertical"
-- altrimenti taglio con sega a catena da sopra e con lama da sotto
elseif BD.DOWN_HEAD and ( b3Raw:getDimZ() + BD.CUT_EXTRA_MIN < dSawMaxDepth2 + dChainSawMaxMat + 10 * GEO.EPS_SMALL) then
bigSectionSplitType = "double horizontal"
end
-- assegno offset in lunghezza
local dOffs = 0
if dOvmTail > BD.OVM_CHAIN_HBEAM then
dOffs = dOvmTail - BD.OVM_CHAIN_HBEAM
bFinishingNeeded = true
end
-- se pezzo non troppo alto, taglio singolo da sopra
if b3Raw:getDimZ() < dMaxMat - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL then
local cutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN
sNotesSplit = 'Split;'
bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_TOP, cutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
-- se pezzo non troppo largo, taglio singolo da davanti
elseif b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( dMaxMat, dTLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
local cutDepth = b3Raw:getDimY() + BD.CUT_EXTRA_MIN
sNotesSplit = 'Split;'
bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_FRONT, cutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
-- altrimenti tagli dai due fianchi (dietro e davanti)
else
local cutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
-- se la sega a catena non può completare lo split esco
if cutDepth >= min( dMaxMat, dTLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
sErr = 'Error : section too big for splitting'
EgtOutLog( sErr)
return false, sErr, -1
-- in base alle scelte precedenti, applico le lavorazioni
if bigSectionSplitType == "single horizontal" then
local dCutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN
local sNotesSplit = 'Split;'
-- verifico se sega a catena lunga e devo quindi estendere ingresso e uscita perchè è probabile che non riesca a ruotare sopra al pezzo
local bExtendStartEnd
local dMinLengthLongChainSaw = 630
if dChainSawLen > dMinLengthLongChainSaw - 10 * GEO.EPS_SMALL then
bExtendStartEnd = true
end
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, sSawing, MCH_MILL_FU.PARAL_TOP, dCutDepth, sNotesSplit, dOffs, bExtendStartEnd)
if not bOk then return bOk, sErr, nNewPhase end
elseif bigSectionSplitType == "single vertical" then
local dCutDepth = b3Raw:getDimY() + BD.CUT_EXTRA_MIN
local sNotesSplit = 'Split;'
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, sSawing, MCH_MILL_FU.PARAL_FRONT, dCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
elseif bigSectionSplitType == "double vertical" then
local dCutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
local sNotesSplit = 'Presplit;'
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_BACK, cutDepth, sNotesSplit, dOffs)
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, sSawing, MCH_MILL_FU.PARAL_BACK, dCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
sNotesSplit = 'Split;'
bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_FRONT, cutDepth, sNotesSplit, dOffs)
bOk, sErr = MakeSplitByChainSaw( Proc.Id, sSawing, MCH_MILL_FU.PARAL_FRONT, dCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
elseif bigSectionSplitType == "double horizontal" then
-- sega a catena da sopra
local dChainSawCutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN - dSawMaxDepth2
local sNotesSplit = 'Presplit;'
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, sSawing, MCH_MILL_FU.PARAL_TOP, dChainSawCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
-- lama da sotto
local dCutExtra = -dChainSawCutDepth + BD.CUT_EXTRA_MIN
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
local sNotes = 'Split;'
local bMaximizeVerticalDepth = true
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dOffs, 0, 0, sNotes, b3Raw, nil, bMaximizeVerticalDepth)
if not bOk then return false, sErr end
-- se è comunque troppo grande per essere separato, esco
else
local sErr = 'Error : section too big for splitting'
EgtOutLog( sErr)
return false, sErr, -1
end
-- se necessaria finitura, creo nuova fase
if bFinishingNeeded then
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET)
nNewPhase = EgtGetCurrPhase()
nDispId = EgtGetPhaseDisposition( nNewPhase)
local nDispId = EgtGetPhaseDisposition( nNewPhase)
if sDownOrSideOrStd == 'down' then
EgtRotateRawPart( nRawId, X_AX(), 180)
EgtSetInfo( nDispId, 'TYPE', 'MID2')
@@ -415,10 +491,41 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
end
-- se finitura con lama
if nQ05 == 1 or nQ05 == 0 or ( not bSplit and dMaxElev > dSawThickCheck) then
if nQ05 < 2 or ( not bSplit and dMaxElev > dSawThickCheck) then
-- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard
if bSplit or dMaxElev > dSawThickCheck then
local bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT)
local bOk, sErr
if not bSplit and ( dimH > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) then
-- ad ogni offset di taglio dovrò fare prima i tagli verticali e poi i cubetti
for i = nCuts, 1, -1 do
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
-- faccia di taglio all'offset corrente
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
local AddProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId}
Topology.Classify( AddProc, b3Raw)
local dCutOffset = ( i - 1) * dOffsL
local vtMoveSurf = Vector3d( -dCutOffset, 0, 0)
EgtMove( AddId, vtMoveSurf, GDB_RT.GLOB)
-- eventuale faccia di taglio all'offset precedente, per limitare il dicing e evitare di tagliare i cubetti nel vuoto
local nLimitingSurf
if nCuts > 1 then
nLimitingSurf = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
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)
if AreOppositeVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
end
-- tagli verticali
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw, sNotes)
if not bOk then return bOk, sErr end
-- tagli a cubetti con eventuale superficie limitante
bOk, sErr = Cut.Make( AddProc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nLimitingSurf)
end
-- tagli aggiuntivi non necessari
else
bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT)
end
if sNotesFinal then
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
end
@@ -467,11 +574,11 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
elseif b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
else
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
dCutExtra = - ( b3Raw:getDimY() - dSawMaxDepth)
local dSawRad = dSawDiam / 2
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
local dKL = dSawRad - dMaxDepth + EgtIf( bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
local dKL = dSawRad - dSawMaxDepth + EgtIf( bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
local dMinSawingLength = 5
if BD.C_SIMM then
@@ -490,9 +597,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
end
-- per travi alte faccio faccio dei tagli orizzontali aggiuntivi
local _, _, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local dMinTailScrapForHorizontalCuts = 10.123
local bAreHorizontalCutsNeeded = not bSplit and ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForHorizontalCuts - 10 * GEO.EPS_SMALL)
local bAreHorizontalCutsNeeded = not bSplit and ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL)
if bAreHorizontalCutsNeeded then
local nHorizontalCuts = ceil ( dimV / BD.MAX_DIM_DICE) - 1
local dHorizontalSliceHeight = dimV / ( nHorizontalCuts + 1)
@@ -535,6 +640,12 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
-- se trave larga effettuo tagli verticali aggiuntivi
if not bSplit and ( dimH > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) then
local sSpecNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = AddVerticalPreCuts( Proc, sCutting, dCutOffset, b3Raw, sSpecNotes)
if not bOk then return bOk, sErr end
end
local sNotes
if bSplit then
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
@@ -558,14 +669,14 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
end
-- verifico che le due lame riescano a lavorare la sezione
local dDimZ = b3Raw:getDimZ()
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
local dExtra = dMaxVertDepth + dSawMaxDepth2 - dDimZ
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not bBigSectionCut then
local sErr = 'Error : section too big for tail cut'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo extra taglio ed accorciamento
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
local dCutExtra = -dSawMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dAccStart = 0
-- limiti da sotto
@@ -575,12 +686,18 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw, nil, true)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
-- se trave larga effettuo tagli verticali aggiuntivi
if not bSplit and ( dimH > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) then
local sSpecNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = AddVerticalPreCuts( Proc, sCutting, dCutOffset, b3Raw, sSpecNotes)
if not bOk then return bOk, sErr end
end
local sNotes
if bSplit then
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
+3 -1
View File
@@ -1,6 +1,7 @@
-- ProcessVariant.lua by Egaltech s.r.l. 2023/11/08
-- Gestione calcolo Feature Custom (Variant) per Travi
-- 2023/11/08 Creazione modulo.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo
local ProcessVariant = {}
@@ -72,6 +73,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
local function MakePocket( Proc, nRawId, b3Raw, nPartId)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- recupero gli indici delle facce da lavorare
local vFace = EgtGetInfo( Proc.Id, 'Faces', 'vi')
if not vFace or #vFace == 0 then
@@ -83,7 +85,7 @@ local function MakePocket( Proc, nRawId, b3Raw, nPartId)
local dTotDepth = 0
local vDepth = {}
for i = 1, #vFace do
vDepth[i] = BL.GetFaceElevation( Proc.Id, vFace[1], nPartId)
vDepth[i] = BL.GetFaceElevation( Proc, vFace[1], b3Solid)
dTotDepth = max( dTotDepth, vDepth[i])
end
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, vFace[1], GDB_ID.ROOT)
+13 -4
View File
@@ -140,6 +140,7 @@ local function MyProcessBeams()
', Lmax='..EgtNumToString( BD.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BD.MinRaw + BD.OVM_MID, 0)..')',
{'Lunghezza grezzo', EgtNumToString( BD.STD_RAW, 0)},
{'Sovramateriale di testa', EgtNumToString( BD.OVM_HEAD, 0)},
{'Offset intermedio', EgtNumToString( BD.OVM_MID, 0)},
{'Forza sezione verticale', ' CB:true,*false'},
{'Ordina per lunghezza', ' CB:true,*false'})
if not vsVal then
@@ -164,9 +165,17 @@ local function MyProcessBeams()
EgtDraw()
return false
end
local dOvmMid = EgtEvalNumExpr( vsVal[3])
if not dOvmMid then
local sOut = 'Offset intermedio : ' .. vsVal[3]
EgtOutLog( sOut)
EgtOutBox( sOut, 'Lavora Travi', 'WARNING')
EgtDraw()
return false
end
-- Sistemo sezione barra con travi
local bVert = ( vsVal[3] == 'true')
local bVert = ( vsVal[4] == 'true')
if bVert then
if dRawW > dRawH then dRawW, dRawH = dRawH, dRawW end
end
@@ -206,7 +215,7 @@ local function MyProcessBeams()
end
-- Se richiesto, ordino le travi in senso di lunghezza crescente
local bOrd = ( vsVal[4] == 'true')
local bOrd = ( vsVal[5] == 'true')
if bOrd then
table.sort( vBeam, function( B1, B2)
if abs( B1.Box:getDimX() - B2.Box:getDimX()) < 1 then
@@ -226,7 +235,7 @@ local function MyProcessBeams()
end
-- Sistemo le travi nel grezzo
local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam)
if not bOk then
EgtOutLog( sErr)
EgtOutBox( sErr, 'Lavora Travi', 'ERROR')
+31 -11
View File
@@ -1,37 +1,57 @@
==== Beam Update Log ====
Versione 2.5l3 (08/01/2023)
- Modif : modifiche per centrare i pezzi in Y sulla tavola (da flag BeamData.CENTER_BEAM)
- Modif : resi più veloci i calcoli di FeatureTopology
- Modif : migliorato calcolo attacco/uscite lame in FacesBySaw.
Versione 2.5l2 (20/12/2023)
- Modif : in Cut e DoubleCut modifica in scelta ribaltamento trave quando si è in condizioni downUp
- Modif : migliorato e esteso il funzionamento di SideMillAsSaw
- Modif : in LapJoint con più facce, nelle OpenPocket, ammesso utensile con diametro fino a 3 volte la dimensione della tasca (era 2)
- Modif : in RoundArch aggiunta gestione senso di rotazione fresa per lavorare sempre in concordanza
- Fixed : correzione a GetFaceWithMostAdj per calcoli con facce che fanno ombra
Versione 2.5l1 (01/12/2023)
- Added : in LongDoubleCut aggiunta Q05 per utilizzo lama anche in feature cieche conme per LongCut
- Modif : Migliorato e velocizzato il calcolo elevazione (EgtSurfTmFacetElevationInBBox)
- Fixed : in MakeTwo di FacesBySaw raffinamento calcolo vtRef per casi dubbi.
Versione 2.5k3 (28/11/2023)
- Added : in Long2Cut gestite lavorazioni lama con Q05 come in LongCut.
Versione 2.5k2 (06/11/2023)
- Added : in LapJoint, per L020, gestita lavorazione speciale gradino scala con fresatura + lama, attivata con Q09.
- Fixed : in ProcessSplit si imposta l'ingombro asse C correttamente anche per teste con asse rotante C con un solo braccio
- Added : in LapJoint, per L020, gestita lavorazione speciale gradino scala con fresatura + lama, attivata con Q09
- Fixed : in ProcessSplit si imposta l'ingombro asse C correttamente anche per teste con asse rotante C con un solo braccio.
Versione 2.5k1 (02/11/2023)
- Modif : in LapJoint gestito caso groove due facce >90° con fresa, se forzato da parametro Q
- Modif : in LongCut e LongDoubleCut migliorata spezzatura taglio passante con due spezzoni
- Modif : nei tagli di lama migliorata gestione con percorso bilinea
- Modif : in LapJoint 2 facce longitudinali si usa taglio di lama solo se si taglia completamente, altrimenti fresa
- Modif : in LapJoint 2 facce longitudinali si usa taglio di lama solo se si taglia completamente, altrimenti fresa.
Versione 2.5j1 (23/10/2023)
- Added : in Process (lancio da EgtCAM5 quindi uso praticamente solo interno) aggiunta possibilità di tenere ordine pezzi in barra come da selezione
- Fixed : piccola correzione a Classify di FeatureTopology per casi senza geometria
- Fixed : in HeadCut e Split corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
- Fixed : in Lapjoint -> MakePocket aggiunto messaggio in caso si rovini il pezzo successivo
- Modif : in Topology aggiunti casi al check solo direzione principale
- Modif : nella ricerca lavorazione da usare controllo di utensile attivo sostituito con controllo utensile presente nel setup corrente
- Fixed : piccola correzione a Classify di FeatureTopology per casi senza geometria
- Fixed : in HeadCut e Split corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
- Fixed : in Lapjoint -> MakePocket aggiunto messaggio in caso si rovini il pezzo successivo.
Versione 2.5i2 (27/09/2023)
- Added : aggiunto riconoscimento sottosquadro da facce non adiacenti
- Modif : in lavorazione tenoni per Turn si assegna SCC per privilegiare accesso dal lato corto della trave.
- Fixed : in LapJoint corretto caso tunnel lungo non lavorato correttamente
- Fixed : in foratura quando errore in applicazione lavorazione si inverte e riprova solo se singola su foro aperto
- Modif : in lavorazione tenoni per Turn si assegna SCC per privilegiare accesso dal lato corto della trave.
Versione 2.5i1 (12/09/2023)
- Fixed : in LapJoint gestito correttamente il ritorno nil di GetUShapeWidth [Ticket #1354]
- Modif : in Cut abbassato a 590 mm il limite per convertire in LongCut [Ticket #1448].
- Modif : in Cut abbassato a 590 mm il limite per convertire in LongCut [Ticket #1448]
- Fixed : in LapJoint gestito correttamente il ritorno nil di GetUShapeWidth [Ticket #1354].
Versione 2.5h2 (11/08/2023)
- Modif : in LapJoint e Mortise modificata posizione braccio per FAST quando vicino alla coda della trave
- Fixed : corrette forature con aggregato quando lato aperto
- Fixed : in RidgeLap corretto ingombro lavorazione in testa e coda quando rivolta verso il basso
- Modif : in LapJoint e Mortise modificata posizione braccio per FAST quando vicino alla coda della trave.
- Fixed : in RidgeLap corretto ingombro lavorazione in testa e coda quando rivolta verso il basso.
Versione 2.5h1 (07/08/2023)
- Fixed : tagli doppi di lato non effettuati se macchina tipo PF e pezzo alto [Ticket #1400]
+3 -3
View File
@@ -1,6 +1,6 @@
-- Version.lua by Egaltech s.r.l. 2023/11/16
-- Version.lua by Egaltech s.r.l. 2024/01/24
-- Gestione della versione di Beam
NAME = 'Beam'
VERSION = '2.5k4'
MIN_EXE = '2.5c1'
VERSION = '2.6a1'
MIN_EXE = '2.6a1'