Compare commits

...

87 Commits

Author SHA1 Message Date
luca.mazzoleni c796a5351f - Hotfix: se testa sopra/sotto la distanza minima feature per attivare le tasche in doppio MIRROR_POCKETS_MIN_DISTANCE diventa 35 2025-10-28 16:42:42 +01:00
luca.mazzoleni eb09d0b65d Merge branch 'release/2.7j1' 2025-10-28 12:56:39 +01:00
andrea.villa 6f14e4f2c2 In ProcessMortise, se diametro utensile esattamente uguale a larghezza tasca, e tasca tonda, si setta un offset radiale negativo 2025-10-27 11:51:19 +01:00
andrea.villa 950060f4dc In ProcessMortise si considera il raggio minimo impostato da parametro P 2025-10-27 09:51:57 +01:00
andrea.villa 1007e08e9d Se lamavorazione di base ha il flag "inverti", allora il flag si deve togliere. 2025-10-17 13:25:02 +02:00
andrea.villa 04acc25535 In DtTenon, si controlla la somma di tutti i grezzi successivi e non solo il primo successivo 2025-10-10 15:37:29 +02:00
andrea.villa 38e26b9e48 Piccola modifica ordinamento feature 2025-10-07 10:11:15 +02:00
luca.mazzoleni 72b7cbac1b Merge tag '2.7i2' into develop
2.7i2
2025-09-30 10:16:16 +02:00
luca.mazzoleni 5f1b863013 Merge branch 'release/2.7i2' 2025-09-30 10:16:05 +02:00
luca.mazzoleni 250802048a update log e version 2025-09-30 10:15:55 +02:00
andrea.villa a8d0bcfec4 In DtTenon, aumentato angolo limite per decidere se ribaltare trave 2025-09-25 10:01:59 +02:00
andrea.villa 459eff5610 In Long2Cut, se le due facce sono ortogonali, si predilige lavorazione perpendicolare, con minore elevazione. 2025-09-23 12:51:31 +02:00
andrea.villa a749895229 In DtTenon, si controlla grezzo successivo per decidere se è necessario tagliare dal basso per ridurre sporgenza trave. 2025-09-18 09:32:50 +02:00
andrea.villa 04489421e7 In ProcessCut, si fa taglio verso Z solo se è possibile avere una direzione di taglio orizzontale e non in verticale. Altrimenti cerca sempre di scegliere in verticale. 2025-09-18 08:42:57 +02:00
andrea.villa 0c16b5e969 In LapJoint, revert della modifica fatta 12-09-2025 . Se la feature veniva lavorata giusto prima dello scarico, la pinza di scarico, che non si poteva più spostare, andava in extra-corsa. 2025-09-17 09:20:09 +02:00
andrea.villa 9193924fbd In Long2Cut, aggiunta tolleranza per calcolo SCC 2025-09-15 17:01:24 +02:00
andrea.villa adbd5e944e In Long2Cut, se lavorazione non completa si prova a lavorare altra facia solo se la feature è composta da due facce 2025-09-12 13:21:33 +02:00
andrea.villa f76797cbd8 In LapJoint, se non è trave corta e la feature è aperta in coda, si sposta dopo separazione a patto che non sia più lunga di metà trave circa 2025-09-12 12:56:42 +02:00
andrea.villa 09e93d600d In DtMortise, se il percorso sul quale calcolare antischeggia non è piano, si salta la lavorazione. 2025-09-03 15:04:20 +02:00
andrea.villa 63f4df2a7d Merge remote-tracking branch 'origin/master' into develop 2025-09-03 10:29:07 +02:00
andrea.villa 80c5035c74 #HOTFIX# Passaggio finitura tenone P14>0
- Corretto calcolo FaceUse
- Si cicla sulle ultime 5 facce anziché solo ultima
2025-09-03 10:28:53 +02:00
luca.mazzoleni c9451e65e1 Merge tag '2.7i1' into develop
2.7i1
2025-09-03 09:25:59 +02:00
luca.mazzoleni 19706d6264 Merge branch 'release/2.7i1' 2025-09-03 09:25:48 +02:00
luca.mazzoleni 46ca7c793f update version e log 2025-09-03 09:25:31 +02:00
andrea.villa e26540193c Aggiunto passaggio di finitura in caso il tenone non cominci dal bordo della trave (P14 > 0) 2025-09-02 15:35:20 +02:00
andrea.villa af107a780e Piccola modifica a valori di ritorno della funzione GetFaceWithMostAdj 2025-09-02 11:55:27 +02:00
andrea.villa 4befa4eee3 Gestione della funzione EgtSurfTmFacetElevationInClosedSurfTm in caso ritorni nil 2025-09-02 10:50:11 +02:00
luca.mazzoleni 07db2da825 - in LapJoint miglioria a TestTwoFacesDownHead 2025-08-28 16:40:21 +02:00
luca.mazzoleni a4e6600510 Merge tag '2.7h3' into develop
2.7h3
2025-08-26 08:46:18 +02:00
luca.mazzoleni cb8465d977 Merge branch 'release/2.7h3' 2025-08-26 08:46:12 +02:00
luca.mazzoleni e867e1decf update log e version 2025-08-26 08:46:04 +02:00
luca.mazzoleni 1cd697cf80 Merge branch 'ConsiderHeadTailCutsForElevation' into develop 2025-08-21 17:40:18 +02:00
luca.mazzoleni 729143ce45 - in BeamExec sia nelle dipendenze che dopo l'ordinamento si mettono i tagli di testa e coda troncanti sempre dopo taglio di testa e coda, rispettivamente;
- in LapJoint se Front Slot sul retro e pezzo lungo si setta di coda
2025-08-21 16:47:07 +02:00
luca.mazzoleni 3f707396bb - in BeamExec si salvano gli id delle eventuali feature troncanti di testa e coda nella parte, per poterle poi usare per ricalcolare l'elevazione
- in LapJoint, per svuotature, se possibile si ricalcolano le elevazioni in caso di feature troncanti
- in BeamLib rivista IsFeatureCuttingEntireSection, allineata con BeamNew
2025-08-20 17:39:08 +02:00
luca.mazzoleni 2b3a36a496 Merge tag '2.7h2' into develop
2.7h2
2025-08-19 10:21:19 +02:00
luca.mazzoleni d9e4285748 Merge branch 'release/2.7h2' 2025-08-19 10:21:07 +02:00
luca.mazzoleni 91d5b0ac84 update log e version 2025-08-19 10:20:34 +02:00
luca.mazzoleni db5334217b - in StepJointNotch se 3 facce si chiama LapJoint
- in LapJoint -> MachineByMill, in lavorazione faccia inclinata, se utensile troppo più grande dell'originale si salta la lavorazione
2025-08-08 17:15:08 +02:00
luca.mazzoleni 54c835f717 - in LapJoint migliorata spezzatura per feature lunghe rispetto al pezzo 2025-08-08 13:04:58 +02:00
luca.mazzoleni 86e2324856 - in Lapjoint lunghe si suddivide usando sempre ENDLEN per evitare problemi di pinzaggio. In futuro (o versione nuova) trattare come LongCut e usare EndLen agli estremi e MaxLen in mezzo 2025-08-08 11:39:26 +02:00
luca.mazzoleni 36f4014969 - in ProcessDrill in foratura in doppio si riduce lo step solo se foro passante e almeno 2 step 2025-08-08 09:52:14 +02:00
luca.mazzoleni 7248c44406 - migliorie a ottimizzazione teste 2025-08-07 17:37:37 +02:00
luca.mazzoleni 044a074b76 - in LapJoint migliorie a SawPlusChain 2025-08-06 17:26:15 +02:00
luca.mazzoleni c0e3dab107 Merge tag '2.7h1' into develop
2.7h1
2025-08-05 09:16:28 +02:00
luca.mazzoleni 2b2157c971 Merge branch 'release/2.7h1' 2025-08-05 09:16:18 +02:00
luca.mazzoleni 8c697d73ac update version e log 2025-08-05 09:15:37 +02:00
luca.mazzoleni c35d032da8 Merge branch 'feature/TrimmedMortiseFix' into develop 2025-07-23 18:10:36 +02:00
luca.mazzoleni 7447d3cc1b - in Mortise implementata lavorazione contorno non trimmato in caso di trim in/out non uniforme 2025-07-23 17:20:10 +02:00
andrea.villa bfdf80a44a In ProfCamb, creato nuovo tipo di lavorazione 'Prof_end' ed eliminata gestione Q06 fatta in precedenza 2025-07-21 08:44:25 +02:00
andrea.villa 3755521d2e In LapJoint, se bUseBHSideMill, si considera feature di coda a patto che il pezzo sia più lungo di VERY_SHORT 2025-07-17 10:01:28 +02:00
andrea.villa 104663a89a In LapJoint, riduzione massimo materiale lama per lavorazioni antischeggia di lama con direzione verticale. 2025-07-15 16:46:10 +02:00
luca.mazzoleni e322c15099 Merge branch 'master' into develop 2025-07-14 12:45:36 +02:00
luca.mazzoleni 5f55bc2f42 Merge branch 'develop' 2025-07-14 12:43:48 +02:00
luca.mazzoleni 6c3a16d59c update log e version 2025-07-14 12:43:23 +02:00
andrea.villa 8218fcc438 In FaceBySaw, corretto calcolo CompLength in caso di ?PerpendicularOutraw' 2025-07-14 12:41:49 +02:00
luca.mazzoleni 6a83320321 Merge tag '2.7g4' into develop
2.7g4
2025-07-11 17:44:17 +02:00
luca.mazzoleni b8b5ab2a65 Merge branch 'release/2.7g4' 2025-07-11 17:44:09 +02:00
luca.mazzoleni e27998599b update log e version 2025-07-11 17:43:53 +02:00
andrea.villa a386c74516 Ripristinato calcolo uso lama sotto in caso di rabbet in LapJoint - TestTwoFacesDownHead 2025-07-11 17:41:31 +02:00
luca.mazzoleni bb9dc261c1 Merge tag '2.7g3' into develop
2.7g3
2025-07-11 14:40:57 +02:00
luca.mazzoleni 0e2067e802 Merge branch 'release/2.7g3' 2025-07-11 14:40:50 +02:00
luca.mazzoleni 3008196992 update log e version 2025-07-11 14:40:31 +02:00
luca.mazzoleni 876e45e1a4 - in RidgeLap correzione alla direzione di lavoro cubetti 2025-07-11 13:03:02 +02:00
luca.mazzoleni fa4d3ab9f6 Merge branch 'master' into develop 2025-07-11 09:20:46 +02:00
luca.mazzoleni 4e6c38d82c update log 2025-07-11 09:20:33 +02:00
luca.mazzoleni d3e1ac5805 update version 2025-07-11 09:17:07 +02:00
luca.mazzoleni bc017d0de7 Merge branch 'master' into develop 2025-07-10 14:57:04 +02:00
luca.mazzoleni 18e180cd12 Merge branch 'develop' 2025-07-10 14:56:33 +02:00
luca.mazzoleni 6d8d32c9fb Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2025-07-10 14:33:46 +02:00
luca.mazzoleni 20074c6ea0 - in LapJoint correzione importante a sega a catena 2025-07-10 14:33:35 +02:00
andrea.villa 806864e360 Merge remote-tracking branch 'origin/master' into develop 2025-07-09 15:42:20 +02:00
andrea.villa 052407a9be Merge branch 'develop' 2025-07-09 15:42:02 +02:00
andrea.villa b5660a8431 In LongDoubleCut corretta lavorazione aggiunta erroneamente dopo separazione 2025-07-09 15:41:35 +02:00
luca.mazzoleni 103d8d7eec Merge tag '2.7g1' into develop
2.7g1
2025-07-08 18:11:09 +02:00
luca.mazzoleni df47842888 Merge branch 'release/2.7g1' 2025-07-08 18:10:58 +02:00
luca.mazzoleni 5db475bcf7 update version e log 2025-07-08 18:10:42 +02:00
luca.mazzoleni 010e1421c7 - in LapJoint, attacco laterale con sega a catena temporaneamente disabilitato, finchè non si risolvono i problemi di movimentazione in macchina 2025-07-08 15:24:34 +02:00
luca.mazzoleni e908562ab6 Merge branch 'feature/DeepDtMortise' into develop 2025-07-02 09:51:37 +02:00
luca.mazzoleni aba4ebecc4 - in LapJoint per sega a catena con attacco laterale step minimo da sotto portato a 260 per macchine tipo PF 2025-07-02 09:51:25 +02:00
luca.mazzoleni a022ecbb7d Merge branch 'develop' into feature/DeepDtMortise 2025-07-01 12:20:04 +02:00
andrea.villa 605f0fcaf1 Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2025-06-30 17:53:47 +02:00
andrea.villa 2676d67737 Merge branch 'FinishSmallMillProf' into develop 2025-06-30 17:52:39 +02:00
luca.mazzoleni a996d4beb3 - in LapJoint correzioni a sega a catena con attacco laterale 2025-06-30 16:13:19 +02:00
luca.mazzoleni 919f71481c Merge branch 'develop' into feature/DeepDtMortise 2025-06-27 09:21:16 +02:00
luca.mazzoleni d0283d7885 Merge branch 'develop' into feature/DeepDtMortise 2025-06-23 17:12:32 +02:00
luca.mazzoleni ccf88745aa Merge branch 'develop' into feature/DeepDtMortise 2025-06-19 10:59:15 +02:00
luca.mazzoleni b5145d4e99 - in MachiningLib si gestisce sortingCriterion anche per fresatura
- in DtMortise gestita lavorazione a più passate per mortasa profonda
- in DtTenon se profondità elevata si cerca una fresa più lunga
2025-06-17 09:46:18 +02:00
16 changed files with 800 additions and 220 deletions
+126 -18
View File
@@ -442,7 +442,7 @@ local function CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
local b3TailBox local b3TailBox
for i = 1, #vProc do for i = 1, #vProc do
local Proc = vProc[i] local Proc = vProc[i]
if Proc.Box and not Proc.Box:isEmpty() then 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.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 if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then
dHeadX = Proc.Box:getCenter():getX() dHeadX = Proc.Box:getCenter():getX()
@@ -467,6 +467,7 @@ end
local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH) local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
local nReplacedFeatureId = nil local nReplacedFeatureId = nil
local bHeadFinishingNeeded = true local bHeadFinishingNeeded = true
local nCuttingFeatureId = nil
for i = 1, #vProc do for i = 1, #vProc do
local Proc = vProc[i] local Proc = vProc[i]
-- controllo se esiste già una feature taglio di testa -- controllo se esiste già una feature taglio di testa
@@ -481,15 +482,19 @@ local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
if Proc.Head and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 340 then if Proc.Head and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 340 then
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria -- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
bHeadFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH) bHeadFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
if not bHeadFinishingNeeded and ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) and ( Proc.Flg > 0) then
nCuttingFeatureId = Proc.Id
end
end end
end end
return bHeadFinishingNeeded, nReplacedFeatureId return bHeadFinishingNeeded, nReplacedFeatureId, nCuttingFeatureId
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH) local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
local nReplacedFeatureId = nil local nReplacedFeatureId = nil
local bTailFinishingNeeded = true local bTailFinishingNeeded = true
local nCuttingFeatureId = nil
for i = 1, #vProc do for i = 1, #vProc do
local Proc = vProc[i] local Proc = vProc[i]
-- controllo se esistè già una feature taglio di coda -- controllo se esistè già una feature taglio di coda
@@ -504,9 +509,12 @@ local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
if Proc.Tail and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 350 then if Proc.Tail and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 350 then
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria -- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
bTailFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH) bTailFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
if not bTailFinishingNeeded and ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) and ( Proc.Flg > 0) then
nCuttingFeatureId = Proc.Id
end
end end
end end
return bTailFinishingNeeded, nReplacedFeatureId return bTailFinishingNeeded, nReplacedFeatureId, nCuttingFeatureId
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
@@ -600,6 +608,17 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
local b3Part = EgtGetBBoxGlob( Pz or GDB_ID.NULL, GDB_BB.EXACT) local b3Part = EgtGetBBoxGlob( Pz or GDB_ID.NULL, GDB_BB.EXACT)
local b3Solid = vBeam[i].Box local b3Solid = vBeam[i].Box
if b3Part:isEmpty() or b3Solid:isEmpty() then break end if b3Part:isEmpty() or b3Solid:isEmpty() then break 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)
local bSFinishingNeeded, nReplacedHeadCutFeatureId, nHeadCuttingFeatureId = AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
local bEFinishingNeeded, nReplacedTailCutFeatureId, nTailCuttingFeatureId = AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
-- Scrivo gli di delle facce di taglio custom: serviranno dopo per calcolare l'elevazione rispetto a queste
if nHeadCuttingFeatureId then
EgtSetInfo( vBeam[i].Id, 'HEADCUTFEATUREID', nHeadCuttingFeatureId)
end
if nTailCuttingFeatureId then
EgtSetInfo( vBeam[i].Id, 'TAILCUTFEATUREID', nTailCuttingFeatureId)
end
if bBigSectionCut then if bBigSectionCut then
-- lascio in coda solo il materiale necessario; il resto verrà tolto nell'head cut successivo -- lascio in coda solo il materiale necessario; il resto verrà tolto nell'head cut successivo
local lastB3Solid = nil local lastB3Solid = nil
@@ -612,9 +631,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
dOffset = dOvmMid dOffset = dOvmMid
end end
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)
local bSFinishingNeeded, nReplacedHeadCutFeatureId = AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
local iSQ05Value = nil local iSQ05Value = nil
if nReplacedHeadCutFeatureId then if nReplacedHeadCutFeatureId then
iSQ05Value = EgtGetInfo( nReplacedHeadCutFeatureId, 'Q05', 'i') iSQ05Value = EgtGetInfo( nReplacedHeadCutFeatureId, 'Q05', 'i')
@@ -624,7 +640,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
else else
DeltaSMin = BD.OVM_BLADE_HBEAM DeltaSMin = BD.OVM_BLADE_HBEAM
end end
local bEFinishingNeeded, nReplacedTailCutFeatureId = AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
local iEQ05Value = nil local iEQ05Value = nil
if nReplacedTailCutFeatureId then if nReplacedTailCutFeatureId then
iEQ05Value = EgtGetInfo( nReplacedTailCutFeatureId, 'Q05', 'i') iEQ05Value = EgtGetInfo( nReplacedTailCutFeatureId, 'Q05', 'i')
@@ -780,7 +795,82 @@ local function PrintFeatures( vProc, b3Raw)
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function OrderFeatures( vProc, b3Raw) -- mi assicuro che i tagli di testa e coda troncanti (usati per ridurre i percorsi utensile in testa e coda) siano sempre fatti per primi
local function ReorderTruncatingCuts( vProc, nPartId)
if not nPartId or #vProc == 0 then return end
local nHeadCuttingFeatureId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i')
local nTailCuttingFeatureId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i')
-- tagli di testa
-- 1: si trovano gli indici del taglio di testa e del rispettivo taglio troncante
local nHeadCutIndex, nHeadCuttingFeatureIndex
for index, value in ipairs( vProc) do
if value.Prc == 340 then
nHeadCutIndex = index
end
if value.Id == nHeadCuttingFeatureId then
nHeadCuttingFeatureIndex = index
end
end
-- 2: se non c'è il taglio di testa, il taglio troncante è il primo. Se c'è il taglio di testa, il taglio troncante lo deve seguire.
if not nHeadCutIndex and nHeadCuttingFeatureIndex then
local HeadCuttingFeature = vProc[ nHeadCuttingFeatureIndex]
table.remove( vProc, nHeadCuttingFeatureIndex)
table.insert( vProc, 1, HeadCuttingFeature)
elseif nHeadCutIndex and nHeadCuttingFeatureIndex then
if abs( nHeadCutIndex - nHeadCuttingFeatureIndex) ~= 1 then
local HeadCut = vProc[ nHeadCutIndex]
local HeadCuttingFeature = vProc[ nHeadCuttingFeatureIndex]
table.remove( vProc, nHeadCutIndex)
-- rimuovere il primo potrebbe aver cambiato l'indice del secondo
if nHeadCutIndex < nHeadCuttingFeatureIndex then
nHeadCuttingFeatureIndex = nHeadCuttingFeatureIndex - 1
end
table.remove( vProc, nHeadCuttingFeatureIndex)
table.insert( vProc, nHeadCutIndex, HeadCut)
table.insert( vProc, nHeadCutIndex + 1, HeadCuttingFeature)
end
end
-- tagli di coda
-- 1: si trovano gli indici del taglio di coda e del rispettivo taglio troncante
local nTailCutIndex, nTailCuttingFeatureIndex
for index, value in ipairs( vProc) do
if value.Prc == 350 then
nTailCutIndex = index
end
if value.Id == nTailCuttingFeatureId then
nTailCuttingFeatureIndex = index
end
end
-- 2: il taglio di coda c'è sempre. Il taglio troncante lo deve seguire.
if nTailCutIndex and nTailCuttingFeatureIndex then
if abs( nTailCutIndex - nTailCuttingFeatureIndex) ~= 1 then
local TailCut = vProc[ nTailCutIndex]
local TailCuttingFeature = vProc[ nTailCuttingFeatureIndex]
table.remove( vProc, nTailCutIndex)
-- rimuovere il primo potrebbe aver cambiato l'indice del secondo
if nTailCutIndex < nTailCuttingFeatureIndex then
nTailCuttingFeatureIndex = nTailCuttingFeatureIndex - 1
end
table.remove( vProc, nTailCuttingFeatureIndex)
table.insert( vProc, nTailCutIndex, TailCut)
table.insert( vProc, nTailCutIndex + 1, TailCuttingFeature)
end
end
return true
end
-------------------------------------------------------------------------------------------------------------
local function OrderFeatures( vProc, b3Raw, nPartId)
local dDrillPenalty = EgtIf( BD.PRESS_ROLLER, 200, 100) local dDrillPenalty = EgtIf( BD.PRESS_ROLLER, 200, 100)
local dSmallDrillRange = EgtIf( b3Raw:getDimX() < BD.LEN_SHORT_PART, BD.DRILL_RANGE_SP or 200, BD.DRILL_RANGE or 600) local dSmallDrillRange = EgtIf( b3Raw:getDimX() < BD.LEN_SHORT_PART, BD.DRILL_RANGE_SP or 200, BD.DRILL_RANGE or 600)
@@ -901,12 +991,12 @@ local function OrderFeatures( vProc, b3Raw)
if abs( B2.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then if abs( B2.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then
return not ( B1.Tail or B2.Box:getMin():getX() + 20 > B1.Box:getCenter():getX()) return not ( B1.Tail or B2.Box:getMin():getX() + 20 > B1.Box:getCenter():getX())
end end
-- se primo è foro e l'altro no, lo penalizzo -- se primo è foro e l'altro no, lo penalizzo (a patto che il foro non attraversi nessuna feature)
if Drill.Identify(B1) and not Drill.Identify(B2) then if Drill.Identify(B1) and not B1.Dependency and not Drill.Identify(B2) then
return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty) return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty)
end end
-- se primo è altro e secondo è foro, lo premio -- se primo è altro e secondo è foro, lo premio (a patto che il foro non attraversi nessuna feature)
if not Drill.Identify(B1) and Drill.Identify(B2) then if not Drill.Identify(B1) and not B2.Dependency and Drill.Identify(B2) then
return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX()) return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX())
end end
-- se prima è mortasa coda di rondine sul fianco e secondo taglio longitudinale, la coda di rondine va sempre prima -- se prima è mortasa coda di rondine sul fianco e secondo taglio longitudinale, la coda di rondine va sempre prima
@@ -1099,6 +1189,8 @@ local function OrderFeatures( vProc, b3Raw)
end end
end end
end end
ReorderTruncatingCuts( vProc, nPartId)
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
@@ -2021,7 +2113,7 @@ local function AreDrillingsMirrored( Proc, ProcMirror, b3Raw)
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
function GetFeatureInfoAndDependency( vProc, b3Raw) function GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
-- ciclo tutte le feature -- ciclo tutte le feature
for i = 1, #vProc do for i = 1, #vProc do
local Proc = vProc[i] local Proc = vProc[i]
@@ -2062,6 +2154,22 @@ function GetFeatureInfoAndDependency( vProc, b3Raw)
end end
end end
end end
-- verifiche per tagli troncanti testa e coda: devono sempre essere subito dopo il taglio di testa e il taglio di coda, rispettivamente
local nHeadCuttingFeatureId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i')
local nTailCuttingFeatureId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i')
if Proc.Prc == 340 and ProcB == nHeadCuttingFeatureId then
Proc.Dependency = {}
Proc.Dependency.ExecBefore = ProcB
elseif Proc == nHeadCuttingFeatureId and ProcB.Prc == 340 then
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
elseif Proc.Prc == 350 and ProcB == nTailCuttingFeatureId then
Proc.Dependency = {}
Proc.Dependency.ExecBefore = ProcB
elseif Proc == nTailCuttingFeatureId and ProcB.Prc == 350 then
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
end
end end
end end
end end
@@ -2073,13 +2181,13 @@ function BeamExec.ProcessFeatures()
end end
-- costanti per doppio -- costanti per doppio
MIRROR_DRILLINGS_MIN_DISTANCE = 40 MIRROR_DRILLINGS_MIN_DISTANCE = 40
MIRROR_POCKETS_MIN_DISTANCE = 50 MIRROR_POCKETS_MIN_DISTANCE = EgtIf( BD.DOWN_HEAD, 35, 50)
-- verifica se possibile rotazione di 90 gradi -- verifica se possibile rotazione di 90 gradi
BD.ROT90 = BD.ROT90 and Verify90DegRotation( EgtGetFirstRawPart()) BD.ROT90 = BD.ROT90 and Verify90DegRotation( EgtGetFirstRawPart())
-- ciclo sui pezzi -- ciclo sui pezzi
local nTotErr = 0 local nTotErr = 0
local Stats = {} local Stats = {}
local nOrd = 1 local nOrd = 1
local nRawId = EgtGetFirstRawPart() local nRawId = EgtGetFirstRawPart()
while nRawId do while nRawId do
-- verifico che il grezzo contenga pezzi oppure sia abbastanza lungo da essere scaricato coi carrelli -- verifico che il grezzo contenga pezzi oppure sia abbastanza lungo da essere scaricato coi carrelli
@@ -2103,7 +2211,7 @@ function BeamExec.ProcessFeatures()
-- recupero le feature di lavorazione della trave -- recupero le feature di lavorazione della trave
local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT) local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
-- recupero informazioni ausiliarie feature e dipendenze tra feature stesse -- recupero informazioni ausiliarie feature e dipendenze tra feature stesse
GetFeatureInfoAndDependency( vProc, b3Raw) GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
-- verifica presenza forature influenzate da lavorazioni di testa o coda -- verifica presenza forature influenzate da lavorazioni di testa o coda
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
@@ -2115,7 +2223,7 @@ function BeamExec.ProcessFeatures()
SetMirroredFeatures( vProc, b3Raw) SetMirroredFeatures( vProc, b3Raw)
end end
-- le ordino lungo X -- le ordino lungo X
OrderFeatures( vProc, b3Raw) OrderFeatures( vProc, b3Raw, nPartId)
-- le classifico -- le classifico
local bAllOk, bSomeDown, bSomeSide, bSplitRot = ClassifyFeatures( vProc, b3Raw, Stats) local bAllOk, bSomeDown, bSomeSide, bSplitRot = ClassifyFeatures( vProc, b3Raw, Stats)
if not bAllOk then if not bAllOk then
+23 -2
View File
@@ -551,7 +551,7 @@ function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
local nAddGrpId = BeamLib.GetAddGroup( nPartId) local nAddGrpId = BeamLib.GetAddGroup( nPartId)
if not nAddGrpId then if not nAddGrpId then
EgtOutLog( 'Error : missing AddGroup') EgtOutLog( 'Error : missing AddGroup')
return 0, 0, 0 return 0, 0, 0, 0
end end
-- verifico eventuale intersezione tra la faccia i-1 esima e la proiezione dell'altra sulla stessa -- verifico eventuale intersezione tra la faccia i-1 esima e la proiezione dell'altra sulla stessa
local nShadowFacetId = EgtCopySurfTmFacet( nSurfId, j - 1, nAddGrpId) local nShadowFacetId = EgtCopySurfTmFacet( nSurfId, j - 1, nAddGrpId)
@@ -899,6 +899,27 @@ function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
return nFaceIndMax, ptC, vtN return nFaceIndMax, ptC, vtN
end end
---------------------------------------------------------------------
function BeamLib.GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrtho)
local _, EdgesEgt = EgtSurfTmGetFacetOutlineInfo( nSurfId, nFacet, GDB_ID.ROOT)
local nEdgeIndMax = 0
local dMaxComp = - GEO.INFINITO
for i = 1, #EdgesEgt do
local vtN = EdgesEgt[i].Norm
if EdgesEgt[i].Open then
vtN = -vtN
end
local dComp = vtN * vtOrtho
if dComp > dMaxComp then
nEdgeIndMax = i -1
dMaxComp = dComp
end
end
return nEdgeIndMax
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function BeamLib.GetTunnelDimension( Proc, nPartId) function BeamLib.GetTunnelDimension( Proc, nPartId)
-- sono necessarie almeno due facce -- sono necessarie almeno due facce
@@ -1168,7 +1189,7 @@ end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H -- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
function BeamLib.IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH) function BeamLib.IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH)
return ((abs(b3Proc:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or b3Proc:getDimY() > dRawW) and (abs(b3Proc:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or b3Proc:getDimZ() > dRawH)) return ( b3Proc:getDimY() > ( dRawW - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( dRawH - 500 * GEO.EPS_SMALL))
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
+2 -2
View File
@@ -83,8 +83,8 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
if BD.KIOTP then Ktp = BD.KIOTP end if BD.KIOTP then Ktp = BD.KIOTP end
if ( sLeadInOutType == 'PerpendicularOutraw') then if ( sLeadInOutType == 'PerpendicularOutraw') then
bLioTang = false bLioTang = false
dLiCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra dLiCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)
dLoCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra dLoCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)
dLiTang = 1 dLiTang = 1
dLoTang = 1 dLoTang = 1
dLiPerp = 0 dLiPerp = 0
+2 -2
View File
@@ -80,7 +80,7 @@ end
-- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa -- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa
local function ConfirmNextMachining() local function ConfirmNextMachining()
-- utensile corrente -- utensile corrente
local sToolUuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sToolUuid = EgtGetMachiningParam( MCH_MP.TUUID)
local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '') local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '')
EgtTdbSetCurrTool( sToolName or '') EgtTdbSetCurrTool( sToolName or '')
-- testa dell'utensile corrente -- testa dell'utensile corrente
@@ -331,7 +331,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
local bOptimizeHeads = BEAM and BEAM.BW and ( not sSortingCriterion or sSortingCriterion == '') local bOptimizeHeads = ( not sSortingCriterion or sSortingCriterion == '')
if bTopHead == nil and bDownHead == nil then if bTopHead == nil and bDownHead == nil then
bTopHead = true bTopHead = true
bDownHead = false bDownHead = false
+1 -1
View File
@@ -627,7 +627,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
local vtOrthoO local vtOrthoO
if bFromBottom and dCutV < dMaxDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then if bFromBottom and dCutV < dMaxDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
vtOrthoO = -Z_AX() vtOrthoO = -Z_AX()
elseif ( bHorizCut or ( dCutV < dMaxDepth - BD.CUT_EXTRA and not bVertCutOk)) and elseif ( bHorizCut and not bVertCutOk) and
( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or ( vtN:getX() > 0 and vtN:getZ() <= 0.708) or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then ( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or ( vtN:getX() > 0 and vtN:getZ() <= 0.708) or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then
vtOrthoO = Z_AX() vtOrthoO = Z_AX()
elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and
+2 -2
View File
@@ -642,8 +642,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local dStep = EgtGetMachiningParam( MCH_MP.STEP) local dStep = EgtGetMachiningParam( MCH_MP.STEP)
local nNumStep = ceil( dDepth/dStep) local nNumStep = ceil( dDepth/dStep)
local dRealStep = dDepth / nNumStep local dRealStep = dDepth / nNumStep
-- Se nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno -- Se foro passante e nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno
if ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then if bOpen and ( nNumStep > 1) and ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then
dRealStep = ceil( dDepth / (nNumStep - 1)) dRealStep = ceil( dDepth / (nNumStep - 1))
EgtSetMachiningParam( MCH_MP.STEP, dRealStep) EgtSetMachiningParam( MCH_MP.STEP, dRealStep)
sMyWarn ='Warning in drill-double : step changed to ' .. tostring(dRealStep) .. 'mm' sMyWarn ='Warning in drill-double : step changed to ' .. tostring(dRealStep) .. 'mm'
+211 -90
View File
@@ -104,7 +104,7 @@ function ProcessDtMortise.GetCutPlane( Proc)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid) local function CalcPathAtHeight( nProcId, AuxId, nAddGrpId, dHeight, dSideAng, b3Solid)
-- copio la curva di base -- copio la curva di base
local NewAuxId = EgtCopyGlob( AuxId, nAddGrpId) local NewAuxId = EgtCopyGlob( AuxId, nAddGrpId)
if not NewAuxId then return end if not NewAuxId then return end
@@ -112,7 +112,7 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
EgtAddCurveCompoLineTg( NewAuxId, 100, false) EgtAddCurveCompoLineTg( NewAuxId, 100, false)
EgtAddCurveCompoLineTg( NewAuxId, 100, true) EgtAddCurveCompoLineTg( NewAuxId, 100, true)
EgtMergeCurvesInCurveCompo( NewAuxId) EgtMergeCurvesInCurveCompo( NewAuxId)
local dOffset = dAltMort * tan( dSideAng) local dOffset = dHeight * tan( dSideAng)
if not EgtOffsetCurve( NewAuxId, dOffset) then return end if not EgtOffsetCurve( NewAuxId, dOffset) then return end
-- la limito entro la trave -- la limito entro la trave
local refBox = Frame3d( b3Solid:getMin()) local refBox = Frame3d( b3Solid:getMin())
@@ -120,7 +120,7 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
local nCount local nCount
NewAuxId, nCount = EgtTrimFlatCurveWithBox( NewAuxId, refBox, vtBoxDiag, true, true, GDB_RT.GLOB) NewAuxId, nCount = EgtTrimFlatCurveWithBox( NewAuxId, refBox, vtBoxDiag, true, true, GDB_RT.GLOB)
-- eseguo traslazione e offset per portarla sul top -- eseguo traslazione e offset per portarla sul top
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dAltMort - 10 * GEO.EPS_SMALL) local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dHeight - 10 * GEO.EPS_SMALL)
EgtMove( NewAuxId, vtMove, GDB_RT.GLOB) EgtMove( NewAuxId, vtMove, GDB_RT.GLOB)
-- se divisa in più parti, le unisco congiungendole con segmenti -- se divisa in più parti, le unisco congiungendole con segmenti
if nCount > 1 then if nCount > 1 then
@@ -137,6 +137,23 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
return NewAuxId return NewAuxId
end end
---------------------------------------------------------------------
local function GetVerticalSteps( dMachiningDepth, dStep )
local MachiningSteps = {}
MachiningSteps.StepLength = 0
if dMachiningDepth <= 0 then
MachiningSteps.Count = 0
return MachiningSteps
end
MachiningSteps.Count = ceil( (dMachiningDepth - 10 * GEO.EPS_SMALL) / dStep )
MachiningSteps.StepLength = dMachiningDepth / MachiningSteps.Count
return MachiningSteps
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- verifica che il box includa il punto in XY -- verifica che il box includa il punto in XY
function EnclosesPoint( b3Box, ptP) function EnclosesPoint( b3Box, ptP)
@@ -155,6 +172,8 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local sWarn
bMakeAntiSplitPath = true
-- ingombro del pezzo -- ingombro del pezzo
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
if not b3Solid then if not b3Solid then
@@ -289,12 +308,56 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
bCW = ( dSpeed >= 0) bCW = ( dSpeed >= 0)
end end
end end
-- verifico che la profondità non superi il massimo materiale dell'utensile local bMultipleZPasses = false
-- se necessario, cerco un utensile più lungo
if dAltMort > dMaxMat + 10 * GEO.EPS_SMALL then if dAltMort > dMaxMat + 10 * GEO.EPS_SMALL then
local sErr = 'Error : DtMortise Depth bigger than Tool Cutting edge' -- recupero la lavorazione : prima ricerca per sola tipologia
EgtOutLog( sErr) sMilling = ML.FindMilling( sMillType..sMchExt, nil, nil, nil, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
return false, sErr if not sMilling and bMillUp then
sMilling = ML.FindMilling( sMillType, nil, nil, nil, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
end
if not sMilling then
local sErr = 'Milling not found in library : Error on DtMortise ' .. tostring( Proc.Id)
EgtOutLog( sErr)
return false, sErr
end
-- recupero la lavorazione : seconda ricerca con tipologia e diametro massimo
sMilling = ML.FindMilling( sMillType..sMchExt, nil, nil, 2 * dMinRad, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
if not sMilling and bMillUp then
sMilling = ML.FindMilling( sMillType, nil, nil, 2 * dMinRad, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
sMchExt = ''
end
if not sMilling then
local sErr = 'Radius too small : Error on DtMortise ' .. tostring( Proc.Id)
EgtOutLog( sErr)
return false, sErr
end
if not sMilling then
local sErr = 'Error : DtMortise Depth bigger than Tool Cutting edge'
EgtOutLog( sErr)
return false, sErr
end
-- riassegno dati utensile
dToolDiam = 100
dMaxMat = 30
dSideAng = 0
bCW = true
bMillOnAggregate = sMchExt == '_AT'
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
dToolDiam = max( dToolDiam, 10)
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
bCW = ( dSpeed >= 0)
end
end
bMultipleZPasses = true
end end
-- tastatura se richiesta -- tastatura se richiesta
local Info = { vtProbe = vtExtr, ptProbe = ptBC, sType = 'DTMortise', sHead = sHeadTool} local Info = { vtProbe = vtExtr, ptProbe = ptBC, sType = 'DTMortise', sHead = sHeadTool}
@@ -382,93 +445,101 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr return false, sErr
end end
-- calcolo il percorso top mortise -- calcolo il percorso top mortise
local nAuxId1 = CalcTopPath( Proc.Id, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid) local nAuxId1 = CalcPathAtHeight( Proc.Id, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
-- se esiste il percorso -- se esiste il percorso
if nAuxId1 then if nAuxId1 then
-- creo percorso sulla parte alta della mortasa if EgtCurveIsFlat( nAuxId1) then
local dToolRadDelta = dAltMort * tan( dSideAng) -- creo percorso sulla parte alta della mortasa
local dTopDiam = dToolDiam + 2 * dToolRadDelta local dToolRadDelta = dAltMort * tan( dSideAng)
-- recupero punto iniziale e finale del percorso local dTopDiam = dToolDiam + 2 * dToolRadDelta
local ptStart = EgtSP( nAuxId1, GDB_RT.GLOB) -- recupero punto iniziale e finale del percorso
local ptEnd = EgtEP( nAuxId1, GDB_RT.GLOB) local ptStart = EgtSP( nAuxId1, GDB_RT.GLOB)
if ptStart and ptEnd then local ptEnd = EgtEP( nAuxId1, GDB_RT.GLOB)
local nId1 if ptStart and ptEnd then
-- se richiesti due segmenti di linea local nId1
if not bMakeAsByArc then -- se richiesti due segmenti di linea
-- determino il punto comune dei due segmenti if not bMakeAsByArc then
local vtDelta = ( ptEnd - ptStart) / 4 -- determino il punto comune dei due segmenti
vtDelta:rotate( vtExtr, -90) local vtDelta = ( ptEnd - ptStart) / 4
local ptMid = ( ptStart + ptEnd) / 2 + vtDelta vtDelta:rotate( vtExtr, -90)
-- creo la spezzata formata dai due segmenti local ptMid = ( ptStart + ptEnd) / 2 + vtDelta
nId1 = EgtCurveCompoFromPoints( nAddGrpId, { ptStart, ptMid, ptEnd}, GDB_RT.GLOB) -- creo la spezzata formata dai due segmenti
-- altrimenti richiesto arco nId1 = EgtCurveCompoFromPoints( nAddGrpId, { ptStart, ptMid, ptEnd}, GDB_RT.GLOB)
-- altrimenti richiesto arco
else
-- direzione del segmento
local vtDir = ptEnd - ptStart ;
local dLen = vtDir:len()
vtDir:normalize()
-- direzioni tangenti iniziale e finale
local vtStart = EgtSV( nAuxId1, GDB_RT.GLOB)
local vtEnd = EgtEV( nAuxId1, GDB_RT.GLOB)
-- angoli
local dAngStart = acos( vtStart * vtDir)
local dAngEnd = acos( vtEnd * vtDir)
local dMaxAng = min( 30, dAngStart, dAngEnd)
if dLen < dTopDiam then
dMaxAng = min( dMaxAng, asin( dLen / dTopDiam))
end
local vtTg = vtDir ; vtTg:rotate( vtExtr, -dMaxAng)
-- creo l'arco
nId1 = EgtArc2PV( nAddGrpId, ptStart, ptEnd, vtTg, GDB_RT.GLOB)
end
if not nId1 then
local sErr = 'Wrong geometry : Error on DtMortise '
EgtOutLog( sErr)
return false, sErr
end
EgtModifyCurveExtrusion( nId1, vtExtr, GDB_RT.GLOB)
-- inserisco la lavorazione di contornatura anti splint
local sNameF = 'DtMtAS_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ nId1, -1}})
-- setto affondamento pari all'altezza della mortsasa
EgtSetMachiningParam( MCH_MP.DEPTH, dAltMort)
-- setto offset radiale con aggiunto un ulteriore allargamento di 1mm
EgtSetMachiningParam( MCH_MP.OFFSR, dToolRadDelta - 1)
-- antischeggia sempre con una passata
if bMultipleZPasses then
EgtSetMachiningParam( MCH_MP.STEP, 0)
end
-- sistemo il lato e la direzione di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
-- se necessario, imposto SCC
if nSCC then
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end
-- dichiaro non si generano sfridi per VMill
local sUserNotes = 'MaxElev='.. EgtNumToString( dAltMort, 1) .. '; VMRS=0;'
-- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= nMyPrevDouble then
nMyPrevDouble = Proc.Double
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
end
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
else else
-- direzione del segmento local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
local vtDir = ptEnd - ptStart ;
local dLen = vtDir:len()
vtDir:normalize()
-- direzioni tangenti iniziale e finale
local vtStart = EgtSV( nAuxId1, GDB_RT.GLOB)
local vtEnd = EgtEV( nAuxId1, GDB_RT.GLOB)
-- angoli
local dAngStart = acos( vtStart * vtDir)
local dAngEnd = acos( vtEnd * vtDir)
local dMaxAng = min( 30, dAngStart, dAngEnd)
if dLen < dTopDiam then
dMaxAng = min( dMaxAng, asin( dLen / dTopDiam))
end
local vtTg = vtDir ; vtTg:rotate( vtExtr, -dMaxAng)
-- creo l'arco
nId1 = EgtArc2PV( nAddGrpId, ptStart, ptEnd, vtTg, GDB_RT.GLOB)
end
if not nId1 then
local sErr = 'Wrong geometry : Error on DtMortise '
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
EgtModifyCurveExtrusion( nId1, vtExtr, GDB_RT.GLOB)
-- inserisco la lavorazione di contornatura anti splint
local sNameF = 'DtMtAS_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ nId1, -1}})
-- setto affondamento pari all'altezza della mortsasa
EgtSetMachiningParam( MCH_MP.DEPTH, dAltMort)
-- setto offset radiale con aggiunto un ulteriore allargamento di 1mm
EgtSetMachiningParam( MCH_MP.OFFSR, dToolRadDelta - 1)
-- sistemo il lato e la direzione di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
-- se necessario, imposto SCC
if nSCC then
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end
-- dichiaro non si generano sfridi per VMill
local sUserNotes = 'MaxElev='.. EgtNumToString( dAltMort, 1) .. '; VMRS=0;'
-- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= nMyPrevDouble then
nMyPrevDouble = Proc.Double
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
end
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
else else
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id) sWarn = 'Warning : skipped DoveTail mortise antisplint'
EgtOutLog( sErr)
return false, sErr
end end
else else
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id) local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
@@ -484,6 +555,23 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local nPass = ceil( dDist / ( 1.9 * dToolDiam)) local nPass = ceil( dDist / ( 1.9 * dToolDiam))
local dStep = 0 local dStep = 0
if nPass > 1 then dStep = max( ( dDist - 2 * dToolDiam) / ( 2 * nPass - 2), 0.25 * dToolDiam) end if nPass > 1 then dStep = max( ( dDist - 2 * dToolDiam) / ( 2 * nPass - 2), 0.25 * dToolDiam) end
local dVerticalStep = 0
if bMultipleZPasses then
local dToolVerticalStep = 0
if EgtMdbSetCurrMachining( sMilling) then
dToolVerticalStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP) or 0
end
if dToolVerticalStep < 10 * GEO.EPS_SMALL then
dToolVerticalStep = dMaxMat / 3
else
dToolVerticalStep = min( dToolVerticalStep, dMaxMat / 3)
end
local VerticalSteps = GetVerticalSteps( dAltMort, dToolVerticalStep)
dVerticalStep = VerticalSteps.StepLength
nPass = VerticalSteps.Count
end
for i = nPass, 1, -1 do for i = nPass, 1, -1 do
-- inserisco la lavorazione di contornatura -- inserisco la lavorazione di contornatura
local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass) local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)
@@ -494,10 +582,39 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr return false, sErr
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) local GeomId = AuxId
if ( i > 1) and bMultipleZPasses then
local dCurrentHeight = dAltMort - ( ( nPass - i + 1) * dVerticalStep)
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error : missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
local b3MortiseNoPocket = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
GeomId = CalcPathAtHeight( Proc.Id, AuxId, nAddGrpId, dCurrentHeight, dSideAng, b3MortiseNoPocket)
if not GeomId then
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
EgtOutLog( sErr)
return false, sErr
end
end
EgtSetMachiningGeometry( {{ GeomId, -1}})
-- imposto offset -- imposto offset
local dOffs = ( i - 1) * dStep local dOffs = ( i - 1) * dStep
if bMultipleZPasses then
if i > 1 then
dOffs = 1
else
dOffs = 0
end
end
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
-- in caso di passate in Z già calcolate lo step deve essere nullo per garantire passate singole
if bMultipleZPasses then
EgtSetMachiningParam( MCH_MP.STEP, 0)
end
-- sistemo il lato e la direzione di lavoro -- sistemo il lato e la direzione di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT)) EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true)) EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
@@ -534,7 +651,11 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end end
-- dichiaro massima elevazione e assenza sfridi per VMill -- dichiaro massima elevazione e assenza sfridi per VMill
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';' local dMaxElev = dMaxMat
if bMultipleZPasses then
dMaxElev = dVerticalStep
end
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo -- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
if bPocket then if bPocket then
sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3) sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3)
@@ -559,7 +680,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr return false, sErr
end end
end end
return true return true, sWarn
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
+143 -10
View File
@@ -64,14 +64,14 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
-- se tenone praticamente in asse, accetto fino a -22 deg -- se tenone praticamente in asse, accetto fino a -22 deg
if abs( vtN:getY()) < 0.088 then if abs( vtN:getY()) < 0.088 then
return ( vtN:getZ() >= -0.375) return ( vtN:getZ() >= -0.375)
-- altrimenti, accetto fino a -10 deg -- altrimenti, accetto fino a -12.5 deg
else else
return ( vtN:getZ() >= -0.174) return ( vtN:getZ() >= -0.216)
end end
-- altrimenti -- altrimenti
else else
-- accetto fino a -7deg -- accetto fino a -12.5 deg
return ( vtN:getZ() >= -0.122) return ( vtN:getZ() >= -0.216)
end end
end end
@@ -209,7 +209,20 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc) CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
-- se esiste grezzo successivo non serve tagliare dal basso
local bFromBottom
local dTotalLength = 0
local nNextRawId = EgtGetNextRawPart( nRawId)
while nNextRawId do
dTotalLength = dTotalLength + EgtGetRawPartBBox( nNextRawId):getDimX()
nNextRawId = EgtGetNextRawPart( nNextRawId)
end
if dTotalLength > BD.MinRaw and not Proc.Tail then
bFromBottom = false
else
bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
end
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
@@ -236,11 +249,32 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
bCW = ( dSpeed >= 0) bCW = ( dSpeed >= 0)
end end
end end
-- verifico che l'altezza non superi il massimo materiale dell'utensile -- se necessario, cerco un utensile più lungo
if dDtTenH > dMaxMat + 10 * GEO.EPS_SMALL then if dDtTenH > dMaxMat + 10 * GEO.EPS_SMALL then
local sErr = 'Error : DtTenon Height bigger than Tool Cutting edge' sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown, nil, nil, 'Longest')
EgtOutLog( sErr) if not sMilling then
return false, sErr local sErr = 'Error : milling not found in library'
EgtOutLog( sErr)
return false, sErr
end
if not sMilling then
local sErr = 'Error : DtTenon Height bigger than Tool Cutting edge'
EgtOutLog( sErr)
return false, sErr
end
-- riassegno dati utensile
dTDiam = 50
dMaxMat = 30
bCW = true
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
bCW = ( dSpeed >= 0)
end
end
end end
-- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0) -- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0)
local dMaxDist local dMaxDist
@@ -331,8 +365,107 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
BL.UpdateTCING( nRawId, dOffs) BL.UpdateTCING( nRawId, dOffs)
end end
end end
-- si controllano le ultime 5 facce della feature
local nIndFace = -1
for i = 1, 5 do
if abs( vtExtr * EgtSurfTmFacetNormVersor( Proc.Id, Proc.Fct-i, GDB_ID.ROOT)) < GEO.EPS_ANG_SMALL then
nIndFace = Proc.Fct-i
end
end
-- controllo se serve passaggio di finitura in caso il tenone non cominci dal bordo della trave (P14 > 0)
if nIndFace > 0 then
-- verifico se almeno uno dei punti iniziale e finale della curva giace in uno dei piani limite del pezzo, quindi se è un lato aperto
local bOpen = false
local ptIni = EgtSP( AuxId, GDB_RT.GLOB)
local ptFin = EgtEP( AuxId, GDB_RT.GLOB)
if ( abs( ptIni:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL or abs( ptFin:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or
( abs( ptIni:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL or abs( ptFin:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or
( abs( ptIni:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL or abs( ptFin:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or
( abs( ptIni:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL or abs( ptFin:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or
( abs( ptIni:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL or abs( ptFin:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or
( abs( ptIni:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL or abs( ptFin:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL) then
bOpen = true
end
-- se entrambi i punti non sono sul limite pezzo
if not bOpen then
-- recupero la lavorazione
sMillType = 'Tenon'
sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
if not sMilling then
local sErr = 'Error : milling to finish the tenon not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
bCW = ( dSpeed >= 0)
end
-- inserisco la passata finale della lavorazione
local sNameF = 'TenF_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, nIndFace}})
-- sistemo i parametri
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
-- sistemo il lato e la direzione di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
EgtSetMachiningParam( MCH_MP.LITANG, 0.7 * dTDiam)
EgtSetMachiningParam( MCH_MP.LIPERP, 20)
EgtSetMachiningParam( MCH_MP.LOTANG, 0.7 * dTDiam)
EgtSetMachiningParam( MCH_MP.LOPERP, 20)
local nFaceUse
if vtExtr:getX() > -GEO.EPS_SMALL then
nFaceUse = MCH_MILL_FU.PARAL_LEFT
else
nFaceUse = MCH_MILL_FU.PARAL_RIGHT
end
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto elevazione
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dDtTenH, 1)) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if BD.TURN then
if abs( vtAx:getY()) > abs( vtAx:getZ()) then
nSCC = EgtIf( vtAx:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
else
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
end
elseif not BD.C_SIMM then
nSCC = MCH_SCC.ADIR_YM
if abs( vtExtr:getY()) > 0.088 then
nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
end
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end
end
end
return true return true
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
return ProcessDtTenon return ProcessDtTenon
+122 -43
View File
@@ -145,6 +145,7 @@ local Q_BLADE_ON_ALONG_FACE = '' -- i
local Q_MAX_ELEVATION = '' -- d local Q_MAX_ELEVATION = '' -- d
local Q_SAW_PLUS_CHAIN = '' -- i local Q_SAW_PLUS_CHAIN = '' -- i
local Q_FORCE_CHAINSAW = '' -- i local Q_FORCE_CHAINSAW = '' -- i
local Q_CHAINSAW_FROM_SIDE = '' -- i
-- variabile smussi -- variabile smussi
@@ -192,7 +193,8 @@ local function AssignQIdent( Proc)
Q_STAIRCASE = '' Q_STAIRCASE = ''
Q_SAW_PLUS_CHAIN = 'Q11' Q_SAW_PLUS_CHAIN = 'Q11'
Q_FORCE_CHAINSAW = 'Q12' Q_FORCE_CHAINSAW = 'Q12'
Q_NO_ROTATION = 'Q13' -- TODO da riportare a Q13 quando è sistemata la gestione del movimento in macchina nell'attacco laterale
Q_CHAINSAW_FROM_SIDE = 'Q999'
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
Q_FORCE_BLADE = 'Q01' -- i Q_FORCE_BLADE = 'Q01' -- i
@@ -792,9 +794,10 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
-- verifico se è in coda -- verifico se è in coda
local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX() local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX()
if ( dEndDist > BD.MAX_DIST_HTFEA) or bUseBHSideMill then if ( dEndDist > BD.MAX_DIST_HTFEA) or bUseBHSideMill then
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 and b3Solid:getDimX() > BD.LEN_VERY_SHORT_PART then
return true return true
else -- se Front Slot e pezzo abbastanza lungo si rimanda la decisione a più avanti
elseif not ( ( Proc.Prc == 17) and ( b3Solid:getDimX() > ( BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART))) then
return false return false
end end
end end
@@ -967,7 +970,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
end end
end end
local bNoRotation = ( EgtGetInfo( Proc.Id, Q_NO_ROTATION, 'i') or 0) == 1 local bNoRotation = ( EgtGetInfo( Proc.Id, Q_CHAINSAW_FROM_SIDE, 'i') or 0) == 1
if bDown and bNoRotation then if bDown and bNoRotation then
bDown = false bDown = false
end end
@@ -3094,7 +3097,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
return false, sErr return false, sErr
end end
local bGoFromHead = true local bGoFromHead = true
local bAttackFromSide = ( ( EgtGetInfo( Proc.Id, Q_NO_ROTATION, 'i') or 0) == 1) local bAttackFromSide = ( ( EgtGetInfo( Proc.Id, Q_CHAINSAW_FROM_SIDE, 'i') or 0) == 1)
and ( Proc.Fct == 4) and ( Proc.Topology == 'Groove') and ( Proc.Fct == 4) and ( Proc.Topology == 'Groove')
-- se normale lungo Z è da sopra: si tenta attacco laterale se richiesto -- se normale lungo Z è da sopra: si tenta attacco laterale se richiesto
if AreSameOrOppositeVectorApprox( Proc.Face[ nFacInd + 1].VtN, Z_AX()) then if AreSameOrOppositeVectorApprox( Proc.Face[ nFacInd + 1].VtN, Z_AX()) then
@@ -3211,7 +3214,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
if vtRef and ( vtRef:getY() > 0.5 or vtRef:getZ() < -0.1) then if vtRef and ( vtRef:getY() > 0.5 or vtRef:getZ() < -0.1) then
vtRef = -vtRef vtRef = -vtRef
end end
if not ( Proc.Topology == 'Tunnel') then if bAttackFromSide then
dDimMin = min( Proc.Face[ nFacInd + 1].Width, Proc.Face[ nFacInd + 1].Height) dDimMin = min( Proc.Face[ nFacInd + 1].Width, Proc.Face[ nFacInd + 1].Height)
dDimMax = min( Proc.Face[ nFacAdj + 1].Width, Proc.Face[ nFacAdj + 1].Height) dDimMax = min( Proc.Face[ nFacAdj + 1].Width, Proc.Face[ nFacAdj + 1].Height)
nLundIdFace = nFacAdj nLundIdFace = nFacAdj
@@ -3224,6 +3227,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
vtRef = -Z_AX() vtRef = -Z_AX()
nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, -Z_AX()) nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, -Z_AX())
end end
else
nFaceZ = nFacInd
end end
dDepth = Proc.Face[ nFaceZ + 1].Elevation dDepth = Proc.Face[ nFaceZ + 1].Elevation
end end
@@ -3259,7 +3264,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
local dOffs = ( i - 1) * dStep local dOffs = ( i - 1) * dStep
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
local dMachiningDepth = dDepth local dMachiningDepth = dDepth
if Proc.Topology == 'Tunnel' then if not bAttackFromSide then
-- se possibile aumento l'affondamento pari al raggio corner + 1 -- se possibile aumento l'affondamento pari al raggio corner + 1
if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then
dMachiningDepth = ( dDepth + dSawCornerRad2 + 1) dMachiningDepth = ( dDepth + dSawCornerRad2 + 1)
@@ -3284,24 +3289,33 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
EgtOutLog( sWarn) EgtOutLog( sWarn)
end end
EgtSetMachiningParam( MCH_MP.DEPTH, dMachiningDepth) EgtSetMachiningParam( MCH_MP.DEPTH, dMachiningDepth)
local dStartAddLen = dSawWidth / 2 + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + EgtMdbGetGeneralParam( MCH_GP.SAFEAGGRBOTTZ) -- si decidono lato di lavoro, inversione e estensione in base al lato aperto
local dEndAddLen = - dSawWidth / 2 local nEdgeIndex = BL.GetEdgeToMachineFromVector( Proc.Id, nFacAdj, vtRef)
if vtRef:getZ() > 10 * GEO.EPS_SMALL then local EdgesEgt = BL.GetEdgesInfo( Proc, Proc.Face[nFacAdj+1])
local CurrentEdge = EdgesEgt[nEdgeIndex+1]
local dStartAddLen = 0
local dEndAddLen = 0
if CurrentEdge.IsStartOpen then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.INVERT, false)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.LEFT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
end end
dStartAddLen = dSawWidth / 2 + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + EgtMdbGetGeneralParam( MCH_GP.SAFEAGGRBOTTZ)
dEndAddLen = - dSawWidth / 2
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
end end
-- in caso di attacco esterno si setta in modo da fare un primo step adeguato per evitare finecorsa -- in caso di attacco esterno si setta in modo da fare un primo step adeguato per evitare finecorsa
-- si riduce la feed opportunamente -- si riduce la feed opportunamente
if not ( Proc.Topology == 'Tunnel') then if bAttackFromSide then
local dMachiningStep = EgtGetMachiningParam( MCH_MP.STEP) or 0 local dMachiningStep = EgtGetMachiningParam( MCH_MP.STEP) or 0
-- TODO qui sostituire con valore preciso da GetSetupInfo -- TODO qui sostituire con valore preciso da GetSetupInfo
if BD.C_SIMM then if BD.C_SIMM then
dMachiningStep = 165 dMachiningStep = 175
if vtRef:getZ() < - 10 * GEO.EPS_SMALL then if vtRef:getZ() < - 10 * GEO.EPS_SMALL then
dMachiningStep = 250 dMachiningStep = 260
end end
end end
local dActualStep = ( dMachiningDepth - dMachiningStep) / ( 2 + 1) local dActualStep = ( dMachiningDepth - dMachiningStep) / ( 2 + 1)
@@ -3316,7 +3330,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
EgtSetMachiningParam( MCH_MP.FEED, dFeed) EgtSetMachiningParam( MCH_MP.FEED, dFeed)
end end
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';' local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
if not ( Proc.Topology == 'Tunnel') then if bAttackFromSide then
sNotes = EgtSetValInNotes( sNotes, 'Plunge', 10) sNotes = EgtSetValInNotes( sNotes, 'Plunge', 10)
end end
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
@@ -3385,6 +3399,10 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
end end
end end
local dExtraOffs = 0 local dExtraOffs = 0
-- se il taglio è praticamente verticale, riduto massimo materiale lama
if BD.DECR_VERT_CUT and vtN:getZ() > 0.985 then
dMaxDepth = dMaxDepth - BD.DECR_VERT_CUT - BD.COLL_SIC
end
-- se profondità superiore al massimo lama modifico elevazione -- se profondità superiore al massimo lama modifico elevazione
if dDepth > dMaxDepth then if dDepth > dMaxDepth then
dExtraOffs = dMaxDepth - dDepth dExtraOffs = dMaxDepth - dDepth
@@ -3420,7 +3438,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw, bLapJointAngTrasm, nPhase, nRawId) local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw, bLapJointAngTrasm, nPhase, nRawId, dCustomMaxElev)
-- distanza dal pezzo successivo -- distanza dal pezzo successivo
local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase) local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase)
-- calcolo l'elevazione dal punto medio -- calcolo l'elevazione dal punto medio
@@ -3523,11 +3541,10 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
end end
end end
end end
-- eventuale massima elevazione imposta dall'utente -- eventuale massima elevazione forzata
local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd') if dCustomMaxElev and dCustomMaxElev < 1 then dCustomMaxElev = nil end
if dMaxElev and dMaxElev < 1 then dMaxElev = nil end
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente -- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
dElev = dMaxElev or dElev dElev = dCustomMaxElev or dElev
local sWarn local sWarn
local dDepth = dElev local dDepth = dElev
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
@@ -3704,7 +3721,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
else else
sWarn = 'Warning : lapjoint chamfer angle machined with different tool' sWarn = 'Warning : lapjoint angled face machined with different tool'
end end
end end
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
@@ -3715,6 +3732,15 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
end end
end end
-- se utensile troppo più grande dell'originale salto la lavorazione
if sTuuidPk and EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then
local dTDiamOriginalTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
if dTDiam > 2 * dTDiamOriginalTool then
sWarn = 'Warning : lapjoint angled face skipped (no compatible tool)'
EgtOutLog( sWarn)
return true, sWarn
end
end
-- Calcolo uso faccia -- Calcolo uso faccia
local nFaceUse = BL.GetNearestParalOpposite( tDimAndRef[1][3]:getVersZ()) local nFaceUse = BL.GetNearestParalOpposite( tDimAndRef[1][3]:getVersZ())
-- inserisco la lavorazione di fresatura -- inserisco la lavorazione di fresatura
@@ -5066,6 +5092,7 @@ function SawPlusChain.GetBottomFaceEdges( Proc, Face)
CurrentEdge.IsOpen = vEdges[j].Open CurrentEdge.IsOpen = vEdges[j].Open
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open) CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open) CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
CurrentEdge.Id = j - 1
if CurrentEdge.AdjacentFaceId == Proc.MainFaces.LongFace.Id then if CurrentEdge.AdjacentFaceId == Proc.MainFaces.LongFace.Id then
table.insert( Edges.LongEdges, CurrentEdge) table.insert( Edges.LongEdges, CurrentEdge)
@@ -5111,6 +5138,7 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face)
CurrentEdge.IsOpen = vEdges[j].Open CurrentEdge.IsOpen = vEdges[j].Open
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open) CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open) CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
CurrentEdge.Id = j - 1
if Proc.Topology == 'Tunnel' then if Proc.Topology == 'Tunnel' then
if CurrentEdge.AdjacentFaceId > -1 then if CurrentEdge.AdjacentFaceId > -1 then
@@ -5260,6 +5288,9 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw)
if Machining.MaxElev then if Machining.MaxElev then
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', Machining.MaxElev) sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', Machining.MaxElev)
end end
if Machining.nEdgeFaceUse then
sUserNotes = EgtSetValInNotes( sUserNotes, 'EdgesFaceUse', EgtNumToString( Machining.nEdgeFaceUse))
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
local bIsApplyOk = ML.ApplyMachining( true, false) local bIsApplyOk = ML.ApplyMachining( true, false)
@@ -5438,6 +5469,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
else else
Cutting.Faceuse = BL.GetNearestOrthoOpposite( -EdgeToMachine.ToolDirection) Cutting.Faceuse = BL.GetNearestOrthoOpposite( -EdgeToMachine.ToolDirection)
end end
Cutting.nEdgeFaceUse = EdgeToMachine.Id
-- SCC -- SCC
Cutting.SCC = SawPlusChain.Saw.GetSCC( EdgeToMachine.ToolDirection) Cutting.SCC = SawPlusChain.Saw.GetSCC( EdgeToMachine.ToolDirection)
-- asse bloccato -- asse bloccato
@@ -5478,6 +5510,7 @@ end
function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw) function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
local bIsCuttingOk = false local bIsCuttingOk = false
local sCuttingOriginalMessage = Cutting.Message or ''
local sCuttingApplyMessage = '' local sCuttingApplyMessage = ''
local dOriginalRadialOffset = Cutting.RadialOffset local dOriginalRadialOffset = Cutting.RadialOffset
@@ -5492,7 +5525,9 @@ function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
bIsCuttingOk, sCuttingApplyMessage = SawPlusChain.ApplyMachining( Cutting, b3Raw) bIsCuttingOk, sCuttingApplyMessage = SawPlusChain.ApplyMachining( Cutting, b3Raw)
-- update messaggi -- update messaggi
if sCuttingApplyMessage and #sCuttingApplyMessage > 0 then if sCuttingApplyMessage and #sCuttingApplyMessage > 0 then
sCuttingApplyMessage = sCuttingApplyMessage .. 'Apply : ' .. sCuttingApplyMessage .. '\n' sCuttingApplyMessage = sCuttingOriginalMessage .. '\n' .. sCuttingApplyMessage .. 'Apply : ' .. sCuttingApplyMessage .. '\n'
else
sCuttingApplyMessage = sCuttingOriginalMessage
end end
end end
@@ -5749,7 +5784,7 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
return bIsCuttingOk, Cutting.Message return bIsCuttingOk, Cutting.Message
end end
end end
else elseif Proc.IsParallel then
-- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato -- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
if Cutting.CanApply and Cutting.RadialOffset > 10 * GEO.EPS_SMALL then if Cutting.CanApply and Cutting.RadialOffset > 10 * GEO.EPS_SMALL then
-- eventuale lavorazione di lama - lato della tasca da cui inizia la lavorazione -- eventuale lavorazione di lama - lato della tasca da cui inizia la lavorazione
@@ -5809,7 +5844,7 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
return bIsMortisingOk, Mortising.Message return bIsMortisingOk, Mortising.Message
end end
end end
else elseif Proc.IsParallel then
-- se la sega a catena non è arrivata sul fondo e c'è almeno un lato aperto va lavorato -- se la sega a catena non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
if Mortising.LongitudinalOffset > 10 * GEO.EPS_SMALL then if Mortising.LongitudinalOffset > 10 * GEO.EPS_SMALL then
-- eventuale lavorazione di sega a catena - lato della tasca da cui inizia la lavorazione -- eventuale lavorazione di sega a catena - lato della tasca da cui inizia la lavorazione
@@ -5852,6 +5887,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if not BD.MAXDIAM_POCK_CORNER then if not BD.MAXDIAM_POCK_CORNER then
BD.MAXDIAM_POCK_CORNER = 30 BD.MAXDIAM_POCK_CORNER = 30
end end
local nMGrpId = EgtGetCurrMachGroup()
local sWarn local sWarn
-- recupero l'ingombro del grezzo di appartenenza -- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId) local b3Raw = EgtGetRawPartBBox( nRawId)
@@ -6438,6 +6474,35 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
dMaxTotLen = BD.GetBottomToolMaxTotLen( vtN) dMaxTotLen = BD.GetBottomToolMaxTotLen( vtN)
end end
local dUserMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd') local dUserMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
local dCustomMaxElev
-- se esistono tagli troncanti in testa o in coda, si calcola il MaxElev da applicare
if not dUserMaxElev then
local nTailCutId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i')
local nHeadCutId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i')
if nHeadCutId or nTailCutId then
local nSurfPartId = EgtCopyGlob( EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, 'Box'), nAddGrpId)
if nHeadCutId then
local ptCCutSurf, vtNCutSurf = EgtSurfTmFacetCenter( nHeadCutId, 0, GDB_ID.ROOT)
EgtCutSurfTmPlane( nSurfPartId, ptCCutSurf, vtNCutSurf, false, GDB_RT.GLOB)
local nSurfPartIdOld = nSurfPartId
nSurfPartId = EgtSurfTmBySewing( nAddGrpId, { nSurfPartId, nHeadCutId}, false)
EgtErase( nSurfPartIdOld)
end
-- in coda si usa il troncante solo se la feature è settata da lavorare dopo separazione (Tail), altrimenti si rischia che venga fatta prima del taglio
if nTailCutId and Proc.Tail then
local ptCCutSurf, vtNCutSurf = EgtSurfTmFacetCenter( nTailCutId, 0, GDB_ID.ROOT)
EgtCutSurfTmPlane( nSurfPartId, ptCCutSurf, vtNCutSurf, false, GDB_RT.GLOB)
local nSurfPartIdOld = nSurfPartId
nSurfPartId = EgtSurfTmBySewing( nAddGrpId, { nSurfPartId, nTailCutId}, false)
EgtErase( nSurfPartIdOld)
end
dCustomMaxElev = EgtSurfTmFacetElevationInClosedSurfTm( Proc.Id, nFacInd, nSurfPartId, true)
if dCustomMaxElev then
dCustomMaxElev = dCustomMaxElev + dCollSic
end
EgtErase( nSurfPartId)
end
end
-- ricerca lavorazione -- ricerca lavorazione
local sPocketing local sPocketing
local _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown) local _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown)
@@ -6445,14 +6510,20 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
_, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind) _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind)
bMillDown = false bMillDown = false
end end
-- se l'utente ha definito un'elevazione custom dUserMaxElev si lavora sempre la faccia standard -- se è presente un'elevazione custom dCustomMaxElev si lavora sempre la faccia standard
if sMyPocketing and if sMyPocketing then
( dMyTMaxDepth > dFacElev + dCollSic - 10 * GEO.EPS_SMALL or ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic and not bIsU) or if dUserMaxElev then
( bIsL and nUseRoughTool == 0) or dCustomMaxElev = dUserMaxElev
( bIsL and Proc.Prc == 20) or elseif dCustomMaxElev and ( dMyTMaxDepth < dCustomMaxElev + dCollSic - 10 * GEO.EPS_SMALL) then
( Proc.Prc == 25 and not bIsU and not bIsL)) or dCustomMaxElev = nil
( dUserMaxElev and dUserMaxElev > 10 * GEO.EPS_SMALL) then end
sPocketing = sMyPocketing if ( dMyTMaxDepth > dFacElev + dCollSic - 10 * GEO.EPS_SMALL or ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic and not bIsU) or
( bIsL and nUseRoughTool == 0) or
( bIsL and Proc.Prc == 20) or
( Proc.Prc == 25 and not bIsU and not bIsL)) or
( dCustomMaxElev and dCustomMaxElev > 10 * GEO.EPS_SMALL) then
sPocketing = sMyPocketing
end
end end
if bMillDown then if bMillDown then
sMchFind = sMchFind ..'_H2' sMchFind = sMchFind ..'_H2'
@@ -6678,7 +6749,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
dToolMaxDiam = dToolTargetDiam dToolMaxDiam = dToolTargetDiam
end end
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind) local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap, nil, nPhase, nRawId) bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap, nil, nPhase, nRawId, dCustomMaxElev)
if not bOk then return false, sWarn2 end if not bOk then return false, sWarn2 end
if sWarn2 then if sWarn2 then
if not sWarn then sWarn = '' end if not sWarn then sWarn = '' end
@@ -6857,6 +6928,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
nil, nil, nil, b3Solid) nil, nil, nil, b3Solid)
if not bOk then return false, sWarn2 end if not bOk then return false, sWarn2 end
end end
-- dopo aver applicato gli antischeggia ricerco la svuotatura perchè l'ottimizzazione teste deve sapere quale è la lavorazione precedente
_, sPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown)
if not sPocketing and bMillUp then
_, sPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind)
bMillDown = false
end
-- se smusso non esclusivo -- se smusso non esclusivo
if nChamfer < 2 then if nChamfer < 2 then
-- eseguo la svuotatura della faccia principale, mi restituisce id utensile, il diametro utensile per il foro opzionale -- eseguo la svuotatura della faccia principale, mi restituisce id utensile, il diametro utensile per il foro opzionale
@@ -6894,7 +6971,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if ( Proc.Fct == 4 and bTailOnSide) and ( dDistToNextPiece > dToolDiameter + 10 * GEO.EPS_SMALL) then if ( Proc.Fct == 4 and bTailOnSide) and ( dDistToNextPiece > dToolDiameter + 10 * GEO.EPS_SMALL) then
sMchFind = EgtIf( bMillDown, 'OpenPocket_H2', 'OpenPocket') sMchFind = EgtIf( bMillDown, 'OpenPocket_H2', 'OpenPocket')
end end
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm, nPhase, nRawId) bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm, nPhase, nRawId, dCustomMaxElev)
if not bOk then return false, sWarn2 end if not bOk then return false, sWarn2 end
if sWarn2 then if sWarn2 then
if not sWarn then sWarn = '' end if not sWarn then sWarn = '' end
@@ -7079,11 +7156,11 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
nCapIdLeftSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId) nCapIdLeftSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
if not nCapIdLeftSide then bAllWithEndCap = false end if not nCapIdLeftSide then bAllWithEndCap = false end
end end
if nFirstId then if nFirstId then
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
EgtErase( nId) EgtErase( nId)
end end
end end
end end
if i > 1 then if i > 1 then
-- taglio della superficie lato sinistro -- taglio della superficie lato sinistro
@@ -7175,7 +7252,7 @@ local function TestTwoFacesDownHead( Proc)
end end
-- recupero le caratteristiche della feature e delle facce -- recupero le caratteristiche della feature e delle facce
local vtRes = Proc.Face[1].VtN ^ Proc.Face[2].VtN local vtRes = Proc.Face[1].VtN ^ Proc.Face[2].VtN
Proc.IsTopDownRabbet = abs( vtRes:getZ()) > 10 * GEO.EPS_SMALL Proc.IsTopDownRabbet = Proc.AffectedFaces.Top and abs( vtRes:getZ()) > 10 * GEO.EPS_SMALL
for i = 1, Proc.Fct do for i = 1, Proc.Fct do
Proc.Face[i].IsTooDownwardForTopBlade = Proc.Face[i].VtN:getZ() < ( BD.CUT_VZ_MIN or -0.484) - 10 * GEO.EPS_SMALL Proc.Face[i].IsTooDownwardForTopBlade = Proc.Face[i].VtN:getZ() < ( BD.CUT_VZ_MIN or -0.484) - 10 * GEO.EPS_SMALL
Proc.Face[i].IsTooWideForTopBlade = Proc.Face[i].WidthTrimmed > dTopBladeMaxDepth Proc.Face[i].IsTooWideForTopBlade = Proc.Face[i].WidthTrimmed > dTopBladeMaxDepth
@@ -7184,9 +7261,11 @@ local function TestTwoFacesDownHead( Proc)
if not ( Proc.Face[1].IsTooDownwardForTopBlade or Proc.Face[2].IsTooDownwardForTopBlade) then if not ( Proc.Face[1].IsTooDownwardForTopBlade or Proc.Face[2].IsTooDownwardForTopBlade) then
bDownHeadBlade = false bDownHeadBlade = false
else else
if ( Proc.Face[1].IsTooDownwardForTopBlade and Proc.Face[2].IsTooWideForTopBlade) or for i = 1, Proc.Fct do
( Proc.Face[2].IsTooDownwardForTopBlade and Proc.Face[1].IsTooWideForTopBlade) then if Proc.Face[i].IsTooDownwardForTopBlade and ( not Proc.IsTopDownRabbet or Proc.Face[i].IsTooWideForTopBlade) then
bDownHeadBlade = true bDownHeadBlade = true
break
end
end end
end end
end end
@@ -7443,7 +7522,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
-- se lunghezza richiede spezzatura -- se lunghezza richiede spezzatura
if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) or ( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and ( b3Solid:getDimX() > ( BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART))) or
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then ( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then
-- una faccia -- una faccia
if Proc.Fct == 1 then if Proc.Fct == 1 then
+6 -6
View File
@@ -1280,10 +1280,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
nFin = 1 nFin = 1
else else
if vtN[vOrd[1]]:getZ() >= vtN[vOrd[2]]:getZ() then if vtN[vOrd[1]]:getZ() >= vtN[vOrd[2]]:getZ() then
if vtN[vOrd[2]]:getZ() < dLimitAngle then if vtN[vOrd[1]]:getZ() < dLimitAngle then
nFin = 1
else
nIni = 2 nIni = 2
else
nFin = 1
end end
else else
if vtN[vOrd[1]]:getZ() < dLimitAngle then if vtN[vOrd[1]]:getZ() < dLimitAngle then
@@ -1334,7 +1334,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
nSCC = EgtIf( nSide == -1, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP) nSCC = EgtIf( nSide == -1, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
end end
else else
local bFromZM = (( vtN[vOrd[i]]:getZ() < 0 and bConvex) or ( vtN[vOrd[i]]:getZ() > 0 and not bConvex)) local bFromZM = (( vtN[vOrd[i]]:getZ() < 10 * GEO.EPS_ANG_SMALL and bConvex) or ( vtN[vOrd[i]]:getZ() > - 10 * GEO.EPS_ANG_SMALL and not bConvex))
nSCC = EgtIf( bFromZM, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP) nSCC = EgtIf( bFromZM, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
end end
end end
@@ -1352,7 +1352,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
if dMachDepth > dMaxDepth - 10 * GEO.EPS_ANG_SMALL then if dMachDepth > dMaxDepth - 10 * GEO.EPS_ANG_SMALL then
-- verifico se posso lavorare la faccia 2 -- verifico se posso lavorare la faccia 2
local nOtherFace = EgtIf( i == 1, 2, 1) local nOtherFace = EgtIf( i == 1, 2, 1)
if j == 1 and vtN[vOrd[nOtherFace]]:getZ() > dLimitAngle and vWidth[vOrd[i]] < dMaxDepth then if Proc.Fct == 2 and j == 1 and vtN[vOrd[nOtherFace]]:getZ() > dLimitAngle and vWidth[vOrd[i]] < dMaxDepth then
vOrd[1], vOrd[2] = vOrd[2], vOrd[1] vOrd[1], vOrd[2] = vOrd[2], vOrd[1]
dLargh = vWidth[vOrd[i]] dLargh = vWidth[vOrd[i]]
dSal, dEal = dEal, dSal dSal, dEal = dEal, dSal
@@ -1432,7 +1432,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end end
end end
end end
if not Proc.bMoveAfterSplit and not bEndFixed and not bConvex then if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left then
-- recupero gruppo per geometria addizionale -- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId) local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then if not nAddGrpId then
+77 -4
View File
@@ -352,6 +352,69 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bModif and not bOpenBtm then if not bModif and not bOpenBtm then
BL.SetOpenSide( AuxId, b3Solid) BL.SetOpenSide( AuxId, b3Solid)
end end
-- recupero il raggio minimo della mortasa
local dMaxDiam = 1000
local nSt, nEnd = EgtCurveDomain( AuxId)
for i = nSt, nEnd - 1 do
local dRad = EgtCurveCompoRadius( AuxId, i)
-- se è un raggio, setto ed esco subito. Tutti i raggi sono uguali nella mortasa
if dRad > 0 then
dMaxDiam = dRad * 2
break
end
end
-- caso speciale feature trimmata diversamente in/out: si ricostruisce la curva non trimmata
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error : missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
-- estrazione loop trimesh: se 1 contorno ha il fondo, se due contorni è passante.
-- se passante si deve discriminare se i due contorni sono uguali (passante standard, trimmata allo stesso modo in/out) oppure se un contorno è diverso dall'altro (e quindi non è trimmata in egual modo in/out)
-- se più di 2 contorni si rimane nel caso standard
local idCurve1, nIdCount = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
if nIdCount == 2 then
local idCurve2 = idCurve1 + 1
local dCurveLength1 = EgtCurveLength( idCurve1)
local dCurveLength2 = EgtCurveLength( idCurve2)
if abs( dCurveLength1 - dCurveLength2) > 100 * GEO.EPS_SMALL then
-- riferimento curva ausiliaria
local frAuxId = Frame3d( EgtGP( AuxId, GDB_RT.GLOB), vtExtr)
-- box dei due contorni nel riferimento della faccia di fondo
local b3Curve1 = EgtGetBBoxRef( idCurve1, GDB_BB.STANDARD, frAuxId)
local b3Curve2 = EgtGetBBoxRef( idCurve2, GDB_BB.STANDARD, frAuxId)
-- per creare la curva non trimmata si creerà un piano di intersezione con la trimesh appena sopra al contorno più vicino a AuxId, ossia a ptOffset
local ptOffset = b3Curve1:getMax()
if b3Curve1:getMin():getZ() > b3Curve2:getMin():getZ() + 10 * GEO.EPS_SMALL then
ptOffset = b3Curve2:getMax()
end
-- ptOffset si sposta appena sopra per garantire l'intersezione
ptOffset = ptOffset + Vector3d( 0, 0, 100 * GEO.EPS_SMALL)
local ptOffsetGlob = Point3d( ptOffset)
ptOffsetGlob:toGlob( frAuxId)
EgtErase( { idCurve1, idCurve2} )
-- intersezione piano a ptOffset con la trimesh: si ottiene la curva originale non trimmata
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOffsetGlob, frAuxId:getVersZ(), Proc.Id, nAddGrpId, GDB_RT.GLOB)
if nPnt == 0 and nCrv == 1 and nSrf == 0 then
EgtCloseCurveCompo( nFirstId)
local vtMove = -frAuxId:getVersZ() * ptOffset:getZ()
EgtMove( nFirstId, vtMove, GDB_RT.GLOB)
EgtErase( AuxId)
EgtChangeId( nFirstId, AuxId)
else
if nFirstId then
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
EgtErase( nId)
end
end
end
end
end
if bOpenBtm then if bOpenBtm then
-- creo superficie chiusa -- creo superficie chiusa
local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05) local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05)
@@ -435,6 +498,10 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- determino larghezza della mortasa -- determino larghezza della mortasa
if dL < dW then dL, dW = dW, dL end if dL < dW then dL, dW = dW, dL end
-- si prende il minimo tra larghezza mortasa e il raggio minimo impostato da parametro
dMaxDiam = min( dW, dMaxDiam)
-- abilitazione lavorazione da sotto -- abilitazione lavorazione da sotto
local bPockUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259) local bPockUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
local bPockDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174) local bPockDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174)
@@ -513,16 +580,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
local sPocketing local sPocketing
if Proc.Prc ~= 53 then if Proc.Prc ~= 53 then
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2) sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2)
if not sPocketing and bPockUp then if not sPocketing and bPockUp then
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, _, bExcludeH2) sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, _, bExcludeH2)
end end
end end
if not sPocketing then if not sPocketing then
sPockType = 'Pocket' sPockType = 'Pocket'
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2) sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2)
if not sPocketing and bPockUp then if not sPocketing and bPockUp then
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, _, bExcludeH2) sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, _, bExcludeH2)
end end
end end
if not sPocketing then if not sPocketing then
@@ -543,6 +610,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
bCW = ( dSpeed >= 0) bCW = ( dSpeed >= 0)
end end
end end
-- inserisco la lavorazione di svuotatura -- inserisco la lavorazione di svuotatura
local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing) local nMchFId = EgtAddMachining( sName, sPocketing)
@@ -562,6 +630,11 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN) EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
end end
-- se diametro utensile esattamente uguale a larghezza tasca, e tasca tonda, si setta un offset radiale negativo
if Proc.Fct > 6 and abs( dMillDiam - dW) < 100 * GEO.EPS_SMALL then
EgtSetMachiningParam( MCH_MP.OFFSR, - 50 * GEO.EPS_SMALL)
end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- sistemo la direzione di lavoro -- sistemo la direzione di lavoro
+23 -31
View File
@@ -33,7 +33,6 @@ local sEnableExtraBladeUpperFace = 'Q02' -- i
local sDepthChamferMill = 'Q03' -- d local sDepthChamferMill = 'Q03' -- d
local sOverMaterialForFinish = 'Q04' -- d local sOverMaterialForFinish = 'Q04' -- d
local sPreemptiveChamfer = 'Q05' -- i local sPreemptiveChamfer = 'Q05' -- i
local bUseSmallMill = 'Q06' -- i
-- abilitazioni extra -- abilitazioni extra
local dMakeAntiSplintOnHead = 1 -- valore impronta antischeggia, per disattivare settare = nil o = 0 local dMakeAntiSplintOnHead = 1 -- valore impronta antischeggia, per disattivare settare = nil o = 0
@@ -208,36 +207,31 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function VerifySmallMillCanFinish( dDiamCurrentTool, dDepthProfile, nSide) function VerifyOtherMillCanFinish( dDepthProfile, nSide)
local dToolMaxDepthSmall, dToolDiamSmall local dToolMaxDepthFinish
-- abilitazione lavorazione da sotto -- abilitazione lavorazione da sotto
local sMillType = 'Prof' local sMillType = 'Prof_end'
local sMillingSmall, _, _, bH2Small = ML.FindMilling( sMillType, nil, nil, nil, nil, true, nil, nil, nil, 'Smallest') local sMillingFinish, _, _, _ = ML.FindMilling( sMillType, nil, nil, nil, nil, true, nil, nil, nil)
if not sMillingSmall then if not sMillingFinish then
return false return false
end end
-- Recupero i dati dell'utensile -- Recupero i dati dell'utensile
if EgtMdbSetCurrMachining( sMillingSmall) then if EgtMdbSetCurrMachining( sMillingFinish) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid)) then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid)) then
dToolMaxDepthSmall = EgtTdbGetCurrToolMaxDepth() dToolMaxDepthFinish = EgtTdbGetCurrToolMaxDepth()
dToolDiamSmall = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
-- se non ci sono almeno 5mm di differenza si fa con utensile standard
if dDiamCurrentTool - 5 < dToolDiamSmall then
return false
end
end end
else else
return false return false
end end
local bDouble = ( dDepthProfile + BD.CUT_EXTRA > dToolMaxDepthSmall) local bDouble = ( dDepthProfile + BD.CUT_EXTRA > dToolMaxDepthFinish)
-- se lavorazione in doppio richiesta, si verifica se richiesta testa sotto -- se lavorazione in doppio richiesta, si verifica se richiesta testa sotto
if bDouble and nSide == 0 then if bDouble and nSide == 0 then
return false -- TODO macchine con BD.DOWN_HEAD potrebbero lavorare in doppio in questo caso! return false -- TODO macchine con BD.DOWN_HEAD potrebbero lavorare in doppio in questo caso!
end end
if not bDouble or ( dDepthProfile + BD.MILL_OVERLAP < dToolMaxDepthSmall * 2) then if not bDouble or ( dDepthProfile + BD.MILL_OVERLAP < dToolMaxDepthFinish * 2) then
return true, sMillingSmall, bDouble return true, sMillingFinish, bDouble
end end
return false return false
end end
@@ -506,12 +500,8 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
local bUseSmallMillOnFinish = EgtGetInfo( Proc.Id, bUseSmallMill, 'i') == 1 -- se configurata fresa di finitura
local sMillingSmall, bDoubleSmall local bUseOtherMillOnFinish, sFinishMilling, bDoubleFinishMill = VerifyOtherMillCanFinish( dProfDepth, nSide)
-- se serve fresa più piccola per finitura
if bUseSmallMillOnFinish then
bUseSmallMillOnFinish, sMillingSmall, bDoubleSmall = VerifySmallMillCanFinish( dMillDiam, dProfDepth, nSide)
end
-- se il chamfer non è esclusivo continuo con le altre lavorazioni -- se il chamfer non è esclusivo continuo con le altre lavorazioni
if nChamfer < 2 then if nChamfer < 2 then
@@ -608,7 +598,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
nMchId = nMch2Id nMchId = nMch2Id
end end
-- se abilitata, aggiungo lavorazione di finitura -- se abilitata, aggiungo lavorazione di finitura
if bFinish and not bUseSmallMillOnFinish then if bFinish and not bUseOtherMillOnFinish then
-- inserisco la lavorazione -- inserisco la lavorazione
local sNewName = 'ProfB_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sNewName = 'ProfB_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId)) local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
@@ -723,7 +713,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
nMchId = nMch2Id nMchId = nMch2Id
end end
-- se abilitata, aggiungo lavorazione di finitura -- se abilitata, aggiungo lavorazione di finitura
if bFinish and not bUseSmallMillOnFinish then if bFinish and not bUseOtherMillOnFinish then
-- inserisco la lavorazione -- inserisco la lavorazione
local sNewName = 'Prof_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sNewName = 'Prof_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId)) local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
@@ -780,12 +770,12 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
end end
-- se finitura con fresa piccola -- se finitura con fresa piccola
if bFinish and bUseSmallMillOnFinish then if bFinish and bUseOtherMillOnFinish then
local sDepthSmall = EgtIf( bDoubleSmall, ( dProfDepth+ BD.MILL_OVERLAP ) / 2, dProfDepth + BD.CUT_EXTRA) local sDepthFinishMill = EgtIf( bDoubleFinishMill, ( dProfDepth+ BD.MILL_OVERLAP ) / 2, dProfDepth + BD.CUT_EXTRA)
local sMachName = 'Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sMachName = 'Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
nMchId = EgtAddMachining( sMachName, sMillingSmall) nMchId = EgtAddMachining( sMachName, sFinishMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sMachName .. '-' .. sMillingSmall local sErr = 'Error adding machining ' .. sMachName .. '-' .. sFinishMilling
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
@@ -793,7 +783,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- imposto l'affondamento -- imposto l'affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, sDepthSmall) EgtSetMachiningParam( MCH_MP.DEPTH, sDepthFinishMill)
-- posizione braccio porta testa -- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)) EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
-- eseguo -- eseguo
@@ -803,11 +793,13 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr return false, sErr
end end
if bDoubleSmall then if bDoubleFinishMill then
local sNewName = 'FinB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sNewName = 'FinB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId)) local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
-- ottengo l'inversione e setto il contrario
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
+4 -4
View File
@@ -176,15 +176,15 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local vtRef2 = Vector3d( vtN[vFaceOrd[2]]) local vtRef2 = Vector3d( vtN[vFaceOrd[2]])
-- eseguo -- eseguo
for i = 1, #vCuts do for i = 1, #vCuts do
local nOrthoOpposite local vtOrtho
if i % 2 == 1 then if i % 2 == 1 then
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef) vtOrtho = vtRef
else else
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef2) vtOrtho = vtRef2
end end
-- lavoro la faccia -- lavoro la faccia
for j = 1, #vCuts[i] do for j = 1, #vCuts[i] do
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrtho, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then if not bOk then
return bOk, sErr return bOk, sErr
end end
+5 -1
View File
@@ -13,6 +13,7 @@ local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut') local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut') local Cut = require( 'ProcessCut')
local Topology = require( 'FeatureTopology') local Topology = require( 'FeatureTopology')
local LapJoint = require( 'ProcessLapJoint')
EgtOutLog( ' ProcessStepJointNotch started', 1) EgtOutLog( ' ProcessStepJointNotch started', 1)
@@ -49,7 +50,7 @@ function ProcessStepJointNotch.Classify( Proc)
-- numero delle facce -- numero delle facce
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id) local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
-- gestisco solo 2 o 4 facce -- gestisco solo 2 o 4 facce
if nFacetCnt ~= 2 and nFacetCnt ~= 4 and nFacetCnt ~= 6 and nFacetCnt ~= 8 then if nFacetCnt ~= 2 and nFacetCnt ~= 3 and nFacetCnt ~= 4 and nFacetCnt ~= 6 and nFacetCnt ~= 8 then
return false, false return false, false
end end
-- verifico le normali delle facce -- verifico le normali delle facce
@@ -583,6 +584,9 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if Proc.Fct == 3 then
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- esecuzione eventuale smusso -- esecuzione eventuale smusso
-- ottengo anche il flag che indica che la feature è larga come la trave -- ottengo anche il flag che indica che la feature è larga come la trave
local bOkc, sErrC, nDiffWidth = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead) local bOkc, sErrC, nDiffWidth = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
+52 -3
View File
@@ -1,12 +1,61 @@
==== Beam Update Log ==== ==== Beam Update Log ====
Versione 2.7i2 (30/09/2025)
- Modif : migliorie a mortasa e tenone a coda di rondine
- Modif : migliorie a LongDoubleCut
- Modif : migliorie ai tagli
Versione 2.7i1 (03/09/2025)
- Added : in Tenone a coda di rondine aggiunto passaggio di finitura in caso di P14 > 0
- Modif : in LapJoint migliorata la scelta lama in caso di due facce e altre piccole correzioni
Versione 2.7h3 (26/08/2025)
- Added : in LapJoint, se possibile, si ricalcola l'elevazione in caso di feature troncanti testa/coda
- Modif : eventuali feature troncanti testa/coda sono fatte sempre subito dopo i rispettivi tagli di testa/coda
Versione 2.7h2 (19/08/2025)
- Modif : migliorata ottimizzazione teste
- Modif : migliorate forature in doppio
- Modif : in LapJoint migliorate lavorazioni lama + sega a catena
- Modif : in LapJoint migliorata spezzatura per feature lunghe rispetto al pezzo
- Modif : in LapJoint tipo BirdsMouth migliorata lavorazione faccia inclinata
- Modif : in StepJointNotch, se 3 facce si riconduce a LapJoint
Versione 2.7h1 (05/08/2025)
- Fixed : in Mortise migliorata la lavorazione in caso di feature trimmata
- Modif : in LapJoint, riduzione massimo materiale lama per lavorazioni antischeggia di lama con direzione verticale
- Modif : in LapJoint migliorie alla lavorazione tipo BlockHaus
- Modif : nei profili si usa il tipo lavorazione Prof_end per la finitura
Versione 2.7g5 (14/07/2025)
- Fixed : in tagli di testa e coda corretti attacchi
Versione 2.7g4 (11/07/2025)
- Fixed : in LapJoint 2 facce correzione nella scelta lama da sotto
Versione 2.7g3 (11/07/2025)
- Fixed : in RidgeLap corretta scelta del lato da lavorare
Versione 2.7g2 (10/07/2025)
- Fixed : in LapJoint correzione per caso in cui la sega a catena lavorava la tasca in modo errato
Versione 2.7g1 (08/07/2025)
- Added : in LapJoint, aggiunti smussi anche se lavorazione con truciolatore
- Added : per profilo caudato aggiunta finitura con fresa piccola
- Added : gestione tastatura
- Modif : nei tagli di testa e coda, compresi quelli di spezzatura, la lama evita di arretrare se non necessario
- Modif : in LongDoubleCut migliorie varie
- Modif : in RidgeLap migliorie varie
- Modif : nelle forature che attraversano un taglio ora si considera la profondità già lavorata
- Fixed : in LongDoubleCut corretta lavorazione aggiunta erroneamente dopo separazione
Versione 2.7f3 (19/06/2025) Versione 2.7f3 (19/06/2025)
- Modifx : in StepJointNotch corretta distanza attacco in/out - Modif : in StepJointNotch corretta distanza attacco in/out
Versione 2.7f2 (18/06/2025) Versione 2.7f2 (18/06/2025)
- Modif : in LongDoubleCut aggiunto messaggio feature non completa se utensile non arriva sul fondo - Modif : in LongDoubleCut aggiunto messaggio feature non completa se utensile non arriva sul fondo
- Modif : in StepJointNotch, se si forza truciolatore, si prende utensile più grande - Modif : in StepJointNotch, se si forza truciolatore, si prende utensile più grande
- Fixed : in LapJoint, piccola correzione calcolo sovrapposizione trimesh per smuotatura - Fixed : in LapJoint, piccola correzione calcolo sovrapposizione trimesh per svuotatura
- Fixed : in LapJoint, per sovrapposizione in spezzatura, corretto caso tipo Tunnel - Fixed : in LapJoint, per sovrapposizione in spezzatura, corretto caso tipo Tunnel
Versione 2.7f1 (03/06/2025) Versione 2.7f1 (03/06/2025)
@@ -20,10 +69,10 @@ Versione 2.7e2 (23/05/2025)
- Fixed : in Scarf Joint correzione alla scelta faccia da lavorare - Fixed : in Scarf Joint correzione alla scelta faccia da lavorare
Versione 2.7e1 (05/05/2025) Versione 2.7e1 (05/05/2025)
- Modif : in LapJoint se tunnel verticale lavorato solo da sopra e l'utensile non arriva, si restituisce warning
- Fixed : in taglio di separazione si riduce percorso di taglio solo se il pezzo è effettivamente alto - Fixed : in taglio di separazione si riduce percorso di taglio solo se il pezzo è effettivamente alto
- Fixed : in foratura corretto caso in cui non si sceglieva l'utensile più lungo disponibile - Fixed : in foratura corretto caso in cui non si sceglieva l'utensile più lungo disponibile
- Fixed : In BatchProcess (Ts7) corretta generazione in caso di progetto senza ricalcolo - Fixed : In BatchProcess (Ts7) corretta generazione in caso di progetto senza ricalcolo
- Modif : in LapJoint se tunnel verticale lavorato solo da sopra e l'utensile non arriva, si restituisce warning
Versione 2.7d3 (22/04/2025) Versione 2.7d3 (22/04/2025)
- Fixed : in LapJoint corretta gestione errata Q04 - Fixed : in LapJoint corretta gestione errata Q04
+1 -1
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di Beam -- Gestione della versione di Beam
NAME = 'Beam' NAME = 'Beam'
VERSION = '2.7f3' VERSION = '2.7i2'
MIN_EXE = '2.7f2' MIN_EXE = '2.7f2'