Compare commits

...

123 Commits

Author SHA1 Message Date
luca.mazzoleni f14cb632d6 Merge branch 'release/3.1b1' 2026-02-26 12:49:35 +01:00
luca.mazzoleni f019633466 update version e log 2026-02-26 12:49:17 +01:00
luca.mazzoleni 57833ebad9 - in ProcessDrill se foratura in doppio si aggiunge la nota LastStep per garantire che non ci siano collisioni tra le punte e prevenire extracorsa 2026-02-26 11:34:41 +01:00
luca.mazzoleni 04a4458562 Merge commit 'b150b5387d73082d6f8904a270b115a1cabbb487' into develop 2026-02-25 19:00:14 +01:00
luca.mazzoleni b150b5387d - in Long2Cut correzione al LeadIn/Out 2026-02-25 18:34:59 +01:00
daniele.nicoli ce05aed8c9 LapJoint, Features lunghe spezzate, forzato parametro invert=false se tasca larga come l'utensile (solo 1 passata senza ritorno all'esterno del pezzo) 2026-02-25 15:14:52 +01:00
daniele.nicoli 6820d88560 Merge branch 'Test/Q_OnlyDrillContour' into develop 2026-02-24 12:03:03 +01:00
daniele.nicoli ae31898e05 - Spostamento del richiamo all'interno della Drill.Make
- Piccole modifiche alla gestione
- Step diventa il 75% del teorico o se più piccolo, il diametro utensile
2026-02-24 12:02:43 +01:00
daniele.nicoli eb1878c17c Definizione Parametro Q04=1 per esecuzione del solo contorno di un foro NON passante 2026-02-24 09:20:13 +01:00
andrea.villa 468fb5debc In DtMortaise, migliorato ingresso/uscita in caso di mortasa con svuotatura 2026-02-20 14:33:46 +01:00
luca.mazzoleni 67fa66cf4f - in LapJoint sistemati commenti 2026-02-20 12:28:25 +01:00
luca.mazzoleni e4b4e846ef Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2026-02-20 12:00:56 +01:00
luca.mazzoleni 102bdc8018 - in FreeContoru.MakeByMill aggiunto Q10 per forzare MaxElev (come in LapJoint) 2026-02-20 12:00:52 +01:00
daniele.nicoli 5ca2c39506 Merge branch 'Test/OpenPocketSplit' into develop 2026-02-20 10:02:53 +01:00
daniele.nicoli 2c3aaf01dc In ProcessLapJoint :
- Eliminata forzatura ZigZag per tasche strette e utensili < 90
- Forzato OpenOutRaw se ce l'apertura sulla curva
2026-02-20 10:02:34 +01:00
daniele.nicoli f52bf933a1 Aggiornamento Versione minima Cam5 2026-02-19 16:54:15 +01:00
daniele.nicoli 993a022894 In LapJoint aggiunta gestione lato aperto in feature lunghe spezzate 2026-02-19 15:55:36 +01:00
luca.mazzoleni 60448c217a Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2026-02-18 18:40:12 +01:00
luca.mazzoleni 3a5338c29b - migliorati commenti in LapJoint 2026-02-18 18:40:07 +01:00
daniele.nicoli 7177b58836 Merge branch 'Test/SpiralIn-Out' into develop 2026-02-18 15:00:17 +01:00
daniele.nicoli bedb274c0f - In ProcessLapJoint, Aggiunto 'OpenPocket_H2' come controllo per SpiralIn 2026-02-17 10:27:55 +01:00
luca.mazzoleni 1df1529bd1 Merge branch 'DoubleDrillPocketLastStep' into develop 2026-02-16 15:07:00 +01:00
luca.mazzoleni 51a8ad95b2 - in ProcessDrill correzione in LastStep 2026-02-16 13:27:35 +01:00
luca.mazzoleni 394fb2194f - in ProcessDrilling correzioni e migliorie alla lavorazione ultimo step di fori svuotati in doppio 2026-02-16 12:10:46 +01:00
luca.mazzoleni 9288304051 - in ProcessDrill per fori fatti con svuotatura in doppio si limita l'affondamento (sarebbe sempre in collisione) e si aggiunge una lavorazione ad hoc, non in doppio, per l'ultimo step 2026-02-16 09:41:37 +01:00
luca.mazzoleni 99b77ff1e0 - in headCut e Split corretti smussi con P08 e P09 2026-02-13 09:22:04 +01:00
luca.mazzoleni 5885954f22 - in LongDoubleCut possibilità di scegliere lavorazione in discordanza. Al momento il parametro arriva da Q14 dalla LapJoint 2026-02-12 12:41:49 +01:00
luca.mazzoleni 440c739e9c - in LongDoubleCut correzione per casi con Q03=1 2026-02-11 17:08:24 +01:00
luca.mazzoleni 026c86297e Merge branch 'master' into develop 2026-02-11 15:01:22 +01:00
andrea.villa d4454331c0 In Long2Cut quando si lavora di fresa, si considera come principale sempre quella ad elevazione minore. Se nei controlli iniziali avesse scelto l'altra, allora si inverte tutto di conseguenza. 2026-02-11 14:58:21 +01:00
luca.mazzoleni bb5b135694 - in LapJoint in caso di L derivanete da spezzatura si fa svuotatura anche se non arriva sul fondo 2026-02-10 15:50:10 +01:00
luca.mazzoleni c94e6f858b Merge remote-tracking branch 'origin/master' into develop 2026-02-10 08:45:02 +01:00
Dario Sassi 49f5ba9cc9 DataBeam 3.1a1 :
- aggiunta gestione UNLOAD da btm (come per LOAD90)
- ora UserNotes presenti nelle levarazioni in libreria vengono conservate.
2026-02-09 20:26:08 +01:00
luca.mazzoleni 1ed912ebfd - in batchProcess modifiche per lettura part offset da btl 2026-02-09 12:58:36 +01:00
luca.mazzoleni d1d204b260 Merge tag '2.7l3' into develop
2.7l3
2025-12-23 08:29:07 +01:00
luca.mazzoleni 3cd3557b12 Merge branch 'release/2.7l3' 2025-12-23 08:28:58 +01:00
luca.mazzoleni 70b0c3d3d2 2.7l3 2025-12-23 08:27:54 +01:00
andrea.villa 2798616813 - Gestione angolo massimo in caso di fori che attraversano un taglio. Paraemtro MAX_ANGLE_DRILL_CUT configurabile da BeamData
- Controllo per aggiunta dei 10mm extra in caso di pretaglio spostato dopo impostazione setup
- Aggiunta funzione "ReorderFeatureWithDependency" per riordinare i fori che dipendono da altre feture
2025-12-18 10:16:34 +01:00
luca.mazzoleni fa74016932 Merge tag '2.7l2' into develop
2.7l2
2025-12-16 13:17:31 +01:00
luca.mazzoleni f309179270 Merge branch 'release/2.7l2' 2025-12-16 13:17:22 +01:00
luca.mazzoleni 9a6e4f8904 - update version e log 2025-12-16 13:16:55 +01:00
andrea.villa ba2ff5a7a7 - se pretagli di coda sono attivi, si aumenta di 10mm la lunghezza del grezzo per fare effettivamente tagliare del materiale
- il calcolo per limitare dimensione cubetti in caso di cubetti romboidi è limitato a 0.5 del teorico
2025-12-12 16:45:29 +01:00
andrea.villa d10b99dc3c Lanciando automatismo una seconda volta, dopo flip del pezzo, restava settato il valore e faceva considerazioni sbagliate. Quindi se non trova taglio troncante si resetta la nota. 2025-12-11 11:04:18 +01:00
andrea.villa 743270ed4d Ripristinato valore per CLEAN_CORNER : Q15 2025-12-10 12:13:57 +01:00
luca.mazzoleni ad0f4048aa - corretta data in log 2025-12-10 10:07:01 +01:00
luca.mazzoleni cb7a114124 Merge tag '2.7l1' into develop
2.7l1
2025-12-10 10:05:08 +01:00
luca.mazzoleni b9a9ce1479 Merge branch 'release/2.7l1' 2025-12-10 10:05:02 +01:00
luca.mazzoleni 812adeed34 - update version e log 2025-12-10 10:04:28 +01:00
andrea.villa 4b41948819 Rimosso valore Q per CLEAN_CORNER perchè non deve finire in versione. Da ripristinare per prossime versioni a Q15 2025-12-10 10:03:36 +01:00
andrea.villa 77599a8c68 Tolta chiamata a debug 2025-12-05 13:04:30 +01:00
andrea.villa 4f43d74d41 In MachiningLib e LapJoint aggiunta gestione fresatura con aggregato flottante. Per ora solo su Groove 4 facce e con Q specifia da attivare 2025-12-05 12:05:32 +01:00
andrea.villa 92d0ac2e93 In LapJoint, la spezzatura della feature considera se è presente del grezzo. 2025-12-04 08:23:23 +01:00
andrea.villa f7dd6c9da2 Per CleanCorner con fresa a V, il default era attivo. Ora viene settato come disattivo. 2025-11-27 15:34:44 +01:00
andrea.villa 63b8ef4377 Merge branch 'CleanCornerMillV60' into develop 2025-11-27 11:30:08 +01:00
andrea.villa e0c4f85bfb Prima versione funzionante pulizia spigoli con fresa a V su tasche non passanti 2025-11-26 16:20:10 +01:00
andrea.villa 675b730dcf Modifiche per lavorazione spigoli feature su faccia frontale o posteriore 2025-11-25 10:28:02 +01:00
luca.mazzoleni c2e49d1804 Merge tag '2.7k1' into develop
2.7k1
2025-11-25 08:52:33 +01:00
luca.mazzoleni 5c4d7224f0 Merge branch 'release/2.7k1' 2025-11-25 08:52:22 +01:00
luca.mazzoleni bd956281e2 update log e version 2025-11-25 08:47:36 +01:00
andrea.villa 0f122feaac Tolti parametri non utilizzati passati alla funzione
Aggiunta lavorazione tramite funzione EGT
2025-11-24 17:13:20 +01:00
andrea.villa eec524a00f Merge branch 'develop' into CleanCornerMillV60 2025-11-24 15:47:17 +01:00
andrea.villa d4b7fe1910 Per DtMortise, si considera che attraversa un LapJoint solo se DtMortise è affondata nel grezzo 2025-11-24 13:29:50 +01:00
andrea.villa 880cecfde2 Riportate funzioni da Wall. Non funzionante. Da completare. 2025-11-24 08:24:34 +01:00
andrea.villa b05d1aa7b8 Spostata creazione del gruppo ausiliario prima della collect. Altrimenti andava in crash quando aggiungeva i prefori. 2025-11-20 09:19:20 +01:00
andrea.villa b775610125 - In ProcessCut, se taglio rivolto verso il basso, si controlla che non sia troppo profondo, cercando di evitare collisione tra pezzo e carro Z
- Il Q14 ha effetto solo su lati longitudinali che si trovano in faccia bottom
2025-11-18 13:11:24 +01:00
luca.mazzoleni 9e284d509b - in BeamExec se foratura in doppio non possibile per distanza punte troppo bassa si restituisce messaggio in Log Cam5 2025-11-13 13:07:27 +01:00
luca.mazzoleni dd7a1e80b2 - in ProcessDrill rimossa la variazione di step nel caso di foratura in doppio: le librerie Egt gestiscono ora correttamente questi casi
- aggiornata versione minima Cam5
2025-11-13 12:23:28 +01:00
andrea.villa 919b32ca8d In ProcessCut, se taglio rivolto verso il basso, si controlla che non sia troppo profondo, cercando di evitare collisione tra pezzo e carro Z 2025-11-12 15:48:10 +01:00
andrea.villa fef5db6046 In SplitCut e HeadCut aggiunti smussi con possibilità di raccordare o smussare spigoli 2025-11-07 10:02:16 +01:00
andrea.villa 0d5dd4d348 Aggiunta gestione Q14 per settare lavorazione discorde in caso di MillAsBlade 2025-11-06 08:38:34 +01:00
andrea.villa e526502177 In LapJoint, se applicazione svuotatura non andata a buon fine e si prova ad allargare tasca, allora si cambia anche il tipo in SPIRALIN 2025-11-04 15:28:09 +01:00
andrea.villa 325f30c61b Merge branch 'master' into develop 2025-11-04 13:18:30 +01:00
andrea.villa f824cde2d0 Nelle profilature, aggiunta tolleranza in calcolo doppia passata 2025-11-04 13:18:06 +01:00
andrea.villa a61b27f292 - Aggiunta tolleranza nel calcolo tipo di taglio
- In BeamLib, la funzione GetFaceHvRefDim non tiene più in considerazione il limite del grezzo, ma sempre il rettangolo minimo che racchiude la faccia.
2025-11-04 09:05:13 +01:00
luca.mazzoleni e582f7a38b Merge branch 'master' into develop 2025-10-30 15:56:15 +01:00
luca.mazzoleni a813d5d742 Merge branch 'develop' 2025-10-30 15:55:56 +01:00
luca.mazzoleni 93e92da027 update log e version 2025-10-30 15:55:41 +01:00
luca.mazzoleni d862e8a2c5 update log 2025-10-30 15:54:38 +01:00
andrea.villa d79151c1d3 in DoubleCut, gestione feature con più di due facce (caso insolito) 2025-10-30 12:38:23 +01:00
luca.mazzoleni 3d62e41811 Merge branch 'master' into develop 2025-10-28 16:43:31 +01:00
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 00d7dd2970 Merge tag '2.7j1' into develop
2.7j1
2025-10-28 12:56:46 +01:00
luca.mazzoleni eb09d0b65d Merge branch 'release/2.7j1' 2025-10-28 12:56:39 +01:00
luca.mazzoleni 0c7a7daba4 update log e version 2025-10-28 12:56:12 +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
31 changed files with 2340 additions and 403 deletions
+69 -2
View File
@@ -144,6 +144,12 @@ local function UpdateAuxData( sAuxFile)
EgtSetInfo( BtlInfoId, 'LOAD90', sLoad90)
bModif = true
end
-- Se definito UNLOAD, aggiorno
local sUnload = EgtGetStringFromIni( 'AuxData', 'UNLOAD', '', sAuxFile)
if sUnload ~= '' then
EgtSetInfo( BtlInfoId, 'UNLOAD', sUnload)
bModif = true
end
-- Se definito PROJID, aggiorno
local sProjId = EgtGetStringFromIni( 'AuxData', 'PROJID', '', sAuxFile)
if sProjId ~= '' then
@@ -241,7 +247,11 @@ if bToProcess then
EgtEraseFile( sNgeFile)
-- eseguo import
EgtNewFile()
if not EgtImportBtl( BEAM.FILE, EIB_FL.TS3_POS + EIB_FL.USEUATTR) then
local nBtlFlag = EIB_FL.TS3_POS + EIB_FL.USEUATTR
if BD.USE_PART_OFFSET then
nBtlFlag = nBtlFlag + EIB_FL.PARTOFFSET
end
if not EgtImportBtl( BEAM.FILE, nBtlFlag) then
BEAM.ERR = 13
BEAM.MSG = 'Error importing BTL file : ' .. BEAM.FILE
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
@@ -381,7 +391,7 @@ if bToProcess then
end
end
-- Verifico sezione barra non troppo piccola
-- Verifico sezione barra non troppo piccola
if dRawW < BD.MIN_WIDTH - 10 * GEO.EPS_SMALL or dRawH < BD.MIN_HEIGHT - 10 * GEO.EPS_SMALL then
local sOut = 'Sezione (' .. EgtNumToString( dRawW, 2) .. ' x ' .. EgtNumToString( dRawH, 2) .. ') ' ..
'sotto i limiti della macchina (' .. EgtNumToString( BD.MIN_WIDTH, 2) .. ' x ' .. EgtNumToString( BD.MIN_HEIGHT, 2) .. ')'
@@ -391,6 +401,63 @@ if bToProcess then
PostErrView( BEAM.ERR, BEAM.MSG)
return
end
-- Se presente offset da btl, verifico se offset uguale per tutti i pezzi
if BD.USE_PART_OFFSET then
vBeamErr = {}
local sPartOffset = EgtGetInfo( vBeam[1].Id, 'PARTOFFSET', 's') or ''
local vPartOffset = EgtSplitString( sPartOffset)
local dRotAng = EgtGetInfo( vBeam[1].Id, 'ROTATED_OK', 'd') or 0
for i = 2, #vBeam do
local sPartOffsetCurrent = EgtGetInfo( vBeam[i].Id, 'PARTOFFSET', 's') or ''
local vPartOffsetCurrent = EgtSplitString( sPartOffsetCurrent)
local dRotAngCurrent = EgtGetInfo( vBeam[i].Id, 'ROTATED_OK', 'd') or 0
local dRotAngDelta = abs( dRotAngCurrent - dRotAng)
if ( #vPartOffset == 5) and ( #vPartOffsetCurrent == 5) then
if dRotAngDelta < GEO.EPS_ANG_SMALL then
if ( vPartOffsetCurrent[2] ~= vPartOffsetCurrent[2])
or ( vPartOffsetCurrent[3] ~= vPartOffset[3])
or ( vPartOffsetCurrent[4] ~= vPartOffset[4])
or ( vPartOffsetCurrent[5] ~= vPartOffset[5]) then
table.insert( vBeamErr, i)
end
elseif dRotAngDelta - 180 < GEO.EPS_ANG_SMALL then
if ( vPartOffsetCurrent[2] ~= vPartOffsetCurrent[4])
or ( vPartOffsetCurrent[3] ~= vPartOffset[5])
or ( vPartOffsetCurrent[4] ~= vPartOffset[2])
or ( vPartOffsetCurrent[5] ~= vPartOffset[3]) then
table.insert( vBeamErr, i)
end
-- se pezzo ruotato di 90deg rispetto al principale, al momento si dà sempre errore
else
table.insert( vBeamErr, i)
end
else
if sPartOffsetCurrent ~= sPartOffset then
table.insert( vBeamErr, i)
end
end
end
if #vBeamErr > 0 then
local sOut = 'Part offset not consistent in beam(s) : '
for i = #vBeamErr, 1, -1 do
local sSeparator = ', '
if i == 1 then
sSeparator = ''
end
sOut = sOut .. vBeam[vBeamErr[i]].Name .. sSeparator
end
BEAM.ERR = 17
BEAM.MSG = sOut
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
PostErrView( BEAM.ERR, BEAM.MSG)
return
end
end
-- Lunghezza della barra
local dRawL = ( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'BARLEN', 'd') or 12000) + 0.1
+286 -72
View File
@@ -442,7 +442,7 @@ local function CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
local b3TailBox
for i = 1, #vProc do
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.Head and Proc.Box:getCenter():getX() < dHeadX then
dHeadX = Proc.Box:getCenter():getX()
@@ -467,6 +467,7 @@ end
local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
local nReplacedFeatureId = nil
local bHeadFinishingNeeded = true
local nCuttingFeatureId = nil
for i = 1, #vProc do
local Proc = vProc[i]
-- 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
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
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
return bHeadFinishingNeeded, nReplacedFeatureId
return bHeadFinishingNeeded, nReplacedFeatureId, nCuttingFeatureId
end
-------------------------------------------------------------------------------------------------------------
local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
local nReplacedFeatureId = nil
local bTailFinishingNeeded = true
local nCuttingFeatureId = nil
for i = 1, #vProc do
local Proc = vProc[i]
-- 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
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
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
return bTailFinishingNeeded, nReplacedFeatureId
return bTailFinishingNeeded, nReplacedFeatureId, nCuttingFeatureId
end
-------------------------------------------------------------------------------------------------------------
@@ -568,11 +576,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
-- salvo nota con lunghezza grezzo
-- Recupero l'identificativo del gruppo di lavoro corrente
local nMGrpId = EgtGetCurrMachGroup()
-- Lunghezza della barra
local dBarLen = EgtGetInfo( nMGrpId, 'BARLEN', 'd')
if not dBarLen then
EgtSetInfo( nMGrpId, 'BARLEN', dRawL)
end
-- Area tavola
local b3Tab = EgtGetTableArea()
@@ -584,6 +587,18 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
-- Impostazione dell'attrezzaggio di default
EgtImportSetup()
-- se pretagli di coda sono attivi, aumento di 10mm la lunghezza del grezzo per fare effettivamente tagliare del materiale.
-- Altrimenti le lavorazioni pensano di essere nel vuoto e si muovono in rapido
if BD.PRECUT_TAIL and VerifyBigSectionCut( dRawW, dRawH) then
dRawL = dRawL + 10
end
-- Lunghezza della barra
local dBarLen = EgtGetInfo( nMGrpId, 'BARLEN', 'd')
if not dBarLen then
EgtSetInfo( nMGrpId, 'BARLEN', dRawL)
end
-- Inserimento dei pezzi con il loro grezzo
local Cnt = 0
local Len = dRawL
@@ -600,6 +615,26 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
local b3Part = EgtGetBBoxGlob( Pz or GDB_ID.NULL, GDB_BB.EXACT)
local b3Solid = vBeam[i].Box
if b3Part:isEmpty() or b3Solid:isEmpty() then break end
-- creo o pulisco gruppo geometrie aggiuntive
if not BL.CreateOrEmptyAddGroup( Pz) then
local sOut = 'Error creating Additional Group in Part ' .. tostring( Pz)
return false, sOut
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 id delle facce di taglio custom: serviranno dopo per calcolare l'elevazione rispetto a queste
if nHeadCuttingFeatureId then
EgtSetInfo( vBeam[i].Id, 'HEADCUTFEATUREID', nHeadCuttingFeatureId)
else
EgtRemoveInfo( vBeam[i].Id, 'HEADCUTFEATUREID')
end
if nTailCuttingFeatureId then
EgtSetInfo( vBeam[i].Id, 'TAILCUTFEATUREID', nTailCuttingFeatureId)
else
EgtRemoveInfo( vBeam[i].Id, 'TAILCUTFEATUREID')
end
if bBigSectionCut then
-- lascio in coda solo il materiale necessario; il resto verrà tolto nell'head cut successivo
local lastB3Solid = nil
@@ -612,9 +647,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
dOffset = dOvmMid
end
end
-- analizzo le features per valutare l'esistenza di feature head/tail che renderebbero inutili le rispettive finiture o di tagli di testa/coda sostituiti da cui leggere il parametro Q05
local vProc = CollectFeatures( Pz, b3Solid, 0)
local bSFinishingNeeded, nReplacedHeadCutFeatureId = AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
local iSQ05Value = nil
if nReplacedHeadCutFeatureId then
iSQ05Value = EgtGetInfo( nReplacedHeadCutFeatureId, 'Q05', 'i')
@@ -624,7 +656,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
else
DeltaSMin = BD.OVM_BLADE_HBEAM
end
local bEFinishingNeeded, nReplacedTailCutFeatureId = AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
local iEQ05Value = nil
if nReplacedTailCutFeatureId then
iEQ05Value = EgtGetInfo( nReplacedTailCutFeatureId, 'Q05', 'i')
@@ -662,11 +693,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
-- assegno ordine in lavorazione
Cnt = Cnt + 1
EgtSetInfo( nRaw, 'ORD', Cnt)
-- creo o pulisco gruppo geometrie aggiuntive
if not BL.CreateOrEmptyAddGroup( Pz) then
local sOut = 'Error creating Additional Group in Part ' .. tostring( Pz)
return false, sOut
end
-- aggiungo faccia per taglio iniziale al pezzo
BL.AddPartStartFace( Pz, b3Solid)
-- se sovramateriale di testa, lo notifico
@@ -780,7 +807,121 @@ local function PrintFeatures( vProc, b3Raw)
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
-------------------------------------------------------------------------------------------------------------
-- mi assicuro che vengano rispettate le dipendenze tra le feature
local function ReorderFeatureWithDependency( vProc)
-- si riordina considerando le dipendenze con alcuni limiti:
-- * se ci sono dipendenze incrociate il risultato finale non è controllato ( A->B e B->C e C->A)
-- * se ci sono dipendenze opposte va in errore ( A->B e B->A)
-- si sistemano le feature da lavorare prima
local i = 1
local nMaxIter = ( #vProc * #vProc) + 1
local nIter = 0
while i <= #vProc do
nIter = nIter + 1
if nIter > nMaxIter then
error( "UNEXPECTED ERROR ON DEPENDENCY")
end
-- si controllano solo i fori
if Drill.Identify( vProc[i]) and vProc[i].Dependency and vProc[i].Dependency.ExecBefore and vProc[i].Dependency.ExecBefore.Id then
local nRefId = vProc[i].Dependency.ExecBefore.Id
local nRefIndex
for j = 1, #vProc do
if i ~= j and vProc[j].Id == nRefId then
nRefIndex = j
break
end
end
-- se il processo deve stare prima, ma ora è dopo
if nRefIndex and nRefIndex < i then
table.insert( vProc, nRefIndex, table.remove( vProc, i))
i = max( nRefIndex - 1, 1)
end
end
i = i + 1
end
end
-------------------------------------------------------------------------------------------------------------
local function OrderFeatures( vProc, b3Raw, nPartId)
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)
@@ -808,6 +949,13 @@ local function OrderFeatures( vProc, b3Raw)
if Hcut.Identify( B2) then
return false
end
-- se uno dipende dall'altro
if B1.Dependency and B1.Dependency.ExecBefore and B1.Dependency.ExecBefore.Id == B2.Id then
return true
end
if B2.Dependency and B2.Dependency.ExecBefore and B2.Dependency.ExecBefore.Id == B1.Id then
return false
end
-- se uno di testa e non l'altro, privilegio quello di testa (a meno che non siano dei fori)
if B1.Head ~= B2.Head and not Drill.Identify(B1) and not Drill.Identify(B2) then
return B1.Head
@@ -901,12 +1049,12 @@ local function OrderFeatures( vProc, b3Raw)
if abs( B2.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then
return not ( B1.Tail or B2.Box:getMin():getX() + 20 > B1.Box:getCenter():getX())
end
-- se primo è foro e l'altro no, lo penalizzo
if Drill.Identify(B1) and not Drill.Identify(B2) then
return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty)
-- se primo è foro e l'altro no, lo penalizzo (a patto che il foro non attraversi nessuna feature)
if Drill.Identify(B1) and not B1.Dependency and not Drill.Identify(B2) then
return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty)
end
-- se primo è altro e secondo è foro, lo premio
if not Drill.Identify(B1) and Drill.Identify(B2) then
-- se primo è altro e secondo è foro, lo premio (a patto che il foro non attraversi nessuna feature)
if not Drill.Identify(B1) and not B2.Dependency and Drill.Identify(B2) then
return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX())
end
-- se prima è mortasa coda di rondine sul fianco e secondo taglio longitudinale, la coda di rondine va sempre prima
@@ -1099,6 +1247,11 @@ local function OrderFeatures( vProc, b3Raw)
end
end
end
ReorderTruncatingCuts( vProc, nPartId)
-- si riverificano feature con dipendenze
ReorderFeatureWithDependency( vProc)
end
-------------------------------------------------------------------------------------------------------------
@@ -1355,7 +1508,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
-- se foratura ( 3/4-040-X)
elseif Drill.Identify( Proc) then
-- esecuzione foratura
bOk, sErr = Drill.Make( Proc, nPhase, nRawId, nPartId)
bOk, sErr = Drill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- se giunzione francese ( 1/2-035-X)
elseif FrenchRidgeLap.Identify( Proc) then
-- esecuzione giunzione francese
@@ -1827,10 +1980,7 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, 0, true, false, true)
dMachiningDepth = dMaxDepth or dMachiningDepth
end
if not sDrilling
or ( sType ~= 'Drill' and ( sType ~= 'Pocket'or ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)))
or not EgtMdbSetCurrMachining( sDrilling) then
if not sDrilling or not EgtMdbSetCurrMachining( sDrilling) then
return
end
local dDrillingStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP)
@@ -1852,7 +2002,9 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
-- recupero la lunghezza della parte inclinata della punta
local dToolDoubleTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN)
-- se foratura splittata, verifico che la distanza minima tra le due punte sia rispettata
if abs( Proc.Flg) == 2 and not ( ( ( 2 * dDrillingStep - dToolTipLength - dToolDoubleTipLength) - MIRROR_DRILLINGS_MIN_DISTANCE) > 10 * GEO.EPS_SMALL) then
local dTipDistance = 2 * dDrillingStep - dToolTipLength - dToolDoubleTipLength
if abs( Proc.Flg) == 2 and not ( ( dTipDistance - MIRROR_DRILLINGS_MIN_DISTANCE) > 10 * GEO.EPS_SMALL) then
EgtOutLog( 'Double drilling skipped, tip distance too small ( ' .. dTipDistance .. ' mm) ')
return
end
-- verifico se in doppio
@@ -1941,14 +2093,18 @@ local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeInt
if vDistHead and #vDistHead > 0 then
-- verifico che il foro sia di testa
if ( bOpen or ( not bOpen and vtExtr:getX() > 0 and vProc[i].Fcs ~= 0) or ( not bOpen and vtExtr:getX() < 0 and vProc[i].Fce ~= 0)) then
vProc[i].MachineAfterHeadCutId = vMachineBeforeIntersectingDrillings.Head.Id
if vProc[i].Dependency and vProc[i].Dependency.ExecAfter and vProc[i].Dependency.ExecAfter.Id == vMachineBeforeIntersectingDrillings.Head.Id then
vProc[i].MachineAfterHeadCutId = vMachineBeforeIntersectingDrillings.Head.Id
end
vProc[i].Head = true
end
-- se esiste intersezione tra il foro e la feature di coda
elseif vDistTail and #vDistTail > 0 then
-- verifico che il foro sia di coda
if ( bOpen or ( not bOpen and vtExtr:getX() < 0 and vProc[i].Fcs ~= 0) or ( not bOpen and vtExtr:getX() > 0 and vProc[i].Fce ~= 0)) then
vProc[i].MachineAfterTailCutId = vMachineBeforeIntersectingDrillings.Tail.Id
if vProc[i].Dependency and vProc[i].Dependency.ExecAfter and vProc[i].Dependency.ExecAfter.Id == vMachineBeforeIntersectingDrillings.Tail.Id then
vProc[i].MachineAfterTailCutId = vMachineBeforeIntersectingDrillings.Tail.Id
end
vProc[i].Tail = true
end
end
@@ -1956,6 +2112,7 @@ local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeInt
end
end
-------------------------------------------------------------------------------------------------------------
local function AreDrillingsMirrored( Proc, ProcMirror, b3Raw)
if Proc.Id == ProcMirror.Id then return false end
@@ -2021,44 +2178,101 @@ local function AreDrillingsMirrored( Proc, ProcMirror, b3Raw)
end
-------------------------------------------------------------------------------------------------------------
function GetFeatureInfoAndDependency( vProc, b3Raw)
-- ciclo tutte le feature
for i = 1, #vProc do
local Proc = vProc[i]
-- calcolo topologia della feature
if NeedTopologyFeature( Proc) then
Topology.Classify( Proc, b3Raw)
-- se non richiesto, setto 'SPECIAL'
else
Proc.Topology = 'SPECIAL'
Proc.TopologyLongName = Proc.Topology
end
-- controllo la feature con tutte le altre per recuperare le dipendenze
for j = 1, #vProc do
local ProcB = vProc[j]
-- verifico se feature tipo LapJoint è attraversata da almeno un foro
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove' or Mortise.Identify( Proc)) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
-- se foro in coda non setto la dipendenza
if not ProcB.AffectedFaces.Left then
Proc.PassedByHole = true
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
end
function GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
if vProc and #vProc > 0 and nPartId then
-- recupero ID per tagli troncanti testa e coda
local nHeadCuttingFeatureId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i') or 0
local nTailCuttingFeatureId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i') or 0
-- ciclo tutte le feature
for i = 1, #vProc do
local Proc = vProc[i]
-- calcolo topologia della feature
if NeedTopologyFeature( Proc) then
Topology.Classify( Proc, b3Raw)
-- se non richiesto, setto 'SPECIAL'
else
Proc.Topology = 'SPECIAL'
Proc.TopologyLongName = Proc.Topology
end
-- verifico se feature tipo LapJoint è attraversata da almeno una mortasa a coda di rondine
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove') and DtMortise.SideIdentify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
Proc.PassedByDtMortise = true
end
-- se tenone è attraversato da foro allora il foro deve essere fatto prima
if Tenon.Identify( Proc) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
Proc.PassedByHole = true
end
-- verifiche per specchiature
if BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS then
-- forature
if BD.DOUBLE_HEAD_DRILLING and Drill.Identify( Proc) and Drill.Identify( ProcB) and not Proc.Mirror then
if AreDrillingsMirrored( Proc, ProcB, b3Raw) then
Proc.Mirror = ProcB
-- controllo la feature con tutte le altre per recuperare le dipendenze
for j = 1, #vProc do
-- non si controlla feature con sé stessa
if i ~= j then
local ProcB = vProc[j]
-- verifico se feature tipo LapJoint è attraversata da almeno un foro
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove' or Mortise.Identify( Proc)) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
-- se foro in coda non setto la dipendenza
if not ProcB.AffectedFaces.Left then
Proc.PassedByHole = true
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
end
end
-- verifico se feature tipo LapJoint è attraversata da almeno una mortasa a coda di rondine
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove')
and DtMortise.SideIdentify( ProcB) and Overlaps( Proc.Box, ProcB.Box) and DtMortise.IsDeeper( ProcB, b3Raw) then
Proc.PassedByDtMortise = true
end
-- se tenone è attraversato da foro allora il foro deve essere fatto prima
if Tenon.Identify( Proc) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
Proc.PassedByHole = true
end
-- se taglio attraversato da foro, si definisce precedenza in base ad angolo
if Drill.Identify( Proc) and Cut.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
-- recupero e verifico l'entità foro
local DrillAuxId = ( EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0) + Proc.Id
local vtDrillExtr = EgtCurveExtrusion( DrillAuxId, GDB_RT.GLOB)
local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs)
local ptCut, vtCutN = EgtSurfTmFacetCenter( ProcB.Id, 0, GDB_ID.ROOT)
local dMaxAngleDrillOnCut = BD.MAX_ANGLE_DRILL_CUT or 10
if GetAngle( vtDrillExtr, vtCutN) > dMaxAngleDrillOnCut then
if bOpen and GetAngle( -vtDrillExtr, vtCutN) < dMaxAngleDrillOnCut then
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
Proc.Dependency = {}
Proc.Dependency.ExecAfter = ProcB
else
Proc.Dependency = {}
Proc.Dependency.ExecBefore = ProcB
ProcB.Dependency = {}
ProcB.Dependency.ExecAfter = Proc
end
else
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
Proc.Dependency = {}
Proc.Dependency.ExecAfter = ProcB
end
end
-- verifiche per specchiature
if BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS then
-- forature
if BD.DOUBLE_HEAD_DRILLING and Drill.Identify( Proc) and Drill.Identify( ProcB) and not Proc.Mirror then
if AreDrillingsMirrored( Proc, ProcB, b3Raw) then
Proc.Mirror = ProcB
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
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
-- se una feature deve essere lavorata prima dei tagli troncanti, si setta che non esiste taglio troncante
if Proc.Dependency and Proc.Dependency.ExecBefore and Proc.Dependency.ExecBefore.Id == nHeadCuttingFeatureId then
-- EgtRemoveInfo( nPartId, 'HEADCUTFEATUREID')
end
if Proc.Dependency and Proc.Dependency.ExecBefore and Proc.Dependency.ExecBefore.Id == nTailCuttingFeatureId then
-- EgtRemoveInfo( nPartId, 'TAILCUTFEATUREID')
end
end
end
@@ -2073,13 +2287,13 @@ function BeamExec.ProcessFeatures()
end
-- costanti per doppio
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
BD.ROT90 = BD.ROT90 and Verify90DegRotation( EgtGetFirstRawPart())
-- ciclo sui pezzi
local nTotErr = 0
local Stats = {}
local nOrd = 1
local nOrd = 1
local nRawId = EgtGetFirstRawPart()
while nRawId do
-- verifico che il grezzo contenga pezzi oppure sia abbastanza lungo da essere scaricato coi carrelli
@@ -2103,7 +2317,7 @@ function BeamExec.ProcessFeatures()
-- recupero le feature di lavorazione della trave
local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
-- 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
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
@@ -2115,7 +2329,7 @@ function BeamExec.ProcessFeatures()
SetMirroredFeatures( vProc, b3Raw)
end
-- le ordino lungo X
OrderFeatures( vProc, b3Raw)
OrderFeatures( vProc, b3Raw, nPartId)
-- le classifico
local bAllOk, bSomeDown, bSomeSide, bSplitRot = ClassifyFeatures( vProc, b3Raw, Stats)
if not bAllOk then
+48 -12
View File
@@ -551,7 +551,7 @@ function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
local nAddGrpId = BeamLib.GetAddGroup( nPartId)
if not nAddGrpId then
EgtOutLog( 'Error : missing AddGroup')
return 0, 0, 0
return 0, 0, 0, 0
end
-- verifico eventuale intersezione tra la faccia i-1 esima e la proiezione dell'altra sulla stessa
local nShadowFacetId = EgtCopySurfTmFacet( nSurfId, j - 1, nAddGrpId)
@@ -698,17 +698,19 @@ function BeamLib.GetFaceHvRefDim( nSurfId, nFacet, b3Raw)
local b3HV = EgtSurfTmGetFacetBBoxRef( nSurfId, nFacet, GDB_BB.STANDARD, frHV)
local dDimH = b3HV:getDimX()
local dDimV = b3HV:getDimY()
-- Si mantiene rettangolo minimo perchè in alcuni casi andava in collisione. Lascio il calcolo in caso si debba ripristinare.
-- se definito grezzo (o solido), applico eventuali limiti
if b3Raw then
local dCoeffY = abs( frHV:getVersX():getY())
if dCoeffY > GEO.EPS_SMALL then
dDimH = min( dDimH, b3Raw:getDimY() / dCoeffY)
end
local dCoeffZ = abs( frHV:getVersY():getZ())
if dCoeffZ > GEO.EPS_SMALL then
dDimV = min( dDimV, b3Raw:getDimZ() / dCoeffZ)
end
end
-- if b3Raw then
-- local dCoeffY = abs( frHV:getVersX():getY())
-- if dCoeffY > GEO.EPS_SMALL then
-- dDimH = min( dDimH, b3Raw:getDimY() / dCoeffY)
-- end
-- local dCoeffZ = abs( frHV:getVersY():getZ())
-- if dCoeffZ > GEO.EPS_SMALL then
-- dDimV = min( dDimV, b3Raw:getDimZ() / dCoeffZ)
-- end
-- end
-- restituisco i valori calcolati
return frHV, dDimH, dDimV
end
@@ -1189,7 +1191,7 @@ end
-------------------------------------------------------------------------------------------------------------
-- 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)
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
-------------------------------------------------------------------------------------------------------------
@@ -1401,5 +1403,39 @@ function BeamLib.GetToolFromMachining( sMachiningName)
return Tool
end
-------------------------------------------------------------------------------------------------------------
--- copia una tabella lua in modo ricorsivo, ossia mantiene indipendenti anche tutte le sottotabelle
--- ATTENZIONE: in caso di modifiche vanno gestiti anche i tipi custom; sarebbe meglio metterla nel LuaLibs
function BeamLib.TableCopyDeep( OriginalTable)
-- controllo se oggetto passato è valido, altrimenti errore. Non deve mai succedere
if not OriginalTable then
error( "TableCopyDeep : can't copy nil object")
end
local CopiedTable = {}
for key, value in pairs( OriginalTable) do
if type( value) == "table" then
if isBBox3d( value) then
CopiedTable[ key] = BBox3d( value)
elseif isColor3d( value) then
CopiedTable[ key] = Color3d( value)
elseif isFrame3d( value) then
CopiedTable[ key] = Frame3d( value)
elseif isPoint3d( value) then
CopiedTable[ key] = Point3d( value)
elseif isQuaternion( value) then
CopiedTable[ key] = Quaternion( value)
elseif isVector3d( value) then
CopiedTable[ key] = Vector3d( value)
else
CopiedTable[ key] = BeamLib.TableCopyDeep( value)
end
else
CopiedTable[ key] = value
end
end
return CopiedTable
end
-------------------------------------------------------------------------------------------------------------
return BeamLib
+1 -1
View File
@@ -423,7 +423,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
-- se piani non ortogonali, diminuisco la distanza di offset opportunamente
local originalOffsetP = OffsetP
if not bGetOrtoPlanes then
local dCoeff = ( vtNPlanes ^ vtNBond):len()
local dCoeff = max( ( vtNPlanes ^ vtNBond):len(), 0.5)
OffsetP = OffsetP * dCoeff
OffsetO = OffsetO * dCoeff
end
+1 -1
View File
@@ -30,7 +30,7 @@ local function ApplyPocket( Proc, nSurfId, nFacet, sPocketing, nInd, dMaxElev, v
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
-- imposto note utente
local sNotes = ''
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
-- eventuale massima elevazione
if dMaxElev > 0.1 then
sNotes = EgtSetValInNotes( sNotes, 'MaxElev', EgtNumToString( dMaxElev, 2))
+7 -5
View File
@@ -596,14 +596,16 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- vtFaceUse non funziona correttaemnte in caso che il lato da lavorare sia a 45°. Potrebbe ritornare una trilinea, non gestibile. Quindi si setta l'EDGE
-- vtFaceUse non funziona correttamente in caso che il lato da lavorare sia a 45°. Potrebbe ritornare una trilinea, non gestibile. Quindi si setta l'EDGE
local nEdgeFaceUse = GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrthO)
if nEdgeFaceUse and ( AreSameOrOppositeDirApprox( vtOrthO:getX(), 0.707) or AreSameOrOppositeDirApprox( vtOrthO:getY(), 0.707) or AreSameOrOppositeDirApprox( vtOrthO:getZ(), 0.707)) then
local sNoteEdgeFaceUse = 'EdgesFaceUse=' .. EgtNumToString( nEdgeFaceUse) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNoteEdgeFaceUse)
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'EdgesFaceUse', EgtNumToString( nEdgeFaceUse))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
else
local sNoteVtFaceUse = 'VtFaceUse=' .. EgtNumToString( vtOrthO:getX(),3) .. ',' .. EgtNumToString( vtOrthO:getY(),3) .. ',' .. EgtNumToString( vtOrthO:getZ(),3) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNoteVtFaceUse)
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtFaceUse', EgtNumToString( vtOrthO:getX(), 3) .. ',' .. EgtNumToString( vtOrthO:getY(), 3) .. ',' .. EgtNumToString( vtOrthO:getZ(), 3))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- imposto allungamenti iniziale e finale (in caso si utilizzi EDGE, non serve prolungare o accorciare)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
+6 -1
View File
@@ -139,6 +139,7 @@ end
---------------------------------------------------------------------
function VerifyMill( Machining, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2)
if ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) and
( Machining.Type ~= 'FloatingAggregate' or abs( Machining.Tool.MaxMat - dDepth) < 100 * GEO.EPS_SMALL) and
( not sTuuidMstr or sTuuidMstr == Machining.Tool.UUID) and
( not dMaxDiam or Machining.Tool.Diameter < dMaxDiam + GEO.EPS_SMALL) and
( not dMaxTotLen or Machining.Tool.TotalLength < dMaxTotLen + GEO.EPS_SMALL) then
@@ -227,7 +228,11 @@ function GetMachinings( MachiningType, sType)
table.insert( validMachinings, Machining)
-- se non è tastatura, recupero dati utensile
if MachiningType ~= MCH_MY.PROBING then
if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then
-- caso speciale utensile su aggregato flottante
if MachiningType == MCH_MY.MILLING and sType == 'FloatingAggregate' then
local sNotes = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
Machining.Tool.MaxMat = EgtGetValInNotes( sNotes, 'TOOL_OVERHANG', 'd') or -1
elseif ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then
Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth()
else
Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
+12 -7
View File
@@ -65,11 +65,14 @@ function ProcessCut.Classify( Proc, b3Raw)
end
-- recupero i dati del taglio
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
if vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1 or ( vtN:getZ() <= - 0.174 and abs( vtN:getY()) > 0.866) then
-- calcolo le massime estensioni lineari orizzontale e verticale della faccia
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
-- calcolo le massime estensioni lineari orizzontale e verticale della faccia
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
if ( vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1) or
( vtN:getZ() <= - 0.174 and abs( vtN:getY()) > 0.866) or
( vtN:getZ() <= - 0.174 and abs( vtN:getZ()) * DimV > BD.MAX_DIM_DICE)
then
-- confronto queste estensioni con la massima dimensione del DiceCut (impossibile lavorare se entrambe maggiori)
if DimH > BD.MAX_DIM_DICE and DimV > BD.MAX_DIM_DICE then
if DimH > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL and DimV > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL then
return true, true
end
end
@@ -90,7 +93,7 @@ function ProcessCut.Classify( Proc, b3Raw)
end
end
-- calcolo l'ingombro orizzontale della faccia
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
_, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale)
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and ( abs( vtN:getY()) > 0.1) and dMaxMat < DimH + BD.CUT_EXTRA) then
return true, true
@@ -379,7 +382,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
local vCuts = {}
local dDicingOffsetP
local dDicingOffsetO
if ( ( not Proc.AdvTail) or bForceDicing) and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
if ( ( not Proc.AdvTail) or bForceDicing) and
( dCutH - 100 * GEO.EPS_SMALL > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or
dCutV - 100 * GEO.EPS_SMALL > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
local ptExtra, vtExtra
local bAutoCalcSurf = true
if Proc.AdvTail then
@@ -627,7 +632,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
local vtOrthoO
if bFromBottom and dCutV < dMaxDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
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
vtOrthoO = Z_AX()
elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and
+30 -7
View File
@@ -475,13 +475,36 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- dati delle facce
local ptC = {}
local vtN = {}
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
ptC[2], vtN[2] = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
local idFirstFace, idSecondFace
-- se ci sono più di due face (caso insolito), si prendono le facce più grandi
if Proc.Fct > 2 then
local Area = {}
-- si prendono le due più grandi, potrebbero essercene più di due
for i = 1, Proc.Fct do
local _, dL, dW = EgtSurfTmFacetMinAreaRectangle( Proc.Id, i - 1)
table.insert( Area, { nIndex = i-1, dArea = dL*dW})
end
-- ordina 'Area' in ordine decrescente
table.sort( Area, function( A, B)
return A.dArea > B.dArea
end
)
idFirstFace = Area[1].nIndex
idSecondFace = Area[2].nIndex
else
idFirstFace = 0
idSecondFace = 1
end
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, idFirstFace, GDB_ID.ROOT)
ptC[2], vtN[2] = EgtSurfTmFacetCenter( Proc.Id, idSecondFace, GDB_ID.ROOT)
-- normale media per capire se taglio di testa o di coda
local vtNm = ( vtN[1] + vtN[2]) ; vtNm:normalize()
local bHead = ( vtNm:getX() > 0)
-- angolo diedro per stabilire se taglio convesso
local bAdj, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
local bAdj, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, idFirstFace, idSecondFace, GDB_ID.ROOT)
local bConvex = true
local bOnY = true
local ptPs = ( ptC[1] + ptC[2]) / 2
@@ -492,8 +515,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
bConvex = ( dAng > 0)
end
-- determino quale faccia è più grande
local _, dB1, dH1 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0)
local _, dB2, dH2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 1)
local _, dB1, dH1 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, idFirstFace)
local _, dB2, dH2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, idSecondFace)
local nBigInd = EgtIf( dB1 * dH1 >= dB2 * dH2, 1, 2)
local nSmaInd = 3 - nBigInd
-- inserimento smussi
@@ -560,8 +583,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
local _, _, dDimV1 = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local _, _, dDimV2 = BL.GetFaceHvRefDim( Proc.Id, 1, b3Raw)
local _, _, dDimV1 = BL.GetFaceHvRefDim( Proc.Id, idFirstFace, b3Raw)
local _, _, dDimV2 = BL.GetFaceHvRefDim( Proc.Id, idSecondFace, b3Raw)
local bFace1TooLongForBlade, bFace2TooLongForBlade = ( dDimV1 >= dMaxDepth), ( dDimV2 >= dMaxDepth)
local dFace1Ang, dFace2Ang = vtN[1]:getZ(), vtN[2]:getZ()
if bFace1TooLongForBlade and dFace1Ang < ( BD.CUT_VZ_MIN or -0.484) or bFace2TooLongForBlade and dFace2Ang < ( BD.CUT_VZ_MIN or -0.484) then
+100 -40
View File
@@ -134,7 +134,8 @@ function ProcessDrill.Split( Proc, b3Raw)
local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs)
-- recupero flag abilitazione split (0=auto,1=no)
local bTrySplit = ( EgtGetInfo( Proc.Id, 'Q02', 'i') ~= 1)
if not bTrySplit then
local bOnlyContour = ( EgtGetInfo( Proc.Id, 'Q04', 'i') == 1)
if ( not bTrySplit) or bOnlyContour then
return false
end
-- restituisco se va fatto in doppio (solo fori orizzontali)
@@ -313,9 +314,41 @@ local function GetHoleStartData( ptCen, vtExtr, b3Solid)
return nFac, CosB, vFaces
end
---------------------------------------------------------------------
local function GetSCC( Proc, vtExtr, b3Solid, bDrillAngTrasm, nPhase)
local nSCC = MCH_SCC.NONE
if bDrillAngTrasm then
nSCC = MCH_SCC.ADIR_NEAR
elseif BD.TURN == 2 then
nSCC = MCH_SCC.ADIR_ZP
elseif not BD.C_SIMM and not BD.TURN then
nSCC = MCH_SCC.ADIR_YM
if AreSameVectorApprox( vtExtr, Z_AX()) then
nSCC = MCH_SCC.ADIR_YM
elseif abs( vtExtr:getX()) < 0.1 then
local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000)
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
elseif vtExtr:getY() > 0.1 then
nSCC = MCH_SCC.ADIR_YP
end
else
nSCC = MCH_SCC.NONE
end
return nSCC
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- Se forzato contorno foro forzo richiamo a FreeContour e uscita dalla funzione
if EgtGetInfo( Proc.Id, 'Q04', 'i') == 1 then
_G.package.loaded.ProcessFreeContour = nil
local FreeContour = require( 'ProcessFreeContour')
return FreeContour.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
-- default per costanti
BD.DRILL_VX_MAX_ANGLEDRILL = ( BD.DRILL_VX_MAX_ANGLEDRILL or 0.928)
-- ingombro del pezzo
@@ -527,6 +560,17 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
-- Verifico inclinazione foro nei limiti
local bTryDrill = EgtIf( dMaxDepth > 0, ( CosB < BD.DRILL_VX_MAX), false)
-- se il foro deve essere eseguito dopo un taglio, potrebbe essere perchè il taglio crea una superficie perpendicolare
if Proc.Dependency and Proc.Dependency.ExecAfter then
local ptCut, vtCutN = EgtSurfTmFacetCenter( Proc.Dependency.ExecAfter.Id, 0, GDB_ID.ROOT)
local dMaxAngleDrillOnCut = BD.MAX_ANGLE_DRILL_CUT or 10
local dAngle = GetAngle( vtExtr, vtCutN)
CosB = cos( dAngle)
if dAngle < dMaxAngleDrillOnCut then
-- controllo di essere nei limiti
bTryDrill = true
end
end
if ( CosB > 0.8 * BD.DRILL_VX_MAX and CosB < BD.DRILL_VX_MAX_ANGLEDRILL) then
-- cerco le forature speciali AngleDrill
local sDrilling3, sType3, dMaxDepth3 = ML.FindAngleDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown)
@@ -577,6 +621,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
dDepth = dMaxDepth
dMaxElev = dMaxDepth
end
-- inserisco la lavorazione
local sName = EgtIf( EgtStartsWith( sType, 'Predrill'), 'Predrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sDrilling)
@@ -587,6 +632,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- eventuali note utente
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
-- eventuale inversione
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'Drill_AT' or sType == 'AngleDrill' or sType == 'Predrill' then
EgtSetMachiningParam( MCH_MP.INVERT, bToInvert)
@@ -594,31 +641,25 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert)
end
-- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if bDrillAngTrasm then
nSCC = MCH_SCC.ADIR_NEAR
elseif BD.TURN == 2 then
nSCC = MCH_SCC.ADIR_ZP
elseif not BD.C_SIMM and not BD.TURN then
nSCC = MCH_SCC.ADIR_YM
if AreSameVectorApprox( vtExtr, Z_AX()) then
nSCC = MCH_SCC.ADIR_YM
elseif abs( vtExtr:getX()) < 0.1 then
local bNearTail = ( Proc.Box:getCenter():getX() < b3Solid:getCenter():getX() and Proc.Box:getCenter():getX() - b3Solid:getMin():getX() < 1000)
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
elseif vtExtr:getY() > 0.1 then
nSCC = MCH_SCC.ADIR_YP
end
else
nSCC = MCH_SCC.NONE
end
local nSCC = GetSCC( Proc, vtExtr, b3Solid, bDrillAngTrasm, nPhase)
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto affondamento
if Proc.Double and Proc.Double > 0 and dDepth > Proc.MachDepthDouble + 10 * GEO.EPS_SMALL then
sMyWarn = 'Warning in double head drilling : depth (' .. EgtNumToString( dDepth, 1) .. ') reduced to (' .. EgtNumToString( Proc.MachDepthDouble, 1) .. ') to match H2 max tool depth'
dDepth = Proc.MachDepthDouble
dMaxElev = Proc.MachDepthDouble
local dLastStepDepth
if Proc.Double and Proc.Double > 0 then
if ( sType == 'Pocket_AT' or sType == 'Pocket') then
if bOpen then
local dReduceDepth = MIRROR_POCKETS_MIN_DISTANCE / 2 + 10
dLastStepDepth = dDepth + dReduceDepth
dDepth = dDepth - dReduceDepth
end
else
sUserNotes = EgtSetValInNotes( sUserNotes, 'LastStep', MIRROR_DRILLINGS_MIN_DISTANCE / 2 + 15)
end
if dDepth > Proc.MachDepthDouble + 10 * GEO.EPS_SMALL then
sMyWarn = 'Warning in double head drilling : depth (' .. EgtNumToString( dDepth, 1) .. ') reduced to (' .. EgtNumToString( Proc.MachDepthDouble, 1) .. ') to match H2 max tool depth'
dDepth = Proc.MachDepthDouble
dMaxElev = Proc.MachDepthDouble
end
end
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- imposto il valore della distanza di sicurezza per l'attacco. Se il valore del db utensili è troppo basso lo alzo a 10.
@@ -626,11 +667,19 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local dMinStartPos = 10
local dStartPos = max( dMinStartPos, dToolDbStartPos)
EgtSetMachiningParam( MCH_MP.STARTPOS, dStartPos)
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill
local sUserNotes = EgtSetVal( 'VMRS', 0) .. ';'
-- dichiarazione nessuna generazione sfridi per Vmill
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
-- aggiungo alle note massima elevazione (coincide con affondamento)
if dMaxElev then
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 1))
local dCustomMaxElev
if Proc.dCustomMaxElev and type( Proc.dCustomMaxElev) == "number" and Proc.dCustomMaxElev > 10 * GEO.EPS_SMALL then
dCustomMaxElev = Proc.dCustomMaxElev
end
if dMaxElev or dCustomMaxElev then
if dCustomMaxElev then
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dCustomMaxElev, 1))
else
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev, 1))
end
end
-- se foro passante, aggiungo questa qualifica alle note
if ( sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill') and bOpen then
@@ -638,16 +687,6 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
end
-- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then
-- calcolo gli step reali
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
local nNumStep = ceil( dDepth/dStep)
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
if ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then
dRealStep = ceil( dDepth / (nNumStep - 1))
EgtSetMachiningParam( MCH_MP.STEP, dRealStep)
sMyWarn ='Warning in drill-double : step changed to ' .. tostring(dRealStep) .. 'mm'
end
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= Proc.PrevDouble then
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
@@ -666,7 +705,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
end
if not bOk then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
EgtSetOperationMode( nMchId, false)
return false, sErr
else
local _, sWarn = EgtGetMachMgrWarning( 0)
@@ -674,6 +713,27 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
EgtSetOperationMode( nMchId, false)
return false, sWarn
else
-- se DrillPocket passante in doppio si fa lavorazione aggiuntiva dell'ultimo step
if Proc.Double and Proc.Double > 0 and ( sType == 'Pocket_AT' or sType == 'Pocket') and bOpen then
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
local idProcLastStep = EgtCopyGlob( Proc.Id, nAddGrpId)
local idAuxIdLastStep = EgtCopyGlob( AuxId, nAddGrpId)
EgtModifyCurveThickness( idAuxIdLastStep, -dLastStepDepth)
local ProcLastStep = BL.TableCopyDeep( Proc)
ProcLastStep.Id = idProcLastStep
ProcLastStep.Flg = 1
ProcLastStep.Double = 0
ProcLastStep.dCustomMaxElev = dLastStepDepth - dDepth
local bOkLastStep, sWarnLastStep = ProcessDrill.Make( ProcLastStep, nPhase, nRawId, nPartId)
if not bOkLastStep then
sWarnLastStep = 'Drillpocket double : incomplete, last step missing'
end
local sPreviousWarn = sMyWarn or sWarn
if sWarnLastStep then
if not sPreviousWarn then sPreviousWarn = '' end
sMyWarn = EgtIf( #sPreviousWarn > 0, sPreviousWarn .. '\n' .. sWarnLastStep, sWarnLastStep)
end
end
return true, ( sMyWarn or sWarn)
end
end
+148 -97
View File
@@ -51,6 +51,23 @@ function ProcessDtMortise.FrontIdentify( Proc)
return (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 56)
end
---------------------------------------------------------------------
-- Riconoscimento della feature profonda, non sulla faccia della trave
function ProcessDtMortise.IsDeeper( Proc, b3Raw)
-- recupero i dati della curva di contorno della faccia di fondo
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if not AuxId then return false end
AuxId = AuxId + Proc.Id
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
if ( AreSameVectorApprox( vtExtr, -Y_AX()) and Proc.Box:getMin():getY() > b3Raw:getMin():getY() + 100 * GEO.EPS_SMALL) or
( AreSameVectorApprox( vtExtr, Y_AX()) and Proc.Box:getMax():getY() < b3Raw:getMax():getY() - 100 * GEO.EPS_SMALL) or
( AreSameVectorApprox( vtExtr, -Z_AX()) and Proc.Box:getMin():getZ() > b3Raw:getMin():getZ() + 100 * GEO.EPS_SMALL) or
( AreSameVectorApprox( vtExtr, Z_AX()) and Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 100 * GEO.EPS_SMALL) then
return true
end
return false
end
---------------------------------------------------------------------
-- Verifica se feature di coda
function ProcessDtMortise.IsTailFeature( Proc, b3Raw)
@@ -172,6 +189,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local sWarn
bMakeAntiSplitPath = true
-- ingombro del pezzo
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
@@ -365,11 +383,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- se con tasca, la lavoro (mai in doppio)
if bPocket then
-- recupero il contorno della tasca (seconda curva ausiliaria)
local sVal = EgtGetInfo( Proc.Id, 'AUXID')
local vsAuxId = EgtSplitString( sVal)
local vAuxId = EgtGetInfo( Proc.Id, 'AUXID', 'vi')
local Aux2Id
if vsAuxId and #vsAuxId >=2 then
Aux2Id = tonumber( vsAuxId[2])
if vAuxId and #vAuxId >=2 then
Aux2Id = vAuxId[2]
end
if Aux2Id then Aux2Id = Aux2Id + Proc.Id end
if not Aux2Id or ( EgtGetType( Aux2Id) & GDB_FY.GEO_CURVE) == 0 then
@@ -405,7 +422,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Aux2Id, -1}})
-- dichiaro non si generano sfridi per VMill
local sUserNotes = 'MaxElev='.. EgtNumToString( dMaxMat - 0.1, 1) .. '; VMRS=0;'
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
@@ -447,94 +466,100 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local nAuxId1 = CalcPathAtHeight( Proc.Id, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
-- se esiste il percorso
if nAuxId1 then
-- creo percorso sulla parte alta della mortasa
local dToolRadDelta = dAltMort * tan( dSideAng)
local dTopDiam = dToolDiam + 2 * dToolRadDelta
-- recupero punto iniziale e finale del percorso
local ptStart = EgtSP( nAuxId1, GDB_RT.GLOB)
local ptEnd = EgtEP( nAuxId1, GDB_RT.GLOB)
if ptStart and ptEnd then
local nId1
-- se richiesti due segmenti di linea
if not bMakeAsByArc then
-- determino il punto comune dei due segmenti
local vtDelta = ( ptEnd - ptStart) / 4
vtDelta:rotate( vtExtr, -90)
local ptMid = ( ptStart + ptEnd) / 2 + vtDelta
-- creo la spezzata formata dai due segmenti
nId1 = EgtCurveCompoFromPoints( nAddGrpId, { ptStart, ptMid, ptEnd}, GDB_RT.GLOB)
-- altrimenti richiesto arco
if EgtCurveIsFlat( nAuxId1) then
-- creo percorso sulla parte alta della mortasa
local dToolRadDelta = dAltMort * tan( dSideAng)
local dTopDiam = dToolDiam + 2 * dToolRadDelta
-- recupero punto iniziale e finale del percorso
local ptStart = EgtSP( nAuxId1, GDB_RT.GLOB)
local ptEnd = EgtEP( nAuxId1, GDB_RT.GLOB)
if ptStart and ptEnd then
local nId1
-- se richiesti due segmenti di linea
if not bMakeAsByArc then
-- determino il punto comune dei due segmenti
local vtDelta = ( ptEnd - ptStart) / 4
vtDelta:rotate( vtExtr, -90)
local ptMid = ( ptStart + ptEnd) / 2 + vtDelta
-- creo la spezzata formata dai due segmenti
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 = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dAltMort, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, '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
-- 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 '
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
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
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
EgtOutLog( sErr)
return false, sErr
sWarn = 'Warning : skipped DoveTail mortise antisplint'
end
else
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
@@ -613,20 +638,44 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- 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))
local ptS = EgtSP( AuxId, GDB_ID.ROOT)
local ptE = EgtEP( AuxId, GDB_ID.ROOT)
-- in presenza di pocket imposto dati ingresso e uscita
if bPocket then
-- recupero il contorno della tasca (seconda curva ausiliaria)
local vAuxId = EgtGetInfo( Proc.Id, 'AUXID', 'vi')
-- si prende il centro del percorso da svuotare ( non si controlla che sia presente perchè già verificata in precedenza)
local ptPocketCenter = EgtGP( Proc.Id + vAuxId[2], GDB_ID.ROOT)
-- calcolo componente tangente e lineare di ingresso
local vtS = EgtSV( Proc.Id + vAuxId[1], GDB_ID.ROOT) -- vettore entrante percorso
local vtOffS = EgtSV( Proc.Id + vAuxId[1], GDB_ID.ROOT) ; vtOffS:rotate( vtExtr, 90) -- vettore da punto iniziale a centro utensile
local vtStartToCenter = ptPocketCenter - ( ptS + ( vtOffS * ( dToolDiam/2))) -- vettore da centro utensilenel punto iniziale e centro del percorso da svuotare
local dLenStartToCenter = vtStartToCenter:len() -- distanza da centro utensile a centro del percorso da svuotare
local dStartTangComp = abs( vtStartToCenter * vtS) -- prodotto scalare tra vettore entrante e vettore tra centro utensilee percordo da svuotare (componente tangente)
local dStartPerpComp = sqrt( dLenStartToCenter^2 - dStartTangComp^2) -- pitagora tra componente tangente e la lunghezza tra i due centri
-- calcolo componente tangente e lineare di uscita
local vtE = EgtEV( Proc.Id + vAuxId[1], GDB_ID.ROOT)
local vtOffE = EgtEV( Proc.Id + vAuxId[1], GDB_ID.ROOT) ; vtOffE:rotate( vtExtr, 90)
local vtEndToCenter = ptPocketCenter - ( ptE + ( vtOffE * ( dToolDiam/2)))
local dLenEndToCenter = vtEndToCenter:len()
local dEndTangComp = abs( vtEndToCenter * vtE)
local dEndPerpComp = sqrt( dLenEndToCenter^2 - dEndTangComp^2)
EgtSetMachiningParam( MCH_MP.STARTPOS, 5)
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 5)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2)
EgtSetMachiningParam( MCH_MP.LIPERP, 5)
EgtSetMachiningParam( MCH_MP.LITANG, dStartTangComp)
EgtSetMachiningParam( MCH_MP.LIPERP, dStartPerpComp)
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.TANGENT)
EgtSetMachiningParam( MCH_MP.LOTANG, dEndTangComp)
EgtSetMachiningParam( MCH_MP.LOPERP, dEndPerpComp)
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
-- altrimenti verifico se sono bilanciati ingresso e uscita, per evitare inizio o fine nel legno
else
local ptS = EgtSP( AuxId, GDB_ID.ROOT)
local ptE = EgtEP( AuxId, GDB_ID.ROOT)
local dDistS = abs( ( ptS - rfDtMrt:getOrigin()) * rfDtMrt:getVersX())
local dDistE = abs( ( ptE - rfDtMrt:getOrigin()) * rfDtMrt:getVersX())
local dIni, dFin = EgtCurveDomain( AuxId)
@@ -650,7 +699,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if bMultipleZPasses then
dMaxElev = dVerticalStep
end
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
if bPocket then
sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3)
@@ -675,7 +726,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr
end
end
return true
return true, sWarn
end
---------------------------------------------------------------------
+123 -8
View File
@@ -64,14 +64,14 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
-- se tenone praticamente in asse, accetto fino a -22 deg
if abs( vtN:getY()) < 0.088 then
return ( vtN:getZ() >= -0.375)
-- altrimenti, accetto fino a -10 deg
-- altrimenti, accetto fino a -12.5 deg
else
return ( vtN:getZ() >= -0.174)
return ( vtN:getZ() >= -0.216)
end
-- altrimenti
else
-- accetto fino a -7deg
return ( vtN:getZ() >= -0.122)
-- accetto fino a -12.5 deg
return ( vtN:getZ() >= -0.216)
end
end
@@ -109,8 +109,9 @@ local function ApplyPocket( Proc, sPocketing, nStep, dSurfStep, nIdSurf, vtExtr)
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
if dSurfStep > 0 then
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
-- imposto elevazione
local sNotes = 'MaxElev=' .. EgtNumToString( dSurfStep, 2) .. ';'
sNotes = EgtSetValInNotes( sNotes, 'MaxElev', EgtNumToString( dSurfStep, 2))
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
end
-- imposto posizione braccio porta testa
@@ -209,7 +210,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,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
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)
if not bOk then return bOk, sErr end
end
@@ -309,7 +323,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- sistemo i parametri
local dOffs = ( i - 1) * dStep
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dDtTenH, 1)) .. ';'
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dDtTenH, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- sistemo il lato e la direzione di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
@@ -352,8 +367,108 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
BL.UpdateTCING( nRawId, dOffs)
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 = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, '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
end
end
---------------------------------------------------------------------
return ProcessDtTenon
+32 -3
View File
@@ -29,11 +29,13 @@ local ML = require( 'MachiningLib')
local Q_DIM_STRIP = 'Q01' -- d
local Q_DEPTH_CHAMFER = 'Q02' -- d
local Q_OVERMAT_FOR_FINISH = 'Q03' -- d
local Q_ONLY_CONTOUR = 'Q04' -- i, valido solo per drill
local Q_ONLY_CHAMFER = 'Q00' -- i
local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket
local Q_IGNORE_LASER_PROBLEMS = 'Q07'
local Q_FORCE_CLAMPABLE_AREA = 'Q08'
local Q_INVERT_LAST_PATH = 'Q09'
local Q_MAX_ELEVATION = 'Q10' -- d
---------------------------------------------------------------------
-- Riconoscimento della feature
@@ -184,6 +186,8 @@ local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham, bDownHead)
EgtOutLog( sErr)
return -1, 0, sErr
end
else
sMilling = ''
end
return nChamfer, dDepth, sMilling
@@ -235,6 +239,7 @@ end
local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
local bContourFromDrill = EgtGetInfo( Proc.Id, Q_ONLY_CONTOUR, 'i') == 1
-- ingombro del pezzo
local Ls = EgtGetFirstNameInGroup( nPartId, 'Box')
local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD)
@@ -259,7 +264,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- verifico se in testa o coda
local bHead = Proc.Head
-- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva
local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true)
local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true, nil)
-- recupero la lavorazione
local bTopHead = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.1)
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
@@ -631,6 +636,14 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtOutLog( sErr)
return false, sErr
end
-- eventuale elevazione forzata
local dCustomMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
if dCustomMaxElev and dCustomMaxElev < 1 then dCustomMaxElev = nil end
if dCustomMaxElev then
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dCustomMaxElev, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
end
-- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
end
@@ -663,7 +676,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- assegno lato di lavoro
if Proc.Grp == 0 then
if bContourFromDrill then
dWorkSide = MCH_MILL_WS.LEFT
elseif Proc.Grp == 0 then
dWorkSide = MCH_MILL_WS.CENTER
elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) or ( Proc.Grp == 1 and bToolInv) or ( Proc.Grp == 2 and bToolInv) then
dWorkSide = MCH_MILL_WS.LEFT
@@ -695,6 +710,14 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToolInvert)
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, dWorkSide)
-- setto valori specifici se lavorazione nel pieno del solo contorno di un foro
if bContourFromDrill then
local dWorkStep = max( ( EgtGetMachiningParam( MCH_MP.STEP) or 0) * 0.75, dToolDiam)
EgtSetMachiningParam( MCH_MP.STEP, dWorkStep)
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.GLIDE)
EgtSetMachiningParam( MCH_MP.LIELEV, dWorkStep)
EgtSetMachiningParam( MCH_MP.LITANG, dWorkStep)
end
-- posizione braccio porta testa
@@ -897,7 +920,9 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- imposto elevazione
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';')
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxDepth, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- imposto eventuale offset radiale, se impostato dall'utente
local dRadialOffset = EgtGetInfo( Proc.Id, Q_RADIAL_OFFSET, 'd') or 0
if abs( dRadialOffset) > 10 * GEO.EPS_SMALL then
@@ -993,6 +1018,10 @@ function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
Q_DEPTH_CHAMFER = 'Q01'
Q_DIM_STRIP = 'Q02'
end
if Proc.Prc == 40 then
Q_DIM_STRIP = ''
Q_OVERMAT_FOR_FINISH = ''
end
-- recupero la tipologia
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
-- se svuotatura
+116
View File
@@ -159,6 +159,112 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
return true, nil
end
---------------------------------------------------------------------
-- smussi in testa
local function MakeHeadChamfer( idProc, nPartId)
local dDepthHeadChamfer = EgtGetInfo( idProc, 'Q08', 'd') or 0
-- se non attivo esco subito
if dDepthHeadChamfer < 100 * GEO.EPS_SMALL then
return
end
-- recupero gruppo per geometria aggiuntiva
local AddGrpId = BL.GetAddGroup( nPartId)
if not AddGrpId then
local sErr = 'Error on process StartFace impossible to find AddGroup'
EgtOutLog( sErr)
return false, sErr
end
-- recupero la lavorazione
local sMilling = ML.FindMilling( 'Mark')
if not sMilling then
local sErr = 'Error : milling not found in library'
EgtOutLog( sErr)
return false, sErr
end
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( idProc, 0, AddGrpId)
if not nLoopId or nLoopCnt > 1 then
local sErr = 'Error MakeHeadChamfer : too many loops'
EgtOutLog( sErr)
return false, sErr
end
-- setto direzione estrusione corretta
EgtModifyCurveExtrusion( nLoopId, X_AX())
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.RIGHT))
local dQ09Value = EgtGetInfo( idProc, 'Q09', 'd')
if not dQ09Value then
dQ09Value = 0.1
end
local bChamferedEdge = dQ09Value > 0
dQ09Value = EgtIf( bChamferedEdge, max( dQ09Value, 0.1), min( dQ09Value, -0.1))
local nIdFirstEntity, nEntityCnt = EgtExplodeCurveCompo( nLoopId)
local p3MidPoint = EgtMP( nIdFirstEntity, GDB_ID.GRID)
for i = 0, nEntityCnt - 1 do
if EgtCurveLength( nIdFirstEntity + i) - 10 < abs( dQ09Value) * 2 then
local sErr = 'Error MakeHeadChamfer : Q09 too high'
EgtOutLog( sErr)
return false, sErr
end
end
-- creo raccordo o fillet
for i = 0, nEntityCnt - 1 do
local idFirst = nIdFirstEntity + i
local idSecond = EgtIf( i == nEntityCnt - 1, nIdFirstEntity, idFirst + 1)
local ptEndPointFirst = EgtEP( idFirst, GDB_ID.GRID) - ( abs( dQ09Value) * EgtEV( idFirst, GDB_ID.GRID))
local ptStartPointSecond = EgtSP( idSecond, GDB_ID.GRID) + ( abs( dQ09Value) * EgtEV( idSecond, GDB_ID.GRID))
if bChamferedEdge then
EgtCurveChamfer( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID)
else
EgtCurveFillet( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID)
end
end
EgtSelectPathObjs( nIdFirstEntity, true)
local idGeom, idGeomCnt = EgtCurveCompoByChain( AddGrpId, GDB_ID.SEL, {0,0,0}, true)
if not idGeom or idGeomCnt > 1 then
local sErr = 'Error MakeHeadChamfer : too many loops'
EgtOutLog( sErr)
return false, sErr
end
EgtChangeClosedCurveStartPoint( idGeom, p3MidPoint, GDB_RT.GRID)
-- reimposto la griglia
EgtSetGridFrame()
-- Inserisco la lavorazione del lato standard
local dExtra = 2
local sName1 = 'HeadCham_' .. ( EgtGetName( idProc) or tostring( idProc))
local nMch1Id = EgtAddMachining( sName1, sMilling)
if not nMch1Id then
local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ idGeom, -1}})
-- assegno affondamento e offset radiale
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthHeadChamfer + dExtra)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMch1Id, false)
return false, sErr
end
return true, nil
end
---------------------------------------------------------------------
-- tagli verticali aggiuntivi
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, dOffsetBetweenCuts)
@@ -533,6 +639,16 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, HeadCutType, Cutting1Data, Cutting2Data, nil, dOvmHead)
-- alla fine del taglio si aggiungono gli smussi in testa
local _, sErrHeadChamfer = MakeHeadChamfer( nOriId or Proc.Id, nPartId)
if sErr then
sErr = sErr..'\n'..sErrHeadChamfer
else
sErr = sErrHeadChamfer
end
return bOk, sErr
end
File diff suppressed because it is too large Load Diff
+7 -5
View File
@@ -483,9 +483,10 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sWarn)
end
-- imposto elevazione e dichiaro non si generano sfridi per VMill
local sNotes = 'MaxElev=' .. EgtNumToString( dFacElev, 1) .. ';'
sNotes = sNotes .. 'VMRS=0;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dFacElev, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
-- provo ad allargare leggermente la tasca
@@ -1425,8 +1426,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- eventuale nota utente per disabilitare controllo ingresso e uscita in grezzo
if k < nO then
local sNotes = 'OutRaw=3;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3)
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- aumento ingresso su spezzoni per evitare collisione durante approccio pezzo
if bFront then
-- se invertito si allunga ingresso su tutti tranne su ultimo
+103 -24
View File
@@ -226,9 +226,10 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId, nSide, nFacInd, d
EgtOutLog( sWarn)
end
-- imposto elevazione e dichiaro non si generano sfridi per VMill
local sNotes = 'MaxElev=' .. EgtNumToString( dFacElev, 1) .. ';'
sNotes = sNotes .. 'VMRS=0;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dFacElev, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
-- provo ad allargare leggermente la tasca
@@ -319,7 +320,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster, nUseSideToolMaster)
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster, nUseSideToolMaster, nUseConventionalMilling)
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
@@ -1131,8 +1132,17 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
elseif ( nSide ~= -1 or BD.DOWN_HEAD or BD.TURN) and nUseMillOnSide == 0 then
-- determino la massima elevazione
local dElev = 0
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[1], b3Solid)
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[2], b3Solid)
-- calcolo l'elevazione della faccia principale
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[1]], b3Solid)
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[2]], b3Solid)
local bFacesSwapped = false
if bInt and not bConvex and dFacElev1 - 10* GEO.EPS_SMALL > dFacElev2 then
vOrd[1], vOrd[2] = vOrd[2], vOrd[1]
dFacElev1, dFacElev2 = dFacElev2, dFacElev1
bFacesSwapped = true
end
-- se facce concave e a 90 gradi, prendo l'elevazione minima
if bOrtho then
dElev = min( dFacElev1, dFacElev2)
@@ -1173,10 +1183,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- se chiuso e corto, applico svuotatura con fresa opportuna
if nFaceLimit == 3 and Proc.Box:getDimX() < 2 * dToolDiam then
-- svuotatura della prima faccia longitudinale
local bOk, sErr = MakeByPocketing( Proc, nPhase, nRawId, nPartId, nSide, tFaceLong[1], dFacElev1)
local bOk, sErr = MakeByPocketing( Proc, nPhase, nRawId, nPartId, nSide, tFaceLong[vOrd[1]], dFacElev1)
-- svuotatura della seconda faccia longitudinale
if not bOk then return bOk, sErr end
return MakeByPocketing( Proc, nPhase, nRawId, nPartId, nSide, tFaceLong[2], dFacElev2)
return MakeByPocketing( Proc, nPhase, nRawId, nPartId, nSide, tFaceLong[vOrd[2]], dFacElev2)
end
-- determino gli estremi
local dStartDist = 0
@@ -1267,26 +1277,28 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local dLimitAngle = -0.5 - 20 * GEO.EPS_SMALL
-- se facce ortogonali (concave), mantengo la lavorazione di testa sulla faccia più grande purchè non superi di 30 gradi il sottosquadra
if bOrtho then
if vtN[vOrd[1]]:getZ() > 0.001 and vtN[vOrd[2]]:getZ() > 0.001 then
if vtN[vOrd[1]]:getZ() >= vtN[vOrd[2]]:getZ() then
local vtN1 = vtN[vOrd[1]]
local vtN2 = vtN[vOrd[2]]
if vtN1:getZ() > 0.001 and vtN2:getZ() > 0.001 then
if vtN1:getZ() >= vtN2:getZ() then
nFin = 1
else
nIni = 2
end
else
if vtN[vOrd[1]]:getZ() < dLimitAngle then
if vtN1:getZ() < dLimitAngle then
nIni = 2
elseif vtN[vOrd[2]]:getZ() < dLimitAngle then
elseif vtN2:getZ() < dLimitAngle then
nFin = 1
else
if vtN[vOrd[1]]:getZ() >= vtN[vOrd[2]]:getZ() then
if vtN[vOrd[2]]:getZ() < dLimitAngle then
nFin = 1
else
if vtN1:getZ() >= vtN2:getZ() then
if vtN1:getZ() < dLimitAngle then
nIni = 2
else
nFin = 1
end
else
if vtN[vOrd[1]]:getZ() < dLimitAngle then
if vtN1:getZ() < dLimitAngle then
nIni = 2
else
nFin = 1
@@ -1334,7 +1346,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
nSCC = EgtIf( nSide == -1, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
end
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)
end
end
@@ -1352,7 +1364,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
if dMachDepth > dMaxDepth - 10 * GEO.EPS_ANG_SMALL then
-- verifico se posso lavorare la faccia 2
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]
dLargh = vWidth[vOrd[i]]
dSal, dEal = dEal, dSal
@@ -1380,15 +1392,19 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtOutLog( sErr)
return false, sErr
end
local dMySal, dMyEal = dSal, dEal
if bFacesSwapped then
dMySal, dMyEal = dMyEal, dMySal
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, tFaceLong[vOrd[i]]}})
-- limito opportunamente la lavorazione
if ( nSide == -1 and BD.DOWN_HEAD) then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dMyEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dMySal)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dMySal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dMyEal)
end
-- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
@@ -1399,6 +1415,28 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- imposto lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bIsMachDownUp, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bSide, true, false))
-- si aggiusta la direzione di lavoro in base a rotazione utensile e preferenza utente (nUseConventionalMilling da fuori o Q14)
EgtMdbSetCurrMachining( sMilling)
local bIsCurrentToolCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
if nUseConventionalMilling == nil then
nUseConventionalMilling = EgtGetInfo( Proc.Id, 'Q14', 'd') or 0
end
local bUseConventionalMilling = false
if nUseConventionalMilling == 1 or ( nUseConventionalMilling == 2 and vtN[vOrd[i]]:getX() < 0.1 and Proc.AffectedFaces.Bottom) then
bUseConventionalMilling = true
end
if bIsCurrentToolCCW ~= bUseConventionalMilling then
local dCurrStartAddLen = EgtGetMachiningParam( MCH_MP.STARTADDLEN)
local dCurrEndAddLen = EgtGetMachiningParam( MCH_MP.ENDADDLEN)
local bCurrInvert = EgtGetMachiningParam( MCH_MP.INVERT)
local nCurrWorkside = EgtGetMachiningParam( MCH_MP.WORKSIDE)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dCurrEndAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dCurrStartAddLen)
EgtSetMachiningParam( MCH_MP.INVERT, not bCurrInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nCurrWorkside == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
end
-- imposto offset radiale (nullo se concavo o di lato)
local dOffsR = EgtIf( k < nO, ( nO - k) * dStep, EgtIf( bConvex, - BD.CUT_EXTRA, 0))
if bSide then dOffsR = 0 end
@@ -1544,6 +1582,12 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- calcolo l'elevazione della faccia principale
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[1]], b3Solid)
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[2]], b3Solid)
local bFacesSwapped = false
if bInt and not bConvex and dFacElev1 - 10* GEO.EPS_SMALL > dFacElev2 then
vOrd[1], vOrd[2] = vOrd[2], vOrd[1]
dFacElev1, dFacElev2 = dFacElev2, dFacElev1
bFacesSwapped = true
end
-- se fresa di fianco o da sotto calcolo quanto l'utensile può andare vicino al limite se l'elevazione della faccia è minore del raggio utensile
if nUseMillOnSide <= 1 or nSide == -1 then
local dFacElev = max( dFacElev1, dFacElev2)
@@ -1642,6 +1686,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
dEndAccDist = 0
end
end
if Proc.bMoveAfterSplit then
nC = 1
dStartDist = Proc.Box:getDimX() - ( dToolDiam / 2 + 5)
dEndDist = - ( dToolDiam / 2 + 5)
end
-- ciclo sulle parti
local nM = 0
for j = 1, nC do
@@ -1724,7 +1773,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local ptC3 = EgtSurfTmFacetCenter( Proc.Id, tFaceLong[vOrd[i]], GDB_ID.ROOT)
local ptDir = ptC3 - ptM ; ptDir:normalize()
-- se concave e dal versore Z della faccia (> -20°) o convesso e versore Z ( > -30°) decido se eseguire la lavoraione con la testa da sopra o da sotto
if ( not bConvex and vtN[vOrd[i]]:getZ() > -0.9397 and ptDir:getZ() > 0) or
if ( not bConvex and vtN[vOrd[i]]:getZ() > -0.9397 and ptDir:getZ() > -0.017) or
( bConvex and vtN[vOrd[i]]:getZ() > -0.866 and ptDir:getZ() > 0) then
sNameF = sPrefix .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
nMchFId = EgtAddMachining( sNameF, sMilling)
@@ -1832,9 +1881,39 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse[vOrd[i]])
end
end
if bFacesSwapped then
local dCurrStartAddLen = EgtGetMachiningParam( MCH_MP.STARTADDLEN)
local dCurrEndAddLen = EgtGetMachiningParam( MCH_MP.ENDADDLEN)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dCurrEndAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dCurrStartAddLen)
end
-- imposto lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bIsMachDownUp, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
EgtSetMachiningParam( MCH_MP.INVERT, true)
-- si aggiusta la direzione di lavoro in base a rotazione utensile e preferenza utente (nUseConventionalMilling da fuori o Q14)
EgtMdbSetCurrMachining( sMilling)
local bIsCurrentToolCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
if nUseConventionalMilling == nil then
nUseConventionalMilling = EgtGetInfo( Proc.Id, 'Q14', 'd') or 0
end
local bUseConventionalMilling = false
if nUseConventionalMilling == 1 or ( nUseConventionalMilling == 2 and vtN[vOrd[i]]:getX() < 0.1 and Proc.AffectedFaces.Bottom) then
bUseConventionalMilling = true
end
if bIsCurrentToolCCW ~= bUseConventionalMilling then
local dCurrStartAddLen = EgtGetMachiningParam( MCH_MP.STARTADDLEN)
local dCurrEndAddLen = EgtGetMachiningParam( MCH_MP.ENDADDLEN)
local bCurrInvert = EgtGetMachiningParam( MCH_MP.INVERT)
local nCurrWorkside = EgtGetMachiningParam( MCH_MP.WORKSIDE)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dCurrEndAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dCurrStartAddLen)
EgtSetMachiningParam( MCH_MP.INVERT, not bCurrInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nCurrWorkside == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
end
-- calcolo la componente dNz non in base alla classificazione della feature (sopra, sotto, fianchi) ma alla componente maggiore
-- local dNz = EgtIf( nSide == 0, vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
-- local dNz = EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
+34 -8
View File
@@ -128,8 +128,9 @@ end
local nFaceUse = BL.GetNearestParalOpposite( vtN)
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- applico il parametro plunge, che setta la lavorazione per affondare solamente, senza lavorare tutto il contorno; 1: solo lato iniziale, 2: solo lato finale, 3: entrambi
local sNotes = 'Plunge=3;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'Plunge' , 3)
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- imposto angolo 3° asse rot
local vtOrtho = BL.GetVersRef( nFaceUse)
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sMortising, 'perpendicular'))
@@ -353,6 +354,18 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
BL.SetOpenSide( AuxId, b3Solid)
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)
@@ -486,6 +499,10 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
-- determino larghezza della mortasa
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
local bPockUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
local bPockDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174)
@@ -564,16 +581,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
local sPocketing
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
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, _, bExcludeH2)
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, _, bExcludeH2)
end
end
if not sPocketing then
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
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, _, bExcludeH2)
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, _, bExcludeH2)
end
end
if not sPocketing then
@@ -594,6 +611,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
bCW = ( dSpeed >= 0)
end
end
-- inserisco la lavorazione di svuotatura
local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sPocketing)
@@ -613,6 +631,11 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
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
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- sistemo la direzione di lavoro
@@ -670,7 +693,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
end
-- imposto elevazione
local sUserNotes = 'MaxElev=' .. EgtNumToString( dMorH, 1) .. ';'
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMorH, 1))
-- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
@@ -730,7 +754,9 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- setto profondità
EgtSetMachiningParam( MCH_MP.DEPTH, -nDepthMin+BD.CUT_EXTRA)
-- imposto elevazione
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (-nDepthMin+BD.CUT_EXTRA), 1) .. ';')
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( (-nDepthMin+BD.CUT_EXTRA), 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
+4 -2
View File
@@ -506,7 +506,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- se il chamfer non è esclusivo continuo con le altre lavorazioni
if nChamfer < 2 then
-- verifico se necessario lavorare in doppio
local bDouble = ( dProfDepth + BD.CUT_EXTRA > dToolMaxDepth)
local bDouble = ( dProfDepth + BD.CUT_EXTRA - 100 * GEO.EPS_SMALL > dToolMaxDepth)
local dDepth = min( dToolMaxDepth, dProfDepth / 2 + BD.MILL_OVERLAP)
-- se lavorazione da due parti, aggiungo la seconda
local sMillingDown
@@ -796,8 +796,10 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if bDoubleFinishMill then
local sNewName = 'FinB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
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.INVERT, true)
-- eseguo
if not ML.ApplyMachining( true, false) then
+7 -3
View File
@@ -453,7 +453,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
end
-- verifico se necessario lavorare in doppio
local bDouble = ( dProfDepth + BD.CUT_EXTRA > dToolMaxDepth)
local bDouble = ( dProfDepth + BD.CUT_EXTRA - 100 * GEO.EPS_SMALL > dToolMaxDepth)
local dDepth = min( dToolMaxDepth, dProfDepth / 2 + BD.MILL_OVERLAP)
-- se lavorazione da due parti, aggiungo la seconda
local sMillingDown
@@ -666,7 +666,9 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1))
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( (dToolMaxDepth/2), 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
end
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
@@ -716,7 +718,9 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
EgtSetMachiningParam( MCH_MP.STEP, 0)
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dWidth, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if BD.TURN then
local nSCC = GetSccForTurn( vtN)
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
+7 -3
View File
@@ -453,7 +453,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
end
-- verifico se necessario lavorare in doppio
local bDouble = ( dProfDepth + BD.CUT_EXTRA > dToolMaxDepth)
local bDouble = ( dProfDepth + BD.CUT_EXTRA - 100 * GEO.EPS_SMALL > dToolMaxDepth)
local dDepth = min( dToolMaxDepth, dProfDepth / 2 + BD.MILL_OVERLAP)
-- se lavorazione da due parti, aggiungo la seconda
local sMillingDown
@@ -666,7 +666,9 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1))
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( (dToolMaxDepth/2), 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
end
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
@@ -716,7 +718,9 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
EgtSetMachiningParam( MCH_MP.STEP, 0)
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dWidth, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if BD.TURN then
local nSCC = GetSccForTurn( vtN)
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
+3 -1
View File
@@ -602,7 +602,9 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
EgtSetMachiningParam( MCH_MP.STEP, 0)
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dWidth, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- imposto tipo uso faccia
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
if nSide == -1 then
+6 -2
View File
@@ -657,7 +657,9 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
EgtSetMachiningParam( MCH_MP.STEP, 0)
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dElev, 1))
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- imposto posizione braccio
local nSCC = MCH_SCC.ADIR_YM
if nSide == 0 then
@@ -697,7 +699,9 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
EgtSetMachiningParam( MCH_MP.STEP, 0)
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dElev, 1))
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- imposto posizione braccio
local nSCC = MCH_SCC.ADIR_YM
if nSide == 0 then
+3 -1
View File
@@ -578,7 +578,9 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
EgtSetMachiningGeometry( {{ Proc.Id, vFaceOrd[2]-1}})
-- imposto elevazione
if dDistFaces then
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dDistFaces, 1) .. ';')
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dDistFaces, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
end
-- eseguo
if not ML.ApplyMachining( true, false) then
+144 -1
View File
@@ -167,6 +167,108 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmTail)
return true, nil
end
---------------------------------------------------------------------
-- smussi in coda
local function MakeTailChamfer( idProc, nPartId, dDepthTailChamfer)
-- recupero gruppo per geometria aggiuntiva
local AddGrpId = BL.GetAddGroup( nPartId)
if not AddGrpId then
local sErr = 'Error on process StartFace impossible to find AddGroup'
EgtOutLog( sErr)
return false, sErr
end
-- recupero la lavorazione
local sMilling = ML.FindMilling( 'Mark')
if not sMilling then
local sErr = 'Error : milling not found in library'
EgtOutLog( sErr)
return false, sErr
end
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( idProc, 0, AddGrpId)
if not nLoopId or nLoopCnt > 1 then
local sErr = 'Error MakeHeadChamfer : too many loops'
EgtOutLog( sErr)
return false, sErr
end
-- setto direzione estrusione corretta
EgtModifyCurveExtrusion( nLoopId, -X_AX())
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.LEFT))
local dQ09Value = EgtGetInfo( idProc, 'Q09', 'd')
if not dQ09Value then
dQ09Value = 0.1
end
local bChamferedEdge = dQ09Value > 0
dQ09Value = EgtIf( bChamferedEdge, max( dQ09Value, 0.1), min( dQ09Value, -0.1))
local nIdFirstEntity, nEntityCnt = EgtExplodeCurveCompo( nLoopId)
local p3MidPoint = EgtMP( nIdFirstEntity, GDB_ID.GRID)
for i = 0, nEntityCnt - 1 do
if EgtCurveLength( nIdFirstEntity + i) - 10 < abs( dQ09Value) * 2 then
local sErr = 'Error MakeTailChamfer : Q09 too high'
EgtOutLog( sErr)
return false, sErr
end
end
-- creo raccordo o fillet
for i = 0, nEntityCnt - 1 do
local idFirst = nIdFirstEntity + i
local idSecond = EgtIf( i == nEntityCnt - 1, nIdFirstEntity, idFirst + 1)
local ptEndPointFirst = EgtEP( idFirst, GDB_ID.GRID) - ( abs( dQ09Value) * EgtEV( idFirst, GDB_ID.GRID))
local ptStartPointSecond = EgtSP( idSecond, GDB_ID.GRID) + ( abs( dQ09Value) * EgtEV( idSecond, GDB_ID.GRID))
if bChamferedEdge then
EgtCurveChamfer( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID)
else
EgtCurveFillet( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID)
end
end
EgtSelectPathObjs( nIdFirstEntity, true)
local idGeom, idGeomCnt = EgtCurveCompoByChain( AddGrpId, GDB_ID.SEL, {0,0,0}, true)
if not idGeom or idGeomCnt > 1 then
local sErr = 'Error MakeTailChamfer : too many loops'
EgtOutLog( sErr)
return false, sErr
end
EgtChangeClosedCurveStartPoint( idGeom, p3MidPoint, GDB_RT.GRID)
-- reimposto la griglia
EgtSetGridFrame()
-- Inserisco la lavorazione del lato standard
local dExtra = 2
local sName1 = 'TailCham_' .. ( EgtGetName( idProc) or tostring( idProc))
local nMch1Id = EgtAddMachining( sName1, sMilling)
if not nMch1Id then
local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ idGeom, -1}})
-- assegno affondamento e offset radiale
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthTailChamfer + dExtra)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMch1Id, false)
return false, sErr
end
return true, nil
end
---------------------------------------------------------------------
-- lavorazione con sega a catena per sezioni alte e larghe
local function MakeCutByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes, dRadialOffset, bExtendStartEnd, bInvert)
@@ -208,6 +310,10 @@ local function MakeCutByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes, dR
local vtN = EgtSurfTmFacetNormVersor( nSurfId, 0, GDB_ID.ROOT)
local vtOrtho = BL.GetVersRef( nFaceUse)
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
-- se il taglio è un precut, sto 10mm più all'interno per essere sicuro di tagliare effettivamente qualcosa
if BD.PRECUT_TAIL and sNotes and sNotes:find( 'Precut;') then
dRadialOffset = dRadialOffset - 10
end
-- imposto offset radiale per mantenere il materiale in coda per la finitura
EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset)
-- imposto eventuale allungamento percorso iniziale
@@ -662,7 +768,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
local dMinTailScrapForAdditionalCuts = 10.123
local bNeedVerticalAddedCuts = not bSplit and ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL)
local bNeedHorizontalAddedCuts = not bSplit and not bBigSectionCut and
( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and
( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE) + 100 * GEO.EPS_SMALL) and
( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) and
dOffsL < BD.MAX_DIM_DICE
-- dati lavorazioni sopra e sotto
@@ -819,6 +925,43 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, TailCutType, Cutting1Data, Cutting2Data, nil, dLenEndRaw)
-- se smussi in coda da aggiungere
local dDepthTailChamfer = EgtGetInfo( nOriId or Proc.Id, 'Q08', 'd') or 0
if dDepthTailChamfer > 100 * GEO.EPS_SMALL then
-- creo subito nuova fase qui, a meno che non sia stata già creata
if nNewPhase == 0 then
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET)
nNewPhase = EgtGetCurrPhase()
local nDispId = EgtGetPhaseDisposition( nNewPhase)
if sDownOrSideOrStd == 'down' then
EgtRotateRawPart( nRawId, X_AX(), 180)
EgtSetInfo( nDispId, 'TYPE', 'MID2')
EgtSetInfo( nDispId, 'ROT', -2)
elseif sDownOrSideOrStd == 'side' then
if bPreMove then EgtMoveRawPart( nRawId, vtMove) end
EgtRotateRawPart( nRawId, X_AX(), EgtIf( BD.RIGHT_LOAD, -90, 90))
if not bPreMove then EgtMoveRawPart( nRawId, vtMove) end
EgtSetInfo( nDispId, 'TYPE', 'MID2')
EgtSetInfo( nDispId, 'ROT', -1)
else
EgtSetInfo( nDispId, 'TYPE', 'END')
end
EgtSetInfo( nDispId, 'ORD', nOrd)
-- se grezzo successivo senza pezzi e finale, va tolto
local nNextRawId = EgtGetNextRawPart( nRawId)
if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then
EgtRemoveRawPartFromCurrPhase( nNextRawId)
end
end
-- alla fine del taglio si aggiungono gli smussi in testa
local _, sErrHeadChamfer = MakeTailChamfer( nOriId or Proc.Id, nPartId, dDepthTailChamfer)
if sErr then
sErr = sErr..'\n'..sErrHeadChamfer
else
sErr = sErrHeadChamfer
end
end
return bOk, sErr, nNewPhase
end
+8 -3
View File
@@ -13,6 +13,7 @@ local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut')
local Topology = require( 'FeatureTopology')
local LapJoint = require( 'ProcessLapJoint')
EgtOutLog( ' ProcessStepJointNotch started', 1)
@@ -49,7 +50,7 @@ function ProcessStepJointNotch.Classify( Proc)
-- numero delle facce
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
-- 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
end
-- verifico le normali delle facce
@@ -180,8 +181,9 @@ local function MakePocket( Proc, nPartId, ptPs, vtN, nFaceRef, nDiffWidth, sMchF
-- La tasca ha sempre almeno un lato aperto, imposto opportuno attacco
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
-- imposto elevazione
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if not ML.ApplyMachining( true, false) then
-- provo ad allargare leggermente la tasca
EgtSetMachiningParam( MCH_MP.OFFSR, -0.1)
@@ -583,6 +585,9 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
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
-- ottengo anche il flag che indica che la feature è larga come la trave
local bOkc, sErrC, nDiffWidth = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
+5 -2
View File
@@ -236,7 +236,9 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- assegno affondamento e offset radiale
EgtSetMachiningParam( MCH_MP.DEPTH, -dTenH + dDepth + dExtra)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dDepth + dExtra, 1) .. ';')
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dDepth + dExtra, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
-- eseguo
@@ -309,7 +311,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- sistemo i parametri
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dTenH - 100 * GEO.EPS_SMALL, 1)) .. ';'
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dTenH - 100 * GEO.EPS_SMALL, 1))
if i < nPass then sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3) end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
+4 -4
View File
@@ -451,12 +451,12 @@ local function MakeMillCut( Proc, i, j, k, sMilling, nFacInd, TabNAD, rfFac, dOf
EgtSetMachiningParam( MCH_MP.STARTADDLEN, ( dToolDiam * 0.75))
EgtSetMachiningParam( MCH_MP.ENDADDLEN, ( dToolDiam * 0.75))
-- Note utente con dichiarazione nessuna generazione sfridi per Vmill solo in ultima passata in Z locale
local sUserNotes
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
if i < nStep then
sUserNotes = 'MaxElev=' .. EgtNumToString( dStep, 1) .. ';'
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dStep, 1))
else
sUserNotes = 'VMRS=0;'
sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dStep, 1) .. ';'
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dStep, 1))
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
+3 -1
View File
@@ -142,7 +142,9 @@ local function MakePocket( Proc, nRawId, b3Raw, nPartId)
end
EgtSetMachiningParam( MCH_MP.DEPTH, min( 0, dMaxDepth - vDepth[i]))
-- imposto elevazione
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';')
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxDepth, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
+61
View File
@@ -1,5 +1,66 @@
==== Beam Update Log ====
Versione 3.1b1 (26/02/2026)
- Added : in LapJoint lunghe gestito Q14 per lavorare discorde
- Added : in forature ora sono possibili le DrillPocket in doppio (ultimo step fatto dalla testa principale)
- Added : in FreeContour (contornatura) aggiunta Q10 per forzare massima elevazione
- Modif : in LongDoubleCut e LapJoint lunghe migliorata la scelta della faccia da lavorare e altre migliorie
- Modif : in LapJoint migliorie alle svuotature
- Modif : in LapJoint lunghe, negli spezzoni successivi al primo, le svuotature considerano l'area svuotata precedente
- Fixed : in forature in doppio si garantisce l'ultimo step per evitare collisioni delle punte o finecorsa
- Fixed : in mortasa a coda di rondine tagliata corretti ingresso uscita in caso di svuotatura
- Fixed : in tagli di testa e coda corretti smussi con P08 e P09
Versione 2.7l3 (23/12/2025)
- Modif : nei fori che attraversano un taglio si decide la precedenza in base all'angolo tra foro e taglio stesso
- Fixed : corretto precut in caso di sega a catena
Versione 2.7l2 (16/12/2025)
- Added : in LapJoint pulizia spigoli con fresa a V su tasche non passanti
Versione 2.7l1 (10/12/2025)
- Added : in LapJoint aggiunta gestione fresatura con aggregato flottante (Q specifica)
- Modif : in LapJoint modfifiche alla lavorazione spigoli su faccia frontale o posteriore
- Modif : in LapJoint lunghe, la spezzatura ora considera se è presente del grezzo dietro
Versione 2.7k1 (25/11/2025)
- Added : in tagli di testa e coda aggiunti smussi con possibilità di raccordare o smussare spigoli
- Added : in Lapjoint aggiunto Q14 per settare lavorazione discorde se longitudinale su faccia sotto
- Modif : migliorati i tagli
- Modif : migliorata lavorazione mortasa a coda di rondine
- Fixed : in Lapjoint alcune svuotature forzate a spirale
Versione 2.7j2 (30/10/2025)
- Fixed : in DoubleCut gestito il caso in cui si ha una terza faccia piccola da non lavorare
Versione 2.7j1 (28/10/2025)
- Modif : migliorato ordinamento feature
- Modif : in mortasa si considera ora il raggio minimo impostato da parametro P
- Modif : migliorie in tenone a coda di rondine
- Fixed : in mortasa corretto percorso errato in caso di diametro utensile uguale a larghezza tasca
- Fixed : in profilo cambered (103) gestito correttamente inverti in lavorazione
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
+3 -3
View File
@@ -1,6 +1,6 @@
-- Version.lua by Egaltech s.r.l. 2024/01/30
-- Version.lua by Egaltech s.r.l. 2026/02/09
-- Gestione della versione di Beam
NAME = 'Beam'
VERSION = '2.7h1'
MIN_EXE = '2.7f2'
VERSION = '3.1b1'
MIN_EXE = '3.1b1'