Compare commits

..

689 Commits

Author SHA1 Message Date
luca.mazzoleni eb8c78b7b1 Merge branch 'develop' into CheckGenerateFix 2024-09-13 10:03:05 +02:00
andrea.villa 4eefdf0842 In FacesBySaw per settare il FaceUse si usa il versore nelle UserNotes 2024-09-12 09:22:28 +02:00
luca.mazzoleni b536c30a88 Merge branch 'develop' into CheckGenerateFix 2024-09-11 13:51:11 +02:00
andrea.villa 9a0ea2e431 Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2024-09-11 08:13:26 +02:00
andrea.villa d61a47755c - ProcessDrill In GetData corretta gestione modifica diametro foro 2024-09-11 08:13:23 +02:00
luca.mazzoleni c6b8b74f26 - in BatchProcess riportate modifiche alla BatchProcessNew: in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check 2024-09-10 18:27:12 +02:00
luca.mazzoleni 53cd49bed1 Merge branch 'develop' into CheckGenerateFix 2024-09-10 18:18:17 +02:00
luca.mazzoleni 2f4a77c73e - in FacesBySaw si invertono gli accorciamenti solo se l'inversione del percorso non è forzata dall'esterno; adeguati HeadCut e Split 2024-09-10 18:12:47 +02:00
luca.mazzoleni 64a3f75b31 Merge branch 'develop' into CheckGenerateFix 2024-09-10 14:13:31 +02:00
luca.mazzoleni 000358b6a6 Merge remote-tracking branch 'origin/master' into develop 2024-09-10 14:12:58 +02:00
Emmanuele Sassi 6c16e7b70a - correzione in lettura array per cambio dll di lettura 2024-09-10 09:02:02 +02:00
luca.mazzoleni 1ae32451e5 Merge branch 'develop' into CheckGenerateFix 2024-09-09 14:43:55 +02:00
luca.mazzoleni 4c68955ba2 Merge tag '2.6i1' into develop
release
2024-09-09 14:42:36 +02:00
luca.mazzoleni dd80929ae1 Merge branch 'release/2.6i1' 2024-09-09 14:42:27 +02:00
luca.mazzoleni af80170976 update log e versione 2024-09-09 14:27:25 +02:00
luca.mazzoleni bf2742c6c7 - in BatchProcessNew, in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check 2024-09-09 14:04:46 +02:00
luca.mazzoleni ec09b3f70c in FacesBySaw -> MakeOne correzione a scelta inversione / lato di lavoro 2024-09-06 09:11:14 +02:00
luca.mazzoleni 952d40cb2b Merge branch 'ZeroPreCutForHeadCutSplit' into develop 2024-09-05 15:57:23 +02:00
luca.mazzoleni 0a767d1afd - in Headcut e Split aggiunta gestione parametro MIN_HEIGHT_ADDED_CUTS da BeamData per scegliere l'altezza minima per cui devono essere aggiunti i tagli orizzontali supplementari 2024-09-05 12:12:29 +02:00
luca.mazzoleni d5be638099 Merge branch 'develop' into ZeroPreCutForHeadCutSplit 2024-09-04 18:28:17 +02:00
luca.mazzoleni b6c5514f9e - in HeadCut e Split correzioni a pretaglio a zero 2024-09-04 18:27:39 +02:00
luca.mazzoleni 4fd18d377f - in split modifiche per precut 2024-09-04 17:52:37 +02:00
andrea.villa 9dff37f1f4 Gestione dipendenza foro-tasca in caso di fase con pezzo ribaltato 2024-09-04 15:54:13 +02:00
luca.mazzoleni b71ad963f1 Merge branch 'develop' into ZeroPreCutForHeadCutSplit 2024-09-04 09:17:07 +02:00
andrea.villa 3aefca4613 - In Mark, gestita la lavorazione del testo 2024-09-04 09:16:24 +02:00
luca.mazzoleni cc5117aa11 - in Split refactoring e implemento pretaglio a zero
- in HeadCut piccole migliorie in pretaglio a zero
2024-09-03 18:02:18 +02:00
andrea.villa c5a8b852d9 - in LapJpint, in MakeLongMoreFaces si aggiunge faccia di fondo anche per topologia Groove passante a 3 facce 2024-09-03 15:11:53 +02:00
andrea.villa 69514074a9 - In ScarfJoint, in ApplyDiceCut, tagli paralleli fatti con unico passaggio di fianco 2024-09-03 12:45:28 +02:00
luca.mazzoleni 6ecd613f12 - in HeadCut corrette Width e Height invertite 2024-09-02 16:54:47 +02:00
luca.mazzoleni 6e4dee29af modifiche a HeadCut per introduzione tagli a zero (PreCut) per evitare problemi con pezzi non lunghi quanto ci si aspetta 2024-09-02 10:29:08 +02:00
luca.mazzoleni da7ebc6b97 - refactoring di ProcessHeadCut 2024-08-29 18:17:08 +02:00
luca.mazzoleni 4685b6bde6 - se lapjoint attraversata da L055, la lapjoint viene fatta prima 2024-08-29 10:47:51 +02:00
luca.mazzoleni 3a063bd2cf Merge branch 'master' into develop 2024-08-26 18:10:47 +02:00
luca.mazzoleni 710a1fe070 - HotFix: in FacesBySaw -> MakeOne corretto SCC in caso di soluzione alternativa 2024-08-26 18:10:20 +02:00
luca.mazzoleni d818492d67 Merge tag '2.6h2' into develop
release
2024-08-26 15:43:59 +02:00
luca.mazzoleni e55e33c40a Merge branch 'release/2.6h2' 2024-08-26 15:43:44 +02:00
luca.mazzoleni 8cadb25261 update log e version 2024-08-26 15:43:30 +02:00
luca.mazzoleni 2622b58cad Merge branch 'OneFaceCutAlternativeDirection' into develop 2024-08-26 15:31:03 +02:00
luca.mazzoleni b5be932955 - in FacesBySaw -> MakeOne aggiunta la possibilità di passare una direzione di lavoro alternativa per poter rispettare contemporaneamente la direzione di lavoro concorde e la direzione di taglio 2024-08-26 15:17:31 +02:00
luca.mazzoleni 44ac2f8c2a Merge branch 'test' into develop 2024-08-22 16:37:55 +02:00
luca.mazzoleni 0b928e987f - in LapJoint -> svuotatura, correzione all'utilizzo dell'elevazione custom 2024-08-22 15:49:25 +02:00
luca.mazzoleni c213c3f059 - in LapJoint -> svuotatura, se l'utente ha definito un'elevazione custom si lavora sempre la faccia standard 2024-08-22 15:23:03 +02:00
luca.mazzoleni 330698b6aa in tunnel LapJoint -> tunnel lo smusso funziona anche se è forzata la sega a catena 2024-08-22 12:01:43 +02:00
luca.mazzoleni eb1ef693c4 Merge branch 'test' into develop 2024-08-22 11:25:02 +02:00
luca.mazzoleni 862751c84a - in FacesBySaw attacchi tangenziali solo da un lato limitati a facce con Z negative
- in BatchProcess e New si verifica l'abilitazione della generazione con EgtVerifyKeyOption
- in Version, MIN_EXE modificato per richiesta compatibilità con EgtVerifyKeyOption
2024-08-21 13:05:31 +02:00
luca.mazzoleni e5a30c38d3 Merge tag '2.6h1' into develop
r
2024-08-20 17:45:26 +02:00
luca.mazzoleni e83d8db1cc Merge branch 'release/2.6h1' 2024-08-20 17:45:14 +02:00
luca.mazzoleni 9de88ffe84 update log e version 2024-08-20 17:45:00 +02:00
luca.mazzoleni ffaf33c62e in BatchProcessNew se flag apposito in Cam5 la generazione è disabilitata 2024-08-20 17:34:46 +02:00
luca.mazzoleni 8c0389582b Merge branch 'ImproveDicingParallelTangentLead' into develop 2024-08-20 17:05:20 +02:00
luca.mazzoleni ebe3d79c11 - in FacesBySaw attacchi tangenziali solo da un lato limitati a facce con basse componenti Y
- in split e headcut i tagli addizionali orizzontali o verticali, se la macchina ha i ruli, si fanno sempre con attacco tangenziale
2024-08-20 17:02:37 +02:00
luca.mazzoleni f8c40739da - in attacchi tangenziali solo da un lato alcune correzioni
- aggiunta la raccolta delle Affected Faces a tutti i casi in cui si crea una feature a posteriori (non presente nel btl)
2024-08-19 17:37:16 +02:00
luca.mazzoleni fa5aac926e - attacchi tangenziali solo da un lato lasciati solo per se FacesBySaw è chiamata da ProcessCut 2024-08-09 12:02:27 +02:00
luca.mazzoleni 749cd1e2bb - in FacesBySaw limiti alle normali se attacco tangenziale dallo stesso lato 2024-08-09 12:00:20 +02:00
luca.mazzoleni 587aaaafce - in FacesBySaw->MakeOne, se attacco tangenziale e cubetti paralleli, si attacca e stacca sempre dallo stesso lato
- modificate di conseguenza funzioni significative che generano questi tipi di taglio
2024-08-08 15:20:51 +02:00
luca.mazzoleni 2cfa7caba7 Merge branch 'ImproveChamferLapJoint' into develop 2024-08-07 17:46:16 +02:00
luca.mazzoleni fc0fba5bd3 - in FacesBySaw revert delle modifiche precedenti per problemi di chiusura rulli 2024-08-07 17:45:38 +02:00
luca.mazzoleni 94159f88f3 - in FacesBySaw.MakeOne se si ha outstroke si tenta attacco alternativo 2024-08-07 16:11:38 +02:00
luca.mazzoleni 4961d2d528 - in LapJoint gestito smusso nel caso Groove-Blind-RightAngles-Parallel-4 2024-08-06 15:25:37 +02:00
luca.mazzoleni 7b22f5cc47 Merge remote-tracking branch 'origin/develop' into develop 2024-08-06 15:19:50 +02:00
andrea.villa 5047d5b652 In SimpleSarf, se assimilabile ad un taglio (1 faccia) si considerare area non pinzabile testa/coda 2024-08-05 09:24:14 +02:00
luca.mazzoleni 7f9b880ff7 Merge branch 'master' into develop 2024-07-19 18:06:44 +02:00
luca.mazzoleni 7e457a22b0 update log e versione 2024-07-19 18:06:32 +02:00
luca.mazzoleni 3c080e2b1a in BatchProcess e BatchProcessNew bToRecalc forzato se flag 3 o 4 2024-07-19 18:04:16 +02:00
luca.mazzoleni 9d3edbfb54 - in BatchProcessNew bToRecalc forzato se flasg 3 o 4
- in ProcessLapJoint si evita di tentare di lavorare con sega a catena da sotto
2024-07-19 16:08:18 +02:00
luca.mazzoleni adf465c5e2 -in SawPlusChain non non si applicano lavorazioni con lama da sotto (lama da sotto al momento non gestita)
-in SawPlusChain ora se una lavorazione non è applicabile si prosegue con le altre invece di uscire
2024-07-18 18:41:09 +02:00
luca.mazzoleni 23f695fd56 Merge branch 'master' into develop 2024-07-18 16:03:36 +02:00
luca.mazzoleni 52f347def1 update log e version 2024-07-17 16:10:37 +02:00
luca.mazzoleni 028688b88a - in SawPlusChain con tunnel passante fatto da un solo lato, se apply della sega a catena fallisce per finecorsa, si riapplica dal lato opposto 2024-07-17 16:06:26 +02:00
luca.mazzoleni cde5b137ae update log e versione per 2.6g3 2024-07-17 15:24:10 +02:00
luca.mazzoleni d0cf5887d3 -in LongCut invertito senso di rotazione truciolatore (ora è in discordanza) 2024-07-17 12:28:21 +02:00
luca.mazzoleni afc4c6aaff - corretto problema in LongDoubleCut in cui si sbagliava la riduzione di affondamento con lama da sotto
- in Lapjoint aggiunta Q_FORCE_CHAINSAW per forzare sega a catena anche in casi in cui ci passerebbe la fresa
2024-07-17 11:46:07 +02:00
luca.mazzoleni caa1875309 Merge branch 'master' into develop 2024-07-12 12:53:14 +02:00
luca.mazzoleni 2e2c2188ce - gestite lavorazioni singole da fare dopo separazione, tramite restituzione di AddedIds dalle Make
- al momento implementato per caso specifico di LongDoubleCut (e Lapjoint riconducibile a LongDoubleCut)
2024-07-12 12:52:53 +02:00
Dario Sassi 0acd75bece DataBeam :
- inserito controllo massimo numero di facce (20) per eseguire GetFacetsInfo.
2024-07-09 18:18:56 +02:00
Dario Sassi db691cefe4 Merge commit 'd0ecd175c284b108acb1b4290cf5616b61d121c8' 2024-07-09 17:52:36 +02:00
luca.mazzoleni d0ecd175c2 Merge branch 'master' into develop 2024-07-08 15:52:25 +02:00
luca.mazzoleni 7e6d4189ef - corretto typo in nome variabile 2024-07-08 15:52:05 +02:00
Dario Sassi abbc200504 Beam :
- anche nel taglio a cubetti se cè' si chiama GetNzLimDownUp di macchina per decidere limite orientamento lama verso il basso.
2024-07-05 18:32:55 +02:00
Dario Sassi 9e4597b739 Beam :
- aggiunta possibilità di funzione GetNzLimDownUp specifica per ogni macchina.
2024-07-05 11:13:08 +02:00
luca.mazzoleni d84d146701 Merge branch 'master' into develop 2024-07-04 15:51:41 +02:00
luca.mazzoleni 00ff8818da Merge branch 'develop' 2024-07-04 15:51:00 +02:00
luca.mazzoleni d5c582f890 update version e log 2024-07-04 15:50:42 +02:00
luca.mazzoleni bc8b0490b7 Merge tag '2.6g2' into develop
r
2024-07-04 15:48:47 +02:00
luca.mazzoleni 5aad9dcbf2 Merge branch 'release/2.6g2' 2024-07-04 15:46:42 +02:00
andrea.villa 8a582f512f In IsTailFeature controllo per spostare lapjoint dopo taglio di separazione per lavorazioni tipo BH 2024-07-04 14:42:23 +02:00
luca.mazzoleni 1fde2e5fec Merge tag '2.6g1' into develop
r
2024-07-01 11:49:53 +02:00
luca.mazzoleni 7a89501cc9 Merge branch 'release/2.6g1' 2024-07-01 11:49:29 +02:00
luca.mazzoleni 89acdcc8f8 update log e version 2024-07-01 11:49:14 +02:00
andrea.villa f7c082e5b1 In StepJointNotch, MakeFourFaces aggiunta copia del parametro PartId sulla nuova Proc 2024-06-28 13:13:22 +02:00
andrea.villa 938c46b9d8 In LapJoint, in VerifySideMillAsSaw modificato criterio ricerca utensile in base a normale della faccia 2024-06-28 12:21:53 +02:00
luca.mazzoleni 917bf5ec4b - in MachiningLib miglioramenti a scelta testa ottimizzata
- in ProcessDtTenon correzione in scelta testa
- in MakeAntiSplintBySaw se non si trova adiacenza tra le facce si restituisce errore
2024-06-26 14:13:37 +02:00
luca.mazzoleni 27d4ab3309 - in LongDoubleCut gestita correttamente SCC per lama 2024-06-20 09:59:36 +02:00
luca.mazzoleni 0ece2d91f4 Merge tag '2.6f3' into develop
s
2024-06-19 16:03:50 +02:00
luca.mazzoleni e08b53d5cf Merge branch 'release/2.6f3' 2024-06-19 16:03:34 +02:00
luca.mazzoleni a330b2fd7f update log e versione 2024-06-19 16:03:26 +02:00
luca.mazzoleni acdd4e10fb - in StepJointNotch abilitati correttamente smussi con testa da sotto
- in Lapjoint lunghe che guardano il top, se sufficientemente lunghe, si blocca l'asse C per non sollecitare inutilmente l'asse B
2024-06-19 15:58:31 +02:00
luca.mazzoleni ee6afb65c1 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2024-06-18 12:47:55 +02:00
luca.mazzoleni ea9db1631b in FacesBySaw -> MakeTwo si accettano facce con qualunque orientazione a patto che siano in testa o in coda e abbastanza piccole 2024-06-18 12:47:51 +02:00
andrea.villa 6513e75408 - Corretto accorciamento start/end in caso di inversione percorso
- In MakeByMillAsSaw si cerca di orientare il motore verso il lato più vicino
2024-06-18 12:09:01 +02:00
luca.mazzoleni 0e7d878f10 Merge tag '2.6f2' into develop
release
2024-06-17 12:06:47 +02:00
luca.mazzoleni 8bd0e5d145 Merge branch 'release/2.6f2' 2024-06-17 12:06:20 +02:00
luca.mazzoleni d8ecfc8463 correzione a tagli a cubetti (ripristinata versione pre 2.6f1) 2024-06-17 12:06:04 +02:00
andrea.villa e52a9c66b6 Ripristinata vecchia gestione tagli a cubetti per Ticket#1723 2024-06-06 16:25:15 +02:00
luca.mazzoleni f3785f8644 Merge tag '2.6f1' into develop
release#
2024-06-06 12:31:35 +02:00
luca.mazzoleni 350aaabbbe Merge branch 'release/2.6f1' 2024-06-06 12:31:24 +02:00
luca.mazzoleni 4eb3b38dd4 update log e version 2024-06-06 12:31:02 +02:00
luca.mazzoleni e9534b4eee correzioni a ottimizzazione teste 2024-06-06 11:31:40 +02:00
luca.mazzoleni da061a05e5 Merge branch 'feature/RidgeLapAndLapJointToLongcutModify' into develop 2024-06-05 16:04:43 +02:00
luca.mazzoleni ba432f5029 - piccola correzione a LapJoint 2024-06-05 11:01:47 +02:00
luca.mazzoleni 812397a047 - In LapJoint -> MakePocket abilitata Q per forzare massima elevazione 2024-06-05 09:33:52 +02:00
luca.mazzoleni cbb42ec088 - in BeamLib funzione IsCutNeeded per capire se il taglio viene sostituito da un headcut o split
- in RidgeLap abilitato Q04 come LapJoint, se riconducibile a 2 facce
- GetFacetsInfo richiamata ogni volta che c'è uno swap di facce
- In LapJoint -> MakePocket abilitata Q per forzare massima elevazione
2024-06-05 09:31:46 +02:00
andrea.villa 0c802464e1 In DiceCut.GetOrtoCutCenter se faccia piccola e lunga, tolto limite Z negativa per calcolare cubetti solo se esiste testa sotto. Altrimenti cubetti per forza. 2024-06-03 15:25:18 +02:00
luca.mazzoleni 498c65b006 in FacesBySaw corretto SCC in caso di asse bloccato parallelo 2024-06-03 12:55:50 +02:00
andrea.villa d81a0e8fbd In DiceCut.GetOrtoCutCenter se faccia piccola e lunga, tolto limite Z negativa per calcolare cubetti. 2024-05-30 15:32:47 +02:00
luca.mazzoleni 47fde315a3 Merge tag '2.6e5' into develop
release
2024-05-27 15:34:51 +02:00
luca.mazzoleni 3ac61219c9 Merge branch 'release/2.6e5' 2024-05-27 15:34:38 +02:00
luca.mazzoleni bad0018381 update log e version 2024-05-27 15:34:05 +02:00
luca.mazzoleni 48261c36d8 - in LapJoint - svuotature massimo diametro riportato a 3 volte la dimensione minima tasca perchè con certe tasche dà problemi di calcolo offset 2024-05-23 17:53:40 +02:00
luca.mazzoleni 4f9093b1d2 - in LapJoint corretto typo parentesi e modificato diametro massimo per svuotature 2024-05-23 15:46:58 +02:00
luca.mazzoleni 52830876e9 Merge tag '2.6e4' into develop
release
2024-05-20 11:01:00 +02:00
luca.mazzoleni 4513833fb3 Merge branch 'release/2.6e4' 2024-05-20 11:00:46 +02:00
luca.mazzoleni 26cc812ed1 - update log e commenti 2024-05-20 11:00:23 +02:00
luca.mazzoleni cc3ff75ea2 - modifica commento 2024-05-20 10:57:21 +02:00
luca.mazzoleni b150c75e96 - in MachiningLib -> FindMachining si considera ottimizzazione teste solo per macchine tipo PF e non più per macchine tipo PF1250
- in SawPlusChain varie migliorie
2024-05-15 17:08:50 +02:00
luca.mazzoleni cc3b0da9e5 - in SawPlusChain le lavorazioni di sega a catena aggiuntive (side) si fermano in mezzeria se tasca passante
- in SawPlusChain il tunnel con sega a catena viene fatto da un solo lato se possibile
2024-05-14 19:00:26 +02:00
luca.mazzoleni 6c8e3017d0 Merge tag '2.6e3' into develop
release
2024-05-14 13:14:45 +02:00
luca.mazzoleni 8613072ea2 Merge branch 'release/2.6e3' 2024-05-14 13:14:36 +02:00
luca.mazzoleni a89ad10f0b update log versione 2024-05-14 13:14:23 +02:00
luca.mazzoleni 91e0214243 Merge branch 'feature/SawPlusChainsawImprove' into develop 2024-05-14 13:08:33 +02:00
luca.mazzoleni f01790e725 Merge branch 'develop' into feature/SawPlusChainsawImprove 2024-05-14 13:08:18 +02:00
luca.mazzoleni 648fa1d9bf - in SawPlusChain si arriva al massimo materiale - 1 2024-05-14 13:07:37 +02:00
luca.mazzoleni 33be9ccaf0 in SawPlusChain:
- implementato tunnel con lama e con sega a catena
- modificata calcolo parametri mortising per gestire lati con elevazione negativa
2024-05-14 12:43:29 +02:00
luca.mazzoleni 1b6c1721c5 -in SawPlusChain implementato tunnel, per ora funzionante solo per lama 2024-05-13 18:02:54 +02:00
luca.mazzoleni d6c08628fb - in SawPlusChain corretto MaxElev sega a catena 2024-05-10 18:25:46 +02:00
luca.mazzoleni ce68e29112 in SawPlusChain modifiche per contemplare lavorazioni con lama dei lati aperti 2024-05-10 16:04:19 +02:00
andrea.villa e936f90086 Cut : in MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti 2024-05-10 14:22:28 +02:00
luca.mazzoleni 6c62ec1fe4 Merge branch 'develop' into feature/SawPlusChainsawImprove 2024-05-10 09:42:26 +02:00
luca.mazzoleni 481cebb207 Merge tag '2.6e2' into develop
release
2024-05-10 09:34:40 +02:00
luca.mazzoleni 126e3f6f92 Merge branch 'release/2.6e2' 2024-05-10 09:34:26 +02:00
luca.mazzoleni 21349b690b update log e version 2024-05-10 09:34:07 +02:00
luca.mazzoleni 93f9af85e7 in SawPlusChain:
- modifiche per contemplare funzione EgtSurfTmGetFacetOutlineInfo
- migliorie alle funzioni di calcolo parametri lavorazione
- ciclo step orizzontali lama spostato in funzione apposita ApplyAllSteps
2024-05-10 09:20:11 +02:00
andrea.villa 366a93dedf LongCut : se non trova fresa per pulizia, da messaggio di warning anziché di errore 2024-05-09 10:16:50 +02:00
andrea.villa 3e83035483 LongCut : allungamento percorso ingresso per evitare collisioni durante approccio pezzo quando si setta OutRaw 2024-05-09 08:13:14 +02:00
luca.mazzoleni efb805cf98 in SawPlusChain:
- Chainsawing rinominata Mortising
- GetVerticalSteps e GetHorizontalSteps sostituiti da funzione unica GetMachiningSteps in BeamLib
- variabili specifiche della strategia ora fanno parte direttamente della tabella SawPlusChain
- alcune correzioni
2024-05-08 12:58:48 +02:00
luca.mazzoleni 1572648a7e - modifiche parziali a SawPlusChain per implemento funzione Egt che fornisce informazioni rigurado ai lati 2024-05-07 18:59:30 +02:00
luca.mazzoleni 3dea3d9be2 Merge branch 'develop' into feature/SawPlusChainsawImprove 2024-05-06 11:42:33 +02:00
luca.mazzoleni 0af620ba76 - in FeatureTopology aggiunta proprietà IsTrough = true anche a Cut 2024-05-06 11:42:22 +02:00
luca.mazzoleni 1fc7aeba75 Merge branch 'develop' into feature/SawPlusChainsawImprove 2024-05-03 14:43:04 +02:00
luca.mazzoleni 6711a2c166 Merge tag '2.6e1' into develop
release
2024-05-03 12:28:11 +02:00
luca.mazzoleni 6a4a53ccd6 Merge branch 'release/2.6e1' 2024-05-03 12:28:01 +02:00
luca.mazzoleni acdf228d52 update log e versione 2024-05-03 12:27:53 +02:00
luca.mazzoleni 769c73765d - in lapJoint -> SawPlusChain piccole modifiche
- in mortise -> AddCleanCornersMachining resa locale variabile erroneamente dichiarata globale
2024-05-03 12:21:41 +02:00
andrea.villa ec48260d73 In LapJoint : in IsTailFeature se LapJoint a 2 facce che taglia intera sezione, da fare dopo taglio di coda 2024-04-22 09:04:34 +02:00
luca.mazzoleni 06461550c3 In LapJoint -> MakeMoreLongFaces corretto calcolo divisione in parti per evitare problemi di ceil con interi perfetti (ceil(3) = 3 o 4??) 2024-04-17 11:11:04 +02:00
luca.mazzoleni f45bcd7651 - in LapJoint -> SideMillAsSaw gestito anche rabbet passante 2024-04-15 12:22:23 +02:00
luca.mazzoleni 05fe546e38 Merge branch 'FixPartInfoAfterRotation' into develop 2024-04-12 14:16:00 +02:00
luca.mazzoleni 63c5d39112 - in BeamExec GetProcessAffectedFaces e GetFacetsInfo rilanciati dopo rotazione
- in BeamExec box della feature aggiornato dopo rotazione
- in LapJoint Groove verso il basso lavorata di preferenza dal lato
2024-04-12 13:15:59 +02:00
luca.mazzoleni f8e56d8f49 Merge tag '2.6d2' into develop
release
2024-04-11 12:56:47 +02:00
luca.mazzoleni b07f2f6b19 Merge branch 'release/2.6d2' 2024-04-11 12:56:30 +02:00
luca.mazzoleni eefd8ba037 - update log e version 2024-04-11 12:56:21 +02:00
luca.mazzoleni 076178db2c Merge branch 'feature/SawPlusChainsaw' into develop 2024-04-11 12:49:21 +02:00
luca.mazzoleni 3699daf998 - in SawPlusChain corretta tolleranza spessore tasca 2024-04-11 12:45:56 +02:00
luca.mazzoleni 617058cdda - in SawPlusChain nei messaggi si scrive il FeatureId invece di TaskId
- commenti e piccole correzioni
2024-04-11 12:14:33 +02:00
luca.mazzoleni d7a517160d - in SawPlusChain piccole correzioni
- in SawPlusChain aggiunta attivazione con parametro Q11
2024-04-11 10:51:05 +02:00
luca.mazzoleni 139579dbef - in SawPlusChain corretta segnalazione errore tasca troppo stretta 2024-04-10 13:19:39 +02:00
luca.mazzoleni 72033c8b9f - in SawPlusChain, in messaggio elevazione non raggiunta, aggiunti valori elevazione e massima profondità raggiunta 2024-04-10 10:07:52 +02:00
luca.mazzoleni cc30f3aeb9 - chiamate a FeatureId (PRID) sostituite con TaskId
- in SawPlusChain angoli iniziali gestiti solo per sega a catena
2024-04-09 19:02:10 +02:00
luca.mazzoleni 969f4cb6a0 - in FeatureTopology modifiche alla definizione di parallelo per tunnel e groove
- in SawPlusChain piccole correzioni
2024-04-09 16:17:57 +02:00
luca.mazzoleni c05e58a61e - in SawPlusChain escluse le lapjoint lunghe
- in SawPlusChain aggiunta scrittura log per tutti gli errori
- proprietà facce della Proc ora lette tramite la funzione GetFacetsInfo in BeamLib
2024-04-09 09:59:00 +02:00
luca.mazzoleni 37026c548d -in SawPlusChain migliorata gestione nome lavorazione
- in SawPlusChain aggiunti angoli alternativi sega a catena
- in SawPlusChain incluso caso 3 facce con fondo che non guarda verso il basso
2024-04-08 15:26:49 +02:00
luca.mazzoleni bfaeb8e414 Merge branch 'develop' into feature/SawPlusChainsaw 2024-04-08 09:56:27 +02:00
luca.mazzoleni 3bd780d005 update log 2024-04-08 09:37:18 +02:00
luca.mazzoleni 1ffa11b2c1 Merge tag '2.6d1' into develop
release
2024-04-08 09:35:02 +02:00
luca.mazzoleni 3548d8593a Merge branch 'release/2.6d1' 2024-04-08 09:34:49 +02:00
luca.mazzoleni 0eac98ecaa update log e versione 2024-04-08 09:34:41 +02:00
luca.mazzoleni a950807979 - in SawPlusChain aggiunto messaggio danneggiamento pezzo successivo 2024-04-05 19:17:17 +02:00
luca.mazzoleni 7676693f66 in sawpluschain correzione tabella non definita 2024-04-04 12:49:19 +02:00
luca.mazzoleni e03896cfef in sawpluschain ulteriori correzioni al calcolo approccio e retrazione 2024-04-04 12:40:59 +02:00
luca.mazzoleni b5094daa43 - in sawpluschain correzione a attacchi 2024-04-04 10:14:16 +02:00
luca.mazzoleni 5f1aaac719 - in sawpluschain migliorati approccio e retrazione lama 2024-04-04 08:48:13 +02:00
luca.mazzoleni 57d696e2fc - in sawpluschain refactoring per migliorare leggibilità
- in sawpluschain gestita estensione start se tasca troppo stretta
- in BeamLib aggiunta funzione GetAdjacentFaces
2024-04-03 17:56:39 +02:00
luca.mazzoleni 99c0ada098 - in sawpluschain migliorata gestione errori chainsaw
- in sawpluschain migliorato riconoscimento facce laterali
2024-04-02 19:05:05 +02:00
luca.mazzoleni a828ca9804 Merge branch 'develop' into feature/Saw+Chainsaw 2024-04-02 12:48:39 +02:00
luca.mazzoleni 88baf851ee -- In LapJoint -> ForceSideMill escluso caso 4 facce senza possibilità di ingresso lungo Y. 2024-04-02 12:47:47 +02:00
luca.mazzoleni 1e094aac56 - in SawPlusChain correzioni a sega a catena 2024-04-02 10:30:27 +02:00
luca.mazzoleni 51b5c7ac80 - in SawPlusChain implementata sega a catena, da testare 2024-03-29 19:20:19 +01:00
luca.mazzoleni e3f8783c18 - in SawPlusChain piccole correzioni 2024-03-29 09:29:08 +01:00
luca.mazzoleni d0015d8252 Merge branch 'develop' into feature/Saw+Chainsaw 2024-03-28 11:56:01 +01:00
luca.mazzoleni 5ebdda4abd - refactoring e migliorie varie 2024-03-28 11:50:39 +01:00
andrea.villa 436dcf69ea In MakeTwo rimossa gestione calcolo differente su ultima passata in caso di macchina FAST 2024-03-27 12:24:44 +01:00
luca.mazzoleni b7b9ea2065 - implementate passate orizzontali 2024-03-27 11:32:09 +01:00
luca.mazzoleni 8b1d3a0efb modifiche a SawPlusChainsaw 2024-03-27 09:24:35 +01:00
luca.mazzoleni 3d0adbdd39 - in SawPlusChainsaw aggiunta gestione accorciamenti percorsi per faccia laterale 2024-03-26 10:59:34 +01:00
luca.mazzoleni 8b51f9dca8 Merge branch 'develop' into feature/Saw+Chainsaw 2024-03-22 17:49:24 +01:00
luca.mazzoleni f589464063 - aggiunte lavorazioni SawPlusChainsaw funzionanti
- manca la gestione nel caso la feature non sia parallela al pezzo
2024-03-22 17:48:50 +01:00
andrea.villa fc7150f9b0 In Long2Cut.Make corretto nome passato alla BL.GetBlockedAxis 2024-03-21 08:42:20 +01:00
luca.mazzoleni 5c83095891 Merge branch 'develop' into feature/Saw+Chainsaw 2024-03-20 17:23:35 +01:00
luca.mazzoleni fe76f4b859 Merge branch 'master' into develop 2024-03-20 09:30:13 +01:00
Dario Sassi 1d2eb24903 DataBeam :
- correzione in Mortise per utilizzo variabili non definite.
2024-03-19 18:00:16 +01:00
luca.mazzoleni 0bb90513b5 Merge tag '2.6c4' into develop
release#
2024-03-18 15:02:27 +01:00
luca.mazzoleni 2fa68977bf Merge branch 'release/2.6c4' 2024-03-18 15:02:07 +01:00
luca.mazzoleni 092ad0cb4c update log e versione 2024-03-18 15:01:47 +01:00
andrea.villa 3953d079c1 ProcessDrill : Per Predrill corretta direzione estrusione per fori con direzione verso il basso 2024-03-18 13:26:22 +01:00
luca.mazzoleni ddcea6524c update log 2024-03-15 12:31:07 +01:00
luca.mazzoleni fe78df8c26 Merge branch 'master' into develop 2024-03-15 12:19:34 +01:00
Dario Sassi 7a70f623d9 DataBeam :
- in LapJoint correzione a calcolo ingombro per feature basse e lunghe dalla testa.
2024-03-15 11:44:13 +01:00
luca.mazzoleni b8ac0ef249 Merge tag '2.6c3' into develop
release
2024-03-15 09:55:08 +01:00
luca.mazzoleni f456ea3c2a Merge branch 'release/2.6c3' 2024-03-15 09:54:50 +01:00
luca.mazzoleni 8732c2fc66 update log e version 2024-03-15 09:54:25 +01:00
luca.mazzoleni 6a135228b8 - piccola correzione ai fori in doppio 2024-03-15 09:41:29 +01:00
luca.mazzoleni 653557a23d - in lapjoint primo implemento di MakeBySawPlusChain, da completare
- in BeamExec -> collect si scrive l'id della feature btl
2024-03-15 09:09:08 +01:00
andrea.villa 036ea8bcc8 Merge branch 'Feature/Predrill' into develop 2024-03-14 10:58:38 +01:00
andrea.villa b620aef7b8 Aggiunta gestione prefori 2024-03-13 17:23:40 +01:00
andrea.villa 58eb8df247 - Gestion Predrill su foro da due parti
- Ordinamento, Predrill sempre prima del foro
2024-03-13 15:24:59 +01:00
andrea.villa 38ab9d4a40 Prima versione gestione Predrill 2024-03-13 12:30:00 +01:00
luca.mazzoleni 4b7c533ae3 Merge branch 'master' into develop 2024-03-12 14:16:59 +01:00
luca.mazzoleni d54c9c98d7 Merge branch 'develop' 2024-03-12 11:37:27 +01:00
luca.mazzoleni d0d5ff3917 - update yml per rimuovere simboli di debug da compilazione 2024-03-12 11:37:11 +01:00
luca.mazzoleni afb72bcf48 Merge tag '2.6c2' into develop
release
2024-03-12 09:42:40 +01:00
luca.mazzoleni 0d6566e2cc Merge branch 'release/2.6c2' 2024-03-12 09:41:46 +01:00
luca.mazzoleni db5503f828 update log e version 2024-03-12 09:41:07 +01:00
luca.mazzoleni 0cfa1207ec - In BeamExec -> CollectFeatures si scrive ora Width e Height della faccia sia trimmate con il grezzo che intere. 2024-03-11 16:08:29 +01:00
luca.mazzoleni d415034d1c Merge branch 'feature/ImproveMirrorDrillings' into develop 2024-03-07 16:11:18 +01:00
luca.mazzoleni 06964c5a34 - rimossi simboli di debug da compile 2024-03-07 16:11:03 +01:00
luca.mazzoleni 68921b5df5 - Implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket 2024-03-07 15:08:57 +01:00
andrea.villa 7801a50ae0 Merge branch 'Ticket#1646' into develop 2024-03-05 11:36:48 +01:00
andrea.villa c418f5b92a In Mortise.Make: Aggiunta possibilità di inserire lavorazione di smusso 2024-03-05 11:32:18 +01:00
andrea.villa 3aa7979be4 In FreeContour aggiunto smusso se lav. di svuotatura e corretto caso non passante 2024-03-05 09:56:18 +01:00
andrea.villa 4fdf3ebdfa Merge branch 'Feature/ImproveOrderFeat' into develop 2024-03-04 12:17:05 +01:00
andrea.villa e25ad8e4a4 BeamExec: Creata funzione calcolo dipendenze tra feature
FeatureTopology : Feature senza topologia, calcolato in BeamExec
2024-03-04 12:16:57 +01:00
andrea.villa d5a45917ec Merge branch 'develop' into Feature/ImproveOrderFeat 2024-03-04 12:11:56 +01:00
luca.mazzoleni eb401d2695 - Implementato attacco esterno se tasca 4 facce sulla coda ma nessun pezzo successivo 2024-03-04 09:48:47 +01:00
luca.mazzoleni 604ffc6a35 - in LapJoint migliorata ricerca pocket (VerifyPocket) 2024-03-01 15:58:57 +01:00
luca.mazzoleni 43da69863d Merge tag '2.6c1' into develop
2.6c12.6c12.6c12.6c12.6c12.6c1
2024-02-29 17:57:44 +01:00
luca.mazzoleni f7b484d6bf Merge branch 'release/2.6c1' 2024-02-29 17:54:58 +01:00
luca.mazzoleni 4a8576bcb2 update log e version 2024-02-29 17:52:40 +01:00
andrea.villa a2854beb8d Migliorata 'CompareFeatures' per ordine forature 2024-02-29 17:20:44 +01:00
luca.mazzoleni aa9f7c577c Merge branch 'TwoFacesDownheadImprovement' into develop 2024-02-29 16:17:49 +01:00
luca.mazzoleni 6fb5c3803f - in LapJoint -> TestTwoFacesDownHead aggiunto default a BD.CUT_VZ_MIN 2024-02-29 16:17:32 +01:00
luca.mazzoleni 7d11c76bef Merge remote-tracking branch 'origin/develop' into TwoFacesDownheadImprovement 2024-02-29 15:15:34 +01:00
luca.mazzoleni 8f8dc23096 - in BeamExec -> Collect aggiunta la scrittura nella Proc di Width e Height delle facce
- in lapjoint 2 facce migliorata la scelta della lama da sotto
2024-02-29 15:14:54 +01:00
andrea.villa 2e2c897b47 In DTTenon.Make Aumentato numero passaggi (massimo 8) 2024-02-29 11:59:24 +01:00
andrea.villa 2c98483de0 In LapJoit.MakeMoreFaces passato b3Solid alla funzione ManageAntiSplintByMill 2024-02-29 09:19:38 +01:00
andrea.villa 8660ae3742 Forzata In Mortise.Make, SPIRAL_IN se c'è anche un solo lato aperto 2024-02-28 14:26:51 +01:00
andrea.villa 3c0d1c9593 In BeamExec : Migliorata 'CompareFeatures' per ordine forature 2024-02-26 17:10:30 +01:00
andrea.villa 005bb0a384 Migliorata 'CompareFeatures' per ordine lavorazioni 2024-02-26 09:42:58 +01:00
andrea.villa 897fa66d33 Rimosso un caso di controllo per HCING/TCING da LapJoint 2024-02-22 12:45:28 +01:00
andrea.villa 3069366ef2 Merge branch 'Feature/ImproveClamping' into develop 2024-02-22 12:37:18 +01:00
andrea.villa ec485c1c62 Migliorato calcolo area non pinzabile in testa HCING e coda TCING in FacesBySaw e LapJoint 2024-02-22 12:36:47 +01:00
luca.mazzoleni 4acaab29f7 in LapJoint correzione al massimo diametro utensile in alcuni casi 2024-02-20 09:54:33 +01:00
luca.mazzoleni 9b35408ef9 Merge branch 'master' into develop 2024-02-14 18:12:50 +01:00
luca.mazzoleni d420e630ce Merge branch 'develop' 2024-02-14 18:06:23 +01:00
luca.mazzoleni 8a9e198c43 update log e versione 2024-02-14 18:06:06 +01:00
luca.mazzoleni d1f1429eb5 - in LapJoint -> MakeMoreFaces escluse le Groove 2 facce dalla gestione Special3faces. 2024-02-13 17:58:58 +01:00
luca.mazzoleni 9184fa23ac - piccole correzioni in LapJoint e Long2Cut 2024-02-12 18:18:47 +01:00
luca.mazzoleni 0950eac628 Merge branch 'Feature/NoRotationForRabbetAlongXTowardsBottom' into develop 2024-02-09 12:55:35 +01:00
luca.mazzoleni 1f730989b3 - Ora i rabbet lungo X che guardano in basso sono sempre fatti con fresatura di lato per evitare di ruotare. 2024-02-09 10:05:38 +01:00
luca.mazzoleni 63169a3859 Merge remote-tracking branch 'origin/master' into develop 2024-01-31 11:34:00 +01:00
luca.mazzoleni f59dac3029 - In LapJoint -> tagli con sega a catena ora si considera l'ingombro della testa per il calcolo della massima profondità.
- In LapJoint aggiunta funzione GetToolEntryAngle per determinare l'angolo di ingresso dell'utensile nella faccia.
2024-01-31 11:33:44 +01:00
Dario Sassi 5a089a737c DataBeam :
- modifiche per limiti pinzaggio con pinze con fronte verticale (ONE, PF) anzichè inclinato (FAST) quindi parametro BD.VICE_MINH grande.
2024-01-30 11:37:25 +01:00
luca.mazzoleni 2ed2e28e8a Merge branch 'master' into develop 2024-01-26 16:58:51 +01:00
luca.mazzoleni 21144825dc hotfix: corretto bug in Split in cui si chiamava la EgtSurfTmFacetNormVersor senza riferimento 2024-01-26 16:58:39 +01:00
luca.mazzoleni 2aba85f3c9 Merge tag '2.6a1' into develop
Finish Release: 2.6a1
2024-01-26 13:24:02 +01:00
luca.mazzoleni 301cc10022 Merge branch 'release/2.6a1' 2024-01-26 13:24:01 +01:00
luca.mazzoleni 63a3d62807 update log 2024-01-24 17:00:23 +01:00
luca.mazzoleni c3b3a8e09a Merge branch 'MultipleChainsawsAndMachiningLibImprovements' into develop 2024-01-24 15:07:49 +01:00
luca.mazzoleni 23c31aa0be Merge remote-tracking branch 'origin/master' into MultipleChainsawsAndMachiningLibImprovements 2024-01-24 14:38:12 +01:00
luca.mazzoleni 4ba4ddb698 - Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest). Al momento implementato solo per FindSawing.
- Nello split con sega a catena ora si cerca di preferenza una lavorazione di tipo 'SawingForSplitting'. Se non trovata si cerca il tipo 'Sawing' come in precedenza.
- In split con sega a catena aggiunta estensione start/end del percorso se utensile lungo, per evitare collisioni con il pezzo durante rotazione.
2024-01-24 14:37:58 +01:00
Dario Sassi 4a408e3f61 DataBeam 2.6a1 :
- modifiche per poter impostare offset intermedio anche se lanciato da EgtCam5
- corretto calcolo cubetti con superficie limitante parallela e opposta a quella di base
- modifiche a Split per tagli a cubetti su grandi sezioni.
2024-01-24 11:46:13 +01:00
Dario Sassi c3c767b839 Merge remote-tracking branch 'origin/MultipleChainsawsAndMachiningLibImprovements' 2024-01-24 09:43:18 +01:00
luca.mazzoleni 0400878279 update commenti 2024-01-23 10:42:17 +01:00
luca.mazzoleni 418fb4e284 - correzione in MachiningLib per gestire il caso in cui una lavorazione sia attiva ma non ha alcun utensile collegato 2024-01-23 10:39:40 +01:00
luca.mazzoleni 337e13dbde In Split con sega a catena ora si cerca di preferenza una lavorazione di tipo 'SawingForSplitting'. Se non trovata si cerca il tipo 'Sawing' come in precedenza. 2024-01-22 18:14:18 +01:00
luca.mazzoleni 8d80f389d3 - In MachiningLib -> FindSawing aggiunto parametro opzionale bConsiderCSimmEncumberance per considerare l'ingombro dell'asse C nel massimo materiale (default false).
- In MachiningLib -> GetMachinings vengono ora raccolti i parametri utensile necessari per i VerifyTool, scritti direttamente nella tabella Machining.Tool.
- Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest) se passato l'apposito parametro SortingCriterion in FindMachining. Al momento implementato solo per FindSawing.
- In HeadCut e Split, nei tagli verticali aggiuntivi, si usa ora BD.MAX_LEN_DICE come dimensione (era BD.MAX_DIM_DICE).
- In LapJoint e LongCut implementata gestione seghe a catena multiple.
2024-01-22 16:34:39 +01:00
luca.mazzoleni 91608ce3f0 Merge branch 'Feature/BigSectionForWideBeams' into develop 2024-01-18 16:17:58 +01:00
luca.mazzoleni dbf0d3cf01 update commenti 2024-01-18 16:17:16 +01:00
luca.mazzoleni e5bab7f1ab - piccola correzione a split 2024-01-18 12:37:40 +01:00
luca.mazzoleni b8fb6816a6 correzione minore 2024-01-16 18:21:06 +01:00
luca.mazzoleni ffb7580a65 - implementata funzione GetBlockedAxis, in BeamLib, che sostituisce le altre specifiche per sega a catena e lama; modificate le relative chiamate 2024-01-16 15:51:59 +01:00
luca.mazzoleni 6255b4c1cb Merge branch 'develop' into Feature/BigSectionForWideBeams 2024-01-12 14:41:42 +01:00
luca.mazzoleni 3ae3bcf1d3 Merge remote-tracking branch 'origin/master' into develop 2024-01-12 14:41:28 +01:00
Dario Sassi a01733defd DataBeam :
- piccola correzione per tagli lama con doppia inclinazione su macchina OikosX.
2024-01-12 12:51:36 +01:00
luca.mazzoleni ba9df21ab1 Merge branch 'develop' into Feature/BigSectionForWideBeams 2024-01-11 16:30:51 +01:00
luca.mazzoleni 6a58e94af0 Merge remote-tracking branch 'origin/master' into develop 2024-01-11 16:30:40 +01:00
luca.mazzoleni eb93769055 - in Split gestiti i tagli aggiuntivi verticali in tutti i casi 2024-01-11 16:22:39 +01:00
luca.mazzoleni 0acffe8d52 - in HeadCut gestiti i tagli aggiuntivi verticali in tutti i casi
- in Cut gestito il passaggio di superficie limitante alla GetDice
- in Split manca la gestione dei tagli aggiuntivi verticali in caso di BigSection
2024-01-11 12:25:28 +01:00
Dario Sassi f2c28f3810 DataBeam :
- correzione a posizionamento barre centrate su tavola da nuova interfaccia.
2024-01-10 23:34:46 +01:00
luca.mazzoleni 0a830c7f4b correzioni alle chiamate a GetSawBlockedAxis per Oikos 2024-01-09 11:43:07 +01:00
luca.mazzoleni 0778516765 Merge branch 'develop' into Feature/BigSectionForWideBeams 2024-01-09 10:07:38 +01:00
luca.mazzoleni 334d8d369e Merge remote-tracking branch 'origin/master' into develop 2024-01-09 09:51:12 +01:00
Dario Sassi 4a6b3accb1 DataBeam :
- alcune modifiche per macchine OikosX e similari.
2024-01-08 19:10:57 +01:00
luca.mazzoleni e22db4a989 Merge branch 'develop' into Feature/BigSectionForWideBeams 2024-01-08 18:09:53 +01:00
luca.mazzoleni 6021a50136 Merge tag '2.5l3' into develop
Finish Release: 2.5l3
2024-01-08 18:07:45 +01:00
luca.mazzoleni 748a6e295a Merge branch 'release/2.5l3' 2024-01-08 18:07:44 +01:00
luca.mazzoleni 2bd563293c update log e version 2024-01-08 18:07:03 +01:00
luca.mazzoleni cc099fb54c - Correzione a Is3EdgesApprox per casi in cui nAddGroup non esista ancora. 2024-01-08 17:19:41 +01:00
luca.mazzoleni 22c74c3252 - in headcut e split varie correzioni a tagli aggiuntivi per trave larga; rimangono da implementare per BigSection
- test annotations @param, #return in funzione GetFaceHvRefDim del BeamLib
2024-01-08 16:55:31 +01:00
luca.mazzoleni 3acebbd892 in split -> bigSection piccola correzione al sormonto tra sega a catena e lama 2024-01-04 18:33:07 +01:00
luca.mazzoleni bc04b680d4 - aggiunta GetSawBlockedAxis per scegliere asse bloccato aggregato lama 2024-01-04 17:29:42 +01:00
luca.mazzoleni 6e8cd5f3bb Merge branch 'develop' into Feature/BigSectionForWideBeams 2024-01-04 11:45:17 +01:00
luca.mazzoleni 91aa9d049f Merge remote-tracking branch 'origin/HEAD' into develop 2024-01-04 11:44:59 +01:00
luca.mazzoleni 5f7f988552 - in split -> bigSection primo implemento sega a catena da sopra e lama da sotto
- in split -> bigSection scelta sega a catena in base a lunghezza
2024-01-04 11:44:44 +01:00
Dario Sassi 7d65813c32 DataBeam 2.5l4 :
- modifiche per centrare i pezzi in Y sulla tavola (da flag BeamData.CENTER_BEAM)
- modifiche per rendere più veloci i calcoli di FeatureTopology
- scorporata CalcHeadTailMachBeforeIntersDrillings da CollectFeatures
- migliorato calcolo attacco/uscite lame in FacesBySaw.
2024-01-02 16:07:40 +01:00
luca.mazzoleni 42d68d968d Merge branch 'develop' into Feature/BigSectionForWideBeams 2023-12-21 11:39:20 +01:00
luca.mazzoleni 01f0182ef5 Merge tag '2.5l2' into develop
Finish Release: 2.5l2
2023-12-20 17:42:28 +01:00
luca.mazzoleni e0f27b9abe Merge branch 'release/2.5l2' 2023-12-20 17:42:28 +01:00
luca.mazzoleni c8b29241ca update log 2023-12-20 17:41:39 +01:00
luca.mazzoleni b0dea42f31 primi test 2023-12-20 17:17:28 +01:00
luca.mazzoleni a9462e189c Merge branch 'master' into develop 2023-12-15 17:57:26 +01:00
Dario Sassi 27ee10d1ec DataBeam :
- piccola miglioria alla precedente correzione, rimanevano non cancellate delle regioni di uso temporaneo.
2023-12-15 17:29:01 +01:00
luca.mazzoleni d73f535a55 Merge remote-tracking branch 'origin/master' into develop 2023-12-15 10:04:02 +01:00
Dario Sassi 5ae487cb20 DataBeam 2.5l2 :
- correzione a GetFaceWithMostAdj per calcoli con facce che fanno ombra.
2023-12-15 09:53:48 +01:00
luca.mazzoleni a3dcabf860 Merge remote-tracking branch 'origin/master' into develop 2023-12-11 09:04:41 +01:00
Dario Sassi 7b854c87c0 DataBeam :
- altra correzione a RoundArch per senso rotazione fresa e modalità climb.
2023-12-08 16:14:06 +01:00
luca.mazzoleni d2fc60b7f1 Merge branch 'master' into develop 2023-12-07 12:53:32 +01:00
Dario Sassi 286816e8e9 DataBeam :
- in ProcessRoundArch aggiunta gestione senso di rotazione della fresa per lavorare sempre in concordanza (climb milling).
2023-12-07 11:16:11 +01:00
luca.mazzoleni 01fbcbbd01 Merge branch 'CutAvoidCollisionsWhenDownUp' into develop 2023-12-07 09:56:49 +01:00
luca.mazzoleni d1c014e20c In ProcessCut e DoubleCut correzione in scelta ribaltamento trave quando si è in condizioni downUp. 2023-12-07 09:55:19 +01:00
luca.mazzoleni 92a924dde1 Merge branch 'develop' into CutAvoidCollisionsWhenDownUp 2023-12-06 18:38:56 +01:00
luca.mazzoleni d033fee929 Merge branch 'SideMillAsSawImprovement' into develop 2023-12-06 18:12:21 +01:00
luca.mazzoleni 1070910b8c - In ProcessLapJoint -> VerifySideMillAsSaw, se SIDEDEPTH non definita, viene calcolata
- update commenti
2023-12-06 17:50:26 +01:00
luca.mazzoleni 306b5b6dff in ProcessCut -> Classify si forza la rotazione della trave se inclinata in Y e la lama non riesce a lavorare solo da un lato, come per doublecut 2023-12-06 15:12:08 +01:00
luca.mazzoleni d2a6d7e75c in ProcessDoubleCut -> Classify si forza la rotazione della trave se inclinata in Y e la lama non riesce a lavorare solo da un lato 2023-12-06 10:44:21 +01:00
luca.mazzoleni 6309092689 In FacesBySaw -> CalcLeadInOutPerpGeom gestito caso in cui la geometria della feature esce dal grezzo 2023-12-05 18:37:28 +01:00
luca.mazzoleni 2ec0d8162e in LapJoint->MakeMoreFaces, nelle OpenPocket, ammesso utensile con diametro fino a 3 volte la dimensione della tasca (era 2) 2023-12-01 10:40:15 +01:00
luca.mazzoleni 60919c595d Merge tag '2.5l1' into develop
Finish Release: 2.5l1
2023-12-01 09:33:29 +01:00
luca.mazzoleni 0638e3c6f3 Merge branch 'release/2.5l1' 2023-12-01 09:33:28 +01:00
luca.mazzoleni de80902a86 update log e versione 2023-12-01 09:33:10 +01:00
luca.mazzoleni 9fbd4a5156 - in MakeTwo di FacesBySaw raffinamento calcolo vtRef per casi dubbi. 2023-11-30 09:23:12 +01:00
luca.mazzoleni 6bd2e5ffb4 - nelle chiamate a EgtSurfTmFacetElevationInBBox aggiunto parametro per forzare calcolo anche se la faccia è esterna al grezzo
- update commenti
2023-11-30 09:12:49 +01:00
luca.mazzoleni f89129d2e8 Merge branch 'ElevationCalculationRefactoring' into develop 2023-11-29 16:50:17 +01:00
luca.mazzoleni e0e2f630d2 Merge remote-tracking branch 'origin/master' into develop 2023-11-29 16:07:49 +01:00
luca.mazzoleni 1664513c8f Ottimizzate le chiamate al calcolo elevazione. Si evita di calcolarla più volte inutilmente perchè calcolata inizialmente nel CollectFeatures. 2023-11-29 16:07:18 +01:00
Dario Sassi c701d4132f DataBeam :
- in MakeTwo di FacesBySaw raffinamento calcolo vtRef per casi dubbi.
2023-11-28 15:56:10 +01:00
Dario Sassi a9052c1d72 Merge commit 'b3bb386ec776ad753e1d9042d90ecd9834c2abd2' 2023-11-28 15:54:49 +01:00
luca.mazzoleni 593fdcfc24 Merge branch 'develop' into ElevationCalculationRefactoring 2023-11-28 15:44:43 +01:00
luca.mazzoleni b9c8921cb2 Merge tag '2.5k5' into develop
Finish Release: 2.5k5
2023-11-28 15:40:00 +01:00
luca.mazzoleni b3bb386ec7 Merge branch 'release/2.5k5' 2023-11-28 15:40:00 +01:00
luca.mazzoleni c69f80a903 update log e versione 2023-11-28 15:39:33 +01:00
luca.mazzoleni d8de7467b0 - tutte le chiamate alle funzioni GetFaceElevation e GetOtherFaceElevation sostituiti con la nuova funzione EgtSurfTmFacetElevationInBBox 2023-11-28 09:55:41 +01:00
luca.mazzoleni 42c043fcd7 Merge branch 'Q05InLong2Cut' into develop 2023-11-24 15:24:03 +01:00
luca.mazzoleni 344467a500 - In Long2Cut, in implemento Q05 come LongCut, aggiunte puliture.
- In Dovetail correzione per variabile sMilling portata da globale a locale.
2023-11-24 15:23:52 +01:00
luca.mazzoleni e82a8c9c1f -In Long2Cut, in implemento Q05 come LongCut, gestiti allungamenti e accorciamenti. Mancano le puliture.
-In LongCut aggiunti alcuni commenti riguardo al Q05.
2023-11-23 13:06:13 +01:00
luca.mazzoleni 85585c0b80 In Long2Cut primo implemento Q05 come LongCut. Ancora da gestire allungamenti e accorciamenti. 2023-11-21 16:23:03 +01:00
luca.mazzoleni 24e853ff92 Merge branch 'master' into develop 2023-11-20 09:51:52 +01:00
Dario Sassi 0bcdf65656 DataBeam 2.5k4 :
- in ProcessLongDoubleCut ora si utilizza la nuova funzione Lua EgtSurfTmFacetElevationInBBox per il calcolo esatto dell'elevazione di una faccia nel solido del pezzo.
2023-11-16 19:05:34 +01:00
Dario Sassi 1e442c7a01 Merge remote-tracking branch 'origin/develop' 2023-11-16 18:08:45 +01:00
luca.mazzoleni 24e38cdad5 in lapjoint modifiche a MakeStaircaseStep 2023-11-15 12:26:08 +01:00
andrea.villa a239a096cd FacesBySaw : In MakeOne migliorato calcolo scelta soluzione lama ( per macchina TURN) 2023-11-14 12:22:25 +01:00
andrea.villa 737abe7d30 Merge branch 'master' into develop 2023-11-14 12:19:19 +01:00
luca.mazzoleni b7b701f9d2 Merge branch 'develop' 2023-11-09 16:01:15 +01:00
Dario Sassi 5974edf8b1 DataBeam :
- aggiornato per compilazione manuale di ProcessVariant.
2023-11-08 17:50:59 +01:00
Dario Sassi 7fcf169b6b DataBeam 2.5k3 :
- aggiunta gestione features Variant (per ora solo con lavorazioni di tipo Pocket).
2023-11-08 17:46:20 +01:00
Dario Sassi f30558db04 DataBeam :
- migliorie e correzioni alla ricerca di lavorazioni di foratura con AngularTransmission ("_AT")
- migliorata gestione dei fori e delle tasche con AngularTransmission.
2023-11-07 09:37:33 +01:00
luca.mazzoleni cb17b9737e Merge branch 'master' into develop 2023-11-06 18:16:07 +01:00
luca.mazzoleni 5315b63163 Merge branch 'develop' 2023-11-06 18:15:53 +01:00
luca.mazzoleni a87c9f5789 update versione e log 2023-11-06 18:15:41 +01:00
luca.mazzoleni 1dc4efa397 Merge branch 'release/2.5k2' 2023-11-06 18:10:39 +01:00
luca.mazzoleni 50917a61b2 Merge tag '2.5k2' into develop
Finish Release: 2.5k2
2023-11-06 18:10:39 +01:00
luca.mazzoleni a843ef2e25 In MakeStaircaseStep gestito ritorno 2023-11-06 18:09:16 +01:00
luca.mazzoleni fc3f6f22ac - update commenti 2023-11-03 18:38:05 +01:00
luca.mazzoleni 84bc8d7bd7 Merge branch 'Feature/L020SpecialStaircase' into develop 2023-11-03 18:33:33 +01:00
luca.mazzoleni 7c7fa26b8d - in Topology -> Classify ora si settano le AffectedFaces nella Proc, se non già presenti
- in LapJoint -> MakeStaircaseStep aggiunta lavorazione smussi opzionale
2023-11-03 18:32:54 +01:00
luca.mazzoleni 54fcc27c49 - in LapJoint -> MakeStaircaseStep aggiunta riduzione profondità lama in caso di angolo inferiore a 90deg 2023-11-03 09:42:12 +01:00
luca.mazzoleni a5a8a0e98b Merge branch 'develop' into Feature/L020SpecialStaircase 2023-11-02 18:27:15 +01:00
luca.mazzoleni 27df151d3d Merge remote-tracking branch 'origin/master' into develop 2023-11-02 18:26:06 +01:00
Dario Sassi 34b4867a0d DataBeam :
- in ProcessSplit si imposta l'ingombro asse C correttamente anche per teste con asse rotante C con un solo braccio.
2023-11-02 18:10:49 +01:00
Dario Sassi 2bf15f2958 Merge branch 'master' of https://gitlab.steamware.net/egaltech/DataBeam 2023-11-02 17:36:38 +01:00
Dario Sassi bfa26e7610 DataBeam 2.5k1 :
- correzione a ProcessSplit per scrittura sbagliata nome variabile (ora dTLen invece di dTlen).
2023-11-02 17:34:55 +01:00
luca.mazzoleni 398ea82d2b Merge branch 'master' into develop 2023-11-02 11:04:17 +01:00
luca.mazzoleni 6f8c94705b Merge branch 'develop' 2023-11-02 11:03:49 +01:00
luca.mazzoleni a77d0b2652 update log e versione 2023-11-02 11:01:52 +01:00
Dario Sassi 6c14b873f9 Merge remote-tracking branch 'origin/master' 2023-10-28 12:27:35 +02:00
luca.mazzoleni 15d85e174b Merge branch 'develop' into Feature/L020SpecialStaircase 2023-10-27 18:25:53 +02:00
luca.mazzoleni a2ba993709 Merge branch 'release/2.5j2' 2023-10-27 18:18:48 +02:00
luca.mazzoleni e90a4db38c Merge tag '2.5j2' into develop
Finish Release: 2.5j2
2023-10-27 18:18:48 +02:00
luca.mazzoleni 5820ccb455 update versione, log, commenti 2023-10-27 18:18:32 +02:00
luca.mazzoleni 57fa9bb8b3 - correzioni minori a LapJoint e Cut 2023-10-27 18:00:09 +02:00
luca.mazzoleni 3fe16f87b7 In LapJoint -> MakeStaircaseStep:
- invertite taglio di lama alzata e pedata
- step lama della pedata limitati a 2, uno a metà e uno in fondo
- corretto faceuse nel caso di lama da sotto (esclusi casi downup)
2023-10-27 17:01:07 +02:00
andrea.villa 15af95a77e Merge branch 'Feature/L020AngleBigger90Deg' into develop 2023-10-27 16:19:46 +02:00
andrea.villa a9e378c468 In LapJoint gestito caso groove due facce >90° con fresa, come da parametro Q 2023-10-27 16:19:23 +02:00
andrea.villa a524a60a41 In BeamLib aggiunto controllo per permettere tagli da sotto con testa da sopra su pezzi molto alti 2023-10-27 13:15:37 +02:00
luca.mazzoleni fdb897ec68 - In LapJoint -> MakeStaircaseStep aggiunti tagli di lama per pedata e alzata. Da verificare gli step 2023-10-27 09:56:09 +02:00
luca.mazzoleni 4e4a1eca4d - In LapJoint -> MakeStaircaseStep correzioni al calcolo step orizzontali fresa 2023-10-26 15:07:17 +02:00
andrea.villa 03bf116341 Merge branch 'Feature/LapJointAsLong2CutFix' into develop 2023-10-25 17:12:28 +02:00
andrea.villa 82d9d4dfde Commenti e migliorie messaggi warning 2023-10-25 16:55:10 +02:00
luca.mazzoleni d39148a9e8 Merge branch 'develop' into Feature/L020SpecialStaircase 2023-10-25 15:58:49 +02:00
luca.mazzoleni a7e0c5a33d - In LapJoint -> MakeStaircaseStep aggiunta la lavorazione con fresa 2023-10-25 15:56:53 +02:00
andrea.villa 8ddf1f260a In LapJoint e LongDoubleCut corretto comportamento con messaggi di ritorno in caso possa fare con lama 2023-10-25 15:37:52 +02:00
andrea.villa 8671415d5e In LapJoint e LongDoubleCut faccio di lama solo se taglio completamente. Altrimenti fresa. 2023-10-25 12:36:38 +02:00
andrea.villa e496feff2c - In LongDoubleCut limito lavorazione a massimo materiale lama prima di applicare. Da completare 2023-10-25 10:15:59 +02:00
andrea.villa 73431c52ca In MakeOne migliorata gestione taglio con percorso bilinea. 2023-10-24 14:45:26 +02:00
andrea.villa 5420bc5165 Merge branch 'Feature/BetterClampManagementOnCutLong' into develop 2023-10-24 14:36:30 +02:00
andrea.villa 3ccc382d5b Merge branch 'develop' into Feature/BetterClampManagementOnCutLong 2023-10-24 14:34:33 +02:00
andrea.villa 29af699ad5 - LongCut e LongDoubleCut: migliorata spezzatura taglio passante con due spezzoni
- BeamExec: aggiunta scrittura parametro BARLEN nelle info del mach group
2023-10-24 14:28:35 +02:00
luca.mazzoleni 5865192e23 Merge branch 'develop' into Feature/L020SpecialStaircase 2023-10-23 14:57:14 +02:00
luca.mazzoleni 374d99ffd9 Merge tag '2.5j1' into develop
Finish Release: 2.5j1
2023-10-23 12:52:53 +02:00
luca.mazzoleni a31c026430 Merge branch 'release/2.5j1' 2023-10-23 12:52:52 +02:00
luca.mazzoleni 982b07ad32 update log 2023-10-23 12:52:18 +02:00
luca.mazzoleni 869683c99a - a Topology aggiunta groove 2 facce (tipo birdsmouth passante)
- prima aggiunta di MakeStaircaseStep
2023-10-23 12:39:15 +02:00
luca.mazzoleni f147f77133 Merge remote-tracking branch 'origin/master' into develop 2023-10-19 09:13:07 +02:00
Dario Sassi 9c5b23d15d DataBeam 2.5j1 :
- nella ricerca lavorazione da usare controllo di utensile attivo sostituito con controllo utensile presente nel setup corrente
2023-10-18 15:09:01 +02:00
andrea.villa 62b1c186f7 Merge branch 'BugFix/HeadCutSplitFixForKairos' into develop 2023-10-17 14:53:52 +02:00
andrea.villa 55f4effbb6 - In HeadCut e Split corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative 2023-10-17 12:34:42 +02:00
Andrea Villa 70b9f9fe89 Merge remote-tracking branch 'origin/develop' into develop 2023-10-17 11:25:18 +02:00
luca.mazzoleni 2ff160f555 In FeatureTopology -> GetFacesParallelToPart rimossa Pocket e aggiunto Rabbet al check solo direzione principale 2023-10-16 18:35:26 +02:00
luca.mazzoleni 7ff3a8eba6 Merge remote-tracking branch 'origin/master' into develop 2023-10-16 09:42:26 +02:00
Dario Sassi 59934d0fdf DataBeam :
- in Process (lancio da EgtCAM5 quindi uso praticamente solo interno) aggiunta possibilità di tenere ordine pezzi in barra come da selezione.
2023-10-12 10:56:46 +02:00
luca.mazzoleni df99424632 Merge remote-tracking branch 'origin/master' into develop 2023-10-04 10:25:48 +02:00
luca.mazzoleni 61b1375c00 - in Lapjoint -> MakePocket aggiunto messaggio in caso si rovini il pezzo successivo 2023-10-04 10:25:38 +02:00
Dario Sassi 07c76f60c8 DataBeam :
- piccola correzione a Classify di FeatureTopology per casi senza geometria.
2023-10-04 09:28:20 +02:00
luca.mazzoleni 2c88c295c8 Merge tag '2.5i2' into develop
Finish Release: 2.5i2
2023-09-27 18:48:29 +02:00
luca.mazzoleni f0bd3d2e6f Merge branch 'release/2.5i2' 2023-09-27 18:48:29 +02:00
luca.mazzoleni a0d3bb9114 - update log 2023-09-27 18:48:13 +02:00
luca.mazzoleni 8f890f35e2 Merge branch 'develop' 2023-09-27 18:36:29 +02:00
luca.mazzoleni 30e2028ebf - in LapJoint -> MakeLongMoreFaces aggiunta Classify Topology alla AddProc creata 2023-09-27 18:35:35 +02:00
luca.mazzoleni 04454ac44f Merge branch 'Feature/BetterUndercutDetection' into develop 2023-09-27 17:43:17 +02:00
luca.mazzoleni d73dbfbffb Merge remote-tracking branch 'origin/HEAD' into develop 2023-09-27 17:36:06 +02:00
luca.mazzoleni b7ec0031e1 - piccola correzione a LapJoint 2023-09-27 17:35:56 +02:00
Dario Sassi d5f2422729 DataBeam 2.5i2 :
- aggiunta cancellazione curve temporanee da loop di facce in BeamLib.Is3EdgesApprox
- piccola modifica per Turn su bInvert di FacesBySaw.MakeOne
- in foratura quando errore in applicazione lavorazione si inverte e riprova solo se singola su foro aperto
- in MakeLongMoreFaces migliorata gestione spezzatura di Tunnel
- in lavorazione tenoni per Turn si assegna SCC per privilegiare accesso dal lato corto della trave.
2023-09-27 17:23:45 +02:00
luca.mazzoleni 1c25ca7667 - In LapJoint -> MakeMoreFaces e Classify refactoring della gestione scanalatura chiusa
- in FeatureTopology modificata GetFacesParallelToPart per tunnel, pocket e groove 3 lati
2023-09-27 11:54:33 +02:00
luca.mazzoleni f54cfa7eb3 - in BeamExec funzione IsFeatureCuttingEntireSection spostata in BeamLib; in ClassifyTopology aggiunto passaggio del parametro nRawId
- in BeamLib -> GetFaceWithMostAdj gestito primo parametro anche come Proc; gestito caso strip con facce tutte in sottosquadro; spostata qui funzione IsFeatureCuttingEntireSection da BeamExec
- In FeatureTopology aggiunte topologie Strip e Cut
- In ProcessDoveTail, ProcessLapJoint, ProcessLongCut, ProcessTyroleanDovetail modificata chiamata a GetFaceWithMostAdj
2023-09-26 17:39:16 +02:00
luca.mazzoleni 8cef86ffd5 - commenti e migliorie stilistiche 2023-09-25 11:38:58 +02:00
luca.mazzoleni 7402062859 - in BeamLib implementato metodo per rilevare sottosquadri da facce non adiacenti, da testare 2023-09-22 18:08:46 +02:00
luca.mazzoleni 36a663199c - in BeamLib implementato parzialmente metodo per rilevare sottosquadri da facce non adiacenti, da ultimare 2023-09-22 16:37:16 +02:00
luca.mazzoleni b628a4200d Merge branch 'BugFix/FixLapJointLongTunnel' into develop 2023-09-19 17:24:32 +02:00
luca.mazzoleni 0d3b3d1f04 Merge branch 'develop' into BugFix/FixLapJointLongTunnel 2023-09-19 17:22:27 +02:00
luca.mazzoleni c490d5d388 Merge branch 'master' into develop 2023-09-19 10:34:21 +02:00
luca.mazzoleni bc401eef07 update log 2023-09-19 10:27:53 +02:00
luca.mazzoleni a93326e3cd - in LapJoint -> MakeLongMoreFaces correzione allargamento superfici per caso di tunnel lungo 2023-09-19 10:08:42 +02:00
luca.mazzoleni 6b5d7525a1 - in LapJoint -> MakeLongMoreFaces modifiche finali per correzione caso tunnel lungo; da testare 2023-09-18 18:46:55 +02:00
luca.mazzoleni 111a733365 - in LapJoint -> MakeLongMoreFaces ulteriori modifiche parziali per correzione caso tunnel lungo 2023-09-18 17:01:22 +02:00
luca.mazzoleni 7ce6ca9f13 - in LapJoint -> MakeLongMoreFaces modifiche parziali per correzione caso tunnel lungo 2023-09-18 15:25:23 +02:00
luca.mazzoleni 6902620f5d - in BeamExec -> Collect aggiunto PartId anche in Proc2 2023-09-14 12:37:17 +02:00
luca.mazzoleni 7c6b5cf12c - in BeamExec -> CollectFeatures aggiunta la scrittura di PartId in Proc
- in LapJoint -> MakeMoreFaces se lavorazione con fresa di lato distinto caso 4 lati groove
2023-09-13 10:59:14 +02:00
luca.mazzoleni 9c0d2111f5 - aggiunta libreria FeatureTopology, clonata da Wall, per la classificazione topologica delle feature
- in BeamLib aggiunte funzioni Is3EdgesApprox e  GetProcessAffectedFaces, clonate da Wall
- in BeamExec aggiunta ClassifyTopology e la raccolta preliminare di alcune informazioni nel CollectFeatures
2023-09-13 09:19:58 +02:00
luca.mazzoleni 19d8be5c9e - in ProcessCut -> MakeFromTop abbassato a 590 mm il limite per convertire in LongCut
- aggiunto commento commit precedente
2023-09-12 10:24:34 +02:00
luca.mazzoleni 41a05b4199 Merge tag '2.5i1' into develop
Finish Release: 2.5i1
2023-09-12 09:05:24 +02:00
luca.mazzoleni ab48827689 Merge branch 'release/2.5i1' 2023-09-12 09:05:23 +02:00
luca.mazzoleni a859f170aa update log e versione 2023-09-12 09:05:05 +02:00
luca.mazzoleni 06f7fdb385 Merge branch 'master' into develop 2023-09-12 09:03:02 +02:00
luca.mazzoleni 36d0e0c198 Merge branch 'develop' 2023-09-12 09:02:34 +02:00
luca.mazzoleni e1dc521fe5 - in LapJoint gestito correttamente il ritorno nil di GetUShapeWidth 2023-09-12 09:01:17 +02:00
luca.mazzoleni 30fc2ab1a4 Merge tag '2.5h2' into develop
Finish Release: 2.5h2
2023-08-11 10:52:04 +02:00
luca.mazzoleni dacf2c5860 Merge branch 'release/2.5h2' 2023-08-11 10:52:03 +02:00
luca.mazzoleni abb7735f9d update log 2023-08-11 10:51:43 +02:00
luca.mazzoleni 2fb4338d50 Merge remote-tracking branch 'origin/master' into develop 2023-08-11 10:36:41 +02:00
Dario Sassi b0150f5b03 DataBeam 2.5h2 :
- in LapJoint e Mortise modificata posizione braccio per FAST quando vicino alla coda della trave
- in RidgeLap corretto ingombro lavorazione in testa e coda quando rivolta verso il basso.
2023-08-11 10:30:36 +02:00
luca.mazzoleni 5802f26bbf Merge branch 'master' into develop 2023-08-08 15:00:31 +02:00
luca.mazzoleni 3be500974a corrette forature con aggregato quando lato aperto 2023-08-08 14:52:03 +02:00
luca.mazzoleni 199c327151 Merge tag '2.5h1' into develop
Finish Release: 2.5h1
2023-08-07 18:31:32 +02:00
luca.mazzoleni 5b6ed18a8e Merge branch 'release/2.5h1' 2023-08-07 18:31:32 +02:00
luca.mazzoleni f34367da55 update log e version 2023-08-07 18:31:06 +02:00
luca.mazzoleni 6665209c66 Merge tag '2.5g4' into develop
Finish Release: 2.5g4
2023-08-07 17:35:21 +02:00
luca.mazzoleni ea7e9dedac Merge branch 'release/2.5g4' 2023-08-07 17:35:21 +02:00
luca.mazzoleni b7b8f30a8c update log e versione 2023-08-07 17:35:09 +02:00
luca.mazzoleni 9ea1c502e8 fix commenti 2023-08-02 11:36:13 +02:00
luca.mazzoleni 4a4c5e7349 in Lapjoint corretto incremento della profondità pari al raggio utensile per tunnel con sega a catena 2023-08-02 11:32:55 +02:00
luca.mazzoleni 2c1831a678 - in split e headcut corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo
- in lapjoint piccola correzione al calcolo della distanza di sicurezza in base al gambo dell'utensile
2023-08-02 09:33:17 +02:00
luca.mazzoleni 5c4b609a56 tagli doppi di lato non effettuati se macchina tipo PF e pezzo alto 2023-08-01 16:18:12 +02:00
luca.mazzoleni 295f8059c4 Merge tag '2.5g3' into develop
Finish Release: 2.5g3
2023-08-01 15:29:44 +02:00
luca.mazzoleni b375b56f21 Merge branch 'release/2.5g3' 2023-08-01 15:29:43 +02:00
luca.mazzoleni 4a5d097256 update log e versione 2023-08-01 15:29:30 +02:00
luca.mazzoleni 9acb252f1b Merge branch 'master' into develop 2023-08-01 15:20:35 +02:00
Dario Sassi 70505bcf29 DataBeam :
- riaggiunto placeholder in bin\LuaLibs.
2023-08-01 15:13:02 +02:00
Dario Sassi 35337836a5 DataBeam :
- in Cut correzione calcolo offset per taglio doppio di lato
- in LongCut ammesso uso lama da sotto fino a Norm +3deg in verticale.
2023-08-01 15:08:30 +02:00
luca.mazzoleni 12bfe2ac27 Merge branch 'Feature/PocketWithAggregate' into develop 2023-08-01 15:06:10 +02:00
luca.mazzoleni 3ec2618f9b Feature/PocketWithAggregate: implementato per tasche 5 lati da sotto e perfettamente verticali 2023-08-01 12:28:08 +02:00
luca.mazzoleni b0e307d89d Merge branch 'develop' into Feature/PocketWithAggregate 2023-08-01 11:41:40 +02:00
luca.mazzoleni 834a1261c5 update log 2023-08-01 09:23:41 +02:00
luca.mazzoleni 0eea92b13d Merge branch 'master' into develop 2023-07-31 18:34:07 +02:00
luca.mazzoleni 29f1af5216 Merge branch 'develop' 2023-07-31 18:33:52 +02:00
luca.mazzoleni b18f7da20a update log 2023-07-31 18:33:40 +02:00
luca.mazzoleni e9a82086e3 Merge branch 'master' into develop 2023-07-31 18:27:58 +02:00
luca.mazzoleni d09069ad78 Merge branch 'master' of https://gitlab.steamware.net/egaltech/DataBeam 2023-07-31 18:26:51 +02:00
luca.mazzoleni 00078c65c1 corretto errore nelle mortase in doppio 2023-07-31 18:26:40 +02:00
Dario Sassi 303a69cbb3 DataBeam 2.5g3 :
- in ProfConvex, ProfConcave e ProfHead corretto e semplificato ModifySideInvertLead per invert.
2023-07-31 18:20:39 +02:00
luca.mazzoleni c762706e89 Merge tag '2.5g2' into develop
Finish Release: 2.5g2
2023-07-31 17:33:09 +02:00
luca.mazzoleni 73f90eefe5 Merge branch 'release/2.5g2' 2023-07-31 17:33:09 +02:00
luca.mazzoleni 4951a4c5c2 update log 2023-07-31 17:32:55 +02:00
luca.mazzoleni 688d43e463 in ProcessDrill modifica minore al riconoscimento forature con aggregato 2023-07-31 17:25:04 +02:00
luca.mazzoleni 300dea8f2c Feature/PocletWithAggregate:
- primo implemento tasca da sotto con aggregato (solo 5 lati, allineato con Z)
- manca ricerca utensile _AT
2023-07-31 16:57:33 +02:00
luca.mazzoleni ad6c7ef6af Merge branch 'Feature/DrillWithAggregate' into develop 2023-07-28 17:07:50 +02:00
luca.mazzoleni bc33759c14 fix commenti 2023-07-28 17:07:36 +02:00
luca.mazzoleni 36cf8f6de8 DrillWithAggregate:
-implemento completato, da testare
2023-07-28 15:45:23 +02:00
luca.mazzoleni e6837d160b In FreeContour, solo se pocket, aggiunta Q06 per specificare un eventuale offset radiale del contorno. 2023-07-28 10:28:35 +02:00
luca.mazzoleni 6c81ad1f1b Merge branch 'master' into develop 2023-07-24 09:27:15 +02:00
DarioS 5cde095b8e DataBeam :
- correzioni per mortise passanti con curva Aux che guarda in basso.
2023-07-21 11:07:47 +02:00
DarioS 76381e27f7 DataBeam 2.5g2 :
- corretta gestione antischeggia con lama su LapJoint (vedi #1351).
2023-07-19 17:33:07 +02:00
luca.mazzoleni 73a970bc20 alcune correzioni minori 2023-07-07 15:47:50 +02:00
luca.mazzoleni bf6b888d27 Merge tag '2.5g1' into develop
Finish Release: 2.5g1
2023-07-05 10:30:27 +02:00
luca.mazzoleni 4768c065ef Merge branch 'release/2.5g1' 2023-07-05 10:30:27 +02:00
luca.mazzoleni 133720bc34 update log e versione 2023-07-05 10:30:12 +02:00
luca.mazzoleni bad5b4aaa4 Merge branch 'master' into develop 2023-06-29 19:05:03 +02:00
luca.mazzoleni 21768ed542 in MakeMoreFaces impedito l'uso del truciolatore se tasca chiusa 2023-06-29 18:45:06 +02:00
DarioS e80e4e8a5d DataBeam :
- in DiceCut modificata scelta tagli ortogonali quando liberi (esteso caso di verticali ammessi)
- migliorato controllo fattibilità taglio di fianco con cubetti
- in LapJoint estesi casi riconoscimento in coda basato su lunghezza.
2023-06-29 18:27:31 +02:00
luca.mazzoleni c6566478e6 in ProcessMortise escluso il riconoscimento lati aperti per le mortase passanti 2023-06-27 17:54:24 +02:00
luca.mazzoleni 84d16b12a9 eliminati placeholder 2023-06-27 17:11:29 +02:00
luca.mazzoleni 43900018dd update ignore 2023-06-27 17:09:51 +02:00
luca.mazzoleni d6249a1f0f piccolo bugfix a Cut per dangerous relief cut 2023-06-27 17:09:15 +02:00
luca.mazzoleni 0954e86cc9 Merge branch 'master' into develop 2023-06-21 18:13:23 +02:00
luca.mazzoleni 79b210def9 Merge branch 'develop' 2023-06-21 18:13:11 +02:00
luca.mazzoleni acdceeb97f update log e versione 2023-06-21 18:12:59 +02:00
luca.mazzoleni 641aa5807d Merge branch 'release/2.5f4' 2023-06-21 17:54:41 +02:00
luca.mazzoleni f3c0987bc1 Merge tag '2.5f4' into develop
Finish Release: 2.5f4
2023-06-21 17:54:41 +02:00
luca.mazzoleni 676815c32b Merge branch 'Feature/DangerousReliefCutsFix' into develop 2023-06-21 17:52:16 +02:00
luca.mazzoleni bcde9ae19c Merge branch 'develop' into Feature/DangerousReliefCutsFix 2023-06-21 15:06:42 +02:00
luca.mazzoleni 5004bc97b6 In FreeContour aumentato l'angolo minimo che attiva l'attacco speciale 2023-06-21 11:11:09 +02:00
luca.mazzoleni c9cefa618e - modificato check direzione tagli perpendicolari per attivare o no i tagli speciali
- esclusi i tagli speciali in caso di longcut
2023-06-19 12:30:28 +02:00
luca.mazzoleni dedf1366e6 Merge tag '2.5f3' into develop
Finish Release: 2.5f3
2023-06-16 19:04:00 +02:00
luca.mazzoleni d72943e20b Merge branch 'release/2.5f3' 2023-06-16 19:03:59 +02:00
luca.mazzoleni 915f8973db correzioni varie al funzionamento 2023-06-16 19:03:18 +02:00
luca.mazzoleni 6ee0d46ff5 Merge branch 'develop' into Feature/DangerousReliefCutsFix 2023-06-14 16:01:35 +02:00
luca.mazzoleni a4d06ff6c6 Merge branch 'master' into develop 2023-06-14 16:00:45 +02:00
luca.mazzoleni bf9d0d2b8f Merge branch 'master' into Feature/DangerousReliefCutsFix 2023-06-14 16:00:31 +02:00
luca.mazzoleni 0443133557 - lieve correzione per la lettura di vCuts 2023-06-14 15:59:41 +02:00
DarioS 5c8f7dee7c DataBeam :
- per scubettatura tagli di testa e coda aggiunta MakeParallelOne
- tolti parametri nForceWorkSide, nForceSCC da MakeOne
2023-06-14 15:08:37 +02:00
luca.mazzoleni dabd2d2681 Merge branch 'develop' into Feature/DangerousReliefCutsFix 2023-06-14 11:44:47 +02:00
luca.mazzoleni 8bdde9e2bf - piccola correzione a tagli aggiuntivi orizzontali in ProcessSplit 2023-06-14 10:31:12 +02:00
luca.mazzoleni 2eccd38463 Merge branch 'develop' into Feature/DangerousReliefCutsFix 2023-06-13 09:25:51 +02:00
luca.mazzoleni 952190d792 Merge branch 'master' into develop 2023-06-13 09:25:36 +02:00
DarioS 9b32d12934 DataBeam :
- correzione a FacesBySaw.MakeTwo per scelta direzione di approccio lama in casi speciali.
2023-06-13 09:14:14 +02:00
luca.mazzoleni a339d49066 Merge tag '2.5f2' into develop
Finish Release: 2.5f2
2023-06-12 17:54:36 +02:00
luca.mazzoleni 3d58080915 Merge branch 'release/2.5f2' 2023-06-12 17:54:36 +02:00
luca.mazzoleni 2ef7e457c1 update log e version 2023-06-12 17:53:22 +02:00
luca.mazzoleni 44a36c4acd - In LapJoint corretto il recupero dati utensile che, in alcune funzioni, puntava all'utensile errato.
- In BeamLib ChangeOrOpenStart corretta ricerca segmento più lungo.
2023-06-12 16:44:51 +02:00
luca.mazzoleni 7a602639ba Merge remote-tracking branch 'origin/master' into develop 2023-06-12 16:13:53 +02:00
luca.mazzoleni 260b8f36bb Merge remote-tracking branch 'origin/master' into Feature/DangerousReliefCutsFix 2023-06-12 15:03:56 +02:00
DarioS 397251e9a3 DataBeam :
- correzione a precedente modifica su svuotatura di LapJoint.
2023-06-12 09:03:14 +02:00
luca.mazzoleni 0e0c78edf4 Merge branch 'develop' into Feature/DangerousReliefCutsFix 2023-06-08 11:11:27 +02:00
luca.mazzoleni 187a211491 Merge branch 'master' into develop 2023-06-08 11:10:58 +02:00
luca.mazzoleni 5e9ff056c2 Merge remote-tracking branch 'origin/master' into Feature/DangerousReliefCutsFix 2023-06-08 11:10:05 +02:00
DarioS 1f0905a34a DataBeam 2.5f1 :
- in Process (esecuzione manuale da Cam5) ordinamento travi di lunghezza praticamente uguale dipende da ordine di selezione
- in LongDoubleCut corretta scelta SCC (orientamento braccio testa) per macchine TURN nel caso di concavi
- in LapJoint limiti su svuotature tasche a L 4 facce come per L 3 facce
- in LapJoint su svuotature aggiunto recupero UserNotes da libreria per MaxOptSize.
2023-06-08 08:11:26 +02:00
luca.mazzoleni dbbdd9f0df funzionamento ok, da testare 2023-06-06 11:13:54 +02:00
luca.mazzoleni df1cb76993 Check per deicidere se fare taglio standard o speciale 2023-06-05 10:25:57 +02:00
luca.mazzoleni 6ee6ebd9be Merge branch 'master' into develop 2023-05-31 11:10:25 +02:00
DarioS 868161df0b DataBeam :
- correzione a foratura per fori annegati nel pezzo e quindi da non fare (quale è il vero ingresso ?)
- riconoscimento fori da sotto anche dalla faccia di ingresso
- in foratura se TURN aggiunta possibilità di forare da sotto
- correzioni a Profili Concavo e Convesso per TURN.
2023-05-26 08:37:02 +02:00
DarioS 240f2959fc Merge commit '5e5a4461ac373dc812c40fa8dec191998b0bc3c5' 2023-05-24 10:22:46 +02:00
luca.mazzoleni 5e5a4461ac update log 2023-05-23 14:59:09 +02:00
luca.mazzoleni 4eec2dcf19 Merge remote-tracking branch 'origin/master' into develop 2023-05-23 11:42:08 +02:00
DarioS c457ff9acf DataBeam :
- in LongCut migliorato calcolo e verifica affondamento per lavorazione con lama con codolo in mezzo
- in LongDoubleCut correzioni per TURN.
2023-05-23 09:31:14 +02:00
DarioS 5f9fc0b975 DataBeam 2.5e4 :
- modifiche per problemi su TURN (aggiustamenti su SCC).
2023-05-18 08:20:28 +02:00
DarioS 51261d1231 DataBeam :
- per le lavorazioni in doppio e precedenti no oppure di tipo diverso, forzo risalita a Zmax (per evitare possibili collisioni nel riposizionamento diretto della seconda testa).
2023-05-11 17:23:08 +02:00
DarioS 7f807d6114 DataBeam 2.5e3 :
- correzione riconoscimento per possibile lavorazione in doppio di tasche che si toccano sul fondo (ovviamente non possibili in doppio)
- in taglio di separazione aggiunta richiesta risalita preliminare a Zmax quando da sopra su macchine PF e ONE
- dopo aver fatto rotazioni e inversioni dei pezzi cambio chiave Info relative per evitare di rifarle se si parte da Nge e non da Btl.
2023-05-11 09:34:48 +02:00
luca.mazzoleni cbccd14b64 Merge branch 'master' into develop 2023-05-09 11:43:03 +02:00
luca.mazzoleni ac58afc627 Merge branch 'develop' 2023-05-04 18:09:02 +02:00
luca.mazzoleni 1d68e47bdf update log e versione 2023-05-04 18:08:51 +02:00
luca.mazzoleni 1d802852bd piccola modifica a SCC per LongCut derivanti da Cut 2023-05-04 18:06:55 +02:00
luca.mazzoleni 01386ce711 update log 2023-05-04 12:05:27 +02:00
luca.mazzoleni 4c4ae7bb6f Merge branch 'master' into develop 2023-05-03 15:54:00 +02:00
luca.mazzoleni b66bd700f4 Merge branch 'develop' 2023-05-03 15:45:34 +02:00
luca.mazzoleni 1c93a079bd update version 2023-05-03 15:45:22 +02:00
luca.mazzoleni 000454139d Merge branch 'release/2.5e1' 2023-05-03 15:23:19 +02:00
luca.mazzoleni b460b2c7a4 Merge tag '2.5e1' into develop
Finish Release: 2.5e1
2023-05-03 15:23:19 +02:00
luca.mazzoleni 65c344bb30 Merge branch 'BugFix/LongCutSccFix' into develop 2023-05-03 15:17:05 +02:00
luca.mazzoleni 587f4c61e2 - in Longcut corretto SCC in caso di asse utensile allineato con Z
- tolleranza su sezione portata a 0.1 mm anche per BatchProcess vecchia
2023-05-03 15:13:28 +02:00
luca.mazzoleni cc63560b19 Merge branch 'master' into develop 2023-04-26 09:46:59 +02:00
DarioS d6813e4efa DataBeam :
- modifica a LongCut per orientamento direzione ausiliaria testa con lama.
2023-04-24 16:42:36 +02:00
luca.mazzoleni 18ebaf8a16 update log modifiche 2023-04-21 09:18:31 +02:00
luca.mazzoleni 60c489f70b Merge remote-tracking branch 'origin/master' into develop 2023-04-21 09:18:01 +02:00
DarioS 270bca6bcc DataBeam :
- in tagli di testa e coda aumentato appena (10.123) spessore minimo applicazione cubetti speciali
- in tagli di coda cubetti speciali rimesse note lavorazione 'PreCut;' e 'Cut;'
- in tagli di coda cubetti speciali rimessa restituzione 3° parametro nNewPhase
- in tagli longitudinali per macchine PF (BD.C_SIMM) modificata assegnazione SCC.
2023-04-20 21:39:57 +02:00
luca.mazzoleni 8ae94c1de6 Merge tag '2.5d2' into develop
Finish Release: 2.5d2
2023-04-20 17:41:40 +02:00
luca.mazzoleni 3ec836ad9a Merge branch 'release/2.5d2' 2023-04-20 17:41:40 +02:00
luca.mazzoleni 479a28afb8 update versione 2023-04-20 17:40:27 +02:00
luca.mazzoleni 9cfccc29d6 Merge branch 'master' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2023-04-20 16:27:10 +02:00
luca.mazzoleni c344493daf aggiunto settings di vs code a gitignore 2023-04-20 16:21:04 +02:00
luca.mazzoleni 9f68bbfeaf Merge branch 'Feature/HorizontalCutsForHeadCutAndSplit' into develop 2023-04-20 16:14:50 +02:00
luca.mazzoleni 60a3731aa3 Feature/HorizontalCutsForHeadCutAndSplit:
- corretto calcolo lead in e lead out in FacesBySaw per gestire faceuse paralleli
- corretto calcolo spessore materiale in coda
- commenti
2023-04-20 15:11:09 +02:00
luca.mazzoleni 8c1b8cb346 Feature/HorizontalCutsForHeadCutAndSplit:
- in HeadCut e Split implementati tagli orizzontali per travi alte per ridurre le dimensioni dei ritagli
- da sistemare calcolo allungamenti nel FacesBySaw che sbaglia con spessori elevati materiale da rimuovere
2023-04-19 18:41:02 +02:00
luca.mazzoleni 3236f8bf73 Merge branch 'Feature/LongCutSCCManagement' into develop 2023-04-18 11:27:27 +02:00
luca.mazzoleni 47f716b3c1 - commenti e piccole correzioni 2023-04-17 17:45:12 +02:00
luca.mazzoleni 81a12d2e98 - in LongCut aggiunta gestione Turn e tagli provenienti da ProcessCut 2023-04-14 18:48:37 +02:00
luca.mazzoleni 3376f50024 - LongCut completa, manca solamente integrazione Turn nella funzione GetSCC
- varie migliorie
2023-04-12 18:17:46 +02:00
luca.mazzoleni e3a42ec170 - alcune correzioni
- gestiti casi inversione e workside per fresa
- rimane ancora da gestire la direzione di lavoro con bAreCuttingStepsTowardsHead
2023-04-11 15:24:20 +02:00
luca.mazzoleni d88dea71d8 Commit modifiche parziali, in LongCut:
- funzione GetSCC per trovare la direzione SCC ottimale in tutti i casi
- da aggiungere casi per Turn in GetSCC
- da aggiungere gestione Invert e WS in tutti i casi, per poter usare la funzione GetSCC
2023-04-11 09:41:01 +02:00
luca.mazzoleni 5942332de8 Merge branch 'develop' 2023-04-06 15:59:31 +02:00
luca.mazzoleni 64020f1f8d update log modifiche 2023-04-06 15:58:05 +02:00
luca.mazzoleni 4578d461e0 Merge branch 'release/2.5d1' 2023-04-05 17:13:40 +02:00
luca.mazzoleni c9d25b6ee9 Merge tag '2.5d1' into develop
Finish Release: 2.5d1
2023-04-05 17:13:40 +02:00
luca.mazzoleni 3be734753a Merge branch 'master' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2023-04-05 17:13:12 +02:00
luca.mazzoleni f0c1c37bc5 correzione typo nome variabile 2023-04-05 17:10:19 +02:00
DarioS 8949a511ee DataBeam :
- in taglio con lama piccola miglioria nella scelta della direzione di approccio per pezzi corti.
2023-04-05 15:56:45 +02:00
luca.mazzoleni e7619caaaf Merge branch 'master' into develop 2023-04-05 09:20:08 +02:00
DarioS ec69624941 DataBeam 2.5d1 :
- aggiornata versione.
2023-04-05 08:55:42 +02:00
DarioS aba419a16e DataBeam :
- modifiche a Split per travi con sezioni molto grandi e materiale inferiore allo spessore lama
- aggiunta possibilità di minima sicurezza su attacco da lato aperto per svuotatura.
2023-04-04 12:56:30 +02:00
luca.mazzoleni 7db7ff1226 Merge branch 'master' into develop 2023-04-03 18:39:58 +02:00
luca.mazzoleni 40dd008318 HotFix: correzione per gestire la lama principale sulla testa secondaria e questa non è una testa da sotto 2023-04-03 18:00:48 +02:00
luca.mazzoleni 30f1a156d6 Merge remote-tracking branch 'origin/master' into develop 2023-04-03 16:21:06 +02:00
DarioS 5e581096aa DataBeam :
- corretto ordinamento per fori di coda da lasciare in coda.
2023-04-03 10:09:52 +02:00
luca.mazzoleni 376f85d1f9 Fix: In LapJoint correzione al calcolo della distanza di collisione nel caso in cui il gambo sia più piccolo dell'utensile. 2023-03-31 14:59:46 +02:00
luca.mazzoleni 2124c7a25a Merge branch 'master' into develop 2023-03-30 12:33:59 +02:00
luca.mazzoleni ef37486f34 update log modifiche 2023-03-30 12:33:47 +02:00
luca.mazzoleni 711e6832c1 update log modifiche 2023-03-30 09:45:58 +02:00
luca.mazzoleni 6eb3cd6429 Update versione 2023-03-30 09:32:48 +02:00
luca.mazzoleni 091d710014 Merge branch 'develop' 2023-03-30 09:30:40 +02:00
luca.mazzoleni 3f3e4db7f4 aggiunto UpdateLog specifico per Beam 2023-03-30 09:30:30 +02:00
luca.mazzoleni dc2ea77a42 Merge branch 'release/2.5c8' 2023-03-30 09:18:49 +02:00
luca.mazzoleni 13c03ff601 Merge tag '2.5c8' into develop
Finish Release: 2.5c8
2023-03-30 09:18:49 +02:00
luca.mazzoleni 9f73a85cd8 Merge remote-tracking branch 'origin/master' into develop 2023-03-29 08:52:12 +02:00
DarioS 61f69ad50a DataBeam :
- in lavorazione DtMortise corretto calcolo larghezza della mortasa per derivare numero e step passate.
2023-03-28 19:02:33 +02:00
luca.mazzoleni 16c3d8467d Merge branch 'master' into develop 2023-03-28 15:05:13 +02:00
DarioS df75f1c760 DataBeam :
- in DtTenon corretto calcolo distanza di lato da lavorare quando faccia di base divisa in più parti.
2023-03-28 13:41:44 +02:00
luca.mazzoleni 23afe7b256 Merge remote-tracking branch 'origin/master' into develop 2023-03-27 18:56:33 +02:00
DarioS d5ebc24bf5 DataBeam :
- piccola miglioria nel calcolo altezza tenone.
2023-03-27 18:21:04 +02:00
luca.mazzoleni dd21a0ec16 - in ProcessTenon e ProcessDtTenon migliorate e unificate condizioni scelta pretaglio con lama o fresa 2023-03-27 13:02:31 +02:00
luca.mazzoleni 58c7d86f6b Merge remote-tracking branch 'origin/master' into develop 2023-03-24 09:13:04 +01:00
DarioS 641bf33e4b DataBeam :
- modifica ingombro tagli inclinati per macchine con trascinatori tipo PF (BD.PRESS_ROLLER).
2023-03-23 20:46:10 +01:00
DarioS 3af41a8d4d DataBeam :
- modifica per fare le mortase a coda di rondine prima dei tagli longitudinali indipendentemente dalla sovrapposizione in Y.
2023-03-23 19:06:50 +01:00
luca.mazzoleni 9ec91b1409 Merge tag '2.5c7' into develop
Finish Release: 2.5c7
2023-03-23 12:44:41 +01:00
luca.mazzoleni 79153f9051 Merge branch 'release/2.5c7' 2023-03-23 12:44:41 +01:00
luca.mazzoleni d486caa1a9 2.5c7 :
- Correzioni a LongCut e LongDoubleCut a seguito di ottimizzazione delle direzioni di avanzamento
2023-03-23 12:42:28 +01:00
luca.mazzoleni e07dfbe0f3 Merge remote-tracking branch 'origin/master' into develop 2023-03-23 12:29:32 +01:00
DarioS 33668827f7 DataBeam 2.5c6 :
- migliorato riconoscimento e gestione lati aperti
2023-03-22 17:32:37 +01:00
luca.mazzoleni 8abea3a099 Merge remote-tracking branch 'origin/master' into develop 2023-03-22 12:27:18 +01:00
DarioS 1ff8907b96 DataBeam :
- aggiornata gestione compilazione e copia in rete come Wall.
2023-03-21 17:07:14 +01:00
DarioS 274ad495bc DataBeam :
- aggiunti a Version.lua NAME e MIN_EXE.
2023-03-21 10:16:25 +01:00
DarioS 660d25ffc7 Merge remote-tracking branch 'origin/develop' 2023-03-20 15:59:41 +01:00
Samuele Locatelli b51737173e typo 2023-03-20 15:24:58 +01:00
Samuele Locatelli fc8dff216d Fix netuse x correzione copia su R: 2023-03-20 15:19:04 +01:00
luca.mazzoleni 5792c3111d fix 2023-03-16 12:39:32 +01:00
luca.mazzoleni cdfbd188fa 2.5c5 (errato 2.5c4 precedente) 2023-03-16 11:09:22 +01:00
luca.mazzoleni 4e98d2a2a4 Piccola correzione 2023-03-16 11:01:49 +01:00
luca.mazzoleni f4d9224d8d 2.5c4 2023-03-16 09:38:33 +01:00
luca.mazzoleni 40c277b95d In LongCut modifica alla lavorazione ulteriore con sega a catena per togliere il codolo e lasciare solo dei punti di supporto 2023-03-16 09:33:28 +01:00
luca.mazzoleni 04e487f782 Merge remote-tracking branch 'origin/master' into develop 2023-03-13 17:50:23 +01:00
DarioS 62e2cc8375 DataBeam 2.5c4 :
- modifiche a lavorazioni con frese che non lavorano di testa per avere nota OutRaw invece di StartOutRaw.
2023-03-13 17:13:46 +01:00
DarioS c78bc69dd1 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam 2023-03-11 10:12:17 +01:00
luca.mazzoleni 2db0d38ccb Merge remote-tracking branch 'origin/master' into develop 2023-03-10 09:09:50 +01:00
DarioS 89fb2101bf DataBeam 2.5c3 :
- gestione ingresso nel grezzo iniziale ma non in quello dinamico per tenoni.
2023-03-10 08:56:46 +01:00
DarioS 40f5c67bf5 DataBeam :
- su FAST allargate possibilità lama downup
- modifiche per controlli aggiunti su utensili NoTipMove.
2023-03-08 08:53:15 +01:00
luca.mazzoleni b6de243461 Merge tag 'LongCut2' into develop
2.5c2 - fix versione
2023-03-06 18:31:08 +01:00
luca.mazzoleni cc5d1f3e52 Merge branch 'hotfix/LongCut2' 2023-03-06 18:31:08 +01:00
luca.mazzoleni 8491922f6d 2.5c2 2023-03-06 18:30:53 +01:00
luca.mazzoleni aede7c527f Merge tag 'LongCut' into develop
2.5c2: hotfix - in LongCut, LongDoubleCut correzione accorciamenti e allungamenti
2023-03-06 18:27:03 +01:00
luca.mazzoleni bab5cb6fd4 Merge branch 'hotfix/LongCut' 2023-03-06 18:27:02 +01:00
luca.mazzoleni de6ffa3d73 in LongCut, LongDoubleCut correzione accorciamenti e allungamenti 2023-03-06 18:26:16 +01:00
luca.mazzoleni 4c4ac340fb Merge remote-tracking branch 'origin/master' into develop 2023-03-03 12:42:56 +01:00
DarioS bf454d6c0f DataBeam 2.5c1 :
- in FreeContour corretta gestione Mark (crash per box non definiti).
2023-03-03 12:23:12 +01:00
luca.mazzoleni abfbc2184f Merge remote-tracking branch 'origin/master' into develop 2023-02-27 17:37:03 +01:00
DarioS 4bbef85875 DataBeam 2.5b3 :
- aggiunto Version.lua.
2023-02-27 17:32:15 +01:00
luca.mazzoleni 09b7496b9d Fix: miglioria per direzione asse C FAST con lama anche su LongDoubleCut -2.5b4 2023-02-24 16:40:28 +01:00
luca.mazzoleni 24bc868527 Merge branch 'master' into develop 2023-02-24 09:36:41 +01:00
DarioS 8e8caf511a DataBeam :
- piccola miglioria per direzione asse C FAST su LongCut con lama.
2023-02-23 20:43:09 +01:00
luca.mazzoleni 73cac99934 fix ramo master 2023-02-23 19:44:37 +01:00
luca.mazzoleni 533575b916 Revert "Merge branch 'develop'"
This reverts commit 5532174bf6, reversing
changes made to 9aaaa5c1b1.
2023-02-23 19:39:52 +01:00
luca.mazzoleni 5532174bf6 Merge branch 'develop' 2023-02-23 19:38:05 +01:00
luca.mazzoleni cdab041283 Merge branch 'Improvement/LongCutBetterFeedDirection' into develop 2023-02-23 19:34:11 +01:00
luca.mazzoleni e303f8205d Improvement/LongCutBetterFeedDirection:
- fix inversione allungamenti / accorciamenti
2023-02-23 19:32:29 +01:00
luca.mazzoleni 9aaaa5c1b1 Revert "Merge branch 'develop' - 2.5b3"
This reverts commit 6ae3f987af, reversing
changes made to 0d8ac98869.
2023-02-23 19:19:53 +01:00
luca.mazzoleni 6ae3f987af Merge branch 'develop' - 2.5b3 2023-02-23 18:56:44 +01:00
luca.mazzoleni f03d4c08af Merge branch 'Improvement/LongCutBetterFeedDirection' into develop - 2.5b3 2023-02-23 18:12:54 +01:00
luca.mazzoleni 90b1215f31 Improvement/LongCutBetterFeedDirection:
- fix commenti
2023-02-23 15:59:50 +01:00
luca.mazzoleni 2e25eb86e3 Improvement/LongCutBetterFeedDirection:
- in LongCut e LongDoubleCut nuova gestione del verso di avanzamento ottimale che contempla tutti i casi
2023-02-23 15:01:29 +01:00
luca.mazzoleni 0a1c80d764 Improvement:
- in LongCut e LongDoubleCut migliorato il verso di avanzamento della lama anche per lama LC
2023-02-21 15:51:41 +01:00
luca.mazzoleni 1077d19eea BugFix:
- in LapJoint corretto il ritorno della funzione MakeByPockets
2023-02-21 12:06:02 +01:00
luca.mazzoleni 1ac895439b Improvement:
- Ora le mortase a coda di rondine laterali sono sempre fatte prima dei tagli longitudinali, se secanti.
2023-02-20 18:32:25 +01:00
luca.mazzoleni d74091d7f3 Merge branch 'master' into develop 2023-02-20 18:30:35 +01:00
DarioS 0d8ac98869 DataBeam :
- modifica a direzione limite in Y per invertire tagli perpendicolari di cubetti.
2023-02-20 12:24:39 +01:00
luca.mazzoleni 8b231d7fd3 Merge branch 'develop' 2023-02-17 18:45:53 +01:00
luca.mazzoleni 36bff56509 Improvement:
- Nelle tasche in doppio la distanza minima ammessa tra le feature è stata portata a 50.
2023-02-17 18:36:51 +01:00
luca.mazzoleni 29eb50649d Merge branch 'develop' 2023-02-17 15:08:59 +01:00
luca.mazzoleni bd503764ed Improvement:
- ora le forature che intersecano le mortase sono sempre fatte prima della mortasa stessa
2023-02-17 12:21:33 +01:00
DarioS ad63364303 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam 2023-02-16 16:54:03 +01:00
DarioS 261f4115f4 Merge branch 'master' of https://gitlab.steamware.net/egaltech/DataBeam 2023-02-16 16:53:28 +01:00
luca.mazzoleni d945e92272 Fix commenti 2023-02-16 11:58:37 +01:00
luca.mazzoleni 58dd72c963 Improvement:
- in LapJoint altra piccola correzione alla scelta utensile di svuotatura
2023-02-16 11:57:11 +01:00
luca.mazzoleni d4ed2d651f Improvement:
- in LapJoint piccola correzione alla scelta utensile di svuotatura
2023-02-16 10:28:29 +01:00
luca.mazzoleni 82d80616f1 Merge branch 'develop' 2023-02-15 19:01:09 +01:00
DarioS 05be6f1d89 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam 2023-02-15 18:21:33 +01:00
luca.mazzoleni 0487b0ac9a Improvement:
- in LongCut e LongDoubleCut migliorato il verso di avanzamento della lama
2023-02-15 13:17:01 +01:00
luca.mazzoleni 580ff476e2 FIx:
- in ScarfJoint, SimpleScarf, StepJoint gestite le rotazioni di 90 deg nell'aggiornamento del grezzo
2023-02-15 09:37:19 +01:00
luca.mazzoleni ce3b623c14 Merge branch 'develop' 2023-02-14 17:02:33 +01:00
luca.mazzoleni 4d57cc7c5b Improvement:
- in FacesBySaw migliorata la direzione di lavoro della lama in modo da essere tendenzialmente opposta all'avanzamento
2023-02-14 15:28:39 +01:00
luca.mazzoleni fb57f47258 Merge branch 'develop' 2023-02-09 17:11:02 +01:00
luca.mazzoleni dc301910e1 Improvement:
- Improvement:
- in ProcessDtTenon ampliato il range dei tenoni lavorabili in sottosquadro
2023-02-09 16:01:49 +01:00
luca.mazzoleni 1a1a5192ee Improvement:
- in ProcessDtTenon permessi tenoni dal basso anche se pezzo stretto e inclinazione laterale non eccessiva
2023-02-08 18:54:24 +01:00
luca.mazzoleni 2561f79c39 Merge branch 'develop' 2023-02-06 18:29:34 +01:00
luca.mazzoleni 123a983c75 Improvement:
- in LapJoint->MakeDrillOnCorner aggiunto controllo distanza di sicurezza minima
2023-02-06 16:21:58 +01:00
luca.mazzoleni b9ceef6f31 Merge remote-tracking branch 'origin/master' into develop 2023-02-06 09:28:01 +01:00
DarioS 39b72e3ab9 DataBeam :
- in DiceCut migliorato calcolo step tagli ortogonali
- in taglio con lama migliorata scelta attacco e uscita ortogonali o tangenti.
2023-02-06 08:31:48 +01:00
luca.mazzoleni 750ddd2c05 Merge remote-tracking branch 'origin/HEAD' into develop 2023-02-01 08:21:12 +01:00
DarioS 279a83b1f4 DataBeam :
- piccola modifica.
2023-01-31 21:01:23 +01:00
luca.mazzoleni e6704addb0 Merge branch 'master' into develop 2023-01-31 18:33:06 +01:00
DarioS 890b2a36e6 DataBeam :
- piccola modifica a messaggi di errore ( 'Clamp move error ' -> 'Special error ').
2023-01-31 18:31:38 +01:00
luca.mazzoleni 4468e24bb9 Merge branch 'develop' 2023-01-31 18:06:47 +01:00
luca.mazzoleni ae4cd29853 Merge branch 'Feature/FindMirroredFeatures' into develop 2023-01-31 17:36:55 +01:00
luca.mazzoleni 478288b018 Merge branch 'Feature/FindMirroredFeatures' into develop 2023-01-31 15:36:39 +01:00
luca.mazzoleni bbd04a33a2 Merge branch 'develop' 2023-01-27 18:28:52 +01:00
47 changed files with 6965 additions and 2091 deletions
+2
View File
@@ -19,3 +19,5 @@
/bin/*.ini /bin/*.ini
/bin/LuaLibs/*.lua /bin/LuaLibs/*.lua
/bin/Images/*.png /bin/Images/*.png
.vscode/settings.json
bin/Images/.placeholder
+20 -17
View File
@@ -2,7 +2,7 @@ variables:
VERS_MAIN: '1.0' VERS_MAIN: '1.0'
APP_NAME: 'Beam' APP_NAME: 'Beam'
NEW_REL: '' NEW_REL: ''
NET_SHARE_R: '\\10.74.82.201\EgwTech' NET_SHARE_X: '\\10.74.82.201\EgwTech'
NET_SHARE_Z: '\\10.74.82.201\Artifacts' NET_SHARE_Z: '\\10.74.82.201\Artifacts'
NET_USERQ: 'steamw\egalware' NET_USERQ: 'steamw\egalware'
@@ -24,39 +24,42 @@ variables:
$FileList = Get-ChildItem("*.lua") $FileList = Get-ChildItem("*.lua")
ForEach ($File in $FileList) { ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf $FileName = Split-Path $File -leaf
lua54 -o bin\$FileName $FileName lua54 -o bin\$FileName -s $FileName
echo "lua54 -o bin\$FileName $FileName" echo "lua54 -o bin\$FileName -s $FileName"
} }
$FileList = Get-ChildItem("LuaLibs\*.lua") $FileList = Get-ChildItem("LuaLibs\*.lua")
ForEach ($File in $FileList) { ForEach ($File in $FileList) {
$FileName = Split-Path $File -leaf $FileName = Split-Path $File -leaf
lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName" echo "lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName"
} }
# helper copia SORGENTI verso cartella di rete R:\ dei SORGENTI # helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI
.CodeReplicaR: &CodeReplicaR .CodeReplicaR: &CodeReplicaR
- | - |
net use R: /delete net use X: /delete
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY . R:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git
SLEEP 2 SLEEP 2
net use R: /delete net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY . X:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git
SLEEP 2
net use X: /delete
# helper copia script verso cartella di rete R:\ delle cartelle bin # helper copia script verso cartella di rete X:\ delle cartelle bin
.ReplicaR: &ReplicaR .ReplicaR: &ReplicaR
- | - |
net use R: /delete net use X: /delete
net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY /MIR bin R:\EgtData\$env:APP_NAME\bin
ROBOCOPY /MIR Images R:\EgtData\$env:APP_NAME\bin\Images
SLEEP 2 SLEEP 2
net use R: /delete net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY /MIR bin X:\EgtData\$env:APP_NAME\bin
ROBOCOPY /MIR Images X:\EgtData\$env:APP_NAME\bin\Images
SLEEP 2
net use X: /delete
# helper copia script verso cartella di rete R:\ delle cartelle bin # helper copia script verso cartella di rete Z:\ delle cartelle bin
.ReplicaZ: &ReplicaZ .ReplicaZ: &ReplicaZ
- | - |
net use Z: /delete net use Z: /delete
SLEEP 2
net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD
ROBOCOPY /MIR bin Z:\EgtData\$env:APP_NAME\bin ROBOCOPY /MIR bin Z:\EgtData\$env:APP_NAME\bin
ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\bin\Images ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\bin\Images
+33 -12
View File
@@ -1,4 +1,4 @@
-- BatchProcess.lua by Egaltech s.r.l. 2022/04/28 -- BatchProcess.lua by Egaltech s.r.l. 2022/05/10
-- Gestione calcolo batch disposizione e lavorazioni per Travi -- Gestione calcolo batch disposizione e lavorazioni per Travi
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3. -- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
-- 2019/07/16 Aggiunta gestione modalità oltre 10 per impostazione macchina e uscita. -- 2019/07/16 Aggiunta gestione modalità oltre 10 per impostazione macchina e uscita.
@@ -23,6 +23,8 @@
-- 2021/06/16 Se disponibile si aggiunge la versione dell'eseguibile alle info del programma CN. -- 2021/06/16 Se disponibile si aggiunge la versione dell'eseguibile alle info del programma CN.
-- 2021/08/04 Direzione vista simulazione da BD.SIMUL_VIEW_DIR se esiste. -- 2021/08/04 Direzione vista simulazione da BD.SIMUL_VIEW_DIR se esiste.
-- 2022/04/28 In info generazione aggiunta indicazione se 64bit. -- 2022/04/28 In info generazione aggiunta indicazione se 64bit.
-- 2023/05/03 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL).
-- 2022/05/10 Dopo aver fatto rotazioni e inversioni dei pezzi cambio chiave Info relative.
-- Intestazioni -- Intestazioni
require( 'EgtBase') require( 'EgtBase')
@@ -57,9 +59,23 @@ end
local sLog = 'BatchProcess : ' .. BEAM.FILE .. ', ' .. BEAM.MACHINE .. ', ' .. sFlag local sLog = 'BatchProcess : ' .. BEAM.FILE .. ', ' .. BEAM.MACHINE .. ', ' .. sFlag
EgtOutLog( sLog) EgtOutLog( sLog)
-- Cancello file di log specifico
local sLogFile = EgtChangePathExtension( BEAM.FILE, '.txt') local sLogFile = EgtChangePathExtension( BEAM.FILE, '.txt')
EgtEraseFile( sLogFile) -- in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check
if BEAM.FLAG == 0 then
local hLogFile = io.open( sLogFile, 'r')
if hLogFile then
for line in hLogFile:lines() do
if EgtStartsWith( line, 'ERR') and tonumber( EgtSplitString( line, '=')[2] or 0) > 0 then
BEAM.FLAG = 4
break
end
end
hLogFile:close()
end
end
-- Cancello file di log specifico
EgtEraseFile( sLogFile)
-- Funzioni per scrittura su file di log specifico -- Funzioni per scrittura su file di log specifico
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId) local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
@@ -266,22 +282,26 @@ if bToProcess then
vBeam[i].PosX = PosX vBeam[i].PosX = PosX
end end
-- Eseguo eventuali rotazioni e inversioni testa-coda -- Se non già eseguite, applico eventuali rotazioni e inversioni testa-coda
for i = 1, #vBeam do for i = 1, #vBeam do
local b3Solid = vBeam[i].Box local b3Solid = vBeam[i].Box
-- rotazione -- rotazione
local dRotAng = EgtGetInfo( vBeam[i].Id, 'ROTATED', 'd') local dRotAng = EgtGetInfo( vBeam[i].Id, 'ROTATED', 'd') or 0
if dRotAng and abs( dRotAng) > GEO.EPS_ANG_SMALL then if abs( dRotAng) > GEO.EPS_ANG_SMALL then
local ptRotCen = b3Solid:getCenter() local ptRotCen = b3Solid:getCenter()
EgtRotate( vBeam[i].Id, ptRotCen, X_AX(), dRotAng, GDB_RT.GLOB) EgtRotate( vBeam[i].Id, ptRotCen, X_AX(), dRotAng, GDB_RT.GLOB)
b3Solid:rotate( ptRotCen, X_AX(), dRotAng) b3Solid:rotate( ptRotCen, X_AX(), dRotAng)
end end
EgtRemoveInfo( vBeam[i].Id, 'ROTATED')
EgtSetInfo( vBeam[i].Id, 'ROTATED_OK', dRotAng)
-- inversione -- inversione
local dInvAng = 180 - ( EgtGetInfo( vBeam[i].Id, 'INVERTED', 'd') or 0) local dInvAng = 180 - ( EgtGetInfo( vBeam[i].Id, 'INVERTED', 'd') or 0)
if abs( dInvAng) > GEO.EPS_ANG_SMALL then if abs( dInvAng) > GEO.EPS_ANG_SMALL then
local ptInvCen = b3Solid:getCenter() local ptInvCen = b3Solid:getCenter()
EgtRotate( vBeam[i].Id, ptInvCen, Z_AX(), dInvAng, GDB_RT.GLOB) EgtRotate( vBeam[i].Id, ptInvCen, Z_AX(), dInvAng, GDB_RT.GLOB)
end end
EgtRemoveInfo( vBeam[i].Id, 'INVERTED')
EgtSetInfo( vBeam[i].Id, 'INVERTED_OK', 180 - dInvAng)
end end
-- Ne verifico le dimensioni -- Ne verifico le dimensioni
@@ -291,8 +311,8 @@ if bToProcess then
for i = 2, #vBeam do for i = 2, #vBeam do
local dDimW = vBeam[i].Box:getDimY() local dDimW = vBeam[i].Box:getDimY()
local dDimH = vBeam[i].Box:getDimZ() local dDimH = vBeam[i].Box:getDimZ()
if ( abs( dDimW - dRawW) > 10 * GEO.EPS_SMALL or abs( dDimH - dRawH) > 10 * GEO.EPS_SMALL) and if ( abs( dDimW - dRawW) > 100 * GEO.EPS_SMALL or abs( dDimH - dRawH) > 100 * GEO.EPS_SMALL) and
( abs( dDimH - dRawW) > 10 * GEO.EPS_SMALL or abs( dDimW - dRawH) > 10 * GEO.EPS_SMALL) then ( abs( dDimH - dRawW) > 100 * GEO.EPS_SMALL or abs( dDimW - dRawH) > 100 * GEO.EPS_SMALL) then
table.insert( vBeamErr, i) table.insert( vBeamErr, i)
end end
end end
@@ -351,7 +371,7 @@ if bToProcess then
local dOvmHead = vBeam[1].PosX or 0 local dOvmHead = vBeam[1].PosX or 0
-- Sistemo le travi nel grezzo -- Sistemo le travi nel grezzo
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam) local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, nil, vBeam)
if not bPbOk then if not bPbOk then
BEAM.ERR = 18 BEAM.ERR = 18
BEAM.MSG = sPbErr BEAM.MSG = sPbErr
@@ -455,7 +475,7 @@ else
-- Passo in modalità lavora -- Passo in modalità lavora
EgtSetCurrMachGroup( EgtGetLastMachGroup()) EgtSetCurrMachGroup( EgtGetLastMachGroup())
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni -- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
if bToRecalc then if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>') EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
EgtImportSetup() EgtImportSetup()
EgtApplyAllMachinings() EgtApplyAllMachinings()
@@ -496,7 +516,7 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F
BEAM.MSG = 'Axis outstroke ' .. sErr BEAM.MSG = 'Axis outstroke ' .. sErr
elseif nErr == MCH_SHE.SPECIAL then elseif nErr == MCH_SHE.SPECIAL then
BEAM.ERR = 24 BEAM.ERR = 24
BEAM.MSG = 'Clamp move error ' .. sErr BEAM.MSG = 'Special error ' .. sErr
else else
BEAM.ERR = 25 BEAM.ERR = 25
BEAM.MSG = 'General failure (contact supplier)' BEAM.MSG = 'General failure (contact supplier)'
@@ -519,7 +539,8 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F
end end
-- *** Genero programma CN *** ( se richiesto) -- *** Genero programma CN *** ( se richiesto)
if BEAM.FLAG == 0 or BEAM.FLAG == 4 then local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
if bIsGenerationEnabled and ( BEAM.FLAG == 0 or BEAM.FLAG == 4) then
EgtOutLog( ' +++ Generating NC part program >>>') EgtOutLog( ' +++ Generating NC part program >>>')
local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '') local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '')
if EgtGetExeVersion then if EgtGetExeVersion then
+29 -11
View File
@@ -1,4 +1,4 @@
-- BatchProcessNew.lua by Egaltech s.r.l. 2022/08/01 -- BatchProcessNew.lua by Egaltech s.r.l. 2024/01/10
-- Gestione calcolo batch disposizione e lavorazioni per Travi -- Gestione calcolo batch disposizione e lavorazioni per Travi
-- 2021/01/07 Per nuova interfaccia Egt. -- 2021/01/07 Per nuova interfaccia Egt.
-- 2021/01/15 CREATE_BAR ora FLAG = 6 (prima 5). -- 2021/01/15 CREATE_BAR ora FLAG = 6 (prima 5).
@@ -12,6 +12,7 @@
-- 2022/04/28 In info generazione aggiunta indicazione se 64bit. -- 2022/04/28 In info generazione aggiunta indicazione se 64bit.
-- 2022/07/24 Modifica per cancellare lavorazioni con ricalcolo e barra già definita. -- 2022/07/24 Modifica per cancellare lavorazioni con ricalcolo e barra già definita.
-- 2022/08/01 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL). -- 2022/08/01 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL).
-- 2024/01/10 Modifiche per centrare i pezzi in Y sulla tavola (come in BeamExec).
-- Intestazioni -- Intestazioni
require( 'EgtBase') require( 'EgtBase')
@@ -44,9 +45,23 @@ end
local sLog = 'BatchProcess : ' .. BEAM.FILE .. ', ' .. BEAM.MACHINE .. ', ' .. sFlag local sLog = 'BatchProcess : ' .. BEAM.FILE .. ', ' .. BEAM.MACHINE .. ', ' .. sFlag
EgtOutLog( sLog) EgtOutLog( sLog)
-- Cancello file di log specifico
local sLogFile = EgtChangePathExtension( BEAM.FILE, '.txt') local sLogFile = EgtChangePathExtension( BEAM.FILE, '.txt')
EgtEraseFile( sLogFile) -- in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check
if BEAM.FLAG == 0 then
local hLogFile = io.open( sLogFile, 'r')
if hLogFile then
for line in hLogFile:lines() do
if EgtStartsWith( line, 'ERR') and tonumber( EgtSplitString( line, '=')[2] or 0) > 0 then
BEAM.FLAG = 4
break
end
end
hLogFile:close()
end
end
-- Cancello file di log specifico
EgtEraseFile( sLogFile)
-- Funzioni per scrittura su file di log specifico -- Funzioni per scrittura su file di log specifico
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId) local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
@@ -209,10 +224,7 @@ if bToProcess then
EgtSetCurrMachGroup() EgtSetCurrMachGroup()
-- Area tavola -- Area tavola
local b3Tab = EgtGetTableArea() local b3Tab = EgtGetTableArea()
-- Calcolo posizione estremo TR o BR della tavola rispetto a sua origine in BL -- Sezione del grezzo
BD.OriXR = Point3d( b3Tab:getDimX(), EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()), 0)
BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
-- Calcolo minimo grezzo scaricabile
local nRawId = EgtGetFirstRawPart() local nRawId = EgtGetFirstRawPart()
if not nRawId then if not nRawId then
BEAM.ERR = 14 BEAM.ERR = 14
@@ -222,6 +234,11 @@ if bToProcess then
return return
end end
local b3Raw = EgtGetRawPartBBox( nRawId) local b3Raw = EgtGetRawPartBBox( nRawId)
-- Calcolo posizione estremo TR o BR della tavola rispetto a sua origine in BL
local dPosY = EgtIf( BD.CENTER_BEAM, ( b3Tab:getDimY() + b3Raw:getDimY() * EgtIf( BD.RIGHT_LOAD, -1, 1)) / 2, EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()))
BD.OriXR = Point3d( b3Tab:getDimX(), dPosY, 0)
BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
-- Calcolo minimo grezzo scaricabile
BE.CalcMinUnloadableRaw( b3Raw:getDimY(), b3Raw:getDimZ()) BE.CalcMinUnloadableRaw( b3Raw:getDimY(), b3Raw:getDimZ())
-- altrimenti devo recuperare i pezzi per creare la barra -- altrimenti devo recuperare i pezzi per creare la barra
else else
@@ -402,7 +419,7 @@ if bToProcess then
end end
-- Sistemo le travi nel grezzo -- Sistemo le travi nel grezzo
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, BEAM.FLAG == 6) local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, nil, vBeam, BEAM.FLAG == 6)
if not bPbOk then if not bPbOk then
BEAM.ERR = 18 BEAM.ERR = 18
BEAM.MSG = sPbErr BEAM.MSG = sPbErr
@@ -559,7 +576,7 @@ else
-- Passo in modalità lavora -- Passo in modalità lavora
EgtSetCurrMachGroup( EgtGetLastMachGroup()) EgtSetCurrMachGroup( EgtGetLastMachGroup())
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni -- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
if bToRecalc then if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>') EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
EgtImportSetup() EgtImportSetup()
EgtApplyAllMachinings() EgtApplyAllMachinings()
@@ -600,7 +617,7 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F
BEAM.MSG = 'Axis outstroke ' .. sErr BEAM.MSG = 'Axis outstroke ' .. sErr
elseif nErr == MCH_SHE.SPECIAL then elseif nErr == MCH_SHE.SPECIAL then
BEAM.ERR = 24 BEAM.ERR = 24
BEAM.MSG = 'Clamp move error ' .. sErr BEAM.MSG = 'Special error ' .. sErr
else else
BEAM.ERR = 25 BEAM.ERR = 25
BEAM.MSG = 'General failure (contact supplier)' BEAM.MSG = 'General failure (contact supplier)'
@@ -623,7 +640,8 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F
end end
-- *** Genero programma CN *** ( se richiesto) -- *** Genero programma CN *** ( se richiesto)
if BEAM.FLAG == 0 or BEAM.FLAG == 4 then local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
if bIsGenerationEnabled and ( BEAM.FLAG == 0 or BEAM.FLAG == 4) then
EgtOutLog( ' +++ Generating NC part program >>>') EgtOutLog( ' +++ Generating NC part program >>>')
local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '') local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '')
if EgtGetExeVersion then if EgtGetExeVersion then
+50 -47
View File
@@ -1,52 +1,55 @@
REM Compilazione degli script Beam Egaltech 2023.01.11 REM Compilazione degli script Beam Egaltech 2023.11.08
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
REM Compilazione 32 e 64 bit REM Compilazione 32 e 64 bit
\EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamExec.lua LuaLibs\BeamExec.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamExec.lua -s LuaLibs\BeamExec.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamLib.lua LuaLibs\BeamLib.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamLib.lua -s LuaLibs\BeamLib.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\DiceCut.lua LuaLibs\DiceCut.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\DiceCut.lua -s LuaLibs\DiceCut.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FaceByPocket.lua LuaLibs\FaceByPocket.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\FaceByPocket.lua -s LuaLibs\FaceByPocket.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FacesBySaw.lua LuaLibs\FacesBySaw.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\FacesBySaw.lua -s LuaLibs\FacesBySaw.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\MachiningLib.lua LuaLibs\MachiningLib.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\FeatureTopology.lua -s LuaLibs\FeatureTopology.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessBlockHausFront.lua LuaLibs\ProcessBlockHausFront.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\MachiningLib.lua -s LuaLibs\MachiningLib.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessChamfer.lua LuaLibs\ProcessChamfer.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessBlockHausFront.lua -s LuaLibs\ProcessBlockHausFront.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessCut.lua LuaLibs\ProcessCut.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessChamfer.lua -s LuaLibs\ProcessChamfer.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDecor.lua LuaLibs\ProcessDecor.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessCut.lua -s LuaLibs\ProcessCut.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDoubleCut.lua LuaLibs\ProcessDoubleCut.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDecor.lua -s LuaLibs\ProcessDecor.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDovetail.lua LuaLibs\ProcessDovetail.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDoubleCut.lua -s LuaLibs\ProcessDoubleCut.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDrill.lua LuaLibs\ProcessDrill.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDovetail.lua -s LuaLibs\ProcessDovetail.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtMortise.lua LuaLibs\ProcessDtMortise.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDrill.lua -s LuaLibs\ProcessDrill.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtTenon.lua LuaLibs\ProcessDtTenon.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtMortise.lua -s LuaLibs\ProcessDtMortise.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFreeContour.lua LuaLibs\ProcessFreeContour.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtTenon.lua -s LuaLibs\ProcessDtTenon.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFrenchRidgeLap.lua LuaLibs\ProcessFrenchRidgeLap.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFreeContour.lua -s LuaLibs\ProcessFreeContour.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessHeadCut.lua LuaLibs\ProcessHeadCut.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFrenchRidgeLap.lua -s LuaLibs\ProcessFrenchRidgeLap.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLapJoint.lua LuaLibs\ProcessLapJoint.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessHeadCut.lua -s LuaLibs\ProcessHeadCut.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongCut.lua LuaLibs\ProcessLongCut.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLapJoint.lua -s LuaLibs\ProcessLapJoint.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongDoubleCut.lua LuaLibs\ProcessLongDoubleCut.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongCut.lua -s LuaLibs\ProcessLongCut.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMark.lua LuaLibs\ProcessMark.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongDoubleCut.lua -s LuaLibs\ProcessLongDoubleCut.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMortise.lua LuaLibs\ProcessMortise.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMark.lua -s LuaLibs\ProcessMark.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfCamb.lua LuaLibs\ProcessProfCamb.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMortise.lua -s LuaLibs\ProcessMortise.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConcave.lua LuaLibs\ProcessProfConcave.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfCamb.lua -s LuaLibs\ProcessProfCamb.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConvex.lua LuaLibs\ProcessProfConvex.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConcave.lua -s LuaLibs\ProcessProfConcave.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfFront.lua LuaLibs\ProcessProfFront.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConvex.lua -s LuaLibs\ProcessProfConvex.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfHead.lua LuaLibs\ProcessProfHead.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfFront.lua -s LuaLibs\ProcessProfFront.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRidgeLap.lua LuaLibs\ProcessRidgeLap.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfHead.lua -s LuaLibs\ProcessProfHead.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRoundArch.lua LuaLibs\ProcessRoundArch.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRidgeLap.lua -s LuaLibs\ProcessRidgeLap.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSawCut.lua LuaLibs\ProcessSawCut.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRoundArch.lua -s LuaLibs\ProcessRoundArch.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessScarfJoint.lua LuaLibs\ProcessScarfJoint.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSawCut.lua -s LuaLibs\ProcessSawCut.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSimpleScarf.lua LuaLibs\ProcessSimpleScarf.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessScarfJoint.lua -s LuaLibs\ProcessScarfJoint.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSplit.lua LuaLibs\ProcessSplit.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSimpleScarf.lua -s LuaLibs\ProcessSimpleScarf.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJoint.lua LuaLibs\ProcessStepJoint.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSplit.lua -s LuaLibs\ProcessSplit.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJointNotch.lua LuaLibs\ProcessStepJointNotch.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJoint.lua -s LuaLibs\ProcessStepJoint.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTenon.lua LuaLibs\ProcessTenon.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJointNotch.lua -s LuaLibs\ProcessStepJointNotch.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua LuaLibs\ProcessText.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTenon.lua -s LuaLibs\ProcessTenon.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua LuaLibs\ProcessTyroleanDovetail.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua -s LuaLibs\ProcessText.lua
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua BatchProcess.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua -s LuaLibs\ProcessTyroleanDovetail.lua
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua BatchProcessNew.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessVariant.lua -s LuaLibs\ProcessVariant.lua
\EgtProg\Dll32\luac54 -o bin\GetBeamData.lua GetBeamData.lua \EgtProg\Dll32\luac54 -o bin\BatchProcess.lua -s BatchProcess.lua
\EgtProg\Dll32\luac54 -o bin\NestProcess.lua NestProcess.lua \EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua -s BatchProcessNew.lua
\EgtProg\Dll32\luac54 -o bin\Process.lua Process.lua \EgtProg\Dll32\luac54 -o bin\GetBeamData.lua -s GetBeamData.lua
\EgtProg\Dll32\luac54 -o bin\Rotate.lua Rotate.lua \EgtProg\Dll32\luac54 -o bin\NestProcess.lua -s NestProcess.lua
\EgtProg\Dll32\luac54 -o bin\Swap.lua Swap.lua \EgtProg\Dll32\luac54 -o bin\Process.lua -s Process.lua
\EgtProg\Dll32\luac54 -o bin\Rotate.lua -s Rotate.lua
\EgtProg\Dll32\luac54 -o bin\Swap.lua -s Swap.lua
\EgtProg\Dll32\luac54 -o bin\Version.lua -s Version.lua
+482 -126
View File
@@ -1,4 +1,4 @@
-- BeamExec.lua by Egaltech s.r.l. 2022/12/28 -- BeamExec.lua by Egaltech s.r.l. 2023/12/26
-- Libreria esecuzione lavorazioni per Travi -- Libreria esecuzione lavorazioni per Travi
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3. -- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato. -- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
@@ -41,7 +41,29 @@
-- 2022/12/28 Implementata gestione forature e code di rondine in doppio. -- 2022/12/28 Implementata gestione forature e code di rondine in doppio.
-- 2023/01/31 Implementata gestione mortase in doppio. -- 2023/01/31 Implementata gestione mortase in doppio.
-- 2023/01/31 Nelle lavorazioni in doppio aggiunta la minima distanza tra le feature. -- 2023/01/31 Nelle lavorazioni in doppio aggiunta la minima distanza tra le feature.
-- 2023/02/17 Ora le forature che intersecano le mortase sono sempre fatte prima della mortasa stessa.
-- 2023/02/17 Nelle tasche in doppio, la distanza minima ammessa tra le feature è stata portata a 50.
-- 2023/02/20 Ora le mortase a coda di rondine laterali sono sempre fatte prima dei tagli longitudinali.
-- 2023/03/31 Corretto ordinamento per fori di coda da lasciare in coda.
-- 2023/07/31 Corretto errore nelle mortase in doppio.
-- 2023/09/13 Aggiunta ClassifyTopology per la classificazione topologica delle feature. In CollectFeatures aggiunta la raccolta preliminare di alcune informazioni.
-- 2023/09/26 Funzione IsFeatureCuttingEntireSection spostata in BeamLib
-- 2023/09/26 In ClassifyTopology aggiunto passaggio del parametro nRawId
-- 2023/10/24 Aggiunta scrittura parametro BARLEN nelle info del mach group
-- 2023/11/08 Aggiunta gestione processi Variant.
-- 2023/11/30 Migliorato il calcolo elevazione con l'utilizzo della nuova funzione EgtSurfTmFacetElevationInBBox.
-- 2023/12/26 Modifiche per centrare i pezzi in Y sulla tavola.
-- 2024/02/26 Migliorata 'CompareFeatures' per ordine lavorazioni
-- Migliorata 'CompareFeatures' per ordine forature
-- 2024/02/19 In Collect aggiunta la scrittura nella Proc di Width e Height delle facce.
-- 2024/02/29 Migliorata 'CompareFeatures' per ordine forature
-- 2024/03/04 Creata funzione calcolo dipendenze tra feature con calcolo topologia.
-- 2024/03/07 Implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket.
-- 2024/03/11 In CollectFeatures si scrive ora Width e Height della faccia sia trimmate con il grezzo che intere.
-- 2024/03/13 In CollectFeatures si scrive lunghezza foro su Proc e si controla se serve Predrill
-- In OrderFeature, preforo sempre prima del foro
-- 2024/04/11 In CollectFeatures aggiunta lettura info PRID, scritta in Proc.FeatureId
-- 2024/09/04 Gestione dipendenza foro-tasca in caso di fase con pezzo ribaltato
-- Tabella per definizione modulo -- Tabella per definizione modulo
local BeamExec = {} local BeamExec = {}
@@ -96,8 +118,10 @@ _G.package.loaded.ProcessTyroleanDovetail = nil
_G.package.loaded.ProcessDovetail = nil _G.package.loaded.ProcessDovetail = nil
_G.package.loaded.ProcessFreeContour = nil _G.package.loaded.ProcessFreeContour = nil
_G.package.loaded.ProcessDecor = nil _G.package.loaded.ProcessDecor = nil
_G.package.loaded.ProcessVariant = nil
local ML = require( 'MachiningLib') local ML = require( 'MachiningLib')
local BL = require( 'BeamLib') local BL = require( 'BeamLib')
local Topology = require( 'FeatureTopology')
local DC = require( 'DiceCut') local DC = require( 'DiceCut')
local Fbs = require( 'FacesBySaw') local Fbs = require( 'FacesBySaw')
local Hcut= require( 'ProcessHeadCut') local Hcut= require( 'ProcessHeadCut')
@@ -133,6 +157,7 @@ local TyroleanDovetail = require( 'ProcessTyroleanDovetail')
local Dovetail = require( 'ProcessDovetail') local Dovetail = require( 'ProcessDovetail')
local FreeContour = require( 'ProcessFreeContour') local FreeContour = require( 'ProcessFreeContour')
local Decor = require( 'ProcessDecor') local Decor = require( 'ProcessDecor')
local Variant = require( 'ProcessVariant')
EgtOutLog( ' BeamExec started', 1) EgtOutLog( ' BeamExec started', 1)
EgtMdbSetGeneralParam( MCH_GP.MAXDEPTHSAFE, BD.COLL_SIC) EgtMdbSetGeneralParam( MCH_GP.MAXDEPTHSAFE, BD.COLL_SIC)
@@ -244,9 +269,37 @@ local function IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H local function NeedTopologyFeature( Proc)
local function IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH) -- richiedono calcolo topologia
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)) if Cut.Identify( Proc) then
return true
end
if DoubleCut.Identify( Proc) then
return true
end
if LongCut.Identify( Proc) then
return true
end
if Long2Cut.Identify( Proc) then
return true
end
if SawCut.Identify( Proc) then
return true
end
if RidgeLap.Identify( Proc) then
return true
end
if LapJoint.Identify( Proc) then
return true
end
if FrenchRidgeLap.Identify( Proc) then
return true
end
if Chamfer.Identify( Proc) then
return true
end
-- tutte le altre non richiedono calcolo topologia
return false
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
@@ -258,8 +311,6 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
local LayerId = {} local LayerId = {}
LayerId[1] = BL.GetAddGroup( PartId) LayerId[1] = BL.GetAddGroup( PartId)
LayerId[2] = EgtGetFirstNameInGroup( PartId or GDB_ID.NULL, 'Processings') LayerId[2] = EgtGetFirstNameInGroup( PartId or GDB_ID.NULL, 'Processings')
local nMachineBeforeIntersectingDrillingsIdHead, dMachineBeforeIntersectingDrillingsXHead, nMachineBeforeIntersectingDrillingsIdTail, dMachineBeforeIntersectingDrillingsXTail = nil, GEO.INFINITO, nil, -GEO.INFINITO
local b3MachineBeforeIntersectingDrillingsBoxHead, b3MachineBeforeIntersectingDrillingsBoxTail = nil, nil
for nInd = 1, 2 do for nInd = 1, 2 do
local ProcId = EgtGetFirstInGroup( LayerId[nInd] or GDB_ID.NULL) local ProcId = EgtGetFirstInGroup( LayerId[nInd] or GDB_ID.NULL)
while ProcId do while ProcId do
@@ -274,8 +325,10 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
-- leggo se ci sono feature collegate -- leggo se ci sono feature collegate
local nAddAdjId = EgtGetInfo( ProcId, 'ADJID', 'i') local nAddAdjId = EgtGetInfo( ProcId, 'ADJID', 'i')
local nAddMainId = EgtGetInfo( ProcId, 'MAINID', 'i') local nAddMainId = EgtGetInfo( ProcId, 'MAINID', 'i')
local nFeatureId = EgtGetInfo( ProcId, 'PRID', 'i')
if nGrp and nPrc and nDo == 1 then if nGrp and nPrc and nDo == 1 then
local Proc = {} local Proc = {}
Proc.PartId = PartId
Proc.Id = ProcId Proc.Id = ProcId
Proc.Grp = nGrp Proc.Grp = nGrp
Proc.Prc = nPrc Proc.Prc = nPrc
@@ -286,6 +339,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
Proc.Fce = 0 Proc.Fce = 0
Proc.CutId = nCutId Proc.CutId = nCutId
Proc.TaskId = nTaskId Proc.TaskId = nTaskId
Proc.FeatureId = nFeatureId or Proc.TaskId
-- se ci sono feature collegate ne scrivo il riferimento nella Proc -- se ci sono feature collegate ne scrivo il riferimento nella Proc
if nAddAdjId then if nAddAdjId then
Proc.AdjId = Proc.Id + nAddAdjId Proc.AdjId = Proc.Id + nAddAdjId
@@ -293,25 +347,29 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
Proc.MainId = Proc.Id + nAddMainId Proc.MainId = Proc.Id + nAddMainId
end end
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD) Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
if Proc.Box and not Proc.Box:isEmpty() then if b3Raw then
-- recupero l'elenco delle facce della parte interessate dalla feature
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
-- recupero informazioni sulle facce della feature
if not Proc.Face then
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
end
end
if Proc.Box and not Proc.Box:isEmpty() then
Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH) Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH)
Proc.Tail, Proc.AdvTail = IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT) Proc.Tail, Proc.AdvTail = IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
if Proc.Fct == 1 and IsFeatureCuttingEntireSection( Proc.Box , dRawW, dRawH) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
if Proc.Head and Proc.Box:getCenter():getX() < dMachineBeforeIntersectingDrillingsXHead then
dMachineBeforeIntersectingDrillingsXHead = Proc.Box:getCenter():getX()
nMachineBeforeIntersectingDrillingsIdHead = Proc.Id
b3MachineBeforeIntersectingDrillingsBoxHead = Proc.Box
elseif Proc.Tail and Proc.Box:getCenter():getX() > dMachineBeforeIntersectingDrillingsXTail then
dMachineBeforeIntersectingDrillingsXTail = Proc.Box:getCenter():getX()
nMachineBeforeIntersectingDrillingsIdTail = Proc.Id
b3MachineBeforeIntersectingDrillingsBoxTail = Proc.Box
end
end
table.insert( vProc, Proc) table.insert( vProc, Proc)
-- se foro -- se foro
if Drill.Identify( Proc) then if Drill.Identify( Proc) then
-- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento) -- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento)
Proc.Diam, Proc.Fcs, Proc.Fce = Drill.GetData( Proc, b3Raw) Proc.Diam, Proc.Len, Proc.Fcs, Proc.Fce = Drill.GetData( Proc, b3Raw)
-- verifico se devo inserire i prefori
if Drill.IsPredrillNeeded( Proc) then
local bAddProc, PredrillProc= Drill.AddPredrillFromDrillProc( Proc)
if bAddProc then
table.insert( vProc, PredrillProc)
end
end
-- verifico se necessaria seconda lavorazione da parte opposta per foro più lungo della punta -- verifico se necessaria seconda lavorazione da parte opposta per foro più lungo della punta
if Drill.Split( Proc, b3Raw) then if Drill.Split( Proc, b3Raw) then
-- aggiorno flags prima parte foro (dati tabelle sempre per riferimento) -- aggiorno flags prima parte foro (dati tabelle sempre per riferimento)
@@ -320,6 +378,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
Proc.Tail = Drill.IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT) Proc.Tail = Drill.IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
-- definisco dati seconda parte -- definisco dati seconda parte
local Proc2 = {} local Proc2 = {}
Proc2.PartId = PartId
Proc2.Id = ProcId Proc2.Id = ProcId
Proc2.Grp = nGrp Proc2.Grp = nGrp
Proc2.Prc = nPrc Proc2.Prc = nPrc
@@ -327,6 +386,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
Proc2.Box = BBox3d( Proc.Box) Proc2.Box = BBox3d( Proc.Box)
Proc2.Fct = Proc.Fct Proc2.Fct = Proc.Fct
Proc2.Diam = Proc.Diam Proc2.Diam = Proc.Diam
Proc2.Len = Proc.Len
Proc2.Head = Drill.IsHeadFeature( Proc2, b3Raw, dCurrOvmH) Proc2.Head = Drill.IsHeadFeature( Proc2, b3Raw, dCurrOvmH)
Proc2.Tail = Drill.IsTailFeature( Proc2, b3Raw, dCurrOvmH) Proc2.Tail = Drill.IsTailFeature( Proc2, b3Raw, dCurrOvmH)
Proc2.Fcs = Proc.Fce Proc2.Fcs = Proc.Fce
@@ -336,10 +396,17 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
Proc2.AdjId = Proc.AdjId Proc2.AdjId = Proc.AdjId
Proc2.MainId = Proc.MainId Proc2.MainId = Proc.MainId
table.insert( vProc, Proc2) table.insert( vProc, Proc2)
-- verifico se devo inserire i prefori
if Drill.IsPredrillNeeded( Proc2) then
local bAddProc, PredrillProc= Drill.AddPredrillFromDrillProc( Proc2)
if bAddProc then
table.insert( vProc, PredrillProc)
end
end
end end
-- se BlockHaus HalfLap -- se BlockHaus HalfLap
elseif Proc.Prc == 37 then elseif Proc.Prc == 37 then
local nFacInd = BL.GetFaceWithMostAdj( Proc.Id, PartId) local nFacInd = BL.GetFaceWithMostAdj( Proc, PartId)
if nFacInd then if nFacInd then
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
if vtN then if vtN then
@@ -359,11 +426,38 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
ProcId = EgtGetNext( ProcId) ProcId = EgtGetNext( ProcId)
end end
end end
local vMachineBeforeIntersectingDrillings = { return vProc
Head = { Id = nMachineBeforeIntersectingDrillingsIdHead, Box = b3MachineBeforeIntersectingDrillingsBoxHead}, end
Tail = { Id = nMachineBeforeIntersectingDrillingsIdTail, Box = b3MachineBeforeIntersectingDrillingsBoxTail}
-------------------------------------------------------------------------------------------------------------
local function CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
local nHeadId
local dHeadX = GEO.INFINITO
local nTailId
local dTailX = -GEO.INFINITO
local b3HeadBox
local b3TailBox
for i = 1, #vProc do
local Proc = vProc[i]
if Proc.Box and not Proc.Box:isEmpty() then
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then
dHeadX = Proc.Box:getCenter():getX()
nHeadId = Proc.Id
b3HeadBox = Proc.Box
elseif Proc.Tail and Proc.Box:getCenter():getX() > dTailX then
dTailX = Proc.Box:getCenter():getX()
nTailId = Proc.Id
b3TailBox = Proc.Box
end
end
end
end
local vMachBeforeIntersDrillings = {
Head = { Id = nHeadId, Box = b3HeadBox},
Tail = { Id = nTailId, Box = b3TailBox}
} }
return vProc, vMachineBeforeIntersectingDrillings return vMachBeforeIntersDrillings
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
@@ -383,7 +477,7 @@ local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
end end
if Proc.Head and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 340 then if Proc.Head and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 340 then
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria -- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
bHeadFinishingNeeded = not IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH) bHeadFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
end end
end end
return bHeadFinishingNeeded, nReplacedFeatureId return bHeadFinishingNeeded, nReplacedFeatureId
@@ -406,7 +500,7 @@ local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
end end
if Proc.Tail and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 350 then if Proc.Tail and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 350 then
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria -- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
bTailFinishingNeeded = not IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH) bTailFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
end end
end end
return bTailFinishingNeeded, nReplacedFeatureId return bTailFinishingNeeded, nReplacedFeatureId
@@ -443,12 +537,15 @@ local function VerifyBigSectionCut( dRawW, dRawH)
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroupOk) function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, bMachGroupOk)
-- default per nuove costanti qualora non definite -- default per nuove costanti qualora non definite
BD.OVM_BLADE_HBEAM = ( BD.OVM_BLADE_HBEAM or 11) BD.OVM_BLADE_HBEAM = ( BD.OVM_BLADE_HBEAM or 11)
BD.OVM_CHAIN_HBEAM = ( BD.OVM_CHAIN_HBEAM or 8) BD.OVM_CHAIN_HBEAM = ( BD.OVM_CHAIN_HBEAM or 8)
-- sovramateriale intermedio nullo se non definito
dOvmMid = ( dOvmMid or 0)
-- Determinazione minimo grezzo scaricabile -- Determinazione minimo grezzo scaricabile
BeamExec.CalcMinUnloadableRaw( dRawW, dRawH) BeamExec.CalcMinUnloadableRaw( dRawW, dRawH)
@@ -465,10 +562,20 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup
-- Impostazione della tavola -- Impostazione della tavola
EgtSetTable( 'Tab') EgtSetTable( 'Tab')
-- 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 -- Area tavola
local b3Tab = EgtGetTableArea() local b3Tab = EgtGetTableArea()
-- Calcolo posizione estremo TR/BR della tavola rispetto a sua origine in BL -- Calcolo posizione estremo TR/BR della tavola rispetto a sua origine in BL
BD.OriXR = Point3d( b3Tab:getDimX(), EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()), 0) local dPosY = EgtIf( BD.CENTER_BEAM, ( b3Tab:getDimY() + dRawW * EgtIf( BD.RIGHT_LOAD, -1, 1)) / 2, EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()))
BD.OriXR = Point3d( b3Tab:getDimX(), dPosY, 0)
BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR) BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
-- Impostazione dell'attrezzaggio di default -- Impostazione dell'attrezzaggio di default
@@ -495,8 +602,12 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup
local lastB3Solid = nil local lastB3Solid = nil
local dOffset = dOvmHead local dOffset = dOvmHead
if i > 1 then if i > 1 then
lastB3Solid = vBeam[i-1].Box if vBeam[i].PosX then
dOffset = vBeam[i].PosX - vBeam[i-1].PosX - lastB3Solid:getDimX() lastB3Solid = vBeam[i-1].Box
dOffset = vBeam[i].PosX - vBeam[i-1].PosX - lastB3Solid:getDimX()
else
dOffset = dOvmMid
end
end end
-- analizzo le features per valutare l'esistenza di feature head/tail che renderebbero inutili le rispettive finiture o di tagli di testa/coda sostituiti da cui leggere il parametro Q05 -- 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 vProc = CollectFeatures( Pz, b3Solid, 0)
@@ -531,8 +642,12 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroup
( abs( PartHeight - dRawW) < 100 * GEO.EPS_SMALL and abs( PartWidth - dRawH) < 100 * GEO.EPS_SMALL)) and ( abs( PartHeight - dRawW) < 100 * GEO.EPS_SMALL and abs( PartWidth - dRawH) < 100 * GEO.EPS_SMALL)) and
NextLen + DeltaE >= 0 then NextLen + DeltaE >= 0 then
-- eventuale sovramateriale di testa -- eventuale sovramateriale di testa
if i > 1 and vBeam[i].PosX then if i > 1 then
DeltaS = max( vBeam[i].PosX - ( dRawL - Len), DeltaSMin) if vBeam[i].PosX then
DeltaS = max( vBeam[i].PosX - ( dRawL - Len), DeltaSMin)
else
DeltaS = max( dOvmMid - DeltaE, 0)
end
end end
-- dimensioni del grezzo -- dimensioni del grezzo
local CrawLen = min( PartLen + DeltaS + DeltaE, Len) local CrawLen = min( PartLen + DeltaS + DeltaE, Len)
@@ -647,11 +762,11 @@ local function PrintFeatures( vProc, b3Raw)
EgtOutLog( ' RawBox=' .. tostring( b3Raw)) EgtOutLog( ' RawBox=' .. tostring( b3Raw))
for i = 1, #vProc do for i = 1, #vProc do
local Proc = vProc[i] local Proc = vProc[i]
local sOut = string.format( ' Id=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Side=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s', local sOut = string.format( ' Id=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Side=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s TopoName=%s',
Proc.Id, Proc.Grp, Proc.Prc, Proc.TaskId, Proc.CutId, Proc.Id, Proc.Grp, Proc.Prc, Proc.TaskId, Proc.CutId,
Proc.Flg, EgtIf( Proc.Down, 'T', 'F'), EgtIf( Proc.Side, 'T', 'F'), Proc.Flg, EgtIf( Proc.Down, 'T', 'F'), EgtIf( Proc.Side, 'T', 'F'),
EgtIf( Proc.Head, 'T', 'F'), EgtIf( Proc.Tail, 'T', EgtIf( Proc.AdvTail, 'A', 'F')), EgtIf( Proc.Head, 'T', 'F'), EgtIf( Proc.Tail, 'T', EgtIf( Proc.AdvTail, 'A', 'F')),
Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, tostring( Proc.Box)) Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, tostring( Proc.Box), Proc.TopologyLongName or '')
-- info speciali per Block Haus Half Lap -- info speciali per Block Haus Half Lap
if Proc.Prc == 37 then if Proc.Prc == 37 then
local sSpec = string.format( ' N=%s Hd=%s', tostring( Proc.vtN or V_NULL()), EgtIf( Proc.HeadDir, 'T', 'F')) local sSpec = string.format( ' N=%s Hd=%s', tostring( Proc.vtN or V_NULL()), EgtIf( Proc.HeadDir, 'T', 'F'))
@@ -690,33 +805,16 @@ local function OrderFeatures( vProc, b3Raw)
if Hcut.Identify( B2) then if Hcut.Identify( B2) then
return false return false
end end
-- se uno di testa e non l'altro, privilegio quello di testa -- se uno di testa e non l'altro, privilegio quello di testa (a meno che non siano dei fori)
if B1.Head ~= B2.Head then if B1.Head ~= B2.Head and not Drill.Identify(B1) and not Drill.Identify(B2) then
return B1.Head return B1.Head
end end
-- se primo è foro e secondo è un ribasso, il foro va sempre prima -- se entrambi di testa e intersecano stesse facce e primo è scasso a due facce e secondo è un profilo caudato, lo scasso è una riduzione e va fatto prima
if Drill.Identify(B1) and LapJoint.Identify(B2) and if ( ( B1.Head and B2.Head) or ( B1.Tail and B2.Tail)) and B1.Topology == 'Rabbet' and ( ProfCamb.Identify( B2) or ProfConcave.Identify( B2) or ProfConvex.Identify( B2)) then
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
return true return true
end end
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo -- se entrambi di testa e intersecano stesse facce e primo è un profilo caudato e secondo è scasso a due facce, lo scasso è una riduzione e va lasciato dopo
if LapJoint.Identify(B1) and Drill.Identify(B2) and if ( ( B1.Head and B2.Head) or ( B1.Tail and B2.Tail)) and B2.Topology == 'Rabbet' and ( ProfCamb.Identify( B1) or ProfConcave.Identify( B1) or ProfConvex.Identify( B1)) then
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
return false
end
-- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone
if ( Tenon.Identify( B1) or DtTenon.Identify( B1)) and ( Tenon.Identify( B2) or DtTenon.Identify( B2)) and
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
return ( ( B1.Prc == 50 or B1.Prc == 55) and B2.Prc == 52)
end
-- se primo house mortise, secondo mortise e si intersecano, metto prima house mortise
if Mortise.Identify( B1) and B1.Prc == 53 and ( Mortise.Identify( B2) or DtMortise.Identify( B2)) and B2.Prc ~= 53 and
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
return true
end
-- se primo mortise, secondo house mortise e si intersecano, metto prima house mortise
if ( Mortise.Identify( B1) or DtMortise.Identify( B1)) and B1.Prc ~= 53 and Mortise.Identify( B2) and B2.Prc == 53 and
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
return false return false
end end
-- se entrambi di testa e primo è scasso o mortasa e secondo no va messo dopo -- se entrambi di testa e primo è scasso o mortasa e secondo no va messo dopo
@@ -729,14 +827,6 @@ local function OrderFeatures( vProc, b3Raw)
not ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) then not ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) then
return true return true
end end
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
if B1.Tail and ( Split.Identify( B2) or not B2.Tail) then
return false
end
-- se secondo è feature di coda e l'altro è separazione o non è feature di coda
if B2.Tail and ( Split.Identify( B1) or not B1.Tail) then
return true
end
-- se primo è feature di coda anticipata e l'altro non è feature di coda -- se primo è feature di coda anticipata e l'altro non è feature di coda
if B1.AdvTail and ( not Split.Identify( B2) or not B2.Tail) then if B1.AdvTail and ( not Split.Identify( B2) or not B2.Tail) then
return false return false
@@ -745,16 +835,52 @@ local function OrderFeatures( vProc, b3Raw)
if B2.AdvTail and ( not Split.Identify( B1) or not B1.Tail) then if B2.AdvTail and ( not Split.Identify( B1) or not B1.Tail) then
return true return true
end end
-- se primo è foro e secondo è un ribasso, il foro va sempre prima a meno che il ribasso non sia di testa
if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2)) and B2.PassedByHole and
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
return true
end
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo a meno che il ribasso non sia di testa
if ( LapJoint.Identify(B1) or Mortise.Identify(B1))and B1.PassedByHole and Drill.Identify(B2) and
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
return false
end
-- se primo è ribasso e secondo è una mortasa a coda di rondine, il ribasso va sempre prima a meno che la mortasa a coda di rondine non sia di testa
if LapJoint.Identify(B1) and B1.PassedByDtMortise and DtMortise.SideIdentify(B2) and
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
return true
end
-- se primo è mortasa a coda di rondine e secondo è ribasso, la mortasa a coda di rondine va sempre dopo a meno che la mortasa a coda di rondine non sia di testa
if DtMortise.SideIdentify(B1) and LapJoint.Identify(B2) and B2.PassedByDtMortise and
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
return false
end
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
if B1.Tail and ( Split.Identify( B2) or not B2.Tail) then
return false
end
-- se secondo è feature di coda e l'altro è separazione o non è feature di coda
if B2.Tail and ( Split.Identify( B1) or not B1.Tail) then
return true
end
-- se primo è scasso o mortasa di coda e secondo no, sempre dopo -- se primo è scasso o mortasa di coda e secondo no, sempre dopo
if B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) and if B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) and
not ( B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2))) then not B2.Tail and ( ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2))) then
return false return false
end end
-- se secondo è scasso o mortasa di coda e primo no, va lasciato dopo -- se secondo è scasso o mortasa di coda e primo no, va lasciato dopo
if B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) and if B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) and
not ( B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1))) then not B1.Tail and ( ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1))) then
return true return true
end end
-- se entrambi di coda e il primo è una feature taglio di lama e il secondo no, feature taglio lama sempre prima
if B1.Tail and B2.Tail and ( Cut.Identify( B1) or DoubleCut.Identify( B1)) and ( not Cut.Identify( B2) and not DoubleCut.Identify( B2)) then
return true
end
-- se entrambi di coda e il secondo è una feature taglio di lama e il primo no, feature taglio lama sempre prima
if B1.Tail and B2.Tail and ( Cut.Identify( B2) or DoubleCut.Identify( B2)) and ( not Cut.Identify( B1) and not DoubleCut.Identify( B1)) then
return false
end
-- se primo è taglio longitudinale completo o altra lav. lunga, dopo tutte le altre feature non di coda -- se primo è taglio longitudinale completo o altra lav. lunga, dopo tutte le altre feature non di coda
if abs( B1.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then if abs( B1.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then
-- se anche l'altra è lunga, faccio prima quello piccolo in YZ -- se anche l'altra è lunga, faccio prima quello piccolo in YZ
@@ -773,16 +899,45 @@ local function OrderFeatures( vProc, b3Raw)
return not ( B1.Tail or B2.Box:getMin():getX() + 20 > B1.Box:getCenter():getX()) return not ( B1.Tail or B2.Box:getMin():getX() + 20 > B1.Box:getCenter():getX())
end end
-- se primo è foro e l'altro no, lo penalizzo -- se primo è foro e l'altro no, lo penalizzo
if B1.Prc == 40 and B2.Prc ~= 40 then if Drill.Identify(B1) and not Drill.Identify(B2) then
return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty) return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty)
end end
-- se primo è altro e secondo è foro, lo premio -- se primo è altro e secondo è foro, lo premio
if B1.Prc ~= 40 and B2.Prc == 40 then if not Drill.Identify(B1) and Drill.Identify(B2) then
return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX()) return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX())
end end
-- se prima è mortasa coda di rondine sul fianco e secondo taglio longitudinale, la coda di rondine va sempre prima
if DtMortise.SideIdentify(B1) and ( LongCut.Identify(B2) or Long2Cut.Identify(B2)) and
OverlapsX( B1.Box, B2.Box) then
return true
end
-- se primo è taglio longitudinale e seconda è mortasa coda di rondine sul fianco, il taglio longitudinale va sempre dopo
if ( LongCut.Identify(B1) or Long2Cut.Identify(B1)) and DtMortise.SideIdentify(B2) and
OverlapsX( B1.Box, B2.Box) then
return false
end
-- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone
if ( Tenon.Identify( B1) or DtTenon.Identify( B1)) and ( Tenon.Identify( B2) or DtTenon.Identify( B2)) and
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
return ( ( B1.Prc == 50 or B1.Prc == 55) and B2.Prc == 52)
end
-- se primo house mortise, secondo mortise e si intersecano, metto prima house mortise
if Mortise.Identify( B1) and B1.Prc == 53 and ( Mortise.Identify( B2) or DtMortise.Identify( B2)) and B2.Prc ~= 53 and
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
return true
end
-- se primo mortise, secondo house mortise e si intersecano, metto prima house mortise
if ( Mortise.Identify( B1) or DtMortise.Identify( B1)) and B1.Prc ~= 53 and Mortise.Identify( B2) and B2.Prc == 53 and
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
return false
end
-- se entrambi fori con posizione praticamente uguale ordino secondo diametro e faccia di inizio (Fcs) -- se entrambi fori con posizione praticamente uguale ordino secondo diametro e faccia di inizio (Fcs)
if B1.Prc == 40 and B2.Prc == 40 and abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < dSmallDrillRange then if B1.Prc == 40 and B2.Prc == 40 and abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < dSmallDrillRange then
if abs( B1.Diam - B2.Diam) < 1.0 then if B1.IsPredrill and not B2.IsPredrill then
return true
elseif not B1.IsPredrill and B2.IsPredrill then
return false
elseif abs( B1.Diam - B2.Diam) < 1.0 then
if B1.Fcs == B2.Fcs then if B1.Fcs == B2.Fcs then
if abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < 1.0 then if abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < 1.0 then
if abs( B1.Box:getCenter():getY() - B2.Box:getCenter():getY()) < 1.0 then if abs( B1.Box:getCenter():getY() - B2.Box:getCenter():getY()) < 1.0 then
@@ -960,7 +1115,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
local bDownSideOnHeadOk = false local bDownSideOnHeadOk = false
if Proc.MachineBeforeIntersectingDrillings then if Proc.MachineBeforeIntersectingDrillings then
table.Insert ( vMachineBeforeIntersectingDrillingsId, Proc.Id) table.insert( vMachineBeforeIntersectingDrillingsId, Proc.Id)
end end
-- se senza geometria (già disabilitato) -- se senza geometria (già disabilitato)
@@ -1070,6 +1225,9 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
-- se decorazione -- se decorazione
elseif Decor.Identify( Proc) then elseif Decor.Identify( Proc) then
bOk, bDown = Decor.Classify( Proc) bOk, bDown = Decor.Classify( Proc)
-- se Variant
elseif Variant.Identify( Proc) then
bOk, bDown = Variant.Classify( Proc, b3Raw)
end end
-- assegno risultato -- assegno risultato
if bOk then if bOk then
@@ -1120,6 +1278,20 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
vProc[nSplitting].Down = true vProc[nSplitting].Down = true
bSomeDown = true bSomeDown = true
end end
-- si cerca di riclassificare le feature che dipendono da altre (in caso siano su rotazioni diverse)
for i = 1, #vProc do
local Proc = vProc[i]
-- FORATURA
if Drill.Identify( Proc) and Proc.Dependency then
if Proc.Dependency.ExecBefore then
if Proc.Dependency.ExecBefore.Down then
local bMachiningSideChanged = Drill.Classify( Proc, b3Raw, 'DOWN')
end
end
end
end
return bAllOk, bSomeDown, bSomeSide, bSplitRot return bAllOk, bSomeDown, bSomeSide, bSplitRot
end end
@@ -1128,6 +1300,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
local bOk = true local bOk = true
local sErr = '' local sErr = ''
local nNewPhase = -1 local nNewPhase = -1
local AddedIds
EgtOutLog( ' * Process ' .. tostring( Proc.Id) .. ' *', 1) EgtOutLog( ' * Process ' .. tostring( Proc.Id) .. ' *', 1)
-- se intestatura ( 1-340-X ) -- se intestatura ( 1-340-X )
if Hcut.Identify( Proc) then if Hcut.Identify( Proc) then
@@ -1153,7 +1326,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
elseif Long2Cut.Identify( Proc) then elseif Long2Cut.Identify( Proc) then
-- se due facce longitudinali, eseguo doppio taglio longitudinale -- se due facce longitudinali, eseguo doppio taglio longitudinale
if Long2Cut.GetLongFacesCount( Proc) == 2 then if Long2Cut.GetLongFacesCount( Proc) == 2 then
bOk, sErr = Long2Cut.Make( Proc, nPhase, nRawId, nPartId) bOk, sErr, _, AddedIds = Long2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- altrimenti eseguo singolo taglio longitudinale -- altrimenti eseguo singolo taglio longitudinale
else else
bOk, sErr = LongCut.Make( Proc, nPhase, nRawId, nPartId) bOk, sErr = LongCut.Make( Proc, nPhase, nRawId, nPartId)
@@ -1171,7 +1344,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
-- o se rivestimento ( 3/4-034-X) o se mezzolegno chalet ( 4-037-X) o se tasca ( 4-039-X) o se taglio triangolato ( 4-120-X) -- o se rivestimento ( 3/4-034-X) o se mezzolegno chalet ( 4-037-X) o se tasca ( 4-039-X) o se taglio triangolato ( 4-120-X)
elseif LapJoint.Identify( Proc) then elseif LapJoint.Identify( Proc) then
-- esecuzione mezzo-legno o scanalatura -- esecuzione mezzo-legno o scanalatura
bOk, sErr = LapJoint.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) bOk, sErr, _, AddedIds = LapJoint.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- se smusso ( 3/4-036-X) -- se smusso ( 3/4-036-X)
elseif Chamfer.Identify( Proc) then elseif Chamfer.Identify( Proc) then
-- esecuzione smusso -- esecuzione smusso
@@ -1266,13 +1439,17 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
elseif Decor.Identify( Proc) then elseif Decor.Identify( Proc) then
-- esecuzione decorazione -- esecuzione decorazione
bOk, sErr = Decor.Make( Proc, nPhase, nRawId, nPartId) bOk, sErr = Decor.Make( Proc, nPhase, nRawId, nPartId)
-- se Variant
elseif Variant.Identify( Proc) then
-- esecuzione variante custom
bOk, sErr = Variant.Make( Proc, nPhase, nRawId, nPartId)
-- altrimenti feature sconosciuta -- altrimenti feature sconosciuta
else else
sErr = 'Error on process ' .. tostring( Proc.Id) .. ' unknown type (' .. tonumber( Proc.Grp) .. '-' .. tonumber( Proc.Prc) .. ')' sErr = 'Error on process ' .. tostring( Proc.Id) .. ' unknown type (' .. tonumber( Proc.Grp) .. '-' .. tonumber( Proc.Prc) .. ')'
EgtOutLog( sErr) EgtOutLog( sErr)
bOk = false bOk = false
end end
return bOk, sErr, ( nNewPhase or -1) return bOk, sErr, ( nNewPhase or -1), AddedIds
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
@@ -1382,16 +1559,14 @@ end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
-- Controlla se la feature ProcMirror è la specchiata di Proc, per feature di tipo tasca o simile -- Controlla se la feature ProcMirror è la specchiata di Proc, per feature di tipo tasca o simile
local function CheckMirrorPocket( Proc, ProcMirror, b3Raw, AuxId) local function CheckMirrorPocket( Proc, ProcMirror, b3Raw, AuxId)
-- recupero i dati geometrici della curva Proc -- recupero i dati geometrici della curva Proc
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptBC = EgtGP( AuxId, GDB_RT.GLOB) local ptBC = EgtGP( AuxId, GDB_RT.GLOB)
local rfDtMrt = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_RT.GLOB) local rfDtMrt = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_RT.GLOB)
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt) local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
local b3Proc = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD) local b3Proc = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
-- determino l'asse della curva Proc
local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB)
-- recupero e verifico l'entità curva ProcMirror -- recupero e verifico l'entità curva ProcMirror
local AuxIdMirror = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i') local AuxIdMirror = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i')
if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.Id end if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.Id end
@@ -1407,35 +1582,48 @@ local function CheckMirrorPocket( Proc, ProcMirror, b3Raw, AuxId)
local ptBCMirror = EgtGP( AuxIdMirror, GDB_RT.GLOB) local ptBCMirror = EgtGP( AuxIdMirror, GDB_RT.GLOB)
local b3DtMrtMirror = EgtGetBBoxRef( ProcMirror.Id, GDB_BB.STANDARD, rfDtMrt) local b3DtMrtMirror = EgtGetBBoxRef( ProcMirror.Id, GDB_BB.STANDARD, rfDtMrt)
local b3ProcMirror = EgtGetBBoxGlob( ProcMirror.Id, GDB_BB.STANDARD) local b3ProcMirror = EgtGetBBoxGlob( ProcMirror.Id, GDB_BB.STANDARD)
-- determino l'asse della curva ProcMirror
local vtAxMirror = EgtEV( AuxIdMirror, GDB_RT.GLOB) - EgtSV( AuxIdMirror, GDB_RT.GLOB) -- verifico se le mortase sono specchiate :
-- devono avere estrusioni opposte
-- verifico se le mortase sono specchiate if not AreOppositeVectorApprox( vtExtr, vtExtrMirror) then
local bIsMirror = true return false
end
-- se di tipo Dt, devono avere l'asse allineato
if DtMortise.SideIdentify( Proc) or DtMortise.SideIdentify( ProcMirror) then
local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB)
local vtAxMirror = EgtEV( AuxIdMirror, GDB_RT.GLOB) - EgtSV( AuxIdMirror, GDB_RT.GLOB)
if not AreSameVectorApprox( vtAx, vtAxMirror) then
return false
end
end
-- devono avere il centro allineato, essere equidistanti dalla mezzeria trave e non essere troppo vicine
local vtDisplacement = ptBC - ptBCMirror local vtDisplacement = ptBC - ptBCMirror
local ptCenRaw = b3Raw:getCenter() local ptCenRaw = b3Raw:getCenter()
local dYMinDistance = EgtIf( ptBC:getY() > ptBCMirror:getY(), abs( b3ProcMirror:getMax():getY() - b3Proc:getMin():getY()), abs( b3Proc:getMax():getY() - b3ProcMirror:getMin():getY()))
local dZMinDistance = EgtIf( ptBC:getZ() > ptBCMirror:getZ(), abs( b3ProcMirror:getMax():getZ() - b3Proc:getMin():getZ()), abs( b3Proc:getMax():getZ() - b3ProcMirror:getMin():getZ()))
local dMinimumDistanceMirroredFeatures = 60
-- controllo che il centro delle due mortase sia allineato, che queste siano equidistanti dalla mezzeria della trave
-- e che queste non siano troppo vicine
if AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) then if AreSameOrOppositeVectorApprox( vtExtr, Y_AX()) then
bIsMirror = abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 500 * GEO.EPS_SMALL and local dYMinDistance = max( b3Proc:getMin():getY(), b3ProcMirror:getMin():getY()) - min( b3Proc:getMax():getY(), b3ProcMirror:getMax():getY())
( abs( ptBC:getY() - ptCenRaw:getY()) - abs( ptBCMirror:getY() - ptCenRaw:getY())) < 500 * GEO.EPS_SMALL and if not ( abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 500 * GEO.EPS_SMALL and
dYMinDistance - dMinimumDistanceMirroredFeatures > 10 * GEO.EPS_SMALL ( abs( ptBC:getY() - ptCenRaw:getY()) - abs( ptBCMirror:getY() - ptCenRaw:getY())) < 500 * GEO.EPS_SMALL and
dYMinDistance > MIRROR_POCKETS_MIN_DISTANCE + 10 * GEO.EPS_SMALL) then
return false
end
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
bIsMirror = abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getY()) < 500 * GEO.EPS_SMALL and local dZMinDistance = max( b3Proc:getMin():getZ(), b3ProcMirror:getMin():getZ()) - min( b3Proc:getMax():getZ(), b3ProcMirror:getMax():getZ())
( abs( ptBC:getZ() - ptCenRaw:getZ()) - abs( ptBCMirror:getZ() - ptCenRaw:getZ())) < 500 * GEO.EPS_SMALL and if not ( abs( vtDisplacement:getX()) < 500 * GEO.EPS_SMALL and abs( vtDisplacement:getY()) < 500 * GEO.EPS_SMALL and
dZMinDistance - dMinimumDistanceMirroredFeatures > 10 * GEO.EPS_SMALL ( abs( ptBC:getZ() - ptCenRaw:getZ()) - abs( ptBCMirror:getZ() - ptCenRaw:getZ())) < 500 * GEO.EPS_SMALL and
dZMinDistance > MIRROR_POCKETS_MIN_DISTANCE + 10 * GEO.EPS_SMALL) then
return false
end
else
return false
end
-- devono avere box con le stesse dimensioni
if not ( abs( b3DtMrt:getDimX() - b3DtMrtMirror:getDimX()) < 500 * GEO.EPS_SMALL and
abs( b3DtMrt:getDimY() - b3DtMrtMirror:getDimY()) < 500 * GEO.EPS_SMALL and
abs( b3DtMrt:getDimZ() - b3DtMrtMirror:getDimZ()) < 500 * GEO.EPS_SMALL) then
return false
end end
-- controllo che le dimensioni dei due box siano le stesse
bIsMirror = bIsMirror and abs( b3DtMrt:getDimX() - b3DtMrtMirror:getDimX()) < 500 * GEO.EPS_SMALL and
abs( b3DtMrt:getDimY() - b3DtMrtMirror:getDimY()) < 500 * GEO.EPS_SMALL and
abs( b3DtMrt:getDimZ() - b3DtMrtMirror:getDimZ()) < 500 * GEO.EPS_SMALL
-- controllo che l'asse delle due mortase sia allineato
bIsMirror = bIsMirror and AreSameVectorApprox( vtAx, vtAxMirror)
return bIsMirror return true
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
@@ -1480,11 +1668,11 @@ local function VerifyMortiseMirrored( Proc, vProc, b3Raw)
local sPockType = 'Mortise' local sPockType = 'Mortise'
local sPocketing local sPocketing
if Proc.Prc ~= 53 then if Proc.Prc ~= 53 then
sPocketing = Mortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType, false) sPocketing = Mortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType, false, true)
end end
if not sPocketing then if not sPocketing then
sPockType = 'Pocket' sPockType = 'Pocket'
sPocketing = Mortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType, false) sPocketing = Mortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType, false, true)
end end
if not sPocketing or not EgtMdbSetCurrMachining( sPocketing) then if not sPocketing or not EgtMdbSetCurrMachining( sPocketing) then
return return
@@ -1495,7 +1683,7 @@ local function VerifyMortiseMirrored( Proc, vProc, b3Raw)
end end
-- recupero eventuale utensile in doppio e suo diametro -- recupero eventuale utensile in doppio e suo diametro
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's') local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtFindToolInCurrSetup( sToolDoubleName) then
return return
end end
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd') local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
@@ -1564,7 +1752,7 @@ local function VerifyDtMortiseMirrored( Proc, vProc, b3Raw)
end end
-- recupero eventuale utensile in doppio e suo diametro -- recupero eventuale utensile in doppio e suo diametro
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's') local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtFindToolInCurrSetup( sToolDoubleName) then
return return
end end
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd') local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
@@ -1622,18 +1810,21 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then
return return
end end
-- verifico se foratura splittata oppure da specchiare
local bIsDrillingOkForMirror = abs( Proc.Flg) == 2 or ( Proc.Mirror ~= nil)
if not bIsDrillingOkForMirror then return end
-- recupero direzione e dimensioni del foro -- recupero direzione e dimensioni del foro
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local dDiam = 2 * EgtArcRadius( AuxId) local dDiam = 2 * EgtArcRadius( AuxId)
local dLen = abs( EgtCurveThickness( AuxId)) local dLen = abs( EgtCurveThickness( AuxId))
local dMachiningDepth = dLen / 2 + BD.DRILL_OVERLAP local dMachiningDepth = EgtIf( abs( Proc.Flg) == 2, dLen / 2 + BD.DRILL_OVERLAP, dLen)
-- recupero lavorazione adatta -- recupero lavorazione adatta
local sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, dMachiningDepth, true, false, true) local sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, dMachiningDepth, true, false, true)
if not sDrilling then if not sDrilling then
sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, 0, true, false, true) sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, 0, true, false, true)
dMachiningDepth = dMaxDepth or dMachiningDepth dMachiningDepth = dMaxDepth or dMachiningDepth
end end
if not sDrilling or sType ~= 'Drill' or not EgtMdbSetCurrMachining( sDrilling) then if not sDrilling or ( sType ~= 'Drill' and sType ~= 'Pocket') or not EgtMdbSetCurrMachining( sDrilling) then
return return
end end
local dDrillingStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP) local dDrillingStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP)
@@ -1641,33 +1832,37 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
if not EgtTdbSetCurrTool( EgtMdbGetCurrMachiningParam( MCH_MP.TOOL) or '') then if not EgtTdbSetCurrTool( EgtMdbGetCurrMachiningParam( MCH_MP.TOOL) or '') then
return return
end end
-- recupero la lunghezza della parte inclinata della punta -- recupero diametro utensile e lunghezza della parte inclinata della punta
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
local dToolTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN) local dToolTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN)
-- recupero eventuale utensile in doppio, suo diametro e massima lavorazione -- recupero eventuale utensile in doppio, suo diametro e massima lavorazione
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's') local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtFindToolInCurrSetup( sToolDoubleName) then
return return
end end
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd') local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
local dToolDoubleMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) local dToolDoubleMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
dMachiningDepth = min( dMachiningDepth, dToolDoubleMaxDepth)
-- recupero la lunghezza della parte inclinata della punta -- recupero la lunghezza della parte inclinata della punta
local dToolDoubleTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN) 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
return
end
-- verifico se in doppio -- verifico se in doppio
local dMinimumDistanceMirroredFeatures = 40 if ( abs( dToolDiam - dToolDoubleDiam) < 10 * GEO.EPS_SMALL) then
dMachiningDepth = min( dMachiningDepth, dToolDoubleMaxDepth) if Proc.Fce ~= 0 or Proc.Mirror then
if abs( Proc.Flg) == 2 and dToolDoubleDiam < dDiam + 10 * GEO.EPS_SMALL and dToolDoubleDiam > dDiam - BD.DRILL_TOL - 10 * GEO.EPS_SMALL and
(( 2 * dDrillingStep - dToolTipLength - dToolDoubleTipLength) - dMinimumDistanceMirroredFeatures) > 10 * GEO.EPS_SMALL then
if Proc.Fce ~= 0 then
if Proc.Flg == -2 then vtExtr = -vtExtr end if Proc.Flg == -2 then vtExtr = -vtExtr end
local ProcToDisable = EgtIf( abs( Proc.Flg) == 2, Proc, Proc.Mirror)
if ( not BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Y_AX())) or if ( not BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Y_AX())) or
( BD.DOWN_HEAD and AreOppositeVectorApprox( vtExtr, Y_AX())) then ( BD.DOWN_HEAD and AreOppositeVectorApprox( vtExtr, Y_AX())) then
Proc.Double = 2 Proc.Double = 2
Proc.MachDepthDouble = dMachiningDepth Proc.MachDepthDouble = dMachiningDepth
DisableOtherDrilling( Proc, vProc) DisableOtherDrilling( ProcToDisable, vProc)
elseif BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Z_AX()) then elseif BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Z_AX()) then
Proc.Double = 3 Proc.Double = 3
Proc.MachDepthDouble = dMachiningDepth Proc.MachDepthDouble = dMachiningDepth
DisableOtherDrilling( Proc, vProc) DisableOtherDrilling( ProcToDisable, vProc)
end end
end end
end end
@@ -1749,11 +1944,117 @@ local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeInt
end end
end end
-------------------------------------------------------------------------------------------------------------
local function AreDrillingsMirrored( Proc, ProcMirror, b3Raw)
if Proc.Id == ProcMirror.Id then return false end
-- geometria ausiliaria foro principale
AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.Id end
if not AuxId or EgtGetType( AuxId ) ~= GDB_TY.CRV_ARC then return false end
-- geometria ausiliaria foro specchiato
local AuxIdMirror = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i')
if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.Id end
if not AuxIdMirror or EgtGetType( AuxIdMirror ) ~= GDB_TY.CRV_ARC then return false end
-- dati del foro principale
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptBC = EgtGP( AuxId, GDB_RT.GLOB)
-- dati del foro specchiato
local vtExtrMirror = EgtCurveExtrusion( AuxIdMirror, GDB_RT.GLOB)
local ptBCMirror = EgtGP( AuxIdMirror, GDB_RT.GLOB)
-- direzione fori
local nDouble
if AreOppositeVectorApprox( vtExtr, vtExtrMirror) then
-- fori lungo Y
-- per macchine tipo PF il foro principale è sul lato back, per macchine tipo PF1250 è sul lato front
if ( BD.TWO_EQUAL_HEADS and AreSameVectorApprox( vtExtr, Y_AX())) or
( BD.DOWN_HEAD and AreOppositeVectorApprox( vtExtr, Y_AX())) then
nDouble = 2
-- fori lungo Z
elseif BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Z_AX()) then
nDouble = 3
else
return false
end
else
return false
end
-- centri allineati, equidistanti dalla mezzeria trave, non troppo vicini
local vtDisplacement = ptBC - ptBCMirror
local ptCenRaw = b3Raw:getCenter()
if nDouble == 2 then
local dYMinDistance = max( Proc.Box:getMin():getY(), ProcMirror.Box:getMin():getY()) - min( Proc.Box:getMax():getY(), ProcMirror.Box:getMax():getY())
if not ( abs( vtDisplacement:getX()) < 100 * GEO.EPS_SMALL and abs( vtDisplacement:getZ()) < 100 * GEO.EPS_SMALL and
( abs( ptBC:getY() - ptCenRaw:getY()) - abs( ptBCMirror:getY() - ptCenRaw:getY())) < 100 * GEO.EPS_SMALL and
dYMinDistance > MIRROR_DRILLINGS_MIN_DISTANCE + 10 * GEO.EPS_SMALL) then
return false
end
else
local dZMinDistance = max( Proc.Box:getMin():getZ(), ProcMirror.Box:getMin():getZ()) - min( Proc.Box:getMax():getZ(), ProcMirror.Box:getMax():getZ())
if not ( abs( vtDisplacement:getX()) < 100 * GEO.EPS_SMALL and abs( vtDisplacement:getY()) < 100 * GEO.EPS_SMALL and
( abs( ptBC:getZ() - ptCenRaw:getZ()) - abs( ptBCMirror:getZ() - ptCenRaw:getZ())) < 100 * GEO.EPS_SMALL and
dZMinDistance > MIRROR_DRILLINGS_MIN_DISTANCE + 10 * GEO.EPS_SMALL) then
return false
end
end
-- fori della stessa profondità
if abs( Proc.Len - ProcMirror.Len) > 10 * GEO.EPS_SMALL then
return false
end
return true
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
Proc.PassedByHole = true
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
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
-- 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
end
end
end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
function BeamExec.ProcessFeatures() function BeamExec.ProcessFeatures()
if BD.IMPROVE_HEAD_TAIL_DRILLINGS == nil then if BD.IMPROVE_HEAD_TAIL_DRILLINGS == nil then
BD.IMPROVE_HEAD_TAIL_DRILLINGS = true BD.IMPROVE_HEAD_TAIL_DRILLINGS = true
end end
-- costanti per doppio
MIRROR_DRILLINGS_MIN_DISTANCE = 40
MIRROR_POCKETS_MIN_DISTANCE = 50
-- verifica se possibile rotazione di 90 gradi -- verifica se possibile rotazione di 90 gradi
BD.ROT90 = BD.ROT90 and Verify90DegRotation( EgtGetFirstRawPart()) BD.ROT90 = BD.ROT90 and Verify90DegRotation( EgtGetFirstRawPart())
-- ciclo sui pezzi -- ciclo sui pezzi
@@ -1781,10 +2082,14 @@ function BeamExec.ProcessFeatures()
local dCurrOvmH = EgtGetInfo( nRawId, 'HOVM', 'd') or 0 local dCurrOvmH = EgtGetInfo( nRawId, 'HOVM', 'd') or 0
local dCurrOvmT = EgtGetInfo( nRawId, 'TOVM', 'd') or 0 local dCurrOvmT = EgtGetInfo( nRawId, 'TOVM', 'd') or 0
-- recupero le feature di lavorazione della trave -- recupero le feature di lavorazione della trave
local vProc, vMachineBeforeIntersectingDrillings = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT) local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
-- recupero informazioni ausiliarie feature e dipendenze tra feature stesse
GetFeatureInfoAndDependency( vProc, b3Raw)
-- verifica presenza forature influenzate da lavorazioni di testa o coda -- verifica presenza forature influenzate da lavorazioni di testa o coda
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeIntersectingDrillings) local vMachBeforeIntersDrillings = CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachBeforeIntersDrillings)
end end
-- verifica presenza di feature specchiate per eventuali lavorazioni simultanee -- verifica presenza di feature specchiate per eventuali lavorazioni simultanee
if BD.TWO_EQUAL_HEADS or BD.DOWN_HEAD then if BD.TWO_EQUAL_HEADS or BD.DOWN_HEAD then
@@ -1820,12 +2125,28 @@ function BeamExec.ProcessFeatures()
nRId = EgtGetNextRawPart( nRId) nRId = EgtGetNextRawPart( nRId)
end end
EgtSetInfo( nDispId, 'ROT', -2) EgtSetInfo( nDispId, 'ROT', -2)
-- flag feature precedente in doppio
local nPrevDouble = 0
-- inserisco le lavorazioni da lavorare ribaltate -- inserisco le lavorazioni da lavorare ribaltate
for i = 1, #vProc do local i = 1
while i <= #vProc do
-- creo la lavorazione -- creo la lavorazione
local Proc = vProc[i] local Proc = vProc[i]
if Proc.Flg ~= 0 and Proc.Down then if Proc.Flg ~= 0 and Proc.Down then
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT) -- dato che ho ruotato, aggiorno alcune proprietà della feature
Proc.Box = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase)
Proc.PrevDouble = nPrevDouble
nPrevDouble = Proc.Double
local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
-- lavorazioni da fare dopo separazione
if AddedIds and #AddedIds > 0 then
for j = 1, #AddedIds do
table.insert( vProc, AddedIds[j])
end
end
if not bOk then if not bOk then
nTotErr = nTotErr + 1 nTotErr = nTotErr + 1
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId}) table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
@@ -1855,6 +2176,7 @@ function BeamExec.ProcessFeatures()
EgtSetInfo( nDispId, 'ROT', -2) EgtSetInfo( nDispId, 'ROT', -2)
end end
end end
i = i + 1
end end
-- se separazione non ancora effettuata, aggiungo nuova fase con le travi in posizione standard -- se separazione non ancora effettuata, aggiungo nuova fase con le travi in posizione standard
if not bSplitRot then if not bSplitRot then
@@ -1892,13 +2214,29 @@ function BeamExec.ProcessFeatures()
nRId = EgtGetNextRawPart( nRId) nRId = EgtGetNextRawPart( nRId)
end end
EgtSetInfo( nDispId, 'ROT', -1) EgtSetInfo( nDispId, 'ROT', -1)
-- flag feature precedente in doppio
local nPrevDouble = 0
-- inserisco le lavorazioni da lavorare ruotate -- inserisco le lavorazioni da lavorare ruotate
local nSideMchOk = 0 local nSideMchOk = 0
for i = 1, #vProc do local i = 1
while i <= #vProc do
-- creo la lavorazione -- creo la lavorazione
local Proc = vProc[i] local Proc = vProc[i]
if Proc.Flg ~= 0 and Proc.Side then if Proc.Flg ~= 0 and Proc.Side then
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT) -- dato che ho ruotato, aggiorno alcune proprietà della feature
Proc.Box = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase)
Proc.PrevDouble = nPrevDouble
nPrevDouble = Proc.Double
local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT)
-- lavorazioni da fare dopo separazione
if AddedIds and #AddedIds > 0 then
for j = 1, #AddedIds do
table.insert( vProc, AddedIds[j])
end
end
if not bOk then if not bOk then
nTotErr = nTotErr + 1 nTotErr = nTotErr + 1
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId}) table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId})
@@ -1931,6 +2269,7 @@ function BeamExec.ProcessFeatures()
EgtSetInfo( nDispId, 'ROT', -1) EgtSetInfo( nDispId, 'ROT', -1)
end end
end end
i = i + 1
end end
-- se non sono state inserite lavorazioni di fianco, elimino la fase perchè inutile e dannosa -- se non sono state inserite lavorazioni di fianco, elimino la fase perchè inutile e dannosa
if nSideMchOk == 0 then if nSideMchOk == 0 then
@@ -1954,12 +2293,28 @@ function BeamExec.ProcessFeatures()
EgtSetInfo( nDispId, 'ORD', nOrd) EgtSetInfo( nDispId, 'ORD', nOrd)
end end
sDownOrSideOrStd = 'STD' sDownOrSideOrStd = 'STD'
-- flag feature precedente in doppio
local nPrevDouble = 0
-- inserisco le lavorazioni non ribaltate della trave -- inserisco le lavorazioni non ribaltate della trave
for i = 1, #vProc do local i = 1
while i <= #vProc do
-- creo la lavorazione -- creo la lavorazione
local Proc = vProc[i] local Proc = vProc[i]
if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD or BD.TURN) then if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD or BD.TURN) then
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT) -- dato che ho ruotato, aggiorno alcune proprietà della feature
Proc.Box = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase)
Proc.PrevDouble = nPrevDouble
nPrevDouble = Proc.Double
local bOk, sMsg, nNewPhase, AddedIds = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
-- lavorazioni da fare dopo separazione
if AddedIds and #AddedIds > 0 then
for j = 1, #AddedIds do
table.insert( vProc, AddedIds[j])
end
end
if not bOk then if not bOk then
nTotErr = nTotErr + 1 nTotErr = nTotErr + 1
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId}) table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
@@ -1987,6 +2342,7 @@ function BeamExec.ProcessFeatures()
EgtSetInfo( nDispId, 'ORD', nOrd) EgtSetInfo( nDispId, 'ORD', nOrd)
end end
end end
i = i + 1
end end
EgtOutLog( ' *** End AddMachinings ***', 1) EgtOutLog( ' *** End AddMachinings ***', 1)
-- passo al grezzo successivo -- passo al grezzo successivo
+439 -256
View File
@@ -1,4 +1,4 @@
-- BeamLib.lua by Egaltech s.r.l. 2023/01/20 -- BeamLib.lua by Egaltech s.r.l. 2023/12/15
-- Libreria globale per Travi -- Libreria globale per Travi
-- 2020/07/28 Corretto calcolo attacchi e uscite di lame per non uscire dalla faccia sotto. -- 2020/07/28 Corretto calcolo attacchi e uscite di lame per non uscire dalla faccia sotto.
-- 2020/08/18 Aggiunto a GetNearestParalOpposite e GetNearestOrthoOpposite parametro opzionale vtNorm. -- 2020/08/18 Aggiunto a GetNearestParalOpposite e GetNearestOrthoOpposite parametro opzionale vtNorm.
@@ -20,6 +20,16 @@
-- 2023/01/10 In GetFaceWithMostAdj aggiunta verifica che la feature abbia almeno una faccia aperta. -- 2023/01/10 In GetFaceWithMostAdj aggiunta verifica che la feature abbia almeno una faccia aperta.
-- 2023/01/20 Modificata PutStartNearestToEdge per gestire lato preferito come Y+, Y-, z*, Z-. Aggiunta funzione GetDistanceToNextPart. -- 2023/01/20 Modificata PutStartNearestToEdge per gestire lato preferito come Y+, Y-, z*, Z-. Aggiunta funzione GetDistanceToNextPart.
-- 2023/01/31 Aggiunta funzione ConvertToClosedCurve, precedentemente parte di ProcessMortise.Make -- 2023/01/31 Aggiunta funzione ConvertToClosedCurve, precedentemente parte di ProcessMortise.Make
-- 2023/02/22 Modifiche a SetOpenSide, aggiunte ChangeOrOpenStart e CurveWithOnlyStraightLines.
-- 2023/06/12 In ChangeOrOpenStart corretta ricerca segmento più lungo.
-- 2023/09/13 Aggiunte funzioni Is3EdgesApprox e GetProcessAffectedFaces.
-- 2023/09/25 In GetFaceWithMostAdj aggiunta verifica sottosquadro anche per facce non adiacenti.
-- 2023/09/26 In GetFaceWithMostAdj gestito primo parametro anche come Proc; gestito caso strip con facce tutte in sottosquadro.
-- 2023/09/26 Spostata qui funzione IsFeatureCuttingEntireSection da BeamExec.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation. Se l'elevazione è già calcolata la recupera da Proc, altrimenti la calcola al momento.
-- 2023/12/15 Correzione a GetFaceWithMostAdj per calcoli con facce che fanno ombra.
-- 2024/01/08 Correzione a Is3EdgesApprox per casi in cui nAddGroup non esista ancora.
-- 2024/01/18 Aggiunta funzione GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local BeamLib = {} local BeamLib = {}
@@ -434,54 +444,22 @@ function BeamLib.GetBoxFaceNorm( b3Box, ptP, vtV)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function BeamLib.GetFaceElevation( nSurfId, nFac, nPartId) function BeamLib.GetFaceElevation( procOrProcId, nFacet, b3Solid)
-- centro e normale della faccia local Proc, nProcId
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFac, GDB_ID.ROOT) if type( procOrProcId) == "table" then
if not ptC or not vtN then return 0 end Proc = procOrProcId
-- riferimento OCS della faccia per ricavare elevazione rispetto alla faccia della superficie nProcId = Proc.Id
local frOCS = Frame3d( ptC, vtN) else
local b3Box = EgtGetBBoxRef( nSurfId, GDB_BB.STANDARD, frOCS) nProcId = procOrProcId
local dElev = b3Box:getMax():getZ() end
-- se definito identificativo di pezzo local dElevation
if nPartId then if not Proc or not Proc.Face or not Proc.Face[nFacet + 1].Elevation then
-- se superficie con più facce dElevation = EgtSurfTmFacetElevationInBBox( nProcId, nFacet, b3Solid, true, GDB_ID.ROOT)
if EgtSurfTmFacetCount( nSurfId) > 1 then else
-- determino elevazione del centro faccia rispetto al box del pezzo dElevation = Proc.Face[nFacet + 1].Elevation
local _, dCenElev = BeamLib.GetPointDirDepth( nPartId, ptC, vtN)
if dCenElev and dCenElev > dElev then
dElev = dCenElev
end
-- altrimenti superficie ad una sola faccia
else
-- determino elevazione box del pezzo rispetto alla faccia
local b3Solid = EgtGetBBoxRef( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD, frOCS)
local dSolidElev = b3Solid:getMax():getZ()
if b3Solid and dSolidElev > dElev then
dElev = dSolidElev
end
end
end end
return dElev
end
--------------------------------------------------------------------- return dElevation
function BeamLib.GetOtherFaceElevation( nSurfId, nOtherSurfId, nOtherFac, nPartId)
-- centro e normale della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nOtherSurfId, nOtherFac, GDB_ID.ROOT)
if not ptC or not vtN then return 0 end
-- riferimento OCS della faccia per ricavare elevazione rispetto alla faccia della superficie
local frOCS = Frame3d( ptC, vtN)
local b3Box = EgtGetBBoxRef( nSurfId, GDB_BB.STANDARD, frOCS)
local dElev = b3Box:getMax():getZ()
-- se definito identificativo di pezzo
if nPartId then
-- determino elevazione del centro faccia rispetto al box del pezzo
local _, dCenElev = BeamLib.GetPointDirDepth( nPartId, ptC, vtN)
if dCenElev and dCenElev > dElev then
dElev = dCenElev
end
end
return dElev
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -507,7 +485,9 @@ function BeamLib.GetFaceElevationFromPointDir( nSurfId, nPartId, ptC, vtN, nIdGe
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng) function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
local nSurfId = Proc.Id
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- verifica che la superficie non sia chiusa e quindi non lavorabile -- verifica che la superficie non sia chiusa e quindi non lavorabile
if EgtSurfIsClosed( nSurfId) then if EgtSurfIsClosed( nSurfId) then
return return
@@ -519,14 +499,17 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
end end
-- recupero le normali delle facce -- recupero le normali delle facce
local vvtN = {} local vvtN = {}
local vPtC = {}
for i = 1, nFacCnt do for i = 1, nFacCnt do
local vtN = EgtSurfTmFacetNormVersor( nSurfId, i - 1, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, i - 1, GDB_ID.ROOT)
vvtN[i] = vtN ; vvtN[i] = vtN ;
vPtC[i] = ptC
end end
-- adiacenze e sottosquadra delle facce -- adiacenze e sottosquadra delle facce
local vAdj = {} local vAdj = {}
local vUcut = {} local vUcut = {}
local vOrtho = {} local vOrtho = {}
local nFacesWithUnderCut = 0
for i = 1, nFacCnt do for i = 1, nFacCnt do
-- recupero le adiacenze del loop esterno -- recupero le adiacenze del loop esterno
local vFacAdj = EgtSurfTmFacetAdjacencies( nSurfId, i - 1)[1] local vFacAdj = EgtSurfTmFacetAdjacencies( nSurfId, i - 1)[1]
@@ -538,7 +521,7 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
end end
end end
vAdj[i] = nCount vAdj[i] = nCount
-- ne determino eventuale sottosquadra ( dal valore passato o - 3deg) e ortogonalità -- ne determino eventuale sottosquadro ( dal valore passato o - 3deg) e ortogonalità, per facce adiacenti
local bUcut = false local bUcut = false
local bOrtho = true local bOrtho = true
for j = 1, #vFacAdj do for j = 1, #vFacAdj do
@@ -554,39 +537,63 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
end end
end end
end end
-- determino evenutale sottosquadro per facce non adiacenti
for j = 1, nFacCnt do
local bIsFaceAdjacent = false
for k = 1, #vFacAdj do
if j - 1 == vFacAdj[k] then
bIsFaceAdjacent = true
break
end
end
if not ( bIsFaceAdjacent or ( j == i)) then
-- recupero gruppo per geometria addizionale
local nAddGrpId = BeamLib.GetAddGroup( nPartId)
if not nAddGrpId then
EgtOutLog( 'Error : missing AddGroup')
return 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)
local nMasterContourId = EgtExtractSurfTmFacetLoops( nSurfId, i - 1, nAddGrpId)
local nShadowContourId = EgtExtractSurfTmLoops( nShadowFacetId, nAddGrpId)
EgtCutSurfTmPlane( nShadowFacetId, vPtC[i], -vvtN[i], false, GDB_RT.GLOB)
if nMasterContourId and nShadowContourId then
local nMasterSurfFlatId = EgtSurfFlatRegion( nAddGrpId, nMasterContourId)
local frOCSMaster = Frame3d( vPtC[i], vvtN[i])
EgtScale( nShadowContourId, frOCSMaster, 1, 1, 0, GDB_RT.GLOB)
EgtModifyCurveExtrusion( nShadowContourId, vvtN[i], GDB_RT.GLOB)
local nShadowSurfFlatId
-- se non troppo ortogonale (almeno 0.5deg di delta)
local dResV = vvtN[i] * vvtN[j]
if abs( dResV) > 0.087 then
EgtOffsetCurve( nShadowContourId, EgtIf( dResV > GEO.EPS_SMALL, - 50, 50) * GEO.EPS_SMALL)
local nShadowSurfFlatId = EgtSurfFlatRegion( nAddGrpId, nShadowContourId)
local bShadowSurfIsExternal = EgtSurfFrTestExternal( nMasterSurfFlatId, nShadowSurfFlatId)
if not bShadowSurfIsExternal then
bUcut = true
end
EgtErase( nShadowSurfFlatId)
end
EgtErase( nMasterSurfFlatId)
end
EgtErase( { nMasterContourId, nShadowContourId, nShadowFacetId})
end
end
if bUcut then
nFacesWithUnderCut = nFacesWithUnderCut + 1
end
vUcut[i] = bUcut vUcut[i] = bUcut
vOrtho[i] = bOrtho vOrtho[i] = bOrtho
end end
-- se 4 facce tutte con adiacenza 2, allora è un tunnel local bEveryFaceHasUndercut = ( nFacesWithUnderCut == nFacCnt)
if nFacCnt == 4 then -- tunnel o assimilabile
if vAdj[1] == 2 and vAdj[2] == 2 and vAdj[3] == 2 and vAdj[4] == 2 then if Proc.Topology == 'Tunnel' or ( bCompare3Fc and Proc.Topology == 'Groove' and Proc.IsThrough) or ( Proc.Topology == 'Strip' and bEveryFaceHasUndercut) then
-- se tutte le facce sono ortogonali tra loro esco con un flag che ne indica questa propietà if Proc.IsParallel or Proc.AllRightAngles then
if vOrtho[1] == true and vOrtho[2] == true and vOrtho[3] == true and vOrtho[4] == true then return -1, GEO.INFINITO, true
return -1, GEO.INFINITO, true else
else -- non gestito nella LapJoint
return -1, GEO.INFINITO return -1, GEO.INFINITO
end
end
end
-- se 3 facce con una che ha 2 adiacenze e le altre hanno 1 adiacenza, allora è una semi-fessura
if bCompare3Fc and nFacCnt == 3 then
local nCount2Adc = 0
local nCount1Adc = 0
-- ottengo il numero di facce con due adiacenze e il numero di facce con una adiacenza
for i = 1, #vAdj do
if vAdj[i] == 2 then
nCount2Adc = nCount2Adc + 1
elseif vAdj[i] == 1 then
nCount1Adc = nCount1Adc + 1
end
end
-- se il numero di adiacenze corrisponde
if nCount2Adc == 1 and nCount1Adc == 2 then
if vOrtho[1] == true and vOrtho[2] == true and vOrtho[3] == true then
return -1, GEO.INFINITO, true
else
return -1, GEO.INFINITO
end
end end
end end
-- recupero le facce non in sottosquadra e con il maggior numero di adiacenze -- recupero le facce non in sottosquadra e con il maggior numero di adiacenze
@@ -616,7 +623,7 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
local dMinElev, dMinElev2 = GEO.INFINITO, GEO.INFINITO local dMinElev, dMinElev2 = GEO.INFINITO, GEO.INFINITO
local dtElev = {} local dtElev = {}
for i = 1, #nFacInd do for i = 1, #nFacInd do
local dElev = BeamLib.GetFaceElevation( nSurfId, nFacInd[i], nPartId) local dElev = BeamLib.GetFaceElevation( Proc, nFacInd[i], b3Solid)
table.insert( dtElev, dElev) table.insert( dtElev, dElev)
if dElev < dMinElev then if dElev < dMinElev then
if dMinElev < dMinElev2 then if dMinElev < dMinElev2 then
@@ -671,6 +678,13 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
--- ritorna il riferimento di tipo OCS della faccia *nFacet* della trimesh *nSurfId* e le dimensioni orizzontale e verticale, eventualmente limitate dal grezzo *b3Raw*
---@param nSurfId integer Id della trimesh
---@param nFacet integer Indice 0-based della faccia della trimesh di cui restituire le informazioni
---@param b3Raw? BBox3d Eventuale box del grezzo per limitare le dimensioni
---@return Frame3d frHv riferimento faccia OCS
---@return number dDimH dimensione orizzontale OCS
---@return number dDmiV dimensione verticale OCS
function BeamLib.GetFaceHvRefDim( nSurfId, nFacet, b3Raw) function BeamLib.GetFaceHvRefDim( nSurfId, nFacet, b3Raw)
-- recupero centro e normale della faccia -- recupero centro e normale della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
@@ -720,7 +734,9 @@ end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho) function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
if BD.C_SIMM then if BD.GetNzLimDownUp then
return BD.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
elseif BD.C_SIMM then
return -0.484 return -0.484
elseif BD.TURN then elseif BD.TURN then
return -2 return -2
@@ -749,12 +765,19 @@ function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
else else
return -0.383 return -0.383
end end
elseif b3Raw:getDimZ() < BD.MIN_DIM_HBEAM then elseif b3Raw:getDimZ() < 300 then
-- N_HorAng < 10° -- N_HorAng < 10°
if vtN and ( abs( vtN:getY()) < 0.174) then if vtN and ( abs( vtN:getY()) < 0.174) then
return -0.5 return -0.5
else else
return -0.24 return -0.259
end
elseif b3Raw:getDimZ() < BD.MIN_DIM_HBEAM then
-- N_HorAng < 10°
if vtN and ( abs( vtN:getY()) < 0.174) then
return -0.342
else
return -0.259
end end
else else
-- N_HorAng < 10° -- N_HorAng < 10°
@@ -793,28 +816,16 @@ function BeamLib.GetDistanceToNextPart( nRawId, nPhase)
-- se segue una parte rimanente riutilizzabile, modifico opportunamente questa distanza -- se segue una parte rimanente riutilizzabile, modifico opportunamente questa distanza
if not BeamLib.IsSplittedPartPhase( nPhase) then if not BeamLib.IsSplittedPartPhase( nPhase) then
local nNextRawId = EgtGetNextRawPart( nRawId) local nNextRawId = EgtGetNextRawPart( nRawId)
if nNextRawId and if nNextRawId and
EgtGetPartInRawPartCount( nNextRawId) <= 0 and EgtGetPartInRawPartCount( nNextRawId) <= 0 and
EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw then EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw then
dDistToNextPiece = BD.OVM_MID dDistToNextPiece = BD.OVM_MID
end end
end end
return dDistToNextPiece return dDistToNextPiece
end end
---------------------------------------------------------------------
function BeamLib.GetChainSawBlockedAxis( nInd)
if BD.GetChainSawBlockedAxis then
return BD.GetChainSawBlockedAxis( nInd)
else
if nInd == 1 then
return EgtIf( BD.C_SIMM, 'A=90', 'A=90')
else
return EgtIf( BD.C_SIMM, 'A=0', 'A=0')
end
end
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function BeamLib.GetChainSawInitAngs( vtN, vtO, nInd) function BeamLib.GetChainSawInitAngs( vtN, vtO, nInd)
if BD.GetChainSawInitAngs then if BD.GetChainSawInitAngs then
@@ -832,6 +843,44 @@ function BeamLib.GetChainSawInitAngs( vtN, vtO, nInd)
end end
end end
---------------------------------------------------------------------
---
---@param sMachining string nome della lavorazione di cui bloccare l'asse
---@param sBlockedAxis string rappresenta lo stato desiderato dell'asse bloccato, parallelo o perpendicolare all'asse rotante da cui dipende (*parallel* o *perpendicular*)
---@param b3Raw? BBox3d
---@param vtTool? Vector3d
---@param vtOut? Vector3d
---@return string # testo contenente il valore dell'asse rotante bloccato da scrivere nel parametro *MCH_MP.BLOCKEDAXIS* della lavorazione (es: 'A2=90')
function BeamLib.GetBlockedAxis( sMachining, sBlockedAxis, b3Raw, vtTool, vtOut)
-- informazioni sull'utensile della lavorazione
local nToolType, sHead
if EgtMdbSetCurrMachining( sMachining) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
nToolType = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
end
end
-- se presente funzione specifica nella macchina, la richiamo
if BD.GetBlockedAxis then
return BD.GetBlockedAxis( sHead, nToolType, sBlockedAxis, b3Raw, vtTool, vtOut) or ''
-- sezione mantenuta per retrocompatibilità con GetChainSawBlockedAxis
elseif nToolType == MCH_TY.MORTISE_STD then
local nInd = EgtIf( sBlockedAxis == 'parallel', 0, 1)
if BD.GetChainSawBlockedAxis then
return BD.GetChainSawBlockedAxis( nInd)
else
if nInd == 1 then
return EgtIf( BD.C_SIMM, 'A=90', 'A=90')
else
return EgtIf( BD.C_SIMM, 'A=0', 'A=0')
end
end
end
return ''
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Trova l'Ind (0 based) della faccia meglio orientata come l'asse vtAx. Restituisce anche vtN e ptC della faccia stessa. La faccia di indice (0 based) fctExclude non viene considerata nella ricerca. -- Trova l'Ind (0 based) della faccia meglio orientata come l'asse vtAx. Restituisce anche vtN e ptC della faccia stessa. La faccia di indice (0 based) fctExclude non viene considerata nella ricerca.
function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude) function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
@@ -924,162 +973,82 @@ function BeamLib.CalcCollisionSafety( vtDir)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function BeamLib.SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId, nStartPoint) function BeamLib.SetOpenSide( nPathInt, b3Solid)
-- fondo tra loro le curve compatibili -- fondo tra loro le curve compatibili
EgtMergeCurvesInCurveCompo( nPathInt) EgtMergeCurvesInCurveCompo( nPathInt)
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt) -- vettore indici lati aperti
local pLastPIni, pLastPEnd local vOpen = {}
-- ciclo sulle curve elementari della composita
-- faccio una copia della curva e la esplodo local _, nNumEnt = EgtCurveDomain( nPathInt)
if nStartIdEnt then for i = 0, nNumEnt - 1 do
-- prendo i punti -- se segmento di retta
for i = 1, nNumEnt do if EgtCurveCompoRadius( nPathInt, i) == -1 then
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB) -- verifico se giace in uno dei piani limite del pezzo quindi se è un lato aperto
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB) local ptIni = EgtUP( nPathInt, i, GDB_RT.GLOB)
-- Se normale lungo la Z considero il box in X e Y local ptFin = EgtUP( nPathInt, i + 1, GDB_RT.GLOB)
if abs(vtOrtho:getZ()) > 0.999 then if ( abs( ptIni:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL and abs( ptFin:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or
-- se corrisponde a X ( abs( ptIni:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL and abs( ptFin:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or ( abs( ptIni:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL and abs( ptFin:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then ( abs( ptIni:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL and abs( ptFin:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or
-- setto l'entità open ( abs( ptIni:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL and abs( ptFin:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or '' ( abs( ptIni:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL and abs( ptFin:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL) then
if #sActInfo > 0 then -- aggiorno il vettore dei lati aperti
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1)) table.insert( vOpen, i)
else
EgtSetInfo( nPathInt, 'OPEN', (i-1))
end
-- prendo i punti per eventuale modifica del punto di inizio percorso
pLastPIni = pPini
pLastPEnd = pPend
-- altrimenti se corrisponde a Y
elseif ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
-- setto l'entità open
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
if #sActInfo > 0 then
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
else
EgtSetInfo( nPathInt, 'OPEN', (i-1))
end
-- prendo i punti per eventuale modifica del punto di inizio percorso
pLastPIni = pPini
pLastPEnd = pPend
end
-- altrimenti se normale lungo la Y considero il box in X e Z
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getY()) > 0.999 then
-- se corrisponde a X
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
-- setto l'entità open
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
if #sActInfo > 0 then
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
else
EgtSetInfo( nPathInt, 'OPEN', (i-1))
end
-- prendo i punti per eventuale modifica del punto di inizio percorso
pLastPIni = pPini
pLastPEnd = pPend
-- altrimenti se corrisponde a Z
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
-- setto l'entità open
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
if #sActInfo > 0 then
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
else
EgtSetInfo( nPathInt, 'OPEN', (i-1))
end
-- prendo i punti per eventuale modifica del punto di inizio percorso
pLastPIni = pPini
pLastPEnd = pPend
end
-- caso che non dovrebbe mai capitare ma gestito per completezza
-- altrimenti se normale lungo la X considero il box in Y e Z
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getX()) > 0.999 then
-- se corrisponde a Y
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
-- setto l'entità open
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
if #sActInfo > 0 then
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
else
EgtSetInfo( nPathInt, 'OPEN', (i-1))
end
-- prendo i punti per eventuale modifica del punto di inizio percorso
pLastPIni = pPini
pLastPEnd = pPend
-- altrimenti se corrisponde a Z
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
-- setto l'entità open
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
if #sActInfo > 0 then
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
else
EgtSetInfo( nPathInt, 'OPEN', (i-1))
end
-- prendo i punti per eventuale modifica del punto di inizio percorso
pLastPIni = pPini
pLastPEnd = pPend
end
-- se asse Z orizzontale verifico se si avvicina piú a Y
elseif abs(vtOrtho:getZ()) < 0.001 then
if abs(vtOrtho:getY()) > 0.75 then
-- se corrisponde a Z
if ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
-- setto l'entità open
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
if #sActInfo > 0 then
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
else
EgtSetInfo( nPathInt, 'OPEN', (i-1))
end
-- prendo i punti per eventuale modifica del punto di inizio percorso
pLastPIni = pPini
pLastPEnd = pPend
end
end
-- se asse Y a 0 (fresa ne davanti ne dietro) verifico se si avvicina piú a Z+
elseif abs(vtOrtho:getY()) < 0.001 then
if abs(vtOrtho:getZ()) > 0.75 then
-- se corrisponde a Y
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
-- setto l'entità open
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
if #sActInfo > 0 then
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
else
EgtSetInfo( nPathInt, 'OPEN', (i-1))
end
-- prendo i punti per eventuale modifica del punto di inizio percorso
pLastPIni = pPini
pLastPEnd = pPend
end
end
end
end
-- se devo cambiare il punto di partenza
if nStartPoint then
if pLastPIni and pLastPEnd then
-- calcolo il punto medio con gli ultimi punti utilizzati
local ptPs = ( pLastPIni + pLastPEnd) / 2
EgtChangeClosedCurveStartPoint( nPathInt, ptPs, GDB_RT.GLOB)
-- se devo eliminare la parte open
if nStartPoint == 2 then
EgtRemoveCurveCompoCurve( nPathInt, true)
EgtRemoveCurveCompoCurve( nPathInt, false)
return true
end
end end
end end
end end
-- assegno gli indici dei lati aperti
EgtSetInfo( nPathInt, 'OPEN', vOpen)
return true
end
return false ---------------------------------------------------------------------
function BeamLib.ChangeOrOpenStart( nPathInt, nStartPoint)
-- verifico richiesta
if nStartPoint ~= 1 and nStartPoint ~= 2 then
return false
end
-- verifico che la curva sia chiusa
if not EgtCurveIsClosed( nPathInt) then
return true
end
-- recupero l'indice del segmento aperto più lungo
local nMaxOpen, dMaxLen
local vOpen = EgtGetInfo( nPathInt or GDB_ID.NULL, 'OPEN', 'vi')
for i = 1, #( vOpen or {}) do
-- se primo o più lungo, lo salvo
local dLen = EgtCurveCompoLength( nPathInt, vOpen[i])
if not dMaxLen or dLen > dMaxLen then
dMaxLen = dLen
nMaxOpen = vOpen[i]
end
end
-- se esiste tratto aperto
if nMaxOpen then
-- sposto il punto di inizio a metà del tratto aperto più lungo (la curva deve essere chiusa)
EgtChangeClosedCurveStart( nPathInt, nMaxOpen + 0.5)
-- aggiorno il vettore dei lati aperti
for i = 1, #vOpen do
vOpen[i] = vOpen[i] - nMaxOpen
end
table.insert( vOpen, #vOpen)
-- se devo eliminare gli estremi aperti
if nStartPoint == 2 then
-- elimino gli estremi
EgtRemoveCurveCompoCurve( nPathInt, true)
EgtRemoveCurveCompoCurve( nPathInt, false)
-- aggiorno il vettore dei lati aperti
table.remove( vOpen, 1)
table.remove( vOpen)
for i = 1, #vOpen do
vOpen[i] = vOpen[i] - 1
end
end
end
-- assegno gli indici modificati dei lati aperti
EgtSetInfo( nPathInt, 'OPEN', vOpen)
-- restituisco flag percorso aperto
return ( not EgtCurveIsClosed( nPathInt))
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
@@ -1102,15 +1071,13 @@ function BeamLib.ConvertToClosedCurve( Proc, AuxId)
-- sistemo i lati aperti -- sistemo i lati aperti
local vFacAdj = EgtSurfTmFacetAdjacencies( Proc.Id, 0)[1] local vFacAdj = EgtSurfTmFacetAdjacencies( Proc.Id, 0)[1]
if vFacAdj then if vFacAdj then
local sOpen = '' local vOpen = {}
for i = 1, #vFacAdj do for i = 1, #vFacAdj do
if vFacAdj[i] < 0 then if vFacAdj[i] < 0 then
sOpen = sOpen .. EgtIf( #sOpen > 0, ',', '') .. tostring( i - 1) table.insert( vOpen, i - 1)
end end
end end
if #sOpen > 0 then EgtSetInfo( AuxId, 'OPEN', vOpen)
EgtSetInfo( AuxId, 'OPEN', sOpen)
end
end end
end end
end end
@@ -1118,5 +1085,221 @@ function BeamLib.ConvertToClosedCurve( Proc, AuxId)
return true, bCurveModified return true, bCurveModified
end end
---------------------------------------------------------------------
function BeamLib.CurveWithOnlyStraightLines( nPathInt)
-- verifico sia una retta oppure una curva composita
local nType = EgtGetType( nPathInt)
if nType == GDB_TY.CRV_LINE then
return true
elseif nType~= GDB_TY.CRV_COMPO then
return false
end
-- ciclo sulle curve elementari della composita
local _, nNumEnt = EgtCurveDomain( nPathInt)
for i = 0, nNumEnt - 1 do
-- se segmento di retta
if EgtCurveCompoRadius( nPathInt, i) ~= -1 then
return false
end
end
return true
end
---------------------------------------------------------------------
-- Funzione per determinare se la faccia ha lati molto corti (trascurabili) ed è quindi approssimabile ad una 3 facce
function BeamLib.Is3EdgesApprox( Proc, nFacet, nAddGrpId)
nAddGrpId = nAddGrpId or BeamLib.GetAddGroup( Proc.PartId)
if not nAddGrpId then
local nEdges = #(EgtSurfTmFacetAdjacencies( Proc.Id, nFacet)[1])
return ( nEdges == 3)
end
local bResult = false
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
if not nContourId then return false end
EgtMergeCurvesInCurveCompo( nContourId)
-- recupero il numero effettivo di lati
local _, nEntityCount = EgtCurveDomain( nContourId)
local nEdges = nEntityCount
if nEntityCount and nEntityCount == 3 then
bResult = true
-- rimuovo i lati molto corti dal conteggio totale
elseif nEntityCount then
for i = 1, nEntityCount do
local dLength = EgtCurveCompoLength( nContourId, i - 1)
if dLength < 15 then nEdges = nEdges - 1 end
end
end
if nEdges == 3 then bResult = true end
-- cancello tutti i contorni appena creati
EgtErase( EgtTableFill( nContourId, nContourCnt))
return bResult
end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
return BeamLib -- restituisce le facce della parte interessate dalla feature Proc
function BeamLib.GetProcessAffectedFaces( Proc)
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
local b3Part = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
local vtFacesAffected = { Top = false, Bottom = false, Front = false, Back = false, Left = false, Right = false}
if Proc.Box and not Proc.Box:isEmpty() then
if Proc.Box:getMax():getZ() > b3Part:getMax():getZ() - 500 * GEO.EPS_SMALL then
vtFacesAffected.Top = true
end
if Proc.Box:getMin():getZ() < b3Part:getMin():getZ() + 500 * GEO.EPS_SMALL then
vtFacesAffected.Bottom = true
end
if Proc.Box:getMin():getY() < b3Part:getMin():getY() + 500 * GEO.EPS_SMALL then
vtFacesAffected.Front = true
end
if Proc.Box:getMax():getY() > b3Part:getMax():getY() - 500 * GEO.EPS_SMALL then
vtFacesAffected.Back = true
end
if Proc.Box:getMin():getX() < b3Part:getMin():getX() + 500 * GEO.EPS_SMALL then
vtFacesAffected.Left = true
end
if Proc.Box:getMax():getX() > b3Part:getMax():getX() - 500 * GEO.EPS_SMALL then
vtFacesAffected.Right = true
end
end
return vtFacesAffected
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))
end
-------------------------------------------------------------------------------------------------------------
function BeamLib.GetAdjacentFaces( Proc, nFacet)
local AdjacentFaces = {}
local vFaceAdjacencies = EgtSurfTmFacetAdjacencies( Proc.Id, nFacet)[1]
for i = 1, #vFaceAdjacencies do
if vFaceAdjacencies[i] > -1 then
local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, nFacet, vFaceAdjacencies[i], GDB_ID.ROOT)
local dLen = dist( ptP1, ptP2)
table.insert( AdjacentFaces, { Id = vFaceAdjacencies[i], LengthOnMainFace = dLen})
end
end
return AdjacentFaces
end
-------------------------------------------------------------------------------------------------------------
function BeamLib.GetFacetsInfo( Proc, b3Raw)
if Proc.Fct > 20 then
return nil
end
local Face = {}
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Proc.PartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
local vAdj
if Proc.AdjacencyMatrix then
vAdj = Proc.AdjacencyMatrix
else
vAdj = BeamLib.GetAdjacencyMatrix( Proc)
end
for i = 1, Proc.Fct do
Face[i] = {}
Face[i].Id = i - 1
Face[i].PtCenter, Face[i].VtN = EgtSurfTmFacetCenter( Proc.Id, i - 1, GDB_ID.ROOT)
if Proc.Fct < 10 then
local frHV, dFaceWidthTrimmed, dFaceHeightTrimmed = BeamLib.GetFaceHvRefDim( Proc.Id, i - 1, b3Raw)
-- frame OCS faccia
Face[i].FrameHV = frHV
-- larghezza OCS faccia trimmata con grezzo
Face[i].WidthTrimmed = dFaceWidthTrimmed
-- altezza OCS faccia trimmata con grezzo
Face[i].HeightTrimmed = dFaceHeightTrimmed
local _, dFaceWidth, dFaceHeight = BeamLib.GetFaceHvRefDim( Proc.Id, i - 1)
-- larghezza OCS faccia
Face[i].Width = dFaceWidth
-- altezza OCS faccia
Face[i].Height = dFaceHeight
-- elevazione calcolata rispetto al box della parte
Face[i].Elevation = EgtSurfTmFacetElevationInBBox( Proc.Id, i - 1, b3Solid, true, GDB_ID.ROOT)
-- area della faccia
-- TODO qui sarebbe meglio l'area vera e non quella del rettangolo minimo
local _, dLongEdgeDimension, dShortEdgeDimension = EgtSurfTmFacetMinAreaRectangle( Proc.Id, i - 1, GDB_ID.ROOT)
Face[i].Area = dShortEdgeDimension * dLongEdgeDimension
-- adiacenze della faccia
-- TODO chiamarle in modo che si capisca che sono solo gli id e non l'intero oggetto faccia
Face[i].Adjacencies = {}
for j = 1, Proc.Fct do
if vAdj[i][j] and vAdj[i][j] ~= 0 and ( i ~= j) then
table.insert( Face[i].Adjacencies, j - 1)
end
end
end
end
return Face
end
---------------------------------------------------------------------
-- restituisce la matrice delle adiacenze di Proc dove i e j sono le facce e a(ij) è l'angolo tra di esse; 0 se nessuna adiacenza
function BeamLib.GetAdjacencyMatrix( Proc)
local vAdj = {}
-- essendo la matrice simmetrica a diagonale nulla, ne calcolo solo la metà superiore
for i = 1, Proc.Fct do
vAdj[i] = {}
for j = i + 1, Proc.Fct do
_, _, _, vAdj[i][j] = EgtSurfTmFacetsContact( Proc.Id, i - 1, j - 1, GDB_ID.ROOT)
if not vAdj[i][j] then vAdj[i][j] = 0 end
end
end
-- riempio di conseguenza il resto della matrice
for i = 1, Proc.Fct do
vAdj[i][i] = 0
for j = i + 1, Proc.Fct do
vAdj[j][i] = vAdj[i][j]
end
end
return vAdj
end
-------------------------------------------------------------------------------------------------------------
function BeamLib.GetMachiningSteps( dMachiningDepth, dStep)
local MachiningSteps = {}
MachiningSteps.StepLength = 0
MachiningSteps.Count = ceil( ( dMachiningDepth - 10 * GEO.EPS_SMALL) / dStep)
if MachiningSteps.Count > 1 then
MachiningSteps.StepLength = ( dMachiningDepth - dStep) / ( MachiningSteps.Count - 1)
end
return MachiningSteps
end
-------------------------------------------------------------------------------------------------------------
function BeamLib.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail)
if not dOvmTail then
dOvmTail = BD.OVM_MID
end
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
if Proc.Head then
-- se coincide con il taglio di separazione precedente, non va fatto
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
return false
end
-- altrimenti taglio di coda
else
-- se coincide con taglio di separazione, non va fatto
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
return false
end
end
-- se coincide con un taglio frontale non va fatto
if Proc.CutFront then
return false
end
return true
end
-------------------------------------------------------------------------------------------------------------
return BeamLib
+7 -9
View File
@@ -1,4 +1,4 @@
-- DiceCut.lua by Egaltech s.r.l. 2023/01/09 -- DiceCut.lua by Egaltech s.r.l. 2024/01/23
-- Gestione dei piano paralleli nei tagli lunghi: equidistanziamento dei piani paralleli -- Gestione dei piano paralleli nei tagli lunghi: equidistanziamento dei piani paralleli
-- Tabella per definizione modulo -- Tabella per definizione modulo
@@ -144,8 +144,8 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDwnUp
EgtErase( IdAuxLocal) EgtErase( IdAuxLocal)
EgtSetGridFrame(Frame3d()) EgtSetGridFrame(Frame3d())
-- riferimento intrinseco -- riferimento intrinseco
local asseX = vtO local asseX = Vector3d( vtO)
local asseY = asseX ^ vtN local asseY = vtN ^ asseX
local Frame = Frame3d( ptC, ptC + asseX, ptC + asseY) local Frame = Frame3d( ptC, ptC + asseX, ptC + asseY)
-- ingombro della faccia secondo questo riferimento -- ingombro della faccia secondo questo riferimento
local Box = EgtGetBBoxRef( FacetId, GDB_BB.STANDARD, Frame) local Box = EgtGetBBoxRef( FacetId, GDB_BB.STANDARD, Frame)
@@ -160,12 +160,11 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDwnUp
end end
local N = ceil( dLen / dOffsetEff) local N = ceil( dLen / dOffsetEff)
local dOffsetRel = dLen / N local dOffsetRel = ( dLen / N) + 10 * GEO.EPS_SMALL
local dCopyPlane local dCopyPlane
local dCenOffs = ( Box:getMax():getX() + Box:getMin():getX()) / 2 local dCenOffs = ( Box:getMax():getX() + Box:getMin():getX()) / 2
if dLen <= dOffsetRel then if dLen <= dOffsetRel then
--dOffsetRel = 0
dCopyPlane = 1 dCopyPlane = 1
elseif dLen <= 2 * dOffsetRel then elseif dLen <= 2 * dOffsetRel then
dOffsetRel = dOffsetEff dOffsetRel = dOffsetEff
@@ -177,8 +176,7 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDwnUp
dCopyPlane = 0.5 dCopyPlane = 0.5
end end
end end
return dOffsetRel, dCopyPlane, dCenOffs, ptS return dOffsetRel, dCopyPlane, dCenOffs, ptS
end end
@@ -398,7 +396,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
end end
local dElevP = DistanzaMassima( nParent, ptCPlanes, vtNPlanes, ptCBond, vtNBond, BBoxRawPart, TBoxPoint) local dElevP = DistanzaMassima( nParent, ptCPlanes, vtNPlanes, ptCBond, vtNBond, BBoxRawPart, TBoxPoint)
local dElevO local dElevO
if ptCBond and vtNBond then if ptCBond and vtNBond and not AreOppositeVectorApprox( vtNBond, vtNPlanes) then
dElevO = DistanzaMassima( nParent, ptCBond, vtNBond, ptCPlanes, vtNPlanes, BBoxRawPart, TBoxPoint) dElevO = DistanzaMassima( nParent, ptCBond, vtNBond, ptCPlanes, vtNPlanes, BBoxRawPart, TBoxPoint)
end end
@@ -475,7 +473,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
if vtNInner:getZ() > -0.0175 or vtNInner:getZ() < dNzLimDwnUp or abs( vtNInner:getY()) > 0.8 then if vtNInner:getZ() > -0.0175 or vtNInner:getZ() < dNzLimDwnUp or abs( vtNInner:getY()) > 0.8 then
vtO:rotate( vtNInner, 90) vtO:rotate( vtNInner, 90)
-- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente -- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente
if ( abs( vtO:getY()) > 3 * abs( vtO:getX()) or BBoxRawPart:getDimZ() > 620) and vtNInner:getZ() > dNzLimDwnUp then if ( abs( vtO:getY()) > 4 * abs( vtO:getX()) or BBoxRawPart:getDimZ() > 620) and vtNInner:getZ() > dNzLimDwnUp then
vtO:rotate( vtNInner, 90) vtO:rotate( vtNInner, 90)
-- se faccia principale verso il basso (almeno -3deg), lo inverto per iniziare da sopra -- se faccia principale verso il basso (almeno -3deg), lo inverto per iniziare da sopra
if vtNInner:getZ() < -0.05 then if vtNInner:getZ() < -0.05 then
+16 -9
View File
@@ -1,5 +1,6 @@
-- FaceByPocket.lua by Egaltech s.r.l. 2022/05/82 -- FaceByPocket.lua by Egaltech s.r.l. 2023/04/04
-- Gestione svuotatura di feature con una faccia -- Gestione svuotatura di feature con una faccia
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local FaceByPocket = {} local FaceByPocket = {}
@@ -15,7 +16,7 @@ local BD = require( 'BeamData')
local ML = require( 'MachiningLib') local ML = require( 'MachiningLib')
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function ApplyPocket( Proc, nSurfId, nFacet, sPocketing, nInd, dMaxElev, vtN) local function ApplyPocket( Proc, nSurfId, nFacet, sPocketing, nInd, dMaxElev, vtN, dOpenMinSafe)
-- inserisco la lavorazione di svuotatura -- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. nInd local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. nInd
@@ -28,11 +29,17 @@ local function ApplyPocket( Proc, nSurfId, nFacet, sPocketing, nInd, dMaxElev, v
EgtSetMachiningGeometry( {{ nSurfId, nFacet}}) EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
-- imposto uso faccia -- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT) EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
-- imposto note utente
local sNotes = ''
-- eventuale massima elevazione
if dMaxElev > 0.1 then if dMaxElev > 0.1 then
-- imposto elevazione sNotes = EgtSetValInNotes( sNotes, 'MaxElev', EgtNumToString( dMaxElev, 2))
local sNotes = 'MaxElev=' .. EgtNumToString( dMaxElev, 2) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
end end
-- eventuale minima distanza di sicurezza di attacco su lati aperti
if dOpenMinSafe then
sNotes = EgtSetValInNotes( sNotes, 'OpenMinSafe', dOpenMinSafe)
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE local nSCC = MCH_SCC.NONE
if not BD.C_SIMM and not BD.TURN then if not BD.C_SIMM and not BD.TURN then
@@ -50,7 +57,7 @@ local function ApplyPocket( Proc, nSurfId, nFacet, sPocketing, nInd, dMaxElev, v
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function FaceByPocket.Make( Proc, nSurfId, nFacet, sPocketing, nPartId, b3Solid) function FaceByPocket.Make( Proc, nSurfId, nFacet, sPocketing, nPartId, b3Solid, dOpenMinSafe)
local bOk = true local bOk = true
local sErr local sErr
-- recupero gruppo per geometria addizionale -- recupero gruppo per geometria addizionale
@@ -72,7 +79,7 @@ function FaceByPocket.Make( Proc, nSurfId, nFacet, sPocketing, nPartId, b3Solid)
end end
-- dati della faccia -- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
local dElev = BL.GetFaceElevation( nSurfId, nFacet, nPartId) local dElev = BL.GetFaceElevation( nSurfId, nFacet, b3Solid)
-- determino numero e valore degli step di lavorazione -- determino numero e valore degli step di lavorazione
local nSurfStep = ceil( dElev / dMaxDepth) local nSurfStep = ceil( dElev / dMaxDepth)
local dSurfStep = dElev / nSurfStep local dSurfStep = dElev / nSurfStep
@@ -84,14 +91,14 @@ function FaceByPocket.Make( Proc, nSurfId, nFacet, sPocketing, nPartId, b3Solid)
EgtSetName( nAddIdTmp, 'AddCut_' .. tostring( Proc.Id)) EgtSetName( nAddIdTmp, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( nAddIdTmp, 'TASKID', Proc.TaskId) EgtSetInfo( nAddIdTmp, 'TASKID', Proc.TaskId)
-- aggiungo lavorazione -- aggiungo lavorazione
bOk, sErr = ApplyPocket( Proc, nAddIdTmp, 0, sPocketing, i, dSurfStep, vtN) bOk, sErr = ApplyPocket( Proc, nAddIdTmp, 0, sPocketing, i, dSurfStep, vtN, dOpenMinSafe)
if not bOk then if not bOk then
return false, sErr return false, sErr
end end
end end
end end
-- faccio ultima superfice -- faccio ultima superfice
bOk, sErr = ApplyPocket( Proc, nSurfId, nFacet, sPocketing, 1, EgtIf( nSurfStep > 1, dSurfStep, 0), vtN) bOk, sErr = ApplyPocket( Proc, nSurfId, nFacet, sPocketing, 1, EgtIf( nSurfStep > 1, dSurfStep, 0), vtN, dOpenMinSafe)
if not bOk then if not bOk then
return false, sErr return false, sErr
end end
+508 -235
View File
@@ -1,4 +1,4 @@
-- FacesBySaw.lua by Egaltech s.r.l. 2022/09/24 -- FacesBySaw.lua by Egaltech s.r.l. 2024/01/07
-- Gestione taglio con lama di feature con una o due facce -- Gestione taglio con lama di feature con una o due facce
-- 2021/01/06 Cambiato limite per attacco Tg con lama e CalcLeadInOutGeom rinominata in CalcLeadInOutPerpGeom. -- 2021/01/06 Cambiato limite per attacco Tg con lama e CalcLeadInOutGeom rinominata in CalcLeadInOutPerpGeom.
-- 2021/02/03 In taglio lama si accettano anche due lati con deviazione minore di 20deg. -- 2021/02/03 In taglio lama si accettano anche due lati con deviazione minore di 20deg.
@@ -13,6 +13,23 @@
-- 2022/04/12 DS Aggiunta gestione speciale cubetti con fresa da sotto. -- 2022/04/12 DS Aggiunta gestione speciale cubetti con fresa da sotto.
-- 2022/06/29 DS In MakeTwo modificato controllo facce dirette verso il basso. -- 2022/06/29 DS In MakeTwo modificato controllo facce dirette verso il basso.
-- 2022/09/08 In MakeOne aggiunto argomento bForceInvert per poter forzare l'inversione del percorso. -- 2022/09/08 In MakeOne aggiunto argomento bForceInvert per poter forzare l'inversione del percorso.
-- 2023/02/13 Migliorata la direzione di lavoro della lama in modo da essere tendenzialmente opposta all'avanzamento.
-- 2023/04/20 Alcune modifiche per gestire tagli con faceuse parallelo.
-- 2023/05/18 Imposto in ogni caso dVzLimDwnUp prima anche di bDownHead.
-- 2023/06/14 Aggiunta MakeParallelOne e tolti parametri nForceWorkSide, nForceSCC da MakeOne.
-- 2023/09/26 Piccola modifica per Turn su bInvert di MakeOne.
-- 2023/10/24 In MakeOne migliorata gestione taglio con percorso bilinea. Aggiunta funzione GetNameSolidFaceIncludingLine.
-- 2023/11/14 In MakeOne migliorato calcolo scelta soluzione per macchina TURN
-- 2023/11/28 In MakeTwo raffinamento calcolo vtRef per casi dubbi.
-- 2023/12/06 In CalcLeadInOutPerpGeom gestito caso in cui la geometria della feature esce dal grezzo.
-- 2023/12/30 Modifiche in CalcLeadInOutPerpGeom e CalcLeadInOutTangGeom con uso di EgtCAvToolPosBox.
-- 2024/01/07 Modifiche per OikosX (BD.TURN == 2).
-- 2024/01/18 Gestita lama con aggregato con asse bloccato per massimizzare capacità di taglio verticale, se da sotto.
-- Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- 2024/02/22 Migliorato calcolo area non pinzabile in testa HCING e coda TCING
-- 2024/03/27 In MakeTwo rimossa gestione calcolo differente su ultima passata in caso di macchina FAST
-- 2024/06/18 In MakeOne in caso di inversione del percorso, si scambia anche accorciamento start con end
-- 2024/09/12 In MakeOne per settare il FaceUse si usa il versore nelle UserNotes
-- Tabella per definizione modulo -- Tabella per definizione modulo
local FacesBySaw = {} local FacesBySaw = {}
@@ -29,12 +46,172 @@ local BD = require( 'BeamData')
local ML = require( 'MachiningLib') local ML = require( 'MachiningLib')
--------------------------------------------------------------------- ---------------------------------------------------------------------
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert) function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut)
EgtOutLog( 'FacesBySaw.MakeParallelOne', 3)
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
-- accetto solo facce perpendicolari all'asse X della trave
if not AreSameOrOppositeVectorApprox( vtN, X_AX()) then
EgtOutLog( 'Error : MakeParallelOne only for faces perpendicular to XAxis')
return false
end
-- l'uso della faccia deve consentire una scelta robusta del percorso
if nFaceUse == MCH_MILL_FU.PARAL_LEFT or
nFaceUse == MCH_MILL_FU.PARAL_RIGHT then
EgtOutLog( 'Error : MakeParallelOne impossible with PARAL_LEFT or PARAL_RIGHT FaceUse')
return false
end
-- distanza della faccia dall'estremo trave verso cui è rivolta
local dDistX = EgtIf( vtN:getX() > 0, b3Raw:getMax():getX() - ptC:getX(), ptC:getX() - b3Raw:getMin():getX())
-- lunghezza attacco/uscita perpendicolari
local dLiTang = 0
local dLiPerp = dDistX + dCutExtra + dCutSic
local dLoTang = dLiTang
local dLoPerp = dLiPerp
-- lunghezza attacco/uscita tangenti
local dLi2Tang = dSawDiam / 2 + dCutSic
local dLi2Perp = 0
local dLo2Tang = dLi2Tang
local dLo2Perp = dLi2Perp
-- scelgo l'attacco più conveniente
local bLioTang
local Ktp = 1.1
if BD.KIOTP then Ktp = BD.KIOTP end
if bForceTangentLeadInOut or ( Ktp * dLi2Tang < dLiPerp) then
bLioTang = true
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
if BD.TURN then
local dMove = EgtIf( nFaceUse == MCH_MILL_FU.PARAL_DOWN or nFaceUse == MCH_MILL_FU.PARAL_TOP, b3Raw:getDimY(), b3Raw:getDimZ())
dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove)
dLoPerp = BD.COLL_SIC
end
end
-- verifico se la lama ruota in senso antiorario
if not EgtMdbSetCurrMachining( sCutting) then
return false
end
local bIsSawCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
local bInvert = bForceInvert
-- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento
if bInvert == nil then
bInvert = ( not bIsSawCCW)
if not BD.TURN then
if bIsSawCCW then
bInvert = (( nFaceUse == MCH_MILL_FU.PARAL_FRONT and vtN:getX() > 0) or ( nFaceUse == MCH_MILL_FU.PARAL_BACK and vtN:getX() < 0))
else
bInvert = (( nFaceUse == MCH_MILL_FU.PARAL_FRONT and vtN:getX() < 0) or ( nFaceUse == MCH_MILL_FU.PARAL_BACK and vtN:getX() > 0))
end
end
end
local nWorkSide = EgtIf( bInvert, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT)
-- posizione braccio
local nSCC = MCH_SCC.NONE
if BD.TURN then
nSCC = EgtIf( nFaceUse == MCH_MILL_FU.PARAL_DOWN or nFaceUse == MCH_MILL_FU.PARAL_TOP, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_ZP)
else
nSCC = EgtIf( vtN:getX() > 0, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
-- inserisco la lavorazione di taglio
local sName = 'Cut_' .. ( EgtGetName( nSurfId) or tostring( nSurfId)) .. '_' .. tostring( nFacet + 1)
local nMchFId = EgtAddMachining( sName, sCutting)
if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
EgtOutLog( sErr)
return false, sErr
end
sName = EgtGetOperationName( nMchFId)
-- aggiungo geometria
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto inversione e lato correzione
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide)
-- affondamento aggiuntivo
EgtSetMachiningParam( MCH_MP.OFFSR, -dCutExtra)
-- offset longitudinale
EgtSetMachiningParam( MCH_MP.OFFSL, EgtIf( bDownUp, -dCutOffset, dCutOffset))
-- imposto attacco/uscita
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
if BD.TURN and bLioTang then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
-- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dAccEnd)
-- imposto angolo 3° asse rot
local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5)
local vtTool
if nFaceUse == MCH_MILL_FU.PARAL_FRONT then
vtTool = Y_AX()
elseif nFaceUse == MCH_MILL_FU.PARAL_BACK then
vtTool = -Y_AX()
elseif nFaceUse == MCH_MILL_FU.PARAL_DOWN then
vtTool = Z_AX()
else
vtTool = -Z_AX()
end
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtTool, vtOut))
-- eventuali note
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
return true, sName, nMchFId
end
---------------------------------------------------------------------
local function GetNameSolidFaceIncludingLine( b3Solid, ptP1Comp, ptP2Comp)
-- se aperto su faccia fronte
if abs( b3Solid:getMin():getY() - ptP1Comp:getY()) < 100 * GEO.EPS_SMALL and abs( b3Solid:getMin():getY() - ptP2Comp:getY()) < 100 * GEO.EPS_SMALL then
return true, 'Front'
-- se aperto su faccia sopra
elseif abs( b3Solid:getMax():getY() - ptP1Comp:getY()) < 100 * GEO.EPS_SMALL and abs( b3Solid:getMax():getY() - ptP2Comp:getY()) < 100 * GEO.EPS_SMALL then
return true, 'Back'
-- se aperto su faccia retro
elseif abs( b3Solid:getMin():getZ() - ptP1Comp:getZ()) < 100 * GEO.EPS_SMALL and abs( b3Solid:getMin():getZ() - ptP2Comp:getZ()) < 100 * GEO.EPS_SMALL then
return true, 'Bottom'
-- se aperto su faccia sotto
elseif abs( b3Solid:getMax():getZ() - ptP1Comp:getZ()) < 100 * GEO.EPS_SMALL and abs( b3Solid:getMax():getZ() - ptP2Comp:getZ()) < 100 * GEO.EPS_SMALL then
return true, 'Top'
-- se aperto su faccia sinistra
elseif abs( b3Solid:getMin():getX() - ptP1Comp:getX()) < 100 * GEO.EPS_SMALL and abs( b3Solid:getMin():getX() - ptP2Comp:getX()) < 100 * GEO.EPS_SMALL then
return true, 'Left'
-- se aperto su faccia destra
elseif abs( b3Solid:getMax():getX() - ptP1Comp:getX()) < 100 * GEO.EPS_SMALL and abs( b3Solid:getMax():getX() - ptP2Comp:getX()) < 100 * GEO.EPS_SMALL then
return true, 'Right'
end
-- se non è sul bordo del solido
return false
end
---------------------------------------------------------------------
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, bForceTangentLeadInOut, Par5Alternative)
-- se lama con asse parallelo alla faccia, passo alla apposita funzione
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
Par5 == MCH_MILL_FU.PARAL_TOP or
Par5 == MCH_MILL_FU.PARAL_FRONT or
Par5 == MCH_MILL_FU.PARAL_BACK or
Par5 == MCH_MILL_FU.PARAL_LEFT or
Par5 == MCH_MILL_FU.PARAL_RIGHT) then
return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut)
end
-- la lama ha asse perpendicolare alla faccia
EgtOutLog( 'FacesBySaw.MakeOne', 3)
-- dati della faccia -- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
-- risolvo parametro ambiguo -- risolvo parametro ambiguo
local nOrthoOpposite local nOrthoOpposite
local vtOrthO local vtOrthO
local nOrthoOppositeAlternative
local vtOrthOAlternative
if isVector3d( Par5) then if isVector3d( Par5) then
nOrthoOpposite = BL.GetNearestOrthoOpposite( Par5, vtN) nOrthoOpposite = BL.GetNearestOrthoOpposite( Par5, vtN)
vtOrthO = Vector3d( Par5) vtOrthO = Vector3d( Par5)
@@ -42,38 +219,101 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
nOrthoOpposite = Par5 nOrthoOpposite = Par5
vtOrthO = BL.GetVersRef( Par5) vtOrthO = BL.GetVersRef( Par5)
end end
-- verifico se testa da sotto if Par5Alternative then
if isVector3d( Par5Alternative) then
nOrthoOppositeAlternative = BL.GetNearestOrthoOpposite( Par5Alternative, vtN)
vtOrthOAlternative = Vector3d( Par5Alternative)
else
nOrthoOppositeAlternative = Par5Alternative
vtOrthOAlternative = BL.GetVersRef( Par5Alternative)
end
end
EgtOutLog( 'VtOrthO='..tostring( vtOrthO)..' FaceUse='..tostring( nOrthoOpposite), 3)
-- verifico se testa da sotto oppure se lavorazione sotto con testa da sopra
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5) local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5)
-- linea o bilinea di lavorazione (qui uso nOrthoOpposite per ripetere esattamente il calcolo del Mach) local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BL.GetVersRef( nOrthoOpposite), GDB_ID.ROOT) -- linea o bilinea di lavorazione
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, vtOrthO, GDB_ID.ROOT)
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small' local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
EgtOutLog( sWarn, 1) EgtOutLog( sWarn, 1)
return true, '' return true, ''
end end
vtV1 = - vtV1 vtV1 = - vtV1
-- verifico se la lama ruota in senso antiorario
if not EgtMdbSetCurrMachining( sCutting) then
return false
end
local bIsSawCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
local bInvert = bForceInvert local bInvert = bForceInvert
-- l'inversione può essere comandata da rotazione lama (direzione concorde, legata anche a DownUp) oppure da direzione Z del percorso (si preferisce lavorare dal basso verso l'alto per limitare le corse)
-- se c'è disaccordo tra rotazione e direzione si cambia il lato di lavoro, se possibile. Se ciò non è possbile comanda la direzione. Se percorso orizzontale comanda la rotazione.
if bInvert == nil then if bInvert == nil then
bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL) if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then
local bIsMachiningDownwards = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
local bIsMachiningUpwards = ( ptP2:getZ() > ptP1:getZ() + 100 * GEO.EPS_SMALL)
if ( bIsSawCCW ~= bDownUp) and ( bIsMachiningDownwards or not ( bIsMachiningDownwards or bIsMachiningUpwards)) then
bInvert = true
elseif ( ( bIsSawCCW ~= bDownUp) ~= bIsMachiningDownwards) then
if Par5Alternative then
bInvert = true
nOrthoOpposite = nOrthoOppositeAlternative
vtOrthO = vtOrthOAlternative
-- avendo riassegnato la direzione di lavoro, i dati della linea vanno ricalcolati
ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, vtOrthO, GDB_ID.ROOT)
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
EgtOutLog( sWarn, 1)
return true, ''
end
vtV1 = - vtV1
elseif bIsMachiningDownwards or not bIsMachiningUpwards then
bInvert = true
else
bInvert = false
end
else
bInvert = false
end
else
local vtTmp = ptP2 - ptP1 ; vtTmp:normalize()
bInvert = ( ( vtOrthO:getX() > 0.1 and vtTmp:getX() < -0.1) or ( vtOrthO:getX() < -0.1 and vtTmp:getX() > 0.1))
end
end end
if bInvert then if bInvert then
ptP1, ptP2 = ptP2, ptP1 ptP1, ptP2 = ptP2, ptP1
vtV1, vtV2 = vtV2, vtV1 vtV1, vtV2 = vtV2, vtV1
-- se l'inversione è forzata dall'esterno, anche gli accorciamenti che arrivano dall'esterno si prendono per buoni
if bForceInvert == nil then
dAccStart, dAccEnd = dAccEnd, dAccStart
end
end end
local vtTg = ptP2 - ptP1 ; vtTg:normalize() local vtTg = ptP2 - ptP1 ; vtTg:normalize()
local dAllStart = 0 local dAllStart = 0
local dAllEnd = 0 local dAllEnd = 0
local bIsBiLinea = false
local dCosAngleL1L2 = 0
local dDist1 = dist( ptP1, ptPm)
local dDist2 = dist( ptP2, ptPm)
-- verifico se la bilinea si trova sul bordo del solido, quindi è una geometria aperta
local nIdSolid = EgtGetParent( EgtGetParent( nSurfId))
-- recupero ingombro del pezzo
local Ls = EgtGetFirstNameInGroup( nIdSolid, 'Box')
local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD)
-- controllo se le linee sono sul bordo della trave, quindi aperte
local bIsL1OnFace = GetNameSolidFaceIncludingLine( b3Solid, ptP1, ptPm)
local bIsL2OnFace = GetNameSolidFaceIncludingLine( b3Solid, ptPm, ptP2)
-- se bilinea, scarto la parte più allineata con la direzione ortogonale (se deviazione angolare oltre 20 deg o lunghezza minore di dSawDiam/2 * cos( 20/2)) ma maggiore di un minimo -- se bilinea, scarto la parte più allineata con la direzione ortogonale (se deviazione angolare oltre 20 deg o lunghezza minore di dSawDiam/2 * cos( 20/2)) ma maggiore di un minimo
if ( ( ptPm - ptP1) - ( ptPm - ptP1) * vtTg * vtTg):len() > 100 * GEO.EPS_SMALL then if ( ( ptPm - ptP1) - ( ptPm - ptP1) * vtTg * vtTg):len() > 100 * GEO.EPS_SMALL then
bIsBiLinea = true
local vtTg1 = ptPm - ptP1 ; vtTg1:normalize() local vtTg1 = ptPm - ptP1 ; vtTg1:normalize()
local vtTg2 = ptP2 - ptPm ; vtTg2:normalize() local vtTg2 = ptP2 - ptPm ; vtTg2:normalize()
local dDist1 = dist( ptP1, ptPm)
local dDist2 = dist( ptP2, ptPm)
local dCosMax = 0.951 -- cos( 18°) local dCosMax = 0.951 -- cos( 18°)
local dLenMin = 30 local dLenMin = 30
local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin) local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin)
--if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then dCosAngleL1L2 = vtTg1 * vtTg2
if vtTg1 * vtTg2 < dCosMax then if dCosAngleL1L2 < dCosMax then
local dOrtho1 = abs( vtTg1 * vtOrthO) local dOrtho1 = abs( vtTg1 * vtOrthO)
local dOrtho2 = abs( vtTg2 * vtOrthO) local dOrtho2 = abs( vtTg2 * vtOrthO)
if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then
@@ -90,9 +330,6 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
vtTg = ptP2 - ptP1 ; vtTg:normalize() vtTg = ptP2 - ptP1 ; vtTg:normalize()
end end
end end
-- verifico se lavorazione con lama sotto e testa sopra
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
local nFaceUse = nOrthoOpposite local nFaceUse = nOrthoOpposite
if bDownUp then nFaceUse = BL.GetOrtupOpposite( nOrthoOpposite) end if bDownUp then nFaceUse = BL.GetOrtupOpposite( nOrthoOpposite) end
local bWsRight = ( bInvert ~= bDownUp) local bWsRight = ( bInvert ~= bDownUp)
@@ -123,47 +360,131 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
-- parametri di attacco/uscita -- parametri di attacco/uscita
local b3Box = BBox3d( b3Raw) local b3Box = BBox3d( b3Raw)
b3Box:expand( dCutSic) b3Box:expand( dCutSic)
local ptP1act = ptP1 + vtN * dCutOffset local ptPa1 = ptP1 + dAccStart * vtTg
local ptP2act = ptP2 + vtN * dCutOffset local ptPa2 = ptP2 + dAccEnd * vtTg
-- attacco perpendicolare -- attacco perpendicolare
local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptP1act, ptP2act, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box) local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptPa1, ptPa2, vtV1, vtV2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box)
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp) local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp) local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
local dLiCompLength = 0
-- attacco tangente -- attacco tangente
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptP1act, ptP2act, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box) local dLi2Tang = 0
local dLi2Perp = 0
local dLo2Tang = 0
local dLo2Perp = 0
local dLi2CompLength = 0
-- si predilige un attacco tangenziale (con calcolo automatico di quanto uscire) se faccia che guarda in giù, non troppo orientata verso X e linea non troppo inclinata in X
-- non si fa se macchina tipo PF e pezzo alto perchè la lama, uscendo da sopra, toccherebbe la traversa
-- TODO si potranno togliere i limiti sulle normali quando si implementerà un modo per calcolare Lead In / Out correttamente in tutti i casi
--
if bSpecialTangentLeadInOut and not bIsBiLinea and ( vtN:getZ() < - 0.087) and ( abs( vtN:getX()) < 0.258) and ( abs( vtTg:getX()) < 0.1736) and ( abs( vtN:getY()) < 0.5 or ( BD.MAX_DIM_HTCUT_HBEAM > 0 or ( b3Raw:getDimZ() < 420))) then
dLi2Tang = 0
dLi2Perp = BD.CUT_EXTRA
dLi2CompLength = dLen + dSawDiam / 2 + BD.COLL_SIC
dLo2Tang = dSawDiam / 2
else
dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptPa1, ptPa2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box)
end
local dLenLi2 = abs( dLi2Tang) local dLenLi2 = abs( dLi2Tang)
local dLenLo2 = abs( dLo2Tang) local dLenLo2 = abs( dLo2Tang)
-- se il lato non lavorato della bilinea è aperto, setto entrata/uscita con la stessa direzione
if bIsBiLinea then
-- angolo tra le due linee
local dCosAlpha = dCosAngleL1L2
local dSinAlpha = sqrt( max( 1 - dCosAlpha * dCosAlpha, 0))
-- se ho accorciato ingresso, setto componente tangente e perpendicolare sul percorso di entrata
if abs( dAllStart) > 100 * GEO.EPS_SMALL and bIsL1OnFace then
-- controllo prima che il secondo lato non sia già incluso nella lavorazione del primo
local dDistPtTang = dCosAlpha * dDist1
local dDistPtPerp = dSinAlpha * dDist1
local dDistToCenter = 0.5 * dSawDiam - dDistPtPerp
local dDistPointToCenter = sqrt( dDistPtTang * dDistPtTang + dDistToCenter * dDistToCenter)
-- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo entrata opportunamente
if dDistPointToCenter > 0.5 * dSawDiam then
dLiTang = -dAllStart * dCosAlpha
dLiPerp = dDist1 * dSinAlpha
end
end
-- se ho accorciato uscita, setto componente tangente e perpendicolare sul percorso di uscita
if abs( dAllEnd) > 100 * GEO.EPS_SMALL and bIsL2OnFace then
-- controllo prima che il secondo lato non sia già incluso nella lavorazione del primo
local dDistPtTang = dCosAlpha * dDist2
local dDistPtPerp = dSinAlpha * dDist2
local dDistToCenter = 0.5 * dSawDiam - dDistPtPerp
local dDistPointToCenter = sqrt( dDistPtTang * dDistPtTang + dDistToCenter * dDistToCenter)
-- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo uscita opportunamente
if dDistPointToCenter > 0.5 * dSawDiam then
dLoTang = -dAllEnd * dCosAlpha
dLoPerp = dDist2 * dSinAlpha
end
end
end
-- scelgo l'attacco più conveniente (se non taglio praticamente longitudinale) -- scelgo l'attacco più conveniente (se non taglio praticamente longitudinale)
local bTurnTang local bLioTang
local Ktp = 1.1 local Ktp = 1.1
if BD.KIOTP then Ktp = BD.KIOTP end if BD.KIOTP then Ktp = BD.KIOTP end
if ( not bDownUp or abs( vtTg:getY()) > 0.5) and if ( not bDownUp or abs( vtTg:getY()) > 0.5) and
( not bDownHead or abs( vtTg:getZ()) < 0.51) and ( not bDownHead or abs( vtTg:getZ()) < 0.51) and
abs( vtTg:getX()) < 0.9848 and abs( vtTg:getX()) < 0.9848 and
( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5) and not bDownHead) or ( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5) and not bDownHead) or
( abs( vtTg:getZ()) < 0.51 and b3Box:getDimZ() > 300 and BD.C_SIMM and BD.MAX_HEIGHT > 450) or ( abs( vtTg:getZ()) < 0.51 and b3Box:getDimZ() > 300 and BD.C_SIMM and BD.MAX_HEIGHT > 450 and b3Box:getDimX() > BD.LEN_SHORT_PART) or
( Ktp * dLenLi2 < dLenLi and Ktp * dLenLo2 < dLenLo) or Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) then ( abs( vtTg:getZ()) < 0.51 and ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) or
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo) or
if BD.TURN then ( BD.TURN == 2 and vtRef:getZ() < -0.1)) then
bTurnTang = true if BD.TURN == 2 then
dLoTang = -( dLiTang + dAllStart - dAccStart + dAllEnd - dAccEnd + dLen) if vtTg:getY() < -0.1 then
bLioTang = 1
local dMove = dist( ptP1, ptP2)
dLiTang = -( dLi2Tang - dAccStart - dAccEnd + dMove)
-- dLiPerp rimane invariato
dLoTang, dLoPerp = dLo2Tang, dLo2Perp
else
bLioTang = 2
local dMove = dist( ptP1, ptP2)
dLiTang, dLiPerp = dLi2Tang, dLi2Perp
dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove)
-- dLoPerp rimane invariato
end
elseif BD.TURN then
bLioTang = 2
local dMove = dist( ptP1, ptP2)
dLiTang, dLiPerp = dLi2Tang, dLi2Perp
dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove)
dLoPerp = BD.COLL_SIC dLoPerp = BD.COLL_SIC
else
bLioTang = true
dLiTang, dLiPerp, dLoTang, dLoPerp, dLiCompLength = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp, dLi2CompLength
end end
end end
-- posizione braccio -- posizione braccio
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3) EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
local nSCC = MCH_SCC.NONE local nSCC = MCH_SCC.NONE
if not BD.TURN then if not BD.TURN then
if abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then -- per ora aggregato usato in verticale solo in split e headcut; Fast non influenzata
if BD.C_SIMM and bMaximizeVerticalDepth then
nSCC = MCH_SCC.ADIR_ZM
elseif abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
else else
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end end
else else
if bTurnTang then if BD.TURN == 2 then
local vtTest = EgtIf( bInvert, vtTg, -vtTg) if vtOrthO:getZ() > -0.01 then
nSCC = MCH_SCC.ADIR_ZP
else
nSCC = MCH_SCC.ADIR_ZM
end
elseif bLioTang then
local vtTest = -vtTg
if abs( vtTest:getY()) > abs( vtTest:getZ()) then if abs( vtTest:getY()) > abs( vtTest:getZ()) then
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) -- calcolo direzione risultante da versore utensile e direzione di lavorazione inverso
-- se la risultante tende verso Y positiva, scelgo soluzione dietro
local vtRes = vtTest + vtAux ; vtRes:normalize()
nSCC = EgtIf( vtRes:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
else else
nSCC = EgtIf( vtTest:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM) nSCC = EgtIf( vtTest:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
end end
@@ -195,6 +516,8 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
EgtSetMachiningGeometry( {{ nSurfId, nFacet}}) EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
-- imposto uso faccia -- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
local sNoteVtFaceUse = 'VtFaceUse=' .. EgtNumToString( vtOrthO:getX(),3) .. ',' .. EgtNumToString( vtOrthO:getY(),3) .. ',' .. EgtNumToString( vtOrthO:getZ(),3) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNoteVtFaceUse)
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto inversione e lato correzione -- imposto inversione e lato correzione
@@ -205,14 +528,19 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
-- offset longitudinale -- offset longitudinale
EgtSetMachiningParam( MCH_MP.OFFSL, EgtIf( bDownUp, -dCutOffset, dCutOffset)) EgtSetMachiningParam( MCH_MP.OFFSL, EgtIf( bDownUp, -dCutOffset, dCutOffset))
-- imposto attacco/uscita -- imposto attacco/uscita
if BD.TURN and bLioTang == 1 then EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TG_PERP) end
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang) EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp) EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
if bTurnTang then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end EgtSetMachiningParam( MCH_MP.LICOMPLEN, dLiCompLength)
if BD.TURN and bLioTang == 2 then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang) EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp) EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
-- imposto allungamenti iniziale e finale -- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
-- imposto angolo 3° asse rot
local sBlockedAxis = EgtIf( bMaximizeVerticalDepth, 'parallel', 'perpendicular')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO))
-- eventuali note -- eventuali note
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
-- eseguo -- eseguo
@@ -226,6 +554,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, bUpdateIng, bDownHead) function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, bUpdateIng, bDownHead)
EgtOutLog( 'FacesBySaw.MakeTwo', 3)
-- bUpdateIng : parametro opzionale con default true -- bUpdateIng : parametro opzionale con default true
if bUpdateIng == nil then bUpdateIng = true end if bUpdateIng == nil then bUpdateIng = true end
-- recupero l'ingombro del grezzo di appartenenza -- recupero l'ingombro del grezzo di appartenenza
@@ -244,59 +573,6 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- 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)
-- recupero dati su giunzione tra facce
local bTouch, ptT1, ptT2, dAngT = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
if not bTouch then
local sErr = 'Error : TwoFacesBySaw faces not touching'
EgtOutLog( sErr)
return false, sErr
end
local ptM = ( ptT1 + ptT2) / 2
local vtTg = ptT2 - ptT1 ;
local bConvex = ( dAngT > 0)
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg)
local bFaceOk = {}
bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB or abs( vtN[1]:getY()) < 0.174)
bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB or abs( vtN[2]:getY()) < 0.174)
if not bDownHead and not bFaceOk[1] and not bFaceOk[2] then
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo direzione di lavoro
local vtRef = {}
vtRef[1] = vtN[1] ^ vtTg
if vtRef[1] * vtN[2] < 0 then vtRef[1] = - vtRef[1] end
vtRef[1]:normalize()
if abs( vtRef[1]:getZ()) < 0.577 and abs( abs( vtRef[1]:getX()) - abs( vtRef[1]:getY())) < 0.1 then
vtRef[1] = ptC[1] - ptM
vtRef[1]:normalize()
end
vtRef[2] = vtN[2] ^ vtTg
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
vtRef[2]:normalize()
if abs( vtRef[2]:getZ()) < 0.577 and abs( abs( vtRef[2]:getX()) - abs( vtRef[2]:getY())) < 0.1 then
vtRef[2] = ptC[2] - ptM
vtRef[2]:normalize()
end
-- determino quale faccia è più grande
local dSqDim1 = ( ptC[1] - ptM):sqlen()
local dSqDim2 = ( ptC[2] - ptM):sqlen()
local nBigInd = EgtIf( dSqDim1 > dSqDim2 - 1., 1, 2)
local nSmaInd = 3 - nBigInd
local nUpInd = EgtIf( vtN[1]:getZ() > vtN[2]:getZ() - GEO.EPS_SMALL, 1, 2)
local nOtInd = 3 - nUpInd
-- metto in relazione la scelta facce con il confronto del versore Z con la scelta in base alla grandezza faccia
-- se la faccia più grande è messa secondaria e il suo versore Z non è troppo negativo
if nOtInd == nBigInd and vtN[nBigInd]:getZ() > -0.5 and vtN[nSmaInd]:getZ() < 0.966 then
nUpInd = nBigInd
nOtInd = nSmaInd
end
-- recupero la lavorazione -- recupero la lavorazione
local sCutting = ML.FindCutting( sCutType, nil, bDownHead) local sCutting = ML.FindCutting( sCutType, nil, bDownHead)
if not sCutting then if not sCutting then
@@ -316,6 +592,59 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end end
end end
-- 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)
-- recupero dati su giunzione tra facce
local bTouch, ptT1, ptT2, dAngT = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
if not bTouch then
local sErr = 'Error : TwoFacesBySaw faces not touching'
EgtOutLog( sErr)
return false, sErr
end
local ptM = ( ptT1 + ptT2) / 2
local vtTg = ptT2 - ptT1 ; vtTg:normalize()
local bConvex = ( dAngT > 0)
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg), oppure in testa o in coda e non troppo distanti dal grezzo esterno
local bFaceOk = {}
bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB or abs( vtN[1]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[1].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB or abs( vtN[2]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[2].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
if not bDownHead and ( not bFaceOk[1] or not bFaceOk[2]) then
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo direzione di lavoro
local vtRef = {}
vtRef[1] = vtN[1] ^ vtTg
if vtRef[1] * vtN[2] < 0 then vtRef[1] = - vtRef[1] end
vtRef[1]:normalize()
if abs( vtTg:getZ()) < 0.708 and abs( vtRef[1]:getZ()) < 0.577 and abs( abs( vtRef[1]:getX()) - abs( vtRef[1]:getY())) < 0.05 then
vtRef[1] = ptC[1] - ptM
vtRef[1]:normalize()
end
vtRef[2] = vtN[2] ^ vtTg
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
vtRef[2]:normalize()
if abs( vtTg:getZ()) < 0.708 and abs( vtRef[2]:getZ()) < 0.577 and abs( abs( vtRef[2]:getX()) - abs( vtRef[2]:getY())) < 0.05 then
vtRef[2] = ptC[2] - ptM
vtRef[2]:normalize()
end
-- determino quale faccia è più grande
local dSqDim1 = ( ptC[1] - ptM):sqlen()
local dSqDim2 = ( ptC[2] - ptM):sqlen()
local nBigInd = EgtIf( dSqDim1 > dSqDim2 - 1., 1, 2)
local nSmaInd = 3 - nBigInd
local nUpInd = EgtIf( vtN[1]:getZ() > vtN[2]:getZ() - GEO.EPS_SMALL, 1, 2)
local nOtInd = 3 - nUpInd
-- metto in relazione la scelta facce con il confronto del versore Z con la scelta in base alla grandezza faccia
-- se la faccia più grande è messa secondaria e il suo versore Z non è troppo negativo
if nOtInd == nBigInd and (( vtN[nBigInd]:getZ() > -0.5 and vtN[nSmaInd]:getZ() < 0.966) or bDownHead) then
nUpInd = nBigInd
nOtInd = nSmaInd
end
-- calcolo extra taglio -- calcolo extra taglio
local dCutExtra = 0 local dCutExtra = 0
if dAngT < -91 and dAngT > -179 then if dAngT < -91 and dAngT > -179 then
@@ -352,12 +681,8 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nOtInd], vtRef[nUpInd]) local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nOtInd], vtRef[nUpInd])
-- lavoro la faccia -- lavoro la faccia
for j = 1, #vCuts[i] do for j = 1, #vCuts[i] do
-- se FAST, pezzo alto e ultimo taglio verticale -> allungo uscita per consentire eventuale rotazione B sul posto local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local dAccEnd = 0 local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not BD.C_SIMM and BD.MAX_HEIGHT_ROT_B_ABOVE and b3Raw:getDimZ() > BD.MAX_HEIGHT_ROT_B_ABOVE and vtOrthO:getZ() > 0.866 and j == #vCuts[i] then
dAccEnd = - ( dSawDiam / 2 + BD.CUT_SIC)
end
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, dAccEnd, nil, b3Raw)
if not bOk then if not bOk then
return bOk, sErr return bOk, sErr
end end
@@ -417,14 +742,16 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
end end
-- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire) -- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire)
if vCuts[i][j] then if vCuts[i][j] then
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then if not bOk then
return bOk, sErr return bOk, sErr
end end
end end
-- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire) -- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire)
if vCuts[i+1][j] then if vCuts[i+1][j] then
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) local bSpecialTangentLeadInOut = ( ( i + 1) % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then if not bOk then
return bOk, sErr return bOk, sErr
end end
@@ -448,13 +775,44 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
end end
-- eventuale segnalazione ingombro di testa o coda -- eventuale segnalazione ingombro di testa o coda
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ()) local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
if bUpdateIng and Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng and local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
not ( abs( vtN[nBigInd]:getX()) < 0.05 and vtN[nBigInd]:getY() < 0 and Proc.Box:getDimX() > 500 and Proc.Box:getDimY() < 40) then -- calcolo punto massimo in Z fino a dove considerare il pinzaggio. Minimo tra pinzaggio massimo e altezza pezzo
local dMaxHZ = b3Raw:getMin():getZ() + min( BD.VICE_MAXH or BD.MAX_HEIGHT, b3Raw:getDimZ())
-- punto massimo in Z considerando anche la Z della feature
local dMaxHZFeat = min( dMaxHZ, Proc.Box:getMax():getZ())
-- dimensione Z del pinzaggio (differenza massima Z pinzabile e box feature)
local dDeltaZClamp = ( ( dMaxHZ - b3Raw:getMin():getZ()) - max( 0, dMaxHZFeat - Proc.Box:getMin():getZ()))
-- se pinzaggio minimo è come il massimo (oppure come l'altezza massima del pezzo) significa che è verticale
local bIsVertClamps = BD.VICE_MINH > BD.MAX_HEIGHT - 100 * GEO.EPS_SMALL
-- condizioni per limitare pinzaggio testa/coda
-- se dimensione del box della feature maggiore di metà pinzaggio minimo o metà spessore pezzo
bUpdateIng = bUpdateIng and Proc.Box:getDimZ() > dMinHIng
-- se la feature si trova più in basso del minimo pinzabile in Z o il 35% dello spessore pezzo
bUpdateIng = bUpdateIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ
-- riportata condizione, ma poco chiara
bUpdateIng = bUpdateIng and not ( abs( vtN[nBigInd]:getX()) < 0.05 and vtN[nBigInd]:getY() < 0 and Proc.Box:getDimX() > 500 and Proc.Box:getDimY() < 40)
-- se feature è al di sotto del pinzaggio massimo
bUpdateIng = bUpdateIng and Proc.Box:getMin():getZ() < dMaxHZ
-- se ho le morse verticali, o se la feature è in centro o verso alto, controllo se non prendo abbastanza.
if bIsVertClamps or ( Proc.Box:getMin():getZ() - b3Raw:getMin():getZ()) > BD.MIN_HEIGHT then
bUpdateIng = bUpdateIng and dDeltaZClamp < BD.VICE_MINH
end
if bUpdateIng then
if Proc.Head then if Proc.Head then
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX() local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
-- se pinze a 45° e pinza abbastanza materiale, compenso comunque, ma solo inclinazione morse
if not bIsVertClamps and dDeltaZClamp > BD.VICE_MINH and BD.VICE_MAXH then
dOffs = min( dOffs, BD.VICE_MAXH - BD.VICE_MINH)
end
BL.UpdateHCING( nRawId, dOffs) BL.UpdateHCING( nRawId, dOffs)
elseif Proc.Tail then elseif Proc.Tail then
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
-- se pinze a 45° e pinza abbastanza materiale, compenso comunque, ma solo inclinazione morse
if not bIsVertClamps and dDeltaZClamp > BD.VICE_MINH and BD.VICE_MAXH then
dOffs = min( dOffs, BD.VICE_MAXH - BD.VICE_MINH)
end
BL.UpdateTCING( nRawId, dOffs) BL.UpdateTCING( nRawId, dOffs)
elseif Proc.Box:getCenter():getX() > b3Solid:getCenter():getX() then elseif Proc.Box:getCenter():getX() > b3Solid:getCenter():getX() then
local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX() local dOffs = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
@@ -478,97 +836,49 @@ function FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dRad, vt
-- Sistema di riferimento intrinseco al taglio -- Sistema di riferimento intrinseco al taglio
local vtX = vtTg ^ vtN local vtX = vtTg ^ vtN
local frFace = Frame3d( ptP1, vtX, vtTg, vtN) local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
EgtOutLog( 'Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3) local bRight = ( vtX * vtRef > 0)
EgtOutLog( 'LioPerp --> Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
-- Versore di attacco e uscita -- Versore di attacco e uscita
local dCos1 = vtV1 * vtRef local dCos1 = vtV1 * vtRef
local dCos2 = vtV2 * vtRef local dCos2 = vtV2 * vtRef
local vtLio local vtLio
if abs( dCos1 - dCos2) < 0.001 then if abs( dCos1 - dCos2) < 0.001 then
if abs( vtV1:getZ()) < abs( vtV2:getZ()) then vtLio = EgtIf( abs( vtV1:getZ()) < abs( vtV2:getZ()), vtV1, vtV2)
vtLio = vtV1
else
vtLio = vtV2
end
elseif dCos1 > dCos2 then elseif dCos1 > dCos2 then
vtLio = vtV1 vtLio = vtV1
else else
vtLio = vtV2 vtLio = vtV2
end end
local bRight = ( vtX * vtLio > 0)
-- Versore di attacco e uscita nel riferimento intrinseco al taglio -- Versore di attacco e uscita nel riferimento intrinseco al taglio
local vtLioL = Vector3d( vtLio) ; vtLioL:toLoc( frFace) local vtLioL = Vector3d( vtLio) ; vtLioL:toLoc( frFace)
-- Spostamento punti per effetto dell'extra o della deficienza di taglio
ptP1 = ptP1 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra)) -- Centro lama a inizio fine percorso
ptP2 = ptP2 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra)) local dOffs = ( -dCutExtra + dRad) * EgtIf( bRight, 1, -1)
-- Non va considerata l'uscita dalla faccia sotto, pertanto va abbassata local ptCen1 = ptP1 + dOffs * vtX
-- 2021/02/26 Abilito anche uscita sotto local ptCen2 = ptP2 + dOffs * vtX
local b3MyBox = BBox3d( b3Box) ; --b3MyBox:Add( b3MyBox:getMin() - 1000 * Z_AX())
-- Attacco -- Box del pezzo espansi ortogonalmente alle tre direzioni canoniche X, Y e Z
local dLiTang = 10000 local b3BoxX = BBox3d( b3Box) ; b3BoxX:expand( 0, 1000, 1000)
local dLiPerp = 10000 local b3BoxY = BBox3d( b3Box) ; b3BoxY:expand( 1000, 0, 1000)
local bLiOk, _, vLiPar = EgtLineBoxInters( ptP1, vtLio, b3MyBox) local b3BoxZ = BBox3d( b3Box) ; b3BoxZ:expand( 1000, 1000, 0)
if bLiOk and #vLiPar > 0 then
-- con la prima faccia di uscita -- Calcolo elevazione dei due centri
local dLen = vLiPar[#vLiPar] local dSawThick = 6
local ptInt = ptP1 + vtLio * dLen EgtCAvSetSawTool( dSawThick, 2 * dRad, dSawThick, 0, 0)
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtLio) local dElev1 = min( EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxX, vtLio),
EgtOutLog( 'LiFaceNorm=' .. tostring( vtFN), 3) EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxY, vtLio),
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLio * vtFN) EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxZ, vtLio))
local dLiLen = dLen + dAddLen EgtOutLog( 'Elev1=' .. EgtNumToString( dElev1), 3)
EgtOutLog( 'LeadIn Dist=' .. EgtNumToString( dLiLen), 3) local dLiTang = -dElev1 * vtLioL:getY()
dLiTang = - dLiLen * vtLioL:getY() local dLiPerp = EgtIf( bRight, dElev1, -dElev1) * vtLioL:getX()
dLiPerp = EgtIf( bRight, dLiLen, - dLiLen) * vtLioL:getX() local dElev2 = min( EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxX, vtLio),
-- verifico se miglioro calcolando con faccia successiva EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxY, vtLio),
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN) EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxZ, vtLio))
local bLiOk2, _, vLiPar2 = EgtLineBoxInters( ptP1, vtLio, b3Mod) EgtOutLog( 'Elev2=' .. EgtNumToString( dElev2), 3)
if bLiOk2 and #vLiPar2 > 0 then local dLoTang = dElev2 * vtLioL:getY()
local dLen2 = vLiPar2[#vLiPar2] local dLoPerp = EgtIf( bRight, dElev2, -dElev2) * vtLioL:getX()
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP1 + vtLio * dLen2, vtLio)
EgtOutLog( 'LiFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLio * vtFN2)
local dLiLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadIn Dist2=' .. EgtNumToString( dLiLen2), 3)
local dLiTang2 = - dLiLen2 * vtLioL:getY()
local dLiPerp2 = EgtIf( bRight, dLiLen2, - dLiLen2) * vtLioL:getX()
if dLiLen2 < dLiLen then
dLiTang = dLiTang2
dLiPerp = dLiPerp2
end
end
end
-- Lunghezza di uscita
local dLoTang = 10000
local dLoPerp = 10000
local bLoOk, _, vLoPar = EgtLineBoxInters( ptP2, vtLio, b3MyBox)
if bLoOk and #vLoPar > 0 then
-- con la prima faccia di uscita
local dLen = vLoPar[#vLoPar]
local ptInt = ptP2 + vtLio * dLen
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtLio)
EgtOutLog( 'LoFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLio * vtFN)
local dLoLen = dLen + dAddLen
EgtOutLog( 'LeadOut Dist=' .. EgtNumToString( dLoLen), 3)
dLoTang = dLoLen * vtLioL:getY()
dLoPerp = EgtIf( bRight, dLoLen, - dLoLen) * vtLioL:getX()
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLoOk2, _, vLoPar2 = EgtLineBoxInters( ptP2, vtLio, b3Mod)
if bLoOk2 and #vLoPar2 > 0 then
local dLen2 = vLoPar2[#vLoPar2]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP2 + vtLio * dLen2, vtLio)
EgtOutLog( 'LoFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLio * vtFN2)
local dLoLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadOut Dist2=' .. EgtNumToString( dLoLen2), 3)
local dLoTang2 = dLoLen2 * vtLioL:getY()
local dLoPerp2 = EgtIf( bRight, dLoLen2, - dLoLen2) * vtLioL:getX()
if dLoLen2 < dLoLen then
dLoTang = dLoTang2
dLoPerp = dLoPerp2
end
end
end
return dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio return dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio
end end
@@ -580,72 +890,35 @@ function FacesBySaw.CalcLeadInOutTangGeom( ptP1, ptP2, vtN, dRad, vtRef, dCutExt
-- Sistema di riferimento intrinseco al taglio -- Sistema di riferimento intrinseco al taglio
local vtX = vtTg ^ vtN local vtX = vtTg ^ vtN
local frFace = Frame3d( ptP1, vtX, vtTg, vtN) local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
if ( vtX * vtRef < 0) then local bRight = ( vtX * vtRef > 0)
vtX = - vtX EgtOutLog( 'LioTang --> Vref=' .. tostring( vtRef), 3)
end
EgtOutLog( 'Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3) -- Centro lama a inizio fine percorso
-- Spostamento punti per effetto dell'extra o della deficienza di taglio local dOffs = ( -dCutExtra + dRad) * EgtIf( bRight, 1, -1)
ptP1 = ptP1 - vtX * dCutExtra local ptCen1 = ptP1 + dOffs * vtX
ptP2 = ptP2 - vtX * dCutExtra local ptCen2 = ptP2 + dOffs * vtX
-- Non va considerata l'uscita dalla faccia sotto, pertanto va abbassata
-- 2021/02/26 Abilito anche uscita sotto -- Box del pezzo espansi ortogonalmente alle tre direzioni canoniche X, Y e Z
local b3MyBox = BBox3d( b3Box) ; --b3MyBox:Add( b3MyBox:getMin() - 1000 * Z_AX()) local b3BoxX = BBox3d( b3Box) ; b3BoxX:expand( 0, 1000, 1000)
-- Attacco local b3BoxY = BBox3d( b3Box) ; b3BoxY:expand( 1000, 0, 1000)
local dLiTang = 10000 local b3BoxZ = BBox3d( b3Box) ; b3BoxZ:expand( 1000, 1000, 0)
-- Calcolo elevazione dei due centri
local dSawThick = 6
EgtCAvSetSawTool( dSawThick, 2 * dRad, dSawThick, 0, 0)
local dElev1 = min( EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxX, -vtTg),
EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxY, -vtTg),
EgtCAvToolPosBox( ptCen1 + dSawThick * vtN, vtN, b3BoxZ, -vtTg))
EgtOutLog( 'Elev1=' .. EgtNumToString( dElev1), 3)
local dLiTang = dElev1
local dLiPerp = 0 local dLiPerp = 0
local bLiOk, _, vLiPar = EgtLineBoxInters( ptP1, vtTg, b3MyBox) local dElev2 = min( EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxX, vtTg),
if bLiOk and #vLiPar > 0 then EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxY, vtTg),
local dLen = vLiPar[1] EgtCAvToolPosBox( ptCen2 + dSawThick * vtN, vtN, b3BoxZ, vtTg))
local ptInt = ptP1 + vtTg * dLen EgtOutLog( 'Elev2=' .. EgtNumToString( dElev2), 3)
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, -vtTg) local dLoTang = dElev2
EgtOutLog( 'LiFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - ( vtX * vtFN)) / ( vtTg * vtFN)
local dLiLen = dLen + dAddLen
EgtOutLog( 'LeadIn Dist=' .. EgtNumToString( dLiLen), 3)
dLiTang = - dLiLen
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLiOk2, _, vLiPar2 = EgtLineBoxInters( ptP1, vtTg, b3Mod)
if bLiOk2 and #vLiPar2 > 0 then
local dLen2 = vLiPar2[1]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP1 + vtTg * dLen2, -vtTg)
EgtOutLog( 'LiFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - ( vtX * vtFN2)) / ( vtTg * vtFN2)
local dLiLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadIn Dist2=' .. EgtNumToString( dLiLen2), 3)
if -dLiLen2 < -dLiLen then
dLiTang = - dLiLen2
end
end
end
-- Lunghezza di uscita
local dLoTang = 10000
local dLoPerp = 0 local dLoPerp = 0
local bLoOk, _, vLoPar = EgtLineBoxInters( ptP2, vtTg, b3MyBox)
if bLoOk and #vLoPar > 0 then
local dLen = vLoPar[#vLoPar]
local ptInt = ptP2 + vtTg * dLen
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtTg)
EgtOutLog( 'LoFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - ( vtX * vtFN)) / ( vtTg * vtFN)
local dLoLen = dLen + dAddLen
EgtOutLog( 'LeadOut Dist=' .. EgtNumToString( dLoLen), 3)
dLoTang = dLoLen
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLoOk2, _, vLoPar2 = EgtLineBoxInters( ptP2, vtTg, b3Mod)
if bLoOk2 and #vLoPar2 > 0 then
local dLen2 = vLoPar2[#vLoPar2]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP2 + vtTg * dLen2, vtTg)
EgtOutLog( 'LoFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - ( vtX * vtFN2)) / ( vtTg * vtFN2)
local dLoLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadOut Dist2=' .. EgtNumToString( dLoLen2), 3)
if dLoLen2 < dLoLen then
dLoTang = dLoLen2
end
end
end
return dLiTang, dLiPerp, dLoTang, dLoPerp return dLiTang, dLiPerp, dLoTang, dLoPerp
end end
+247
View File
@@ -0,0 +1,247 @@
-- FeatureTopology.lua by Egaltech s.r.l. 2023/09/12
-- Libreria per classificazione topologica feature travi
-- 2023/09/26 Aggiunte topologie Strip e Cut.
-- 2023/09/27 Modificata GetFacesParallelToPart per tunnel, pocket e groove 3 lati
-- 2023/10/16 In GetFacesParallelToPart rimossa Pocket e aggiunto Rabbet al check solo direzione principale
-- 2023/11/03 In Classify ora si settano le AffectedFaces nella Proc, se non già presenti.
-- Aggiunta groove 2 facce, differenziata da rabbet.
-- 2024/03/04 Feature senza topologia, calcolato in BeamExec
-- 2024/05/06 A topologia Cut aggiunta IsThrough = true
-- Tabella per definizione modulo
local FeatureTopology = {}
-- Include
require( 'EgtBase')
-- Carico le librerie
local BL = require( 'BeamLib')
EgtOutLog( ' FeatureTopology started', 1)
---------------------------------------------------------------------
-- restituisce gli id delle facce di Proc che hanno il numero di adiacenze nAdj
function FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, nAdj)
if not vAdj then vAdj = BL.GetAdjacencyMatrix( Proc) end
local nFct = #( vAdj or {})
local vFacesWithGivenAdj = {}
for i = 1, nFct do
local nAdjCount = 0
for j = 1, nFct do
if vAdj[i][j] and vAdj[i][j] ~= 0 then
nAdjCount = nAdjCount + 1
end
end
if nAdjCount == nAdj then
table.insert( vFacesWithGivenAdj, i - 1)
end
end
return vFacesWithGivenAdj
end
---------------------------------------------------------------------
-- restituisce true se Proc ha tutti gli angoli concavi (bAllConcave) e, nei casi in cui ha senso, se questi sono esattamente 90 deg (bAllRight)
local function AreAllAnglesConcaveOrRight( vAdj)
local bAllConcave, bAllRight = true, true
local nFct = #( vAdj or {})
for i = 1, nFct do
for j = 1, nFct do
-- se trovo un angolo convesso restituisco falso e esco subito
if vAdj[i][j] and vAdj[i][j] > 0 then
bAllConcave = false
bAllRight = false
break
elseif vAdj[i][j] and vAdj[i][j] ~= 0 and vAdj[i][j] + 90 > 500 * GEO.EPS_ANG_SMALL then
bAllRight = false
end
end
end
-- se 1 faccia oppure 2 facce con angolo convesso non ha senso ritornare valori per bAllRight
if nFct < 2 or ( nFct == 2 and vAdj[1][2] > 0) then
return bAllConcave
else
return bAllConcave, bAllRight
end
end
---------------------------------------------------------------------
-- restituisce true se almeno una delle dimensioni della feature è maggiore o uguale ad una delle dimensioni principali del pezzo (tolleranza 1 mm)
local function IsAnyDimensionLongAsPart( Proc)
local bResult = false
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
local b3Solid = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
if Proc.Box:getDimX() > b3Solid:getDimX() - 1000 * GEO.EPS_SMALL or
Proc.Box:getDimY() > b3Solid:getDimY() - 1000 * GEO.EPS_SMALL or
Proc.Box:getDimZ() > b3Solid:getDimZ() - 1000 * GEO.EPS_SMALL then
bResult = true
end
return bResult
end
---------------------------------------------------------------------
-- retituisce un vettore con gli indici (0 based) delle facce triangolari (o quasi) di Proc
local function GetTriangularFaces( Proc)
local vTriangularFaces = {}
for i = 1, Proc.Fct do
if BL.Is3EdgesApprox( Proc, i - 1) then
table.insert( vTriangularFaces, i - 1)
end
end
return vTriangularFaces
end
---------------------------------------------------------------------
-- restituisce un vettore contenente gli indici delle facce di Proc parallele ad una delle direzioni principali; il check varia in base alla famiglia topologica
local function GetFacesParallelToPart( Proc, sFamily)
local vFacesParallelToPart = {}
for i = 0, Proc.Fct - 1 do
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i, GDB_ID.ROOT)
if sFamily == 'Rabbet' or sFamily == 'Bevel' or sFamily == 'DoubleBevel' or sFamily == 'Strip' then
local vTriangularFaces = GetTriangularFaces( Proc)
local bIsTriangularFace = false
-- verifico se la faccia è triangolare
for j = 1, #vTriangularFaces do
if i == vTriangularFaces[j] then
bIsTriangularFace = true
end
end
-- se faccia triangolare deve avere la normale parallela ad una direzione principale
if bIsTriangularFace then
if AreSameOrOppositeVectorApprox( vtN, X_AX()) or AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
table.insert( vFacesParallelToPart, i)
end
-- altrimenti deve avere una componente della normale nulla
else
if abs( vtN:getX()) < 10 * GEO.EPS_SMALL or abs( vtN:getY()) < 10 * GEO.EPS_SMALL or abs( vtN:getZ()) < 10 * GEO.EPS_SMALL then
table.insert( vFacesParallelToPart, i)
end
end
else
-- la normale deve essere parallela ad una direzione principale
if AreSameOrOppositeVectorApprox( vtN, X_AX()) or AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
table.insert( vFacesParallelToPart, i)
end
end
end
return vFacesParallelToPart
end
---------------------------------------------------------------------
-- restituisce una stringa con il nome esteso della topologia della feature
-- *famiglia-passante-angoli tutti concavi a 90deg-facce tutte parallele alle dimensioni principali-numero di facce*
local function GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, nNumberOfFaces)
-- feature passante o cieca
local sThrough = '_'
if bIsThrough ~= nil then sThrough = EgtIf( bIsThrough, 'Through', 'Blind') end
-- tutti gli angoli della feature sono retti oppure no
local sAllRightAngles = '_'
if bAllRightAngles ~= nil then sAllRightAngles = EgtIf( bAllRightAngles, 'RightAngles', 'NotRightAngles') end
-- tutte le dimensioni della feature sono parallele agli assi principali del pezzo oppure no
local sParallel = '_'
if bIsParallel ~= nil then sParallel = EgtIf( bIsParallel, 'Parallel', 'NotParallel') end
local sLongName = sFamily .. '-' .. sThrough .. '-' .. sAllRightAngles .. '-' .. sParallel .. '-' .. nNumberOfFaces
return sLongName
end
---------------------------------------------------------------------
-- riconosce se Proc è una delle topologie standard e, in caso positivo, ne scrive le caratteristiche in campi specifici della Proc stessa restituendo true
function FeatureTopology.Classify( Proc, b3Raw)
-- la feature deve avere geometria
if not Proc.Box or Proc.Box:isEmpty() then
return false
end
-- se già calcolato, esco
if Proc.Topology then
return true
end
-- calcoli
if not Proc.AffectedFaces then
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
end
if not Proc.Face then
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
end
local vAdj = Proc.AdjacencyMatrix or BL.GetAdjacencyMatrix( Proc)
local bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( vAdj)
local vTriangularFaces = GetTriangularFaces( Proc)
local bIsAnyDimensionLongAsPart = IsAnyDimensionLongAsPart( Proc)
local vFacesWithOneAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 1)
local vFacesWithTwoAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 2)
local vFacesWithThreeAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 3)
local vFacesWithFourAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 4)
local dRawW = b3Raw:getDimY()
local dRawH = b3Raw:getDimZ()
local bIsFeatureCuttingEntireSection = BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
-- assegnazione tipologia
local sFamily
local bIsThrough
if Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
sFamily = 'Cut'
bIsThrough = true
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart then
sFamily = 'Bevel'
bIsThrough = true
elseif Proc.Fct == 2 and bAllAnglesConcave and #vTriangularFaces == 1 then
sFamily = 'Bevel'
bIsThrough = false
elseif Proc.Fct == 2 and bAllAnglesConcave and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) then
sFamily = 'Rabbet'
bIsThrough = true
-- birdsmouth
elseif Proc.Fct == 2 and bAllAnglesConcave then
sFamily = 'Groove'
bIsThrough = true
elseif Proc.Fct == 2 and not bAllAnglesConcave and bIsAnyDimensionLongAsPart then
sFamily = 'DoubleBevel'
bIsThrough = true
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 1 and #vTriangularFaces == 2 then
sFamily = 'Bevel'
bIsThrough = false
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 1 and bIsAnyDimensionLongAsPart then
sFamily = 'Groove'
bIsThrough = true
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 3 then
sFamily = 'Groove'
bIsThrough = false
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithThreeAdj == 2 then
sFamily = 'Groove'
bIsThrough = false
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithTwoAdj == 4 and bIsAnyDimensionLongAsPart then
sFamily = 'Tunnel'
bIsThrough = true
elseif Proc.Fct >= 4 and #vFacesWithOneAdj == 2 and bIsAnyDimensionLongAsPart then
sFamily = 'Strip'
bIsThrough = true
elseif Proc.Fct == 5 and bAllAnglesConcave and #vFacesWithFourAdj == 1 then
sFamily = 'Pocket'
bIsThrough = false
end
-- verifico se facce parallele a quelle della trave
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily)
local bIsParallel = ( #vFacesParallelToPart == Proc.Fct)
-- assegnazioni
if sFamily then
Proc.Topology = sFamily
Proc.TopologyLongName = GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, Proc.Fct)
Proc.IsThrough = bIsThrough
Proc.AllRightAngles = bAllRightAngles
Proc.IsParallel = bIsParallel
Proc.vAdj = vAdj
return true
else
Proc.Topology = 'OTHER'
Proc.TopologyLongName = Proc.Topology
return false
end
end
-------------------------------------------------------------------------------------------------------------
return FeatureTopology
+215 -131
View File
@@ -1,4 +1,4 @@
-- MachiningLib.lua by Egaltech s.r.l. 2022/05/07 -- MachiningLib.lua by Egaltech s.r.l. 2023/11/06
-- Libreria ricerca lavorazioni per Travi -- Libreria ricerca lavorazioni per Travi
-- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste. -- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste.
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati -- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
@@ -6,6 +6,14 @@
-- 2022/11/25 Per FindMilling implementata la possibilità di escludere la testa H3 dalla ricerca utensile. -- 2022/11/25 Per FindMilling implementata la possibilità di escludere la testa H3 dalla ricerca utensile.
-- 2022/12/28 Per FindMilling e FindDrilling possibilità di escludere la testa H2 dalla ricerca utensile. -- 2022/12/28 Per FindMilling e FindDrilling possibilità di escludere la testa H2 dalla ricerca utensile.
-- 2023/01/31 Per FindPocketing implementata la possibilità di escludere le teste H2 o H3 dalla ricerca utensile. -- 2023/01/31 Per FindPocketing implementata la possibilità di escludere le teste H2 o H3 dalla ricerca utensile.
-- 2023/07/28 Aggiunta gestione del tipo di foratura "Drill_AT".
-- 2023/11/06 Migliorie e correzioni alle forature con AngularTransmission ("_AT").
-- 2024/01/18 In FindSawing aggiunto il parametro opzionale dDepth.
-- 2024/01/19 In FindSawing aggiunto parametro opzionale bConsiderCSimmEncumberance per considerare l'ingombro dell'asse C nel massimo materiale (default false).
-- 2024/01/23 Nella GetMachinings vengono ora raccolti i parametri utensile necessari per i VerifyTool, scritti direttamente nella tabella Machining.Tool.
-- Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest) se passato l'apposito parametro SortingCriterion in FindMachining. Al momento implementato solo per FindSawing.
-- 2024/03/01 In VerifyPocketing implementato l'ordinamento per dimensioni utensile.
-- 2024/03/13 Aggiunta gestione Predrill
-- Tabella per definizione modulo -- Tabella per definizione modulo
local MachiningLib = {} local MachiningLib = {}
@@ -66,154 +74,230 @@ local function SetCurrMachineHeadType()
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- funzione che conferma e rende attivi testa e utensile ipotizzati -- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa
local function ConfirmNextMachining() local function ConfirmNextMachining()
-- se non definita testa successiva, esco -- utensile corrente
if not nNextMachHead or nNextMachHead < 1 or nNextMachHead > 2 then return end local sToolUuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
-- altrimenti, la confermo come attiva local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '')
nActiveHead = nNextMachHead EgtTdbSetCurrTool( sToolName or '')
if nNextMachHead == 1 then -- testa dell'utensile corrente
H1_TOOL = H1_NEXT_TOOL local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
elseif nNextMachHead == 2 then local nHead = tonumber( sHead:sub( 2, #sHead)) + 0
H2_TOOL = H2_NEXT_TOOL
if ( nHead < 10 and nHead >= 30) or vFixedHeads[nHead] then
-- testa che non richiede ottimizzazione
return
elseif nHead >= 20 then
nHead = 2
elseif nHead >= 10 then
nHead = 1
end
-- se la testa richiede ottimizzazione, confermo testa attiva
nActiveHead = nHead
if nActiveHead == 1 then
H1_TOOL = sToolName
elseif nActiveHead == 2 then
H2_TOOL = sToolName
end end
-- reset prossima testa
nNextMachHead = 0
H1_NEXT_TOOL = ''
H2_NEXT_TOOL = ''
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- funzione che traccia testa e utensile ipotizzati local function SetCurrMachiningAndTool( Machining)
local function SetNextMachining( sToolName, nHead, bFixed) EgtMdbSetCurrMachining( Machining.Name)
if nHead < 1 or nHead > 2 then return end EgtTdbSetCurrTool( Machining.Tool.Name)
if bFixed then local bActive = EgtFindToolInCurrSetup( Machining.Tool.Name)
nNextMachHead = 0
H1_NEXT_TOOL = ''
H2_NEXT_TOOL = ''
end
nNextMachHead = nHead
if nHead == 1 then
H1_NEXT_TOOL = sToolName
elseif nHead == 2 then
H2_NEXT_TOOL = sToolName
end
end
---------------------------------------------------------------------
local function SetCurrMachiningAndTool( sMachName)
if not EgtMdbSetCurrMachining( sMachName) then return false end
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
local sTool = EgtTdbGetToolFromUUID( sTuuid)
if not sTool then return false end
if not EgtTdbSetCurrTool( sTool) then return false end
local bActive = EgtTdbGetCurrToolParam( MCH_TP.ACTIVE)
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local nHead = tonumber( sHead:sub( 2, #sHead)) local nHead = tonumber( sHead:sub( 2, #sHead))
local bH2 = ( nHead >= 21 and nHead <= 29) local bH2 = ( nHead >= 21 and nHead <= 29)
local bH3 = ( nHead >= 31 and nHead <= 39) local bH3 = ( nHead >= 31 and nHead <= 39)
local bFixed = ( vFixedHeads[nHead]) local bFixed = ( vFixedHeads[nHead])
return bActive, sTool, bH2, bFixed, bH3 return bActive, Machining.Tool.Name, bH2, bFixed, bH3
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function VerifyDrill( dDiam, dDepth, bH2) function VerifyDrill( Machining, dDiam, dDepth, bH2)
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) local dFreeLen = Machining.Tool.Length - Machining.Tool.ToolHolderLength - EgtMdbGetGeneralParam( MCH_GP.MAXDEPTHSAFE)
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) if Machining.Tool.Diameter < dDiam + 10 * GEO.EPS_SMALL and
local dMaxToolLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) Machining.Tool.Diameter > dDiam - BD.DRILL_TOL - 10 * GEO.EPS_SMALL and
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) then
local dDiamTh = EgtTdbGetCurrToolThDiam() return true, { TMaxMat = Machining.Tool.MaxMat, MaxToolLength = Machining.Tool.TotalLength, ToolDiam = Machining.Tool.Diameter, DiamTh = Machining.Tool.ToolHolderDiameter, FreeLen = dFreeLen, H2 = bH2}
local dLenTh = 72
if EgtTdbGetCurrToolThLength then dLenTh = EgtTdbGetCurrToolThLength() end
local dFreeLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) - dLenTh - EgtMdbGetGeneralParam( MCH_GP.MAXDEPTHSAFE)
if dTDiam < dDiam + 10 * GEO.EPS_SMALL and
dTDiam > dDiam - BD.DRILL_TOL - 10 * GEO.EPS_SMALL and
( not dDepth or dTMaxMat > dDepth - GEO.EPS_SMALL) then
return true, { TMaxMat = dTMaxMat, MaxToolLength = dMaxToolLength, ToolDiam = dToolDiam, DiamTh = dDiamTh, FreeLen = dFreeLen, H2 = bH2}
end end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function VerifyDrillPocket( dDiam, dDepth, bH2) function VerifyDrillPocket( Machining, dDiam, dDepth, bH2)
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) if Machining.Tool.Diameter < dDiam - 10 * GEO.EPS_SMALL and
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) then
local dMaxToolLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) return true, { TMaxDepth = Machining.Tool.MaxMat, MaxToolLength = Machining.Tool.TotalLength, ToolDiam = Machining.Tool.Diameter, DiamTh = Machining.Tool.ToolHolderDiameter, FreeLen = Machining.Tool.MaxMat, H2 = bH2}
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
local dDiamTh = EgtTdbGetCurrToolThDiam()
local dFreeLen = dTMaxDepth
if dTDiam < dDiam - 10 * GEO.EPS_SMALL and
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) then
return true, { TMaxDepth = dTMaxDepth, MaxToolLength = dMaxToolLength, ToolDiam = dToolDiam, DiamTh = dDiamTh, FreeLen = dFreeLen, H2 = bH2}
end end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function VerifyMill( dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2) function VerifyMill( Machining, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2)
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) if ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) and
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() ( not sTuuidMstr or sTuuidMstr == Machining.Tool.UUID) and
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) ( not dMaxDiam or Machining.Tool.Diameter < dMaxDiam + GEO.EPS_SMALL) and
local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) ( not dMaxTotLen or Machining.Tool.TotalLength < dMaxTotLen + GEO.EPS_SMALL) then
if ( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and return true, { TMaxDepth = Machining.Tool.MaxMat, TDiam = Machining.Tool.Diameter, H2 = bH2}
( not sTuuidMstr or sTuuidMstr == sTuuid) and
( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
( not dMaxTotLen or dTTotLen < dMaxTotLen + GEO.EPS_SMALL) then
return true, { TMaxDepth = dTMaxDepth, TDiam = dTDiam, H2 = bH2}
end end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function VerifyPocket( dMaxDiam, dDepth, dMaxTotLen, bH2) function VerifyPocket( Machining, dMaxDiam, dDepth, dMaxTotLen, bH2)
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) if ( not dMaxDiam or Machining.Tool.Diameter < dMaxDiam + GEO.EPS_SMALL) and
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) and
local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) ( not dMaxTotLen or Machining.Tool.TotalLength < dMaxTotLen + GEO.EPS_SMALL) then
if ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and return true, { TDiam = Machining.Tool.Diameter, TMaxDepth = Machining.Tool.MaxMat, H2 = bH2}
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
( not dMaxTotLen or dTTotLen < dMaxTotLen + GEO.EPS_SMALL) then
return true, { TDiam = dTDiam, TMaxDepth = dTMaxDepth, H2 = bH2}
end end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function VerifyTool( MachiningType, sType, Params, bH2) function VerifyChainSaw( Machining, dDepth, CSimmEncumberance, bH2)
-- riduco il massimo materiale dell'ingombro asse C. Se non richiesto, arriverà un valore di CSimmEncumberance nullo
Machining.Tool.MaxMat = min( Machining.Tool.MaxMat, Machining.Tool.TotalLength - CSimmEncumberance)
if not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL then
return true, { H2 = bH2}
end
end
---------------------------------------------------------------------
function VerifyTool( Machining, MachiningType, Params, bH2)
if MachiningType == MCH_MY.DRILLING then if MachiningType == MCH_MY.DRILLING then
if EgtStartsWith( sType, 'Drill') or EgtStartsWith( sType, 'AngleDrill') then if Machining.SubType == 'Drill' or Machining.SubType == 'AngleDrill' or Machining.SubType == 'Predrill' then
return VerifyDrill( Params.Diam, Params.Depth, bH2) return VerifyDrill( Machining, Params.Diam, Params.Depth, bH2)
elseif EgtStartsWith( sType, 'Pocket') then elseif Machining.SubType == 'DrillPocket' then
return VerifyDrillPocket( Params.Diam, Params.Depth, bH2) return VerifyDrillPocket( Machining, Params.Diam, Params.Depth, bH2)
end end
elseif MachiningType == MCH_MY.SAWING then elseif MachiningType == MCH_MY.SAWING then
return true, { H2 = bH2} return true, { H2 = bH2}
elseif MachiningType == MCH_MY.MILLING then elseif MachiningType == MCH_MY.MILLING then
return VerifyMill( Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2) return VerifyMill( Machining, Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2)
elseif MachiningType == MCH_MY.POCKETING then elseif MachiningType == MCH_MY.POCKETING then
return VerifyPocket( Params.MaxDiam, Params.Depth, Params.MaxTotLen, bH2) return VerifyPocket( Machining, Params.MaxDiam, Params.Depth, Params.MaxTotLen, bH2)
elseif MachiningType == MCH_MY.MORTISING then elseif MachiningType == MCH_MY.MORTISING then
return true, { H2 = bH2} return VerifyChainSaw( Machining, Params.Depth, Params.CSimmEncumberance, bH2)
else else
return false return false
end end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function GetMachinings( MachiningType) function GetMachinings( MachiningType, sType)
local Machinings
-- leggo le lavorazioni disponibili
if MachiningType == MCH_MY.DRILLING then if MachiningType == MCH_MY.DRILLING then
return Drillings Machinings = Drillings
elseif MachiningType == MCH_MY.SAWING then elseif MachiningType == MCH_MY.SAWING then
return Cuttings Machinings = Cuttings
elseif MachiningType == MCH_MY.MILLING then elseif MachiningType == MCH_MY.MILLING then
return Millings Machinings = Millings
elseif MachiningType == MCH_MY.POCKETING then elseif MachiningType == MCH_MY.POCKETING then
return Pocketings Machinings = Pocketings
elseif MachiningType == MCH_MY.MORTISING then elseif MachiningType == MCH_MY.MORTISING then
return Sawings Machinings = Sawings
end end
-- scrivo i parametri utensile nella lavorazione
local validMachinings = {}
for i = 1, #Machinings do
local Machining = Machinings[i]
if EgtMdbSetCurrMachining( Machining.Name) then
Machining.Tool = {}
Machining.Tool.UUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
Machining.Tool.Name = EgtTdbGetToolFromUUID( Machining.Tool.UUID)
if Machining.Tool.Name then
if EgtTdbSetCurrTool( Machining.Tool.Name) then
table.insert( validMachinings, Machining)
if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then
Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth()
else
Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
end
if MachiningType == MCH_MY.DRILLING then
if EgtStartsWith( Machining.Type, 'Drill') then
Machining.SubType = 'Drill'
elseif EgtStartsWith( Machining.Type, 'AngleDrill') then
Machining.SubType = 'AngleDrill'
elseif EgtStartsWith( Machining.Type, 'Pocket') then
Machining.SubType = 'DrillPocket'
elseif EgtStartsWith( Machining.Type, 'Predrill') then
Machining.SubType = 'Predrill'
end
end
Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
Machining.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN)
Machining.Tool.TotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
Machining.Tool.ToolHolderDiameter = EgtTdbGetCurrToolThDiam()
Machining.Tool.ToolHolderLength = EgtTdbGetCurrToolThLength() or 72
end
end
end
end
-- ritorno la lista delle sole lavorazioni valide
return validMachinings
end
---------------------------------------------------------------------
---restituisce la lista delle lavorazioni ordinata secondo il criterio *sCriterion*
---@param Machinings table lista della lavorazioni da riordinare
---@param sCriterion string criterio di ordinamento ('Longest', 'Shortest', 'Biggest', 'Smallest')
function ReorderMachinings( Machinings, sCriterion)
-- funzioni di ordinamento
local function SortMachiningsByLongestTool( Machining1, Machining2)
if Machining1.Tool.MaxMat > Machining2.Tool.MaxMat + 10 * GEO.EPS_SMALL then
return true
else
return false
end
end
local function SortMachiningsByShortestTool( Machining1, Machining2)
if Machining1.Tool.MaxMat < Machining2.Tool.MaxMat - 10 * GEO.EPS_SMALL then
return true
else
return false
end
end
local function SortMachiningsByBiggestTool( Machining1, Machining2)
if Machining1.Tool.Diameter > Machining2.Tool.Diameter + 10 * GEO.EPS_SMALL then
return true
else
return false
end
end
local function SortMachiningsBySmallestTool( Machining1, Machining2)
if Machining1.Tool.Diameter < Machining2.Tool.Diameter - 10 * GEO.EPS_SMALL then
return true
else
return false
end
end
-- ordinamento in base al criterio
-- ordine di default, ossia quello che arriva dal database
if not sCriterion then
return
-- prima gli utensili più lunghi
elseif sCriterion == 'Longest' then
table.sort( Machinings, SortMachiningsByLongestTool)
-- prima gli utensili più corti
elseif sCriterion == 'Shortest' then
table.sort( Machinings, SortMachiningsByShortestTool)
-- prima gli utensili con diametro più grande
elseif sCriterion == 'Biggest' then
table.sort( Machinings, SortMachiningsByBiggestTool)
-- prima gli utensili con diametro più piccolo
elseif sCriterion == 'Smallest' then
table.sort( Machinings, SortMachiningsBySmallestTool)
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function ReturnParams( MachiningType, MachiningName, sType, ToolParams) function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
if MachiningType == MCH_MY.DRILLING then if MachiningType == MCH_MY.DRILLING then
local _, sOrigType = EgtEndsWith( sType, '_H2') local _, sOrigType = EgtEndsWith( sType, '_H2')
return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'AngleDrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'Drill_AT' or sOrigType == 'AngleDrill' or sOrigType == 'Predrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen
elseif MachiningType == MCH_MY.SAWING then elseif MachiningType == MCH_MY.SAWING then
return MachiningName, ToolParams.H2 return MachiningName, ToolParams.H2
elseif MachiningType == MCH_MY.MILLING then elseif MachiningType == MCH_MY.MILLING then
@@ -226,7 +310,7 @@ function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3) local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
if bTopHead == nil and bDownHead == nil then if bTopHead == nil and bDownHead == nil then
bTopHead = true bTopHead = true
bDownHead = false bDownHead = false
@@ -253,11 +337,12 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
local sH2Mach = '' local sH2Mach = ''
local sH2Tool = '' local sH2Tool = ''
local sH2Param local sH2Param
-- ricerca sulle forature, dal diametro maggiore al minore local Machinings = GetMachinings( MachiningType, sType)
local Machinings = GetMachinings( MachiningType) ReorderMachinings( Machinings, sSortingCriterion)
local ForStart = 1 local ForStart = 1
local ForEnd = #Machinings local ForEnd = #Machinings
local ForStep = 1 local ForStep = 1
-- le forature vanno scorse dal diametro maggiore al minore
if MachiningType == MCH_MY.DRILLING then if MachiningType == MCH_MY.DRILLING then
ForStart = #Machinings ForStart = #Machinings
ForEnd = 1 ForEnd = 1
@@ -265,16 +350,16 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
end end
if ( BEAM and BEAM.BW) or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then if ( BEAM and BEAM.BW) or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
_, sType = EgtEndsWith( sType, '_H2') _, sType = EgtEndsWith( sType, '_H2')
elseif ( not BEAM or not BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and bDownHead then elseif not ( BEAM and BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then
if not EgtEndsWith( sType, '_H2') then if not EgtEndsWith( sType, '_H2') then
sType = sType .. '_H2' sType = sType .. '_H2'
end end
end end
local MachineHeadUse = MachineHeadType local MachineHeadUse = MachineHeadType
if not BEAM or not BEAM.BW then if not ( BEAM and BEAM.BW) and MachineHeadUse == TWO_EQUAL_HEADS then
MachineHeadUse = ONE_HEAD MachineHeadUse = ONE_HEAD
end end
if BEAM and BEAM.BW and MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then if MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
-- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra -- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
MachineHeadUse = TWO_EQUAL_HEADS MachineHeadUse = TWO_EQUAL_HEADS
end end
@@ -283,27 +368,24 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
for i = ForStart, ForEnd, ForStep do for i = ForStart, ForEnd, ForStep do
local Machining = Machinings[i] local Machining = Machinings[i]
local sMachiningType = Machining.Type local sMachiningType = Machining.Type
if BEAM and BEAM.BW then if ( BEAM and BEAM.BW) or MachineHeadUse == TWO_EQUAL_HEADS then
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2') _, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
end end
-- recupero dati utensile -- recupero dati utensile
local bToolActive, sToolName, bH2, bFixed, bH3 = SetCurrMachiningAndTool( Machining.Name) local bToolActive, sToolName, bH2, bFixed, bH3 = SetCurrMachiningAndTool( Machining)
if Machining.On and sMachiningType == sType and bToolActive and ( not bH2 or bH2 == not bExcludeH2) and ( not bH3 or bH3 == not bExcludeH3) then if Machining.On and sMachiningType == sType and bToolActive and ( not bH2 or bH2 == not bExcludeH2) and ( not bH3 or bH3 == not bExcludeH3) then
local bOk, ToolParams = VerifyTool( MachiningType, sType, Params, bH2) local bOk, ToolParams = VerifyTool( Machining, MachiningType, Params, bH2)
if bOk then if bOk then
if MachineHeadUse == ONE_HEAD then if MachineHeadUse == ONE_HEAD then
SetNextMachining( sToolName, 1, bFixed)
return ReturnParams(MachiningType, Machining.Name, Machining.Type, ToolParams) return ReturnParams(MachiningType, Machining.Name, Machining.Type, ToolParams)
elseif MachineHeadUse == TWO_EQUAL_HEADS then elseif MachineHeadUse == TWO_EQUAL_HEADS then
-- se nessuna testa attiva, prendo la prima lavorazione disponibile -- se nessuna testa attiva, prendo la prima lavorazione disponibile
if nActiveHead == 0 then if nActiveHead == 0 then
SetNextMachining( sToolName, EgtIf( bH2, 2, 1), bFixed)
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
-- verifico se posso usare lo stesso utensile della testa attiva -- verifico se posso usare lo stesso utensile della testa attiva
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo -- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo, a meno che non siano entrambi grandi (truciolatori)
if ( not sH1Param or not sH1Param.TDiam or sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam) and ( not sH2Param or not sH2Param.TDiam or sH2Param.TDiam < 1.25 * ToolParams.TDiam) then if ( not sH1Param or not sH1Param.TDiam or ( sH1Param.TDiam < 75 and ToolParams.TDiam < 75 and sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam)) and ( not sH2Param or not sH2Param.TDiam or ( sH2Param.TDiam < 75 and ToolParams.TDiam < 75 and sH2Param.TDiam < 1.25 * ToolParams.TDiam)) then
SetNextMachining( sToolName, nActiveHead, bFixed)
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
end end
end end
@@ -323,10 +405,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
end end
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
if bTopHead and not bH2 then if bTopHead and not bH2 then
SetNextMachining( sToolName, 1, bFixed)
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
elseif bDownHead and bH2 then elseif bDownHead and bH2 then
SetNextMachining( sToolName, 2, bFixed)
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
end end
end end
@@ -334,34 +414,30 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
end end
end end
if MachineHeadUse == TWO_EQUAL_HEADS then if MachineHeadUse == TWO_EQUAL_HEADS then
-- se uno dei due utensili è molto più grande dell'altro scelgo quello senza fare altre analisi -- se entrambi gli utensili sono piccoli (no truciolatori) e uno dei due è molto più grande dell'altro scelgo quello senza fare altre analisi
if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then if sH1Param.TDiam < 75 or sH2Param.TDiam < 75 then
SetNextMachining( sH1Tool, 1, bFixed) if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param) return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
SetNextMachining( sH2Tool, 2, bFixed) return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param) end
end end
end end
-- verifico se cambiare testa o cambiare utensile su quella corrente -- verifico se cambiare testa o cambiare utensile su quella corrente
if nActiveHead == 1 then if nActiveHead == 1 then
if sH2Mach ~= "" then if sH2Mach ~= "" then
SetNextMachining( sH2Tool, 2, bFixed)
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param) return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen --return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
elseif sH1Mach ~= "" then elseif sH1Mach ~= "" then
SetNextMachining( sH1Tool, 1, bFixed)
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param) return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen --return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
end end
elseif nActiveHead == 2 then elseif nActiveHead == 2 then
if sH1Mach ~= "" then if sH1Mach ~= "" then
SetNextMachining( sH1Tool, 1, bFixed)
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param) return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen --return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
elseif sH2Mach ~= "" then elseif sH2Mach ~= "" then
SetNextMachining( sH2Tool, 2, bFixed)
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param) return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen --return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
end end
@@ -379,10 +455,17 @@ function MachiningLib.FindCutting( sType, bTopHead, bDownHead)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2) function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission, bIsPredrill)
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Drill', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2) local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5, sTypeMach
if not MachiningName or MachiningName == '' then -- se il foro è un predrill, cerco solo punte abilitate al Predrill
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Pocket', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead) if bIsPredrill then
sTypeMach = 'Predrill'
else
sTypeMach = EgtIf( bAngleTransmission, 'Drill_AT', 'Drill')
end
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, sTypeMach, { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2)
if ( not MachiningName or MachiningName == '') then
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Pocket_AT', 'Pocket'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead)
end end
if MachiningName and MachiningName ~= '' then if MachiningName and MachiningName ~= '' then
return MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 return MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5
@@ -403,13 +486,14 @@ function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotL
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3) function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
return FindMachining( MCH_MY.POCKETING, sType, { MaxDiam = dMaxDiam, Depth = dDepth, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3) return FindMachining( MCH_MY.POCKETING, sType, { MaxDiam = dMaxDiam, Depth = dDepth, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function MachiningLib.FindSawing( sType) function MachiningLib.FindSawing( sType, dDepth, bConsiderCSimmEncumberance, sSortingCriterion)
return FindMachining( MCH_MY.MORTISING, sType) if not BD.C_SIMM_ENC then BD.C_SIMM_ENC = EgtIf( BD.C_SIMM, 180, 90) end
return FindMachining( MCH_MY.MORTISING, sType, { Depth = dDepth, CSimmEncumberance = EgtIf( bConsiderCSimmEncumberance, BD.C_SIMM_ENC, 0)}, nil, nil, nil, nil, sSortingCriterion)
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
+4 -2
View File
@@ -151,7 +151,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO
-- se va fatto, inserisco la lavorazione -- se va fatto, inserisco la lavorazione
if bCut then if bCut then
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AuxId, 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} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
if bOk then if bOk then
@@ -242,7 +243,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO
-- se va fatto, inserisco la lavorazione -- se va fatto, inserisco la lavorazione
if bCut then if bCut then
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AuxId, 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} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
if bOk then if bOk then
+158 -74
View File
@@ -1,4 +1,4 @@
-- ProcessCut.lua by Egaltech s.r.l. 2022/12/19 -- ProcessCut.lua by Egaltech s.r.l. 2023/08/01
-- Gestione calcolo singoli tagli di lama per Travi -- Gestione calcolo singoli tagli di lama per Travi
-- 2021/05/18 I due tagli con testa da sotto di un cubetto sono fatti di seguito. -- 2021/05/18 I due tagli con testa da sotto di un cubetto sono fatti di seguito.
-- 2021/06/06 Correzioni per tagli con testa da sotto. -- 2021/06/06 Correzioni per tagli con testa da sotto.
@@ -18,6 +18,14 @@
-- 2022/08/30 Modificata la condizione che determina l'utilizzo della testa da sotto. Ora controlla se la trave è più grande del doppio della massima larghezza del cubetto. -- 2022/08/30 Modificata la condizione che determina l'utilizzo della testa da sotto. Ora controlla se la trave è più grande del doppio della massima larghezza del cubetto.
-- 2022/09/23 Corretta la condizione per cui è richiesto l'aggiornamento del grezzo. -- 2022/09/23 Corretta la condizione per cui è richiesto l'aggiornamento del grezzo.
-- 2023/01/26 Migliorata la direzione di lavoro della lama in alcuni casi in cui il truciolo veniva scaricato dal lato errato. -- 2023/01/26 Migliorata la direzione di lavoro della lama in alcuni casi in cui il truciolo veniva scaricato dal lato errato.
-- 2023/06/19 Aggiunti tagli speciali per evitare il rischio che il cubetto rimanga appoggiato al motore.
-- 2023/08/01 Correzione su offset per taglio doppio di lato.
-- 2023/08/01 In caso di pezzi alti su macchina tipo PF i tagli doppi di lato non vengono usati, si usa il metodo standard.
-- 2023/09/12 In MakeFromTop abbassato a 590 mm il limite per convertire in LongCut.
-- 2023/10/27 In MakeFromTop corretto massimo materiale in caso di lavorazione da sotto.
-- 2023/12/07 Correzione in Classify in scelta ribaltamento trave quando si è in condizioni downUp.
-- 2024/01/18 Gestita superficie limitante opzionale da passare a diceCut.
-- 2024/05/10 In MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessCut = {} local ProcessCut = {}
@@ -62,10 +70,22 @@ function ProcessCut.Classify( Proc, b3Raw)
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw) local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw)
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp) local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
if bDownCut then if bDownCut then
-- recupero i dati della lama
local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide')
local sCutting = ML.FindCutting( sCutType, true, false)
local dMaxDepth = 0
local dMaxMat = 0
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
end
end
-- calcolo l'ingombro orizzontale della faccia -- calcolo l'ingombro orizzontale della faccia
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0) local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli) -- 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 then 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 return true, true
end end
end end
@@ -172,7 +192,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
-- Inserisco la lavorazione del lato opposto -- Inserisco la lavorazione del lato opposto
@@ -195,7 +215,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch2Id, false)
return false, sErr return false, sErr
end end
return true, nil return true, nil
@@ -206,13 +226,14 @@ end
local function UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw) local function UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
-- eventuale segnalazione ingombro di testa o coda (se non chiamata da altre feature) -- eventuale segnalazione ingombro di testa o coda (se non chiamata da altre feature)
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ()) local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ then
if Proc.Head then if Proc.Head then
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
if vtN:getZ() > 0.5 then if vtN:getZ() > 0.5 then
dOffs = dOffs - 0.6 * Proc.Box:getDimX() dOffs = dOffs - 0.6 * Proc.Box:getDimX()
elseif vtN:getZ() < -0.5 then elseif vtN:getZ() < -0.5 then
dOffs = dOffs - 0.2 * Proc.Box:getDimX() dOffs = dOffs - EgtIf( BD.PRESS_ROLLER, 0.4, 0.2) * Proc.Box:getDimX()
elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then
dOffs = dOffs - 0.3 * Proc.Box:getDimX() dOffs = dOffs - 0.3 * Proc.Box:getDimX()
end end
@@ -222,7 +243,7 @@ local function UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
if vtN:getZ() > 0.5 then if vtN:getZ() > 0.5 then
dOffs = dOffs - 0.6 * Proc.Box:getDimX() dOffs = dOffs - 0.6 * Proc.Box:getDimX()
elseif vtN:getZ() < -0.5 then elseif vtN:getZ() < -0.5 then
dOffs = dOffs - 0.2 * Proc.Box:getDimX() dOffs = dOffs - EgtIf( BD.PRESS_ROLLER, 0.4, 0.2) * Proc.Box:getDimX()
elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then
dOffs = dOffs - 0.3 * Proc.Box:getDimX() dOffs = dOffs - 0.3 * Proc.Box:getDimX()
end end
@@ -233,7 +254,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione con testa da sopra -- Applicazione della lavorazione con testa da sopra
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes) local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf)
-- ingombro del grezzo -- ingombro del grezzo
b3Raw = b3Raw or EgtGetRawPartBBox( nRawId) b3Raw = b3Raw or EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo -- ingombro del pezzo
@@ -246,14 +267,15 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
if bFromBottom == nil then if bFromBottom == nil then
bFromBottom = ( vtN:getZ() > 0.25 and b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and vtN:getX() < 0 and abs( vtN:getY()) < 0.259) bFromBottom = ( vtN:getZ() > 0.25 and b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and vtN:getX() < 0 and abs( vtN:getY()) < 0.259)
end end
local dMinFeatureLengthForLongCut = 590.000
-- verifico se da considerare taglio lungo ( non da sotto, inclinato non più di 30deg, largo come la trave e abbastanza lungo) -- verifico se da considerare taglio lungo ( non da sotto, inclinato non più di 30deg, largo come la trave e abbastanza lungo)
local bLongCut = ( not bDownCut and vtN:getZ() > 0.865 and local bLongCut = ( not bDownCut and vtN:getZ() > 0.865 and
Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000)) ( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > dMinFeatureLengthForLongCut))
-- verifico se da considerare taglio lungo dal lato, solo per macchine tipo PF1250, inclinato non più di 30deg -- verifico se da considerare taglio lungo dal lato, solo per macchine tipo PF1250, inclinato non più di 30deg
local bLongCutFromSide = ( not bDownCut and ( BD.C_SIMM and BD.DOWN_HEAD and ( abs(vtN:getY()) > 0.865) and local bLongCutFromSide = ( not bDownCut and ( BD.C_SIMM and BD.DOWN_HEAD and ( abs(vtN:getY()) > 0.865) and
Proc.Box:getDimZ() > b3Solid:getDimZ() - 10 * GEO.EPS_SMALL) and Proc.Box:getDimZ() > b3Solid:getDimZ() - 10 * GEO.EPS_SMALL) and
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000)) ( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > dMinFeatureLengthForLongCut))
-- se taglio lungo e Q04 = 1 allora lancio il processo dell'L10 -- se taglio lungo e Q04 = 1 allora lancio il processo dell'L10
local bNoDicing = EgtGetInfo( Proc.Id, 'Q04', 'i') == 1 local bNoDicing = EgtGetInfo( Proc.Id, 'Q04', 'i') == 1
if bNoDicing then if bNoDicing then
@@ -342,7 +364,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- verifico se necessari tagli supplementari -- verifico se necessari tagli supplementari o se presente superficie limitante
EgtOutLog( string.format( 'MaxDepth=%.1f MaxVertDepth=%.1f CutH=%.1f CutV=%.1f', dMaxDepth, dMaxVertDepth, dCutH, dCutV), 3) EgtOutLog( string.format( 'MaxDepth=%.1f MaxVertDepth=%.1f CutH=%.1f CutV=%.1f', dMaxDepth, dMaxVertDepth, dCutH, dCutV), 3)
local vCuts = {} local vCuts = {}
if not Proc.AdvTail and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then if not Proc.AdvTail and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
@@ -353,6 +375,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
ptExtra = Point3d( b3Solid:getMin():getX() + 5*GEO.EPS_SMALL, ptMiddle:getY(), ptMiddle:getZ()) ptExtra = Point3d( b3Solid:getMin():getX() + 5*GEO.EPS_SMALL, ptMiddle:getY(), ptMiddle:getZ())
vtExtra = X_AX() vtExtra = X_AX()
bAutoCalcSurf = false bAutoCalcSurf = false
-- superficie limitante
elseif nLimitingSurf then
ptExtra, vtExtra = EgtSurfTmFacetCenter( nLimitingSurf, 0, GDB_ID.ROOT)
end end
-- verifico elevazione max del materiale tagliato -- verifico elevazione max del materiale tagliato
local dMaxElev local dMaxElev
@@ -369,9 +394,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
dMaxElev = Proc.Box:getMax():getX() - b3Solid:getMin():getX() dMaxElev = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
end end
end end
-- per macchina TURN aggiusto massima dimensione cubetto -- per macchina TURN (ma non OikosX) aggiusto massima dimensione cubetto
local dNewDiceDim local dNewDiceDim
if BD.TURN then if BD.TURN and BD.TURN ~= 2 then
local dDimRef = GEO.INFINITO local dDimRef = GEO.INFINITO
if abs( vtN:getZ()) < 0.003 then if abs( vtN:getZ()) < 0.003 then
dDimRef = b3Raw:getDimZ() dDimRef = b3Raw:getDimZ()
@@ -395,6 +420,19 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
if bCustDiceCut and #vCuts == 0 then if bCustDiceCut and #vCuts == 0 then
return false, -1 return false, -1
end end
-- per caso speciale in cui c'è il rischio che il cubetto rimanga appoggiato sul motore, faccio solo i tagli perpendicolari seguiti da due tagli verticali laterali
local bDangerousReliefCut = false
-- verifico che i tagli perpendicolari siano perpendicolari al lato più vicino a Z
local nFirstPerpendicularCut = ( #vCuts > 0 and ( vCuts[1][1] or vCuts[3][1]))
if nFirstPerpendicularCut then
local frFace = BL.GetFaceHvRefDim( Proc.Id, 0)
local vtTemp = EgtSurfTmFacetNormVersor( nFirstPerpendicularCut, 0, GDB_ID.ROOT) ^ frFace:getVersX()
if not ( vtTemp:isSmall()) and not ( bDownCut or bFromBottom) and not bLongCut and ( not BD.C_SIMM or b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL) then
bDangerousReliefCut = true
end
end
--DC.PrintOrderCut( vCuts) --DC.PrintOrderCut( vCuts)
if #vCuts > 0 then if #vCuts > 0 then
-- sistemo posizione nel DB e nome -- sistemo posizione nel DB e nome
@@ -405,8 +443,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId) EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
if ( i % 2) == 1 then if ( i % 2) == 1 then
local vtO = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT) local vtO = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
if ( vtN:getY() > 0.707 and vtO:getY() < -0.05) or if ( vtN:getY() > 0.766 and vtO:getY() < -0.05) or
( vtN:getY() < -0.707 and vtO:getY() > 0.05) then ( vtN:getY() < -0.766 and vtO:getY() > 0.05) then
EgtInvertSurf( vCuts[i][j]) EgtInvertSurf( vCuts[i][j])
bOrthInv = true bOrthInv = true
end end
@@ -442,7 +480,15 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
if vtO then if vtO then
vtOrthoO = Vector3d( vtO) * EgtIf( bOrthInv, -1, 1) vtOrthoO = Vector3d( vtO) * EgtIf( bOrthInv, -1, 1)
else else
if bHorizCut then -- ricalcolo tipo taglio perché "bHorizCut" è calcolato sulla feature, mentre il cubetto potrebbe essere lavorato in un altro modo
local _, dLen, dWidth = BL.GetFaceHvRefDim( vCuts[i][1], 0, b3Raw)
local bCutDirection = bHorizCut
-- se bisogna tagliare di fianco ma la lunghezza faccia è più del massimo materiale, forzo lavorazione da sopra
if not bHorizCut and dLen > dMaxDepth then
bCutDirection = true
end
if bCutDirection then
vtOrthoO = Z_AX() vtOrthoO = Z_AX()
else else
if vtN:getZ() < dNzLimDwnUp then if vtN:getZ() < dNzLimDwnUp then
@@ -453,44 +499,91 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
end end
end end
end end
-- lavoro la faccia local dDiceFaceMaxH = 0
for j = 1, #vCuts[i] do local dDiceFaceMinH = GEO.INFINITO
-- se taglio dal basso if ( i % 2) == 0 and bDangerousReliefCut then
if bDownCut then for j = 1, #vCuts[i] do
-- se strato pari composto da 1 o 2 elementi local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][j], 0)
if ( i % 2) == 0 and #vCuts[i] <= 2 then dDiceFaceMaxH = max( dDiceFaceMaxH, dDiceFaceH)
-- il primo elemento prende la direzione prevista, il secondo quella opposta -- calcolo lato orizzontale minore ipotizzando sia un trapezio
local vtNewOrthoO = Vector3d( vtOrthoO) local dDiceFaceH2 = ( 2 * EgtSurfArea( vCuts[i][j]) ) / dDiceFaceV - dDiceFaceH
local dVzLimDwnUp = dNzLimDwnUp dDiceFaceMinH = min( dDiceFaceMinH, dDiceFaceH2)
if j ~= 1 then end
vtNewOrthoO = -vtOrthoO end
if not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then dVzLimDwnUp = -0.708 end -- caso speciale con rischio cubetto sul motore
if ( i % 2) == 0 and bDangerousReliefCut and ( dMaxDepth > dDiceFaceMaxH - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN) then
local bDoubleCut = false
local dCutExtra = BD.CUT_EXTRA
if dMaxDepth < dDiceFaceMaxH + BD.CUT_EXTRA then
bDoubleCut = true
dCutExtra = - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN
end
local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
local nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT
if Proc.Tail then
nFaceUseCut1, nFaceUseCut2 = nFaceUseCut2, nFaceUseCut1
end
if bDoubleCut then
local bOk, sErr = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut1, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw, true)
if not bOk then return false, sErr end
end
local bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw)
if not bOk2 then return false, sErr2 end
-- caso standard
else
-- lavoro la faccia
for j = 1, #vCuts[i] do
-- se taglio dal basso
if bDownCut then
-- se strato pari composto da 1 o 2 elementi
if ( i % 2) == 0 and #vCuts[i] <= 2 then
-- il primo elemento prende la direzione prevista, il secondo quella opposta
local vtNewOrthoO = Vector3d( vtOrthoO)
local dVzLimDwnUp = dNzLimDwnUp
if j ~= 1 then
vtNewOrthoO = -vtOrthoO
if BD.GetNzLimDownUp then
dVzLimDwnUp = BD.GetNzLimDownUp( b3Raw, vtN, V_NULL(), true)
elseif not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then
dVzLimDwnUp = -0.708
end
end
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then return bOk, sErr end
end end
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) -- tutti gli altri casi vengono saltati
-- caso generale
else
-- in generale sta sollevato di pochissimo
local dExtraCut = -0.1
-- se tagli paralleli
if ( i % 2) == 0 then
-- se non ci sono tagli ortogonali devo affondare
if bNoPerpCuts then
dExtraCut = BD.CUT_EXTRA
-- se altrimenti tagli ortogonali invertiti, devo approfondire dello spessore lama
elseif bOrthInv then
dExtraCut = dSawThick
-- se ultimo taglio, devo affondare
elseif j == #vCuts[i] then
dExtraCut = BD.CUT_EXTRA
end
end
local dVzLimDwnUp = dNzLimDwnUp
if BD.GetNzLimDownUp then
dVzLimDwnUp = BD.GetNzLimDownUp( b3Raw, vtN, V_NULL(), true)
elseif not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then
dVzLimDwnUp = -0.708
end
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local vtOrthoOAlternative
if ( i % 2 == 0) and ( Proc.Fct == 1) and bNoPerpCuts then
vtOrthoOAlternative = - vtOrthoO
end
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bSpecialTangentLeadInOut, nil, vtOrthoOAlternative)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
-- tutti gli altri casi vengono saltati
-- caso generale
else
-- in generale sta sollevato di pochissimo
local dExtraCut = -0.1
-- se tagli paralleli
if ( i % 2) == 0 then
-- se non ci sono tagli ortogonali devo affondare
if bNoPerpCuts then
dExtraCut = BD.CUT_EXTRA
-- se altrimenti tagli ortogonali invertiti, devo approfondire dello spessore lama
elseif bOrthInv then
dExtraCut = dSawThick
-- se ultimo taglio, devo affondare
elseif j == #vCuts[i] then
dExtraCut = BD.CUT_EXTRA
end
end
local dVzLimDwnUp = dNzLimDwnUp
if not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw)
if not bOk then return bOk, sErr end
end end
end end
end end
@@ -505,9 +598,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
end end
-- lavoro la faccia -- lavoro la faccia
local vtOrthoO local vtOrthoO
if bFromBottom and dCutV < dMaxVertDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then if bFromBottom and dCutV < dMaxDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
vtOrthoO = -Z_AX() vtOrthoO = -Z_AX()
elseif bHorizCut and ( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or vtN:getX() > 0 or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then elseif bHorizCut 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() vtOrthoO = Z_AX()
elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and
vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then
@@ -670,14 +763,16 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
-- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire) -- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire)
if vCuts[i][j] then if vCuts[i][j] then
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then if not bOk then
return bOk, sErr return bOk, sErr
end end
end end
-- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire) -- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire)
if vCuts[i+1][j] then if vCuts[i+1][j] then
local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
end end
@@ -726,7 +821,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng) function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf)
-- sovramateriale di coda -- sovramateriale di coda
dOvmTail = dOvmTail or BD.OVM_MID dOvmTail = dOvmTail or BD.OVM_MID
-- ingombro del grezzo -- ingombro del grezzo
@@ -742,20 +837,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
-- se taglio di testa -- se taglio di testa
if not bForced then if not bForced then
if Proc.Head then if not BL.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail) then
-- se coincide con il taglio di separazione precedente, non va fatto
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
return true
end
-- altrimenti taglio di coda
else
-- se coincide con taglio di separazione, non va fatto
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
return true
end
end
-- se coincide con un taglio frontale non va fatto
if Proc.CutFront then
return true return true
end end
end end
@@ -767,7 +849,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
-- recupero la lavorazione -- recupero la lavorazione
local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide') local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide')
local sCutting local sCutting
sCutting, bDownHead = ML.FindCutting( sCutType, bTopHead, bDownHead) local bH2
sCutting, bH2 = ML.FindCutting( sCutType, bTopHead, bDownHead)
bDownHead = bH2 and bDownHead
if not sCutting then if not sCutting then
local sErr = 'Error : cutting not found in library' local sErr = 'Error : cutting not found in library'
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -776,12 +860,12 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
local bNoDicing = false local bNoDicing = false
-- se taglio con testa da sopra -- se taglio con testa da sopra
if not bDownHead and not bDownTurn then if not bDownHead and not bDownTurn then
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes) local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf)
bNoDicing = bNoDicing2 bNoDicing = bNoDicing2
if not bOk then return false, sErr end if not bOk then return false, sErr end
-- altrimenti taglio con testa da sotto -- altrimenti taglio con testa da sotto
else else
local bOk, sErr = MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut) local bOk, sErr = MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return false, sErr end if not bOk then return false, sErr end
end end
-- Aggiornamento ingombro (se vero taglio o richiesto) -- Aggiornamento ingombro (se vero taglio o richiesto)
+26 -43
View File
@@ -1,6 +1,8 @@
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2022/07/11 -- ProcessDoubleCut.lua by Egaltech s.r.l. 2023/03/22
-- Gestione calcolo doppi tagli di lama per Travi -- Gestione calcolo doppi tagli di lama per Travi
-- 2022/08/29 Implementata la fresatura dal lato per tagli problematici per PF1250 -- 2022/08/29 Implementata la fresatura dal lato per tagli problematici per PF1250.
-- 2023/03/22 Eliminata SetOpenSide locale, si usa quella di libreria.
-- 2023/12/07 Correzione in Classify in scelta ribaltamento trave quando si è in condizioni downUp
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessDoubleCut = {} local ProcessDoubleCut = {}
@@ -53,10 +55,22 @@ function ProcessDoubleCut.Classify( Proc, b3Raw)
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN) local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN)
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp) local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
if bDownCut then if bDownCut then
-- recupero i dati della lama
local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide')
local sCutting = ML.FindCutting( sCutType, true, false)
local dMaxDepth = 0
local dMaxMat = 0
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
end
end
-- calcolo l'ingombro orizzontale della faccia -- calcolo l'ingombro orizzontale della faccia
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, nFac) local _, DimH = BL.GetFaceHvRefDim( Proc.Id, nFac)
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli) -- 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 then 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 return true, true
end end
end end
@@ -160,7 +174,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
-- Inserisco la lavorazione del lato opposto -- Inserisco la lavorazione del lato opposto
@@ -183,7 +197,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch2Id, false)
return false, sErr return false, sErr
end end
return true return true
@@ -222,39 +236,6 @@ local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bP
return bUsePocketing, sPocketing, dMaxDepth, dToolDiam return bUsePocketing, sPocketing, dMaxDepth, dToolDiam
end end
---------------------------------------------------------------------
local function SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
-- fondo tra loro le curve compatibili
EgtMergeCurvesInCurveCompo( nPathInt)
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt)
local pLastPIni, pLastPEnd
-- faccio una copia della curva e la esplodo
if nStartIdEnt then
-- ciclo i lati della curva e controllo per ognuno se giace in uno dei piani limite del pezzo: se sì allora il lato è aperto
for i = 1, nNumEnt do
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB)
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB)
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
-- scrivo nelle proprietà della curva quali sono i lati aperti
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
if #sActInfo > 0 then
-- se ci sono già altri lati aperti
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
else
-- se è l'unico
EgtSetInfo( nPathInt, 'OPEN', (i-1))
end
end
end
end
return false
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Solid) local function MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Solid)
local nFirstMachId local nFirstMachId
@@ -287,7 +268,7 @@ local function MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Sol
-- e assegno l'estrusione -- e assegno l'estrusione
nPathInt = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId) nPathInt = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId)
EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB) EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB)
SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId) BL.SetOpenSide( nPathInt, b3Solid)
-- variabili per parametri lavorazione -- variabili per parametri lavorazione
local dMachDepth local dMachDepth
local dElev = 0 local dElev = 0
@@ -540,7 +521,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD) local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD)
-- applico lavorazione -- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
@@ -552,7 +534,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD) local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD)
-- applico lavorazione -- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
+8 -6
View File
@@ -1,6 +1,7 @@
-- ProcessDovetail.lua by Egaltech s.r.l. 2021/02/04 -- ProcessDovetail.lua by Egaltech s.r.l. 2021/02/04
-- Gestione calcolo giunzione coda di rondine -- Gestione calcolo giunzione coda di rondine
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe) -- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessDovetail = {} local ProcessDovetail = {}
@@ -280,7 +281,7 @@ function ProcessDovetail.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
end end
-- deve avere la normale principale diretta verso la testa -- deve avere la normale principale diretta verso la testa
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL) local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId) local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
if vtN:getZ() < BD.NZ_MINA and nFacInd2 then if vtN:getZ() < BD.NZ_MINA and nFacInd2 then
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT) ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
@@ -341,7 +342,7 @@ function ProcessDovetail.IsTailFeature( Proc, b3Raw)
end end
end end
-- deve avere la normale principale diretta verso la coda -- deve avere la normale principale diretta verso la coda
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId) local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
if vtN:getZ() < BD.NZ_MINA and nFacInd2 then if vtN:getZ() < BD.NZ_MINA and nFacInd2 then
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT) ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
@@ -933,10 +934,10 @@ local function MachSideFaces( Proc, nPartId, b3Raw, nFacetCnt, bForceUseRough,
end end
else else
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa -- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, sin(dSideAngle)) nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, sin(dSideAngle))
if not nFacInd or nFacInd < 0 then if not nFacInd or nFacInd < 0 then
-- provo eliminando i sottosquadra -- provo eliminando i sottosquadra
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, -2) nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, -2)
if not nFacInd or nFacInd < 0 then if not nFacInd or nFacInd < 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MachSideFaces could not find reference face' local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MachSideFaces could not find reference face'
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -1432,7 +1433,8 @@ local function MakeAuxCut( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol
return true return true
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail} local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
-- imposto la nota nel gruppo aggiuntivo di lavorazione per evitare di tagliare una seconda volta -- imposto la nota nel gruppo aggiuntivo di lavorazione per evitare di tagliare una seconda volta
@@ -1683,7 +1685,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol
end end
-- determino il massimo affondamento con l'utensile -- determino il massimo affondamento con l'utensile
local sMchFind = 'Long2Cut' local sMchFind = 'Long2Cut'
sMilling = ML.FindMilling( sMchFind) local sMilling = ML.FindMilling( sMchFind)
if not sMilling then if not sMilling then
local sErr = 'Milling not found in library : Error on Dovetail ' .. tostring( Proc.Id) local sErr = 'Milling not found in library : Error on Dovetail ' .. tostring( Proc.Id)
EgtOutLog( sErr) EgtOutLog( sErr)
+134 -25
View File
@@ -1,4 +1,4 @@
-- ProcessDrill.lua by Egaltech s.r.l. 2022/11/30 -- ProcessDrill.lua by Egaltech s.r.l. 2023/11/06
-- Gestione calcolo forature per Travi -- Gestione calcolo forature per Travi
-- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile. -- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile.
-- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto. -- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto.
@@ -16,6 +16,14 @@
-- 2022/10/25 Nella funzione Split aggiunto il controllo che le facce di ingresso e uscita siano differenti (potrebbe succedere per fori molto corti). Modifica importatore in futuro. -- 2022/10/25 Nella funzione Split aggiunto il controllo che le facce di ingresso e uscita siano differenti (potrebbe succedere per fori molto corti). Modifica importatore in futuro.
-- 2022/11/23 Aggiunta la gestione dei fori con angolo < 30 gradi, per i quali si usa la testa della macchina per accorciare l'utile di lavoro. -- 2022/11/23 Aggiunta la gestione dei fori con angolo < 30 gradi, per i quali si usa la testa della macchina per accorciare l'utile di lavoro.
-- 2022/12/28 Implementata gestione forature in doppio -- 2022/12/28 Implementata gestione forature in doppio
-- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax.
-- 2023/07/28 Aggiunta gestione rinvio 90deg solo per forature da sotto esattamente verticali.
-- 2023/09/26 Se errore in applicazione lavorazione si inverte e riprova solo se foratura singola su foro aperto.
-- 2023/11/06 Migliorata gestione dei fori con AngularTransmission.
-- 2024/03/13 Aggiunta gestione Predrill
-- 2024/03/18 Per Predrill corretta direzione estrusione per fori con direzione verso il basso
-- 2024/09/04 Gestione dipendenza foro-tasca in caso di fase con pezzo ribaltato
-- 2024/09/10 In GetData corretta gestione modifica diametro foro
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessDrill = {} local ProcessDrill = {}
@@ -92,20 +100,22 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Recupero dati foro e adattamento se speciale -- Recupero dati foro e adattamento se speciale
function ProcessDrill.GetData( Proc, b3Raw) function ProcessDrill.GetData( Proc, b3Raw)
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
-- verifico se foro da adattare -- verifico se foro da adattare
if EgtExistsInfo( Proc.Id, 'DiamUser') then if EgtExistsInfo( Proc.Id, 'DiamUser') then
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') local nNewAuxId
if AuxId then AuxId = AuxId + Proc.Id end if AuxId then nNewAuxId = AuxId + Proc.Id end
if AuxId and EgtGetType( AuxId) == GDB_TY.CRV_ARC and BD.USER_HOLE_DIAM and BD.USER_HOLE_DIAM > 1 then if AuxId and EgtGetType( nNewAuxId) == GDB_TY.CRV_ARC and BD.USER_HOLE_DIAM and BD.USER_HOLE_DIAM > 1 then
EgtModifyArcRadius( AuxId, BD.USER_HOLE_DIAM / 2) EgtModifyArcRadius( nNewAuxId, BD.USER_HOLE_DIAM / 2)
end end
end end
-- recupero diametro -- recupero diametro e lunghezza
local dDiam = EgtGetInfo( Proc.Id, 'P12', 'd') or 0 local dDiam = EgtGetInfo( Proc.Id, 'P12', 'd') or 0
local dLen = abs( EgtCurveThickness( Proc.Id + AuxId)) or 0
-- recupero faccia di entrata e uscita -- recupero faccia di entrata e uscita
local nFcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0 local nFcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0
local nFce = EgtGetInfo( Proc.Id, 'FCE', 'i') or 0 local nFce = EgtGetInfo( Proc.Id, 'FCE', 'i') or 0
return dDiam, nFcs, nFce return dDiam, dLen, nFcs, nFce
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
@@ -130,13 +140,83 @@ function ProcessDrill.Split( Proc, b3Raw)
-- restituisco se va fatto in doppio (solo fori orizzontali) -- restituisco se va fatto in doppio (solo fori orizzontali)
local bHoriz = ( abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and local bHoriz = ( abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and
( abs( vtExtr:getY()) * b3Raw:getDimZ() > abs( vtExtr:getZ()) * b3Raw:getDimY() or Proc.Fce == 5 or Proc.Fce == 6)) ( abs( vtExtr:getY()) * b3Raw:getDimZ() > abs( vtExtr:getZ()) * b3Raw:getDimY() or Proc.Fce == 5 or Proc.Fce == 6))
local bAngTransm = ( BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreSameOrOppositeVectorApprox( vtExtr, Z_AX()))
local bSlant = ( abs( vtExtr:getX()) > BD.DRILL_VX_MAX) local bSlant = ( abs( vtExtr:getX()) > BD.DRILL_VX_MAX)
return ( bOpen and ( bHoriz or BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and not bSlant) return ( bOpen and ( bHoriz or BD.ROT90 or BD.DOWN_HEAD or BD.TURN or bAngTransm) and not bSlant)
end
---------------------------------------------------------------------
-- Verifica se bisogna aggiungere un preforo
function ProcessDrill.IsPredrillNeeded( Proc)
local dDepthPredrill = EgtGetInfo( Proc.Id, 'Q03', 'i')
-- se non c'è la Q oppure se zero, allora non è da fare
if not dDepthPredrill or dDepthPredrill <= 0 then
return false
-- altrimenti Predrill da fare
else
return true
end
end
---------------------------------------------------------------------
-- Aggiunge il preforo alla feature passata
function ProcessDrill.AddPredrillFromDrillProc( Proc)
local dDepthPredrill = EgtGetInfo( Proc.Id, 'Q03', 'i')
-- foro più corto del preforo, allora è il foro che diventa il preforo stesso
if Proc.Len <= dDepthPredrill then
Proc.IsPredrill = true
Proc.IsPredrillOf = Proc.Id
return false
-- altrimenti creo un nuovo process
else
-- recupero gruppo per geometria aggiuntiva
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
-- recupero e verifico l'entità foro
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
local ptCen = EgtCP( Proc.Id + AuxId, GDB_RT.GLOB)
local vtExtr = EgtCurveExtrusion( Proc.Id + AuxId, GDB_RT.GLOB)
-- copio foro originale
local nPreHoleId = EgtCopyGlob( Proc.Id, nAddGrpId)
local nPreHoleAux = EgtCopyGlob( Proc.Id + AuxId, nAddGrpId)
-- se foro invertito sposto geometria dall'altro lato del foro e inverto direzione estrusione
if Proc.Flg == -2 then
local vsExtr = -vtExtr * Proc.Len
EgtMove( nPreHoleAux, vsExtr, GDB_RT.GLOB)
EgtModifyCurveExtrusion( nPreHoleAux, -vtExtr, GDB_RT.GLOB)
end
EgtModifyCurveThickness( nPreHoleAux, -dDepthPredrill)
local PredrillProc = {}
-- definisco dati seconda parte
PredrillProc.PartId = Proc.PartId
PredrillProc.Id = nPreHoleId
PredrillProc.Grp = Proc.Grp
PredrillProc.Prc = Proc.Prc
PredrillProc.Flg = 1
PredrillProc.Box = Proc.Box
PredrillProc.Fct = Proc.Fct
PredrillProc.Diam = Proc.Diam
PredrillProc.Len = dDepthPredrill
PredrillProc.Head = Proc.Head
PredrillProc.Tail = Proc.Tail
PredrillProc.Fcs = Proc.Fcs
PredrillProc.Fce = 0 -- il preforo è sempre chiuso, non ha faccia di uscita
PredrillProc.CutId = Proc.CutId
PredrillProc.TaskId = Proc.TaskId
PredrillProc.AdjId = Proc.AdjId
PredrillProc.MainId = Proc.MainId
PredrillProc.IsPredrill = true
PredrillProc.IsPredrillOf = Proc.Id
return true, PredrillProc
end
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Classificazione della feature -- Classificazione della feature
function ProcessDrill.Classify( Proc, b3Raw) function ProcessDrill.Classify( Proc, b3Raw, sDownOrSideOrStd)
-- recupero e verifico l'entità foro -- recupero e verifico l'entità foro
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0 local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
if AuxId then AuxId = AuxId + Proc.Id end if AuxId then AuxId = AuxId + Proc.Id end
@@ -155,18 +235,40 @@ function ProcessDrill.Classify( Proc, b3Raw)
ptCen = ptCen + vtExtr * dLen ptCen = ptCen + vtExtr * dLen
end end
end end
-- verifico se foro annegato nel pezzo e quindi non lavorabile
if Proc.Fcs == 0 and Proc.Fce == 0 then
return false, false, false
end
-- verifico se troppo inclinato e quindi non lavorabile -- verifico se troppo inclinato e quindi non lavorabile
if not ( Proc.Fcs == 5 or Proc.Fcs == 6 or Proc.Fce == 5 or Proc.Fce == 6) and abs( vtExtr:getX()) > BD.DRILL_VX_MAX then if not ( Proc.Fcs == 5 or Proc.Fcs == 6 or Proc.Fce == 5 or Proc.Fce == 6) and abs( vtExtr:getX()) > BD.DRILL_VX_MAX then
return false, false, false return false, false, false
end end
local bOpen = ( Proc.Fce ~= 0) local bOpen = ( Proc.Fce ~= 0)
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and ( Proc.Flg == 2 or Proc.Flg == -2)))) local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and abs( Proc.Flg) == 2)))
local bAngTransm = ( BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreSameOrOppositeVectorApprox( vtExtr, Z_AX()))
-- se ci sono delle dipendenze da altre feature da rispettare
if sDownOrSideOrStd then
if sDownOrSideOrStd == 'DOWN' then
if vtExtr:getZ() < - BD.DRILL_VZ_MIN then
Proc.Down = true
return true
end
end
return false
end
-- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco -- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco
if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then
if not bOpen then if not bOpen then
return true, true, false -- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione
if bAngTransm then
return true, false, false
else
return true, true, false
end
else else
return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN or bAngTransm), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN)
end end
else else
return true, false, false return true, false, false
@@ -236,19 +338,21 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
end end
local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0) local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)
-- verifico possibilità di foratura da sotto -- verifico possibilità di foratura da sotto
local bDownDrill = ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true)) local bDownDrill = ( BD.TURN or ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true)))
-- se presente rinvio angolare
local bDrillAngTrasm = ( BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreOppositeVectorApprox( vtExtr, Z_AX()))
-- verifico che il foro non sia fattibile solo da sotto -- verifico che il foro non sia fattibile solo da sotto
local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill) local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill and not bDrillAngTrasm)
if bToInvert and ( not bOpen or Proc.Flg ~= 1) then if bToInvert and ( not bOpen or Proc.Flg ~= 1) then
local sErr = 'Error : drilling from bottom impossible' local sErr = 'Error : drilling from bottom impossible'
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- se non già richiesta inversione e invertibile -- se non già richiesta inversione e invertibile
if not bToInvert and Proc.Flg == 1 and ( -vtExtr:getZ() >= BD.DRILL_VZ_MIN or bDownDrill) then if not bToInvert and Proc.Flg == 1 and -vtExtr:getZ() >= BD.DRILL_VZ_MIN then
-- se il foro è cieco o troppo inclinato all'inizio, lo inverto -- se il foro è cieco o dalla faccia sotto o troppo inclinato all'inizio, lo inverto
local _, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid) local nFac, CosB, _ = GetHoleStartData( ptCen, vtExtr, b3Solid)
if Proc.Fcs == 0 or ( CosB > BD.DRILL_VX_MAX and bOpen) then if Proc.Fcs == 0 or (( nFac == 2 or CosB > BD.DRILL_VX_MAX) and bOpen) then
bToInvert = true bToInvert = true
end end
end end
@@ -272,15 +376,15 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.421) local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.421)
local bExcludeH2 = false local bExcludeH2 = false
if Proc.Double and Proc.Double > 0 then if Proc.Double and Proc.Double > 0 then
bMillUp = true -- bMillUp = true
bDrillDown = false bDrillDown = false
bExcludeH2 = true bExcludeH2 = true
end end
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante -- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
-- recupero la lavorazione -- recupero la lavorazione
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2) local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
if not sDrilling and dCheckDepth then if not sDrilling and dCheckDepth then
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2) sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
if sDrilling then dCheckDepth = nil end if sDrilling then dCheckDepth = nil end
end end
if not sDrilling then if not sDrilling then
@@ -437,7 +541,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
dMaxElev = dMaxDepth dMaxElev = dMaxDepth
end end
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Drill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = EgtIf( EgtStartsWith( sType, 'Predrill'), 'Predrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sDrilling) local nMchId = EgtAddMachining( sName, sDrilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
@@ -447,14 +551,16 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- eventuale inversione -- eventuale inversione
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then if sType == 'Drill' or sType == 'Drill_H2' or sType == 'Drill_AT' or sType == 'AngleDrill' or sType == 'Predrill' then
EgtSetMachiningParam( MCH_MP.INVERT, bToInvert) EgtSetMachiningParam( MCH_MP.INVERT, bToInvert)
else else
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert) EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert)
end end
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE local nSCC = MCH_SCC.NONE
if not BD.C_SIMM and not BD.TURN then if bDrillAngTrasm then
nSCC = MCH_SCC.ADIR_NEAR
elseif not BD.C_SIMM and not BD.TURN then
nSCC = MCH_SCC.ADIR_YM nSCC = MCH_SCC.ADIR_YM
if AreSameVectorApprox( vtExtr, Z_AX()) then if AreSameVectorApprox( vtExtr, Z_AX()) then
nSCC = MCH_SCC.ADIR_YM nSCC = MCH_SCC.ADIR_YM
@@ -494,11 +600,14 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
-- se lavorazione in doppio -- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then if Proc.Double and Proc.Double > 0 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double) sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= Proc.PrevDouble then
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
end
end end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo -- eseguo
local bOk = ML.ApplyMachining( true, false) local bOk = ML.ApplyMachining( true, false)
if not bOk and bDownDrill then if not bOk and bDownDrill and bOpen and abs( Proc.Flg) == 1 then
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
else else
+30 -8
View File
@@ -1,4 +1,4 @@
-- ProcessDtMortise.lua by Egaltech s.r.l. 2022/08/18 -- ProcessDtMortise.lua by Egaltech s.r.l. 2023/05/11
-- Gestione calcolo mortase a coda di rondine per Travi -- Gestione calcolo mortase a coda di rondine per Travi
-- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa. -- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa.
-- 2021/04/08 Miglioria scelta lavorazione in presenza di testa da sotto. -- 2021/04/08 Miglioria scelta lavorazione in presenza di testa da sotto.
@@ -9,6 +9,9 @@
-- 2022/08/18 Migliorato calcolo dello step. -- 2022/08/18 Migliorato calcolo dello step.
-- 2022/09/29 Aggiunto riconoscimento della sola feature laterale. -- 2022/09/29 Aggiunto riconoscimento della sola feature laterale.
-- 2022/12/28 Aggiunta gestione lavorazione in doppio. -- 2022/12/28 Aggiunta gestione lavorazione in doppio.
-- 2023/03/06 Aggiunta forzatura ingresso fuori dal grezzo con pocket.
-- 2023/03/28 Corretto calcolo larghezza mortasa quando più larga che lunga.
-- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessDtMortise = {} local ProcessDtMortise = {}
@@ -176,13 +179,17 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- determino l'altezza della mortasa (0=faccia di fondo) -- ne determino l'asse
local rfDtMrt, dLenMrt, dWidthMrt = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_RT.GLOB)
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
local dAltMort = b3DtMrt:getDimZ()
-- ne determino l'asse (valido se non pocket)
local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB) local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB)
vtAx:normalize() vtAx:normalize()
-- determino l'altezza della mortasa (0=faccia di fondo)
local rfDtMrt, dLenMrt, dWidthMrt = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_RT.GLOB)
if abs( rfDtMrt:getVersY() * vtAx) > abs( rfDtMrt:getVersX() * vtAx) then
rfDtMrt:rotate( rfDtMrt:getOrigin(), rfDtMrt:getVersZ(), 90)
dLenMrt, dWidthMrt = dWidthMrt, dLenMrt
end
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
local dAltMort = b3DtMrt:getDimZ()
-- verifico se di tipo pocket -- verifico se di tipo pocket
local bPocket = ( EgtGetInfo( Proc.Id, 'P05', 'i') == 1) local bPocket = ( EgtGetInfo( Proc.Id, 'P05', 'i') == 1)
if bPocket then bMakeAntiSplitPath = false end if bPocket then bMakeAntiSplitPath = false end
@@ -203,7 +210,8 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB)
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} 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) local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
@@ -283,7 +291,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- se con tasca, la lavoro -- se con tasca, la lavoro (mai in doppio)
if bPocket then if bPocket then
-- recupero il contorno della tasca (seconda curva ausiliaria) -- recupero il contorno della tasca (seconda curva ausiliaria)
local sVal = EgtGetInfo( Proc.Id, 'AUXID') local sVal = EgtGetInfo( Proc.Id, 'AUXID')
@@ -344,6 +352,8 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM) nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
end end
end end
-- flag di mirror precedente aggiornabile localmente
local nMyPrevDouble = Proc.PrevDouble
-- se parametro interno abilitato e il percorso non è chiuso, aggiungo percorso e lavorazione antischeggia -- se parametro interno abilitato e il percorso non è chiuso, aggiungo percorso e lavorazione antischeggia
if bMakeAntiSplitPath and not EgtCurveIsClosed( AuxId) then if bMakeAntiSplitPath and not EgtCurveIsClosed( AuxId) then
-- recupero gruppo per geometria addizionale -- recupero gruppo per geometria addizionale
@@ -425,6 +435,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- se lavorazione in doppio -- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then if Proc.Double and Proc.Double > 0 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double) sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= nMyPrevDouble then
nMyPrevDouble = Proc.Double
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
end
end end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo -- eseguo
@@ -503,9 +517,17 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- dichiaro massima elevazione e assenza sfridi per VMill -- dichiaro massima elevazione e assenza sfridi per VMill
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';' local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
if bPocket then
sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3)
end
-- se lavorazione in doppio -- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then if Proc.Double and Proc.Double > 0 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double) sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= nMyPrevDouble then
nMyPrevDouble = Proc.Double
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
end
end end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo -- eseguo
+51 -61
View File
@@ -1,7 +1,11 @@
-- ProcessTenon.lua by Egaltech s.r.l. 2022/06/07 -- ProcessTenon.lua by Egaltech s.r.l. 2023/03/28
-- Gestione calcolo tenone a coda di rondine per Travi -- Gestione calcolo tenone a coda di rondine per Travi
-- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa. -- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa.
-- 2022/04/14 Aumentati un poco i limiti di orientamento verso il basso per FAST e PF. -- 2022/04/14 Aumentati un poco i limiti di orientamento verso il basso per FAST e PF.
-- 2023/02/08 Aumentato il range per cui i tenoni vengono lavorati in sottosquadro.
-- 2023/03/27 Migliorate condizioni scelta pretaglio con lama o fresa; gestione unificata con ProcessTenon.
-- 2023/03/28 Corretta gestione faccia di base quando divisa in più parti per distanza massima da lavorare.
-- 2024/02/29 Aumentato numero passaggi CR su tenone. Massimo 8
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessDtTenon = {} local ProcessDtTenon = {}
@@ -9,6 +13,7 @@ local ProcessDtTenon = {}
-- Include -- Include
require( 'EgtBase') require( 'EgtBase')
local BL = require( 'BeamLib') local BL = require( 'BeamLib')
local Fbp = require( 'FaceByPocket')
local Cut = require( 'ProcessCut') local Cut = require( 'ProcessCut')
EgtOutLog( ' ProcessTenon started', 1) EgtOutLog( ' ProcessTenon started', 1)
@@ -38,14 +43,17 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
-- se tenone praticamente in asse, accetto fino a -30 deg -- se tenone praticamente in asse, accetto fino a -30 deg
if abs( vtN:getY()) < 0.088 then if abs( vtN:getY()) < 0.088 then
return ( vtN:getZ() >= -0.51) return ( vtN:getZ() >= -0.51)
-- se macchina Fast, pezzo stretto e inclinazione laterale non eccessiva, accetto fino a -27deg
elseif ( not BD.C_SIMM) and abs( vtN:getY()) < 0.5 and b3Raw:getDimY() < 150.1 then
return ( vtN:getZ() >= -0.454)
-- altrimenti accetto fino a -21deg -- altrimenti accetto fino a -21deg
else else
return ( vtN:getZ() >= -0.359) return ( vtN:getZ() >= -0.359)
end end
-- se trave medio-bassa -- se trave medio-bassa
elseif b3Raw:getDimZ() < 281 then elseif b3Raw:getDimZ() < 281 then
-- se tenone praticamente in asse, accetto fino a -25 deg -- se tenone praticamente in asse oppure pezzo stretto e inclinazione laterale non eccessiva, accetto fino a -25 deg
if abs( vtN:getY()) < 0.088 then if abs( vtN:getY()) < 0.088 or ( abs( vtN:getY()) < 0.5 and b3Raw:getDimY() < 150.1) then
return ( vtN:getZ() >= -0.422) return ( vtN:getZ() >= -0.422)
-- altrimenti, accetto fino a -15 deg -- altrimenti, accetto fino a -15 deg
else else
@@ -163,6 +171,9 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- ne determino l'asse -- ne determino l'asse
local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB) local vtAx = EgtEV( AuxId, GDB_RT.GLOB) - EgtSV( AuxId, GDB_RT.GLOB)
vtAx:normalize() vtAx:normalize()
-- abilitazione lavorazione da sotto
local bMillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
local bMillDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174)
-- se tenone inclinato o non esattamente alle estremità, necessario taglio di lama sulla testa -- se tenone inclinato o non esattamente alle estremità, necessario taglio di lama sulla testa
if not AreSameOrOppositeVectorApprox( vtN, X_AX()) or if not AreSameOrOppositeVectorApprox( vtN, X_AX()) or
( Proc.Box:getMax():getX() < b3Raw:getMax():getX() - dOvmHead - 100 * GEO.EPS_SMALL and ( Proc.Box:getMax():getX() < b3Raw:getMax():getX() - dOvmHead - 100 * GEO.EPS_SMALL and
@@ -179,63 +190,34 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if AddId then if AddId then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId) EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se pezzo piccolo, in coda e piano inclinato attorno a Z applico svuotatura -- solo per macchine tipo PF e simili: se pezzo piccolo, in coda, piano inclinato attorno a Z e inclinato verso il basso applico svuotatura
if b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getX() < 0 and abs( vtExtr:getY()) > 0.173 then if b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getX() < 0 and abs( vtExtr:getY()) > 0.173 and vtExtr:getZ() < -0.1 and BD.C_SIMM then
local sPocketing = ML.FindPocketing( 'OpenPocket') -- recupero la lavorazione
local dMaxDepth = 100 local sPocketing = ML.FindPocketing( 'OpenPocket', nil, nil, nil, not bMillDown, bMillDown)
local dStep = 30 if not sPocketing then
local nSurfStep local sErr = 'Error : pocketing '..sPockType..' not found in library'
-- acquisisco i dati necessari dall'utensile EgtOutLog( sErr)
if EgtMdbSetCurrMachining( sPocketing) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
dStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP) or dStep
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
-- acquisisco elevazione
local dElev = BL.GetFaceElevation( AddId, 0, nPartId)
nSurfStep = ceil( dElev / dMaxDepth)
dSurfStep = dElev / nSurfStep
local bOk = true
local sErr
-- copio superfice al passo superfice e ci applico la lavorazione
for i = nSurfStep, 2, -1 do
local nAddIdTmp = EgtSurfTmPlaneInBBox( nAddGrpId, ptC+((dSurfStep*(i-1))*vtN), vtN, b3Solid, GDB_RT.GLOB)
if nAddIdTmp then
EgtSetName( nAddIdTmp, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( nAddIdTmp, 'TASKID', Proc.TaskId)
-- aggiungo lavorazione
bOk, sErr = ApplyPocket( Proc, sPocketing, i, (dSurfStep + 0), nAddIdTmp, vtExtr)
if not bOk then
break
end
end
end
if not bOk then
return false, sErr return false, sErr
end end
-- faccio ultima superfice -- eseguo le svuotature necessarie
bOk, sErr = ApplyPocket( Proc, sPocketing, 1, EgtIf( nSurfStep > 1, ( dSurfStep + 0), 0), AddId, vtExtr) local bOk, sErr = Fbp.Make( Proc, AddId, 0, sPocketing, nPartId, b3Solid)
if not bOk then if not bOk then
return false, sErr return false, sErr
end end
-- altrimenti applico taglio di lama -- altrimenti applico taglio di lama
else else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} 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) local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
end end
end end
-- abilitazione lavorazione da sotto
local bMillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
local bMillDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174)
-- recupero la lavorazione -- recupero la lavorazione
local sMillType = 'DtTenon' local sMillType = 'DtTenon'
local sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown) local sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
if not sMilling then if not sMilling then
local sErr = 'Error : milling not found in library' local sErr = 'Error : milling not found in library'
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -261,28 +243,35 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
return false, sErr return false, sErr
end end
-- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0) -- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0)
local dMaxDist = 0 local dMaxDist
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( Proc.Id, 0, EgtGetParent( Proc.Id)) for i = 0, Proc.Fct - 1 do
if nLoopId then local ptFC, vtFN = EgtSurfTmFacetCenter( Proc.Id, i, GDB_ID.ROOT)
local dUmin, dUmax = EgtCurveDomain( nLoopId) if not AreSameVectorApprox( vtFN, vtN) or abs( ( ptFC - ptBC) * vtN) > 100 * GEO.EPS_SMALL then
for dU = dUmin, dUmax do break
local ptP = EgtUP( nLoopId, dU, GDB_ID.ROOT) end
local ptNear = EgtNP( AuxId, ptP, GDB_ID.ROOT) local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( Proc.Id, i, EgtGetParent( Proc.Id))
local dDist = dist( ptP, ptNear) if nLoopId then
if dDist > dMaxDist then local dUmin, dUmax = EgtCurveDomain( nLoopId)
dMaxDist = dDist for dU = dUmin, dUmax do
local ptP = EgtUP( nLoopId, dU, GDB_ID.ROOT)
local ptNear = EgtNP( AuxId, ptP, GDB_ID.ROOT)
local dDist = dist( ptP, ptNear)
if not dMaxDist or dDist > dMaxDist then
dMaxDist = dDist
end
end
for j = 1, nLoopCnt do
EgtErase( nLoopId + j - 1)
end end
end end
for i = 1, nLoopCnt do end
EgtErase( nLoopId + i - 1) if not dMaxDist then
end
else
local b3DtAux = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frDtTen) local b3DtAux = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frDtTen)
dMaxDist = 2 * ( b3DtTen:getRadius() - b3DtAux:getRadius()) dMaxDist = 2 * ( b3DtTen:getRadius() - b3DtAux:getRadius())
end end
EgtOutLog( 'MaxDist=' .. EgtNumToString( dMaxDist, 3), 3) EgtOutLog( 'MaxDist=' .. EgtNumToString( dMaxDist, 3), 3)
-- Cicli di lavorazione (max 6) -- Cicli di lavorazione (max 8)
local MAX_PASS = 6 local MAX_PASS = 8
local nStep = min( ceil( dMaxDist / ( 0.7 * dTDiam)), MAX_PASS) local nStep = min( ceil( dMaxDist / ( 0.7 * dTDiam)), MAX_PASS)
local dStep = min( dMaxDist, 0.7 * dTDiam * MAX_PASS) / nStep local dStep = min( dMaxDist, 0.7 * dTDiam * MAX_PASS) / nStep
for i = nStep, 1, -1 do for i = nStep, 1, -1 do
@@ -299,7 +288,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- sistemo i parametri -- sistemo i parametri
local dOffs = ( i - 1) * dStep local dOffs = ( i - 1) * dStep
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dDtTenH, 1) .. ';') local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dDtTenH, 1)) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- sistemo il lato e la direzione di lavoro -- sistemo il lato e la direzione di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT)) EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false)) EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
+111 -30
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/11/03 -- ProcessFreeContour.lua by Egaltech s.r.l. 2023/03/03
-- Gestione calcolo profilo libero per Travi -- Gestione calcolo profilo libero per Travi
-- 2022/08/23 Aggiunta la funzione MakeByMark per la gestione del caso P13=10 -- 2022/08/23 Aggiunta la funzione MakeByMark per la gestione del caso P13=10
-- 2022/09/21 In MakeByMill aggiunto messaggio per elevazione non raggiunta. -- 2022/09/21 In MakeByMill aggiunto messaggio per elevazione non raggiunta.
@@ -6,7 +6,11 @@
-- 2022/11/09 Aggiunta la gestione della chiamata della FreeContour da parte della SimpleScarf. -- 2022/11/09 Aggiunta la gestione della chiamata della FreeContour da parte della SimpleScarf.
-- 2022/11/24 In MakeByMill aggiunta la lavorazione sopra/sotto nel caso di testa sotto -- 2022/11/24 In MakeByMill aggiunta la lavorazione sopra/sotto nel caso di testa sotto
-- In MakeByMill se BeamData forza lettura codolo da Q questo viene sempre fatto indipendentemente dalle dimensioni della feature -- In MakeByMill se BeamData forza lettura codolo da Q questo viene sempre fatto indipendentemente dalle dimensioni della feature
-- 2023/03/03 Corretta MakeByMark ( non definiti b3Raw e b3Aux ).
-- 2023/06/21 In CalcSpecialAdd modificato l'angolo minimo da 5 a 15 deg.
-- 2023/07/28 In MakeByPocket aggiunta Q06 per specificare un eventuale offset radiale del contorno.
-- 2024/03/05 In MakebyPocket aggiunta lavorazione di smusso
-- In MakeByMill eliminata doppia lavorazione smusso se contorno non passante
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessFreeContour = {} local ProcessFreeContour = {}
@@ -26,12 +30,14 @@ local Q_DIM_STRIP = 'Q01' -- d
local Q_DEPTH_CHAMFER = 'Q02' -- d local Q_DEPTH_CHAMFER = 'Q02' -- d
local Q_OVERMAT_FOR_FINISH = 'Q03' -- d local Q_OVERMAT_FOR_FINISH = 'Q03' -- d
local Q_ONLY_CHAMFER = 'Q00' -- i local Q_ONLY_CHAMFER = 'Q00' -- i
local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Riconoscimento della feature -- Riconoscimento della feature
function ProcessFreeContour.Identify( Proc) function ProcessFreeContour.Identify( Proc)
return ( ( Proc.Grp == 0 or Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 250) return ( ( Proc.Grp == 0 or Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 250)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Verifica se feature di testa -- Verifica se feature di testa
function ProcessFreeContour.IsHeadFeature( Proc, b3Raw, dCurrOvmH) function ProcessFreeContour.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
@@ -206,8 +212,8 @@ local function CalcSpecialAdd( nCrv, bStartVsEnd, dToolDiam)
-- tangenti prima e dopo il punto interno -- tangenti prima e dopo il punto interno
local vtPrev = EgtUV( nCrv, nIn, -1) local vtPrev = EgtUV( nCrv, nIn, -1)
local vtNext = EgtUV( nCrv, nIn, 1) local vtNext = EgtUV( nCrv, nIn, 1)
-- se c'è perdita di tangenza (delta angolare oltre i 5 gradi) -- se c'è perdita di tangenza (delta angolare oltre i 15 gradi)
if vtPrev * vtNext < 0.996 then if vtPrev * vtNext < 0.966 then
-- lunghezza del tratto -- lunghezza del tratto
local ptP0 = EgtUP( nCrv, nOut) local ptP0 = EgtUP( nCrv, nOut)
local ptP1 = EgtUP( nCrv, nIn) local ptP1 = EgtUP( nCrv, nIn)
@@ -290,16 +296,18 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
local bCross = false local bCross = false
if abs( vtExtr:getX()) < 0.707 then if abs( vtExtr:getX()) < 0.707 then
if abs( vtExtr:getY()) > abs( vtExtr:getZ()) then if abs( vtExtr:getY()) > abs( vtExtr:getZ()) then
-- se è passante
if b3Aux:getDimY() > b3Raw:getDimY() - 1.0 then if b3Aux:getDimY() > b3Raw:getDimY() - 1.0 then
bCross = true bCross = true
dDepth = min( dDepth, b3Raw:getDimY() / abs( vtExtr:getY())) dDepth = min( dDepth, b3Raw:getDimY() / abs( vtExtr:getY()))
end end
if bDown then if bDown then
nSide = -1 nSide = -1
else else
nSide = 1 nSide = 1
end end
else else
-- se è passante
if b3Aux:getDimZ() > b3Raw:getDimZ() - 1.0 then if b3Aux:getDimZ() > b3Raw:getDimZ() - 1.0 then
bCross = true bCross = true
dDepth = min( dDepth, b3Raw:getDimZ() / abs( vtExtr:getZ())) dDepth = min( dDepth, b3Raw:getDimZ() / abs( vtExtr:getZ()))
@@ -369,28 +377,28 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham and Proc.Prc ~= 70 then if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham and Proc.Prc ~= 70 then
local bDoubleCham = false local bDoubleCham = false
local dExtra = 2 local dExtra = 2
local sChamferDown, sChamferUp local sChamferDown, sChamferUp
if nDouble > 1 and bCanDouble then if nDouble > 1 and bCanDouble then
if nSide == 0 then if nSide == 0 then
if BD.DOWN_HEAD then if BD.DOWN_HEAD then
-- recupero la lavorazione -- recupero la lavorazione
local nChamferDown local nChamferDown
nChamferDown, _, sChamferDown = VerifyChamfer( Proc, AuxId, nRawId, true, true) nChamferDown, _, sChamferDown = VerifyChamfer( Proc, AuxId, nRawId, true, true)
if nChamferDown < 0 then if nChamferDown < 0 then
sWarn = 'Warning : chamfer from bottom not found in library'
sChamferDown = nil
EgtOutLog( sWarn)
end
end
local nChamferUp
nChamferUp, _, sChamferUp = VerifyChamfer( Proc, AuxId, nRawId, true, false)
if nChamferUp < 0 then
sWarn = 'Warning : chamfer from bottom not found in library' sWarn = 'Warning : chamfer from bottom not found in library'
sChamferDown = nil sChamferUp = nil
EgtOutLog( sWarn) EgtOutLog( sWarn)
end end
end end
local nChamferUp
nChamferUp, _, sChamferUp = VerifyChamfer( Proc, AuxId, nRawId, true, false)
if nChamferUp < 0 then
sWarn = 'Warning : chamfer from bottom not found in library'
sChamferUp = nil
EgtOutLog( sWarn)
end
end end
end
-- eseguo -- eseguo
for i = 1, nStep do for i = 1, nStep do
-- inserisco la lavorazione -- inserisco la lavorazione
@@ -435,9 +443,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
end end
if nSide == 0 then if nSide == 0 then
bDoubleCham = EgtIf( sChamferDown and BD.DOWN_HEAD, true, false) bDoubleCham = EgtIf( sChamferDown and BD.DOWN_HEAD, true, false) and bCanDouble
else else
bDoubleCham = true bDoubleCham = bCanDouble
end end
-- assegno affondamento e offset radiale -- assegno affondamento e offset radiale
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra) EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra)
@@ -704,7 +712,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
-- eventuale segnalazione ingombro di testa o coda -- eventuale segnalazione ingombro di testa o coda
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ()) local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ then
if Proc.Head then if Proc.Head then
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
BL.UpdateHCING( nRawId, dOffs) BL.UpdateHCING( nRawId, dOffs)
@@ -729,8 +738,72 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- recupero i dati della curva e del profilo -- recupero i dati della curva e del profilo
local dDepth = abs( EgtCurveThickness( AuxId)) local dDepth = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
--local bToolInv = ( vtExtr:getZ() < -0.1) local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
-- recupero la lavorazione local bToolInv = ( not bDownHead and vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
local dExtra = 2
-- verifico se servono gli smussi. Se lavorazione principale di svuotatura significa che è solo da un lato
-- generalmente sono lavorazioni non molto lunghe, quindi non si gestistono gli step
-- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva
local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true)
-- se devo inserire il chamfer
if nChamfer > 0 and Proc.Grp ~= 0 and dDepth > dDepthCham and Proc.Prc ~= 70 then
-- inserisco la lavorazione
local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sNameCh, sChamfer)
if not nMchId then
local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- se lavorazione da sopra o da sotto
if Proc.Grp == 3 then
if not bToolInv then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
end
end
if Proc.Grp == 4 then
if not bToolInv then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
end
end
-- assegno affondamento e offset radiale
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
if Proc.Head then
nSCC = MCH_SCC.ADIR_XP
elseif Proc.Tail then
nSCC = MCH_SCC.ADIR_XM
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
nSCC = MCH_SCC.ADIR_YP
elseif vtExtr:getY() > -0.01 then
nSCC = MCH_SCC.ADIR_YP
else
nSCC = MCH_SCC.ADIR_YM
end
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
end
end
-- recupero la lavorazione di svuotatura
local sPocketing = ML.FindPocketing( 'Pocket', nil, dDepth) local sPocketing = ML.FindPocketing( 'Pocket', nil, dDepth)
if not sPocketing then if not sPocketing then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library'
@@ -772,6 +845,11 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- imposto elevazione -- imposto elevazione
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';') EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';')
-- 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
EgtSetMachiningParam( MCH_MP.OFFSR, -dRadialOffset)
end
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -782,7 +860,9 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function MakeByMark( Proc, nRawId, b3Raw, nPartId) local function MakeByMark( Proc, nRawId, nPartId)
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo -- ingombro del pezzo
local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') local Ls = EgtGetFirstNameInGroup( nPartId, 'Box')
local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD)
@@ -802,6 +882,7 @@ local function MakeByMark( Proc, nRawId, b3Raw, nPartId)
-- recupero i dati della curva e del profilo -- recupero i dati della curva e del profilo
local dDepth = abs( EgtCurveThickness( AuxId)) local dDepth = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
local bToolInv = ( vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5) local bToolInv = ( vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
-- verifico che la marcatura non sia orientata verso il basso (-5 deg) -- verifico che la marcatura non sia orientata verso il basso (-5 deg)
if vtExtr:getZ() < - 0.1 and not BD.DOWN_HEAD and not BD.TURN then if vtExtr:getZ() < - 0.1 and not BD.DOWN_HEAD and not BD.TURN then
@@ -870,7 +951,7 @@ function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0 local nCntType = EgtGetInfo( Proc.Id, 'CNT_TYPE', 'i') or 0
-- se marcatura -- se marcatura
if nCntType == 10 then if nCntType == 10 then
return MakeByMark( Proc, nRawId, b3Raw, nPartId) return MakeByMark( Proc, nRawId, nPartId)
-- se fresatura -- se fresatura
else else
return MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) return MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
+282 -82
View File
@@ -6,6 +6,11 @@
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut -- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
-- 2022/11/02 Corretti accorciamenti per DoubleCut -- 2022/11/02 Corretti accorciamenti per DoubleCut
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta -- 2022/11/10 Corrette finiture lama per BigSection con trave alta
-- 2023/04/20 Per travi alte aggiunti tagli orizzontali per ridurre le dimensioni degli scarti
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
-- 2024/01/18 Gestiti tagli verticali aggiuntivi per travi larghe.
-- 2024/01/22 Nei tagli verticali aggiuntivi si usa ora BD.MAX_LEN_DICE come dimensione (era BD.MAX_DIM_DICE).
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessHeadCut = {} local ProcessHeadCut = {}
@@ -16,6 +21,8 @@ local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw') local Fbs = require( 'FacesBySaw')
local Cut = require( 'ProcessCut') local Cut = require( 'ProcessCut')
local Pocket = require( 'FaceByPocket') local Pocket = require( 'FaceByPocket')
local Topology = require( 'FeatureTopology')
local Split = require( 'ProcessSplit')
EgtOutLog( ' ProcessHeadCut started', 1) EgtOutLog( ' ProcessHeadCut started', 1)
@@ -23,6 +30,10 @@ EgtOutLog( ' ProcessHeadCut started', 1)
local BD = require( 'BeamData') local BD = require( 'BeamData')
local ML = require( 'MachiningLib') local ML = require( 'MachiningLib')
if BD.PRECUT_HEAD == nil then
BD.PRECUT_HEAD = true
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Riconoscimento della feature -- Riconoscimento della feature
function ProcessHeadCut.Identify( Proc) function ProcessHeadCut.Identify( Proc)
@@ -119,7 +130,7 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
-- Inserisco la lavorazione del lato opposto -- Inserisco la lavorazione del lato opposto
@@ -142,12 +153,204 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
return true, nil return true, nil
end end
---------------------------------------------------------------------
-- tagli verticali aggiuntivi
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw)
local nVerticalCuts = ceil( Proc.Face[1].WidthTrimmed / ( BD.MAX_LEN_DICE)) - 1
local dVerticalSliceHeight = Proc.Face[1].WidthTrimmed / ( nVerticalCuts + 1)
-- recupero il diametro dell'utensile
local dSawDiam = 400
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
end
end
local bOk, sErr
-- tagli orizzontali
for j = nVerticalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
local dVerticalCutOffset = dVerticalSliceHeight * -j
local bForceTangentLeadInOut = BD.PRESS_ROLLER
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
if not bOk then return bOk, sErr end
end
return bOk, sErr
end
---------------------------------------------------------------------
-- tagli standard
local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, HeadCutType, Cutting1Data, Cutting2Data, dStartOffset, dOvmHead)
local PrecutType = { bBigSectionCut = HeadCutType.bBigSectionCut, bHorizCut = HeadCutType.bHorizCut, bDoubleHorizCut = HeadCutType.bDoubleHorizCut, bDoubleCut = HeadCutType.bDoubleCut, sType = 'Precut', bNeedVerticalAddedCuts = false, bNeedHorizontalAddedCuts = false}
if not HeadCutType.bDoubleHorizCut then
-- flag di lavorazione faccia
local nOrthoOpposite = EgtIf( HeadCutType.bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_FRONT)
-- calcolo extra taglio ed accorciamento
local dCutExtra = 0
local dAccStart = 0
local dAccEnd = 0
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
dCutExtra = EgtIf( HeadCutType.bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
else
dCutExtra = - ( b3Raw:getDimY() - Cutting1Data.dMaxDepth)
local dSawRad = Cutting1Data.dSawDiam / 2
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
local dKL = dSawRad - Cutting1Data.dMaxDepth + EgtIf( HeadCutType.bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
local dMinSawingLength = 5
if BD.C_SIMM then
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo entrata
if dAccEnd > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccStart = b3Raw:getDimZ() - dAccEnd - dMinSawingLength
end
else
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo uscita
if dAccStart > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccEnd = b3Raw:getDimZ() - dAccStart - dMinSawingLength
end
end
end
-- per travi alte faccio dei tagli orizzontali aggiuntivi
if HeadCutType.bNeedHorizontalAddedCuts then
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not ( HeadCutType.bBigSectionCut) and BD.PRECUT_HEAD then
dStartOffset = dOvmHead
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
local nHorizontalCuts = ceil( Proc.Face[1].HeightTrimmed / BD.MAX_DIM_DICE) - 1
local dHorizontalSliceHeight = Proc.Face[1].HeightTrimmed / ( nHorizontalCuts + 1)
for i = nCuts, 1, -1 do
local dCutXOffset = ( i - 1) * dOffsetBetweenCuts
-- tagli orizzontali
for j = nHorizontalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
local bForceTangentLeadInOut = BD.PRESS_ROLLER
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
if not bOk then return bOk, sErr end
end
-- se necessario taglio verticale doppio, eseguo l'opposto
if HeadCutType.bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStartDoubleCut, dAccEndDoubleCut, '', b3Raw, true)
if not bOk then return false, sErr end
end
-- taglio verticale
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, '', b3Raw, true)
if not bOk then return bOk, sErr end
end
return true, sWarn
end
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not ( HeadCutType.bBigSectionCut) and BD.PRECUT_HEAD and HeadCutType.bNeedVerticalAddedCuts then
dStartOffset = dOvmHead
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- se necessari tagli in doppio, eseguo gli opposti
if HeadCutType.bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and HeadCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, '', b3Raw, true)
if not bOk then return false, sErr end
end
end
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
-- se trave larga effettuo tagli verticali aggiuntivi
if HeadCutType.bNeedVerticalAddedCuts then
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw)
if not bOk then return bOk, sErr end
end
if i == 1 and HeadCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw, true)
if not bOk then return false, sErr end
end
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
else
-- verifico esistenza della lavorazione con lama da sotto
if not Cutting2Data.sCutting then
local sErr = 'Error : cutting H2 not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- verifico che le due lame riescano a lavorare la sezione
local dDimZ = b3Raw:getDimZ()
local dExtra = Cutting1Data.dMaxVertDepth + Cutting2Data.dMaxDepth - dDimZ
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not HeadCutType.bBigSectionCut then
local sErr = 'Error : section too big for head cut'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo extra taglio ed accorciamento
local dCutExtra = -Cutting2Data.dMaxDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dCutExtra2 = -Cutting1Data.dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dAccStart = 0
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not ( HeadCutType.bBigSectionCut) and BD.PRECUT_HEAD and HeadCutType.bNeedVerticalAddedCuts then
dStartOffset = dOvmHead
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- eseguo i tagli da sotto necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and HeadCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting2Data.sCutting, Cutting2Data.dSawDiam, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw, nil, true)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and HeadCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
-- se trave larga effettuo tagli verticali aggiuntivi
if HeadCutType.bNeedVerticalAddedCuts then
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw)
if not bOk then return bOk, sErr end
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
if not bOk then return false, sErr end
end
end
return true
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut) function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut)
@@ -159,6 +362,8 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead) local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
if not bOkc then return bOkc, sErrC end if not bOkc then return bOkc, sErrC end
end end
-- eventuali informazioni sul tipo di finitura
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
-- recupero la lavorazione -- recupero la lavorazione
local sCutting = ML.FindCutting( 'HeadSide') local sCutting = ML.FindCutting( 'HeadSide')
if not sCutting then if not sCutting then
@@ -190,7 +395,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2 dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2 dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2 dSawThick2 = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick2
end end
end end
-- caratteristiche taglio -- caratteristiche taglio
@@ -200,21 +405,29 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA) local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
-- verifico necessità di tagli aggiuntivi orizzontali o verticali
local dMinOvmHeadForAddeddCuts = 10.123
local bNeedVerticalAddedCuts = ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL)
local bNeedHorizontalAddedCuts = ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL)
-- dati lavorazioni sopra e sotto
local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth}
local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dMaxDepth2, dSawThick = dSawThick2}
-- dati sul taglio di testa da effettuare
local HeadCutType = { bBigSectionCut = bBigSectionCut, bHorizCut = bHorizCut, bDoubleHorizCut = bDoubleHorizCut, bDoubleCut = bDoubleCut, bNeedVerticalAddedCuts = bNeedVerticalAddedCuts, bNeedHorizontalAddedCuts = bNeedHorizontalAddedCuts}
-- dati geometrici del taglio -- dati geometrici del taglio
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
-- se non obbligatorio e coincide con inizio grezzo, non va fatto -- se non obbligatorio e coincide con inizio grezzo, non va fatto
if not bNeedHCut and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL then if not bNeedHCut and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL then
return true return true
end end
-- determino se più tagli con offset -- determino se lo spessore del materiale da rimuovere è eccessivo e quindi vanno fatti più tagli con offset
local nCuts = max( ceil( dOvmHead / ( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP)), 1) local nCuts = max( ceil( dOvmHead / (( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP) + 0.5)), 1)
local dOffsL = dOvmHead / nCuts local dOffsL = dOvmHead / nCuts
-- se taglio per sezioni alte e larghe -- se taglio per sezioni alte e larghe
if bBigSectionCut then if bBigSectionCut then
if dOvmHead > 0 then if dOvmHead > 0 then
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
-- se finitura con lama -- se finitura con lama
if nQ05 == 1 or nQ05 == 0 then if nQ05 < 2 then
local dSawThickCheck = dSawThick local dSawThickCheck = dSawThick
if dSawThick2 > 0 and bDoubleHorizCut then if dSawThick2 > 0 and bDoubleHorizCut then
dSawThickCheck = min( dSawThick, dSawThick2) dSawThickCheck = min( dSawThick, dSawThick2)
@@ -225,9 +438,64 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
else else
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX() dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
end end
-- taglio a zero (con sega a catena o mix catena + lama) per evitare problemi con grezzo più lungo del previsto
if BD.PRECUT_HEAD then
-- recupero dati utensile della sega a catena più lunga a disposizione
local sSawing = ML.FindSawing( 'SawingForSplitting', nil, nil, 'Longest')
if not sSawing then
sSawing = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
end
local dChainSawMaxMat = 0
local dChainSawLen = 0
if EgtMdbSetCurrMachining( sSawing or '') then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dChainSawMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dChainSawMaxMat
dChainSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dChainSawLen
end
end
local SawingData = { sSawing = sSawing, dChainSawMaxMat = dChainSawMaxMat, dChainSawLen = dChainSawLen, bInvert = true}
local dOffset = dOvmHead
local bOkPrecut, sErrPrecut = Split.MakeBigSectionSplitting( Proc, b3Raw, dOffset, SawingData, Cutting2Data)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard -- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard
if dMaxElev > dSawThickCheck then if dMaxElev > dSawThickCheck then
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT) local bOk, sErr
-- se trave larga effettuo tagli verticali aggiuntivi
if bNeedVerticalAddedCuts then
-- ad ogni offset di taglio dovrò fare prima i tagli verticali e poi i cubetti
for i = nCuts, 1, -1 do
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
-- faccia di taglio all'offset corrente
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
local AddProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId}
Topology.Classify( AddProc, b3Raw)
local dCutOffset = ( i - 1) * dOffsL
local vtMove = Vector3d( dCutOffset, 0, 0)
EgtMove( AddId, vtMove, GDB_RT.GLOB)
-- eventuale faccia di taglio all'offset precedente, per limitare il dicing e evitare di tagliare i cubetti nel vuoto
local nLimitingSurf
if nCuts > 1 then
nLimitingSurf = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
local dLastCutOffset = i * dOffsL
local vtMoveLimitingSurf = Vector3d( dLastCutOffset - 10 * GEO.EPS_SMALL, 0, 0)
EgtMove( nLimitingSurf, vtMoveLimitingSurf, GDB_RT.GLOB)
local vtNLimitingSurf = EgtSurfTmFacetNormVersor( nLimitingSurf, 0, GDB_ID.ROOT)
if AreSameVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
end
-- tagli verticali
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw)
if not bOk then return bOk, sErr end
-- tagli a cubetti con eventuale superficie limitante
bOk, sErr = Cut.Make( AddProc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nLimitingSurf)
end
-- tagli aggiuntivi non necessari
else
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true)
end
return bOk, sErr return bOk, sErr
end end
-- se finitura con truciolatore -- se finitura con truciolatore
@@ -249,79 +517,11 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
end end
end end
end end
-- se tagli standard
if not bDoubleHorizCut then local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, HeadCutType, Cutting1Data, Cutting2Data, nil, dOvmHead)
-- flag di lavorazione faccia
local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_FRONT) return bOk, sErr
-- calcolo extra taglio ed accorciamento end
local dCutExtra = 0
local dAccStart = 0
local dAccEnd = 0
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
else
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
local dSawRad = dSawDiam / 2
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
if BD.C_SIMM then
dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL)
else
dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL)
end
end
-- se necessari tagli in doppio, eseguo gli opposti
if bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, '', b3Raw, true)
if not bOk then return false, sErr end
end
end
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
if not bOk then return false, sErr end
end
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
else
-- verifico esistenza della lavorazione con lama da sotto
if not sCutting2 then
local sErr = 'Error : cutting H2 not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- verifico che le due lame riescano a lavorare la sezione
local dDimZ = b3Raw:getDimZ()
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not bBigSectionCut then
local sErr = 'Error : section too big for head cut'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo extra taglio ed accorciamento
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dAccStart = 0
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
-- eseguo i tagli da sotto necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
if not bOk then return false, sErr end
end
end
return true
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
return ProcessHeadCut return ProcessHeadCut
+1945 -291
View File
File diff suppressed because it is too large Load Diff
+404 -141
View File
@@ -1,4 +1,4 @@
-- ProcessLongCut.lua by Egaltech s.r.l. 2023/01/18 -- ProcessLongCut.lua by Egaltech s.r.l. 2023/08/01
-- Gestione calcolo taglio longitudinale per Travi -- Gestione calcolo taglio longitudinale per Travi
-- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale. -- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale.
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto. -- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
@@ -13,12 +13,29 @@
-- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw). -- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw).
-- 2022/09/23 Modificato l'angolo per l'abilitazione della lama da sotto: ora interviene anche per facce verticali. -- 2022/09/23 Modificato l'angolo per l'abilitazione della lama da sotto: ora interviene anche per facce verticali.
-- 2022/11/04 Aggiunto passaggio parametro bDownHead (Testa da Sotto) nelle chiamate a MakeSideFace. -- 2022/11/04 Aggiunto passaggio parametro bDownHead (Testa da Sotto) nelle chiamate a MakeSideFace.
-- 2022/11/28 Correzioni varie per attacco, pulizia spigoli, utilizzo H3 -- 2022/11/28 Correzioni varie per attacco, pulizia spigoli, utilizzo H3.
-- 2022/11/30 Modifiche su SCC per TURN. -- 2022/11/30 Modifiche su SCC per TURN.
-- 2023/01/18 Aggiunta, se richiesta, una lavorazione ulteriore con sega a catena nei casi in cui la doppia lama non sia sufficiente. -- 2023/01/18 Aggiunta, se richiesta, una lavorazione ulteriore con sega a catena nei casi in cui la doppia lama non sia sufficiente.
-- 2023/01/26 Rimossa la pulitura della faccia laterale nel caso in cui la feature abbia almeno una faccia rivolta verso il basso. -- 2023/01/26 Rimossa la pulitura della faccia laterale nel caso in cui la feature abbia almeno una faccia rivolta verso il basso.
-- 2023/01/27 In MakeSideFace il prolungamento di uscita è ora fissato a 10 mm. -- 2023/01/27 In MakeSideFace il prolungamento di uscita è ora fissato a 10 mm.
-- 2023/01/27 In caso di lavorazione aggiuntiva con fresa a catena il taglio con lama da sotto viene effettuato a step. -- 2023/01/27 In caso di lavorazione aggiuntiva con fresa a catena il taglio con lama da sotto viene effettuato a step.
-- 2023/02/15 Migliorato verso di avanzamento della lama.
-- 2023/02/21 Verso di avanzamento della lama migliorato anche con lama LC.
-- 2023/02/22 Nuova gestione del verso di avanzamento ottimale che contempla tutti i casi.
-- 2023/03/06 Correzione per i casi con lavorazione limitata.
-- 2023/03/15 Modifica alla lavorazione ulteriore con sega a catena per togliere il codolo e lasciare solo dei punti di supporto.
-- 2023/03/22 Correzione a SCC lama a seguito di modifiche alle direzioni dei tagli.
-- 2023/04/17 Gestione unificata SCC tramite funzione apposita GetSCC
-- 2023/05/03 Corretto SCC in caso di asse utensile allineato con Z.
-- 2023/05/19 Migliorato calcolo e verifica affondamento per lavorazione con lama con codolo in mezzo.
-- 2023/08/01 Ammesso uso lama da sotto fino a N +3deg in verticale.
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
-- 2023/10/24 Migliorata spezzatura taglio passante con due spezzoni
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- 2024/01/22 Implementata gestione seghe a catena multiple.
-- 2024/05/09 In Make, allungamento percorso ingresso per evitare collisioni durante approccio pezzo quando si setta OutRaw=3
-- In Make, se non trova fresa per pulizia, da messaggio di warning anziché di errore
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessLongCut = {} local ProcessLongCut = {}
@@ -56,6 +73,143 @@ function ProcessLongCut.Classify( Proc)
return true, false return true, false
end end
---------------------------------------------------------------------
-- Estrazione dell'UUID utensile di una lavorazione
function GetToolUUID( sMachining)
if EgtMdbSetCurrMachining( sMachining) then
local sToolUUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
return sToolUUID
end
end
---------------------------------------------------------------------
-- Calcolo dei versori caratteristici della feature
function GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert, sMachining)
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT)
local vtOrthO = BL.GetVersRef( nFaceUse)
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( Proc.Id, nFacet, vtOrthO, GDB_ID.ROOT)
local vtTg = ptP2 - ptP1 ; vtTg:normalize()
local dAllStart = 0
local dAllEnd = 0
-- se bilinea, scarto la parte più allineata con la direzione ortogonale (se deviazione angolare oltre 20 deg o lunghezza minore di dSawDiam/2 * cos( 20/2)) ma maggiore di un minimo
if ( ( ptPm - ptP1) - ( ptPm - ptP1) * vtTg * vtTg):len() > 100 * GEO.EPS_SMALL then
local vtTg1 = ptPm - ptP1 ; vtTg1:normalize()
local vtTg2 = ptP2 - ptPm ; vtTg2:normalize()
local dDist1 = dist( ptP1, ptPm)
local dDist2 = dist( ptP2, ptPm)
local dCosMax = 0.951 -- cos( 18°)
local dLenMin = 30
local dToolDiam = 400
if EgtMdbSetCurrMachining( sMachining) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
end
end
local dLenMax = max( 0.5 * dToolDiam * 0.17365 + 1, 2 * dLenMin)
--if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then
if vtTg1 * vtTg2 < dCosMax then
local dOrtho1 = abs( vtTg1 * vtOrthO)
local dOrtho2 = abs( vtTg2 * vtOrthO)
if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then
if dDist1 > dLenMin or dDist1 > 0.5 * dDist2 then
ptP2 = Point3d( ptPm)
dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL
end
else
if dDist2 > dLenMin or dDist2 > 0.5 * dDist1 then
ptP1 = Point3d( ptPm)
dAllStart = - dDist1 - 10 * GEO.EPS_SMALL
end
end
vtTg = ptP2 - ptP1 ; vtTg:normalize()
end
end
local bWsRight = ( bInvert)
-- Versore di riferimento
local vtRef = Vector3d( vtTg)
vtRef:rotate( vtN, 90)
-- Versore esterno
local vtOut = vtRef - vtRef * vtTg * vtTg ; vtOut:normalize()
-- Versore ausiliario (direzione braccio)
local vtAux = Vector3d( vtN:getX(), vtN:getY(), 0) ; vtAux:normalize()
vtAux:rotate( Z_AX(), EgtIf( bWsRight, 90, -90))
if vtAux:isSmall() then
vtAux = Vector3d( vtOut:getX(), vtOut:getY(), 0) ; vtAux:normalize()
else
if abs( vtAux * vtOut) < GEO.EPS_SMALL then
if abs( vtTg:getZ()) > 0.5 then
if vtAux * vtRef < 0 then
vtAux = - vtAux
end
elseif vtAux * vtTg > 0 then
vtAux = - vtAux
end
elseif vtAux * vtOut < 0 then
vtAux = - vtAux
end
end
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
return vtAux, vtRef, vtOut, vtTg
end
---------------------------------------------------------------------
-- Calcolo posizione braccio
function ProcessLongCut.GetSCC( Proc, nFacet, sMachining, nFaceUse, bInvert, nCuttingStep, nC, bAreCuttingStepsTowardsHead, bIsTopBlade, bCustUseBlade)
local nSCC
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacet, GDB_ID.ROOT)
local sToolUUID = GetToolUUID( sMachining)
local bIsBlade
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sToolUUID) or '') then
bIsBlade = ( ( EgtTdbGetCurrToolParam( MCH_TP.TYPE) & MCH_TF.SAWBLADE) ~= 0)
end
-- se Turn posiziono la testa per creare il minor ingombro possibile
if BD.TURN then
if nFaceUse == MCH_MILL_FU.ORTHO_DOWN or ( ( nFaceUse == MCH_MILL_FU.PARAL_FRONT or nFaceUse == MCH_MILL_FU.PARAL_BACK) and vtN:getZ() > -GEO.EPS_SMALL) then
nSCC = MCH_SCC.ADIR_ZP
elseif nFaceUse == MCH_MILL_FU.ORTHO_TOP or ( nFaceUse == MCH_MILL_FU.PARAL_FRONT or nFaceUse == MCH_MILL_FU.PARAL_BACK) then
nSCC = MCH_SCC.ADIR_ZM
elseif nFaceUse == MCH_MILL_FU.ORTHO_FRONT or ( ( nFaceUse == MCH_MILL_FU.PARAL_DOWN or nFaceUse == MCH_MILL_FU.PARAL_TOP) and vtN:getY() > -GEO.EPS_SMALL) then
nSCC = MCH_SCC.ADIR_YP
elseif nFaceUse == MCH_MILL_FU.ORTHO_BACK or ( nFaceUse == MCH_MILL_FU.PARAL_DOWN or nFaceUse == MCH_MILL_FU.PARAL_TOP) then
nSCC = MCH_SCC.ADIR_YM
end
-- se Fast e fresa con asse utensile diretto come Z posiziono l'aggregato in Ym per avere il minore ingombro possibile
elseif not BD.C_SIMM and not bIsBlade and AreSameVectorApprox( vtN, Z_AX()) then
nSCC = MCH_SCC.ADIR_YM
-- se Fast ( escluso caso speciale con taglio non passante e inclinato in X e escluso caso con lama esattamente diretta in Z) posiziono l'aggregato in X per ottimizzare il pinzaggio
elseif not BD.C_SIMM and ( not ( bCustUseBlade and abs(vtN:getX()) > 0.001) or not bIsBlade) and not ( bIsBlade and AreSameVectorApprox( vtN, Z_AX())) then
if bAreCuttingStepsTowardsHead then
nSCC = EgtIf( ( not ( nCuttingStep == 1 or nCuttingStep == nC - 1)), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
else
nSCC = EgtIf( ( not ( nCuttingStep == 1 or nCuttingStep == nC - 1)), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
end
-- per Fast ( caso speciale con taglio non passante e inclinato in X e caso lama diretta esattamente in Z)
elseif not BD.C_SIMM then
local vtAux = GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert, sMachining)
if bCustUseBlade then
nSCC = EgtIf( ( nFaceUse == MCH_MILL_FU.ORTHO_TOP or nFaceUse == MCH_MILL_FU.ORTHO_FRONT) and vtN:getY() > -GEO.EPS_SMALL, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
elseif ( abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL) then
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
else
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
-- per PF o simili e lama con aggregato lo posiziono per stare il più lontano possibile dalla trave
elseif ( bIsBlade and bIsTopBlade) then
if abs( vtN:getX()) > 0.001 then
local vtAux = GetProcessSpecificVectors( Proc, nFacet, nFaceUse, bInvert, sMachining)
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
else
nSCC = MCH_SCC.ADIR_XP
end
-- per PF o simili e lama senza aggregato o fresa non do alcuna preferenza
else
nSCC = MCH_SCC.NONE
end
return nSCC
end
----------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------
local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam, bForcedLim, dDistToMachine, bUnderDir) local function MakeSideFace( nId, nFac, nSide, sMilling, dToolDiam, bForcedLim, dDistToMachine, bUnderDir)
if ( not BD.DOWN_HEAD or not BD.TURN) and nSide == -1 then if ( not BD.DOWN_HEAD or not BD.TURN) and nSide == -1 then
@@ -141,7 +295,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
-- laterale sul punto medio della linea in comune -- laterale sul punto medio della linea in comune
local frFc = Frame3d( ptPm, vtN) ; local frFc = Frame3d( ptPm, vtN) ;
local b3BoxLoc = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frFc) local b3BoxLoc = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frFc)
dDepth = b3BoxLoc:getDimZ() or 0 local dDepth = b3BoxLoc:getDimZ() or 0
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
local dSawDiam = 400 local dSawDiam = 400
local dSawThick = 0 local dSawThick = 0
@@ -290,7 +444,7 @@ end
-- Applicazione della lavorazione -- Applicazione della lavorazione
local function MakeByPocketing( Proc, nPhase, nRawId, nPartId) local function MakeByPocketing( Proc, nPhase, nRawId, nPartId)
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa -- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId) local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId)
-- cerco la svuotatura opportuna -- cerco la svuotatura opportuna
local sPocketing = ML.FindPocketing( 'OpenPocket', Proc.Box:getDimX()) local sPocketing = ML.FindPocketing( 'OpenPocket', Proc.Box:getDimX())
if not sPocketing then if not sPocketing then
@@ -347,12 +501,18 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- lavorazione faccia laterale con sega a catena -- lavorazione faccia laterale con sega a catena
local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal) local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal, bShortenStart, bShortenEnd)
-- Recupero i dati dell'utensile -- Recupero i dati dell'utensile
local sSawing = ML.FindSawing( 'Sawing') local sSawing = ML.FindSawing( 'Sawing', dDepth, true)
-- se non trovo alcuna sega a catena lunga a sufficienza, accetto di non arrivare sul fondo
if not sSawing then
sSawing = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
end
local dMaxMat = 0 local dMaxMat = 0
local dSawCornerRad = 0 local dSawCornerRad = 0
local dSawThick = 0 local dSawThick = 0
local dSawDiameter = 0
local sWarn
-- se non trova una lavorazione di sawing esco -- se non trova una lavorazione di sawing esco
if not sSawing then if not sSawing then
local sErr = 'Error : Sawing not found in library' local sErr = 'Error : Sawing not found in library'
@@ -365,6 +525,7 @@ local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal)
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
dSawCornerRad = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or dSawCornerRad dSawCornerRad = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or dSawCornerRad
dSawDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiameter
end end
end end
end end
@@ -382,15 +543,25 @@ local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal)
local nFaceUse = MCH_MILL_FU.PARAL_DOWN local nFaceUse = MCH_MILL_FU.PARAL_DOWN
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto angolo 3° asse rot -- imposto angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1)) EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'perpendicular'))
local vtN = EgtSurfTmFacetNormVersor( nSurfId, 0, GDB_ID.ROOT) local vtN = EgtSurfTmFacetNormVersor( nSurfId, 0, GDB_ID.ROOT)
local vtOrtho = BL.GetVersRef( nFaceUse) local vtOrtho = BL.GetVersRef( nFaceUse)
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1)) EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
-- imposto eventuale sovramateriale -- imposto eventuale sovramateriale
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
-- imposto tratti in cui la sega a catena non lavora per lasciare del materiale di supporto
local dSupportingWoodLength = 30
-- imposto allungamento percorso iniziale e finale -- imposto allungamento percorso iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) if bShortenStart then
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal - dSupportingWoodLength - dSawDiameter)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
end
if bShortenEnd then
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal - dSupportingWoodLength - dSawDiameter)
else
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
end
-- imposto il lato di lavorazione -- imposto il lato di lavorazione
local nWorkSide = MCH_MILL_WS.RIGHT local nWorkSide = MCH_MILL_WS.RIGHT
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide) EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide)
@@ -410,7 +581,7 @@ local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal)
return false, sErr return false, sErr
end end
-- impostazione alternativa angolo 3° asse rot -- impostazione alternativa angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2)) EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'parallel'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2)) EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2))
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -433,6 +604,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
-- recupero l'ingombro del grezzo di appartenenza -- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId) local b3Raw = EgtGetRawPartBBox( nRawId)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- recupero lunghezza grezzo totale da info sulla macchinata
local dBarLen = EgtGetInfo( EgtGetCurrMachGroup(), 'BARLEN', 'd')
local dOvmHead = b3Raw:getMax():getX() - b3Solid:getMax():getX()
-- dati della faccia -- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
local _, dLen, dWidth = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_ID.ROOT) local _, dLen, dWidth = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_ID.ROOT)
@@ -489,6 +665,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
-- leggo il parametro Q05 solo se è una vera longcut L010 -- leggo il parametro Q05 solo se è una vera longcut L010
elseif ProcessLongCut.Identify( Proc) then elseif ProcessLongCut.Identify( Proc) then
nUseBlade = EgtGetInfo( Proc.Id, 'Q05', 'i') or 0 nUseBlade = EgtGetInfo( Proc.Id, 'Q05', 'i') or 0
-- funzionamento Q05 --
-- 0: fresa; 1: lama solo se feature passante, faccia verso l'alto; 2: lama solo se feature passante, qualunque orientamento faccia; 3: lama con feature sia cieca che passante, faccia verso l'alto, lavorazione non rovina pezzo successivo; 4: lama con feature sia cieca che passante, qualunque orientamento faccia, lavorazione non rovina pezzo successivo
end end
local bForceUseBladeOnNotThruFace local bForceUseBladeOnNotThruFace
if nCustForceUseBladeOnNCF then if nCustForceUseBladeOnNCF then
@@ -536,8 +714,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= -0.5 then if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= -0.5 then
bCanUseUnderBlade = true bCanUseUnderBlade = true
end end
-- se faccia da sotto o di lato ma con versore Z sotto l'orizzontale abilito la lavorazione con lame mixate -- se faccia da sotto o di lato ma con versore Z sotto l'orizzontale abilito la lavorazione con lame mixate (limite 3 deg verso alto)
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= 0.0175 then if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= 0.053 then
bCanUseUnderBlade = true bCanUseUnderBlade = true
end end
-- se faccia da sopra o di lato ma con versore Z negativo verifico che abbia un angolo compatibile (28deg) per non avere extracorsa -- se faccia da sopra o di lato ma con versore Z negativo verifico che abbia un angolo compatibile (28deg) per non avere extracorsa
@@ -568,11 +746,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
local dToolDiam = 0 local dToolDiam = 0
local dThick = 0 local dThick = 0
local dMaxDepth = 0 local dMaxDepth = 0
local dMaxVertDepth = 0
local sCuttingDn local sCuttingDn
local dToolDiamDn = 0 local dToolDiamDn = 0
local dThickDn = 0 local dThickDn = 0
local dMaxDepthDn = 0 local dMaxDepthDn = 0
-- recupero la lavorazione -- recupero eventuale lavorazione con lama su testa da sotto
if bCanUseUnderBlade then if bCanUseUnderBlade then
sCuttingDn = ML.FindCutting( 'HeadSide_H2', false, true) sCuttingDn = ML.FindCutting( 'HeadSide_H2', false, true)
if not sCuttingDn then if not sCuttingDn then
@@ -590,6 +769,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
end end
end end
end end
-- recupero eventuale lavorazione con lama
if bCanUseBlade then if bCanUseBlade then
local sCutType = EgtIf( BD.USE_LONGCUT, 'LongCut', 'HeadSide') local sCutType = EgtIf( BD.USE_LONGCUT, 'LongCut', 'HeadSide')
sCutting = ML.FindCutting( sCutType) sCutting = ML.FindCutting( sCutType)
@@ -605,6 +785,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
dThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThick dThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dThick
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
end end
end end
end end
@@ -745,7 +926,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
bFinishWithChainSaw = EgtIf ( ( EgtGetInfo( Proc.Id, 'Q05', 'i') or 0) == 1, true, false) bFinishWithChainSaw = EgtIf ( ( EgtGetInfo( Proc.Id, 'Q05', 'i') or 0) == 1, true, false)
end end
local nFaceUse local nFaceUse
local nFaceUse2 local nFaceUse2
-- se ho solo lama da sotto -- se ho solo lama da sotto
if bCanUseUnderBlade and not bCanUseBlade then if bCanUseUnderBlade and not bCanUseBlade then
@@ -759,21 +940,23 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
end end
-- si percorrono i lati alto e basso della faccia -- si percorrono i lati alto e basso della faccia
-- calcolo quanto è l'affondamento del taglio -- calcolo quanto è l'affondamento del taglio
local dOffsetTopBlade = ( dWidth + dDimStrip) / 2 local dMainMaxDepth = EgtIf( abs( vtN:getY()) < 1e-6, dMaxDepth, dMaxVertDepth)
local dOffsetDownBlade = ( dWidth + dDimStrip) / 2 local dOtherMaxDept = EgtIf( bCanUseUnderBlade, dMaxDepthDn, dMainMaxDepth)
local dCoeff = min( ( dWidth - dDimStrip) / ( dMainMaxDepth + dOtherMaxDept), 1)
local dOffsetTopBlade = dWidth - dCoeff * dMainMaxDepth
local dOffsetDownBlade = dWidth - dCoeff * dOtherMaxDept
local nStepDownBlade = 1 local nStepDownBlade = 1
local dStepDownBlade = dWidth - dOffsetDownBlade local dStepDownBlade = dOtherMaxDept
-- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama -- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama
if ( nSide == -1 or abs(nSide) == 2) and bCanUseUnderBlade and (( dWidth - dDimStrip) / 2) > dMaxDepthDn then if ( nSide == -1 or abs(nSide) == 2) and bCanUseUnderBlade and ( dOffsetTopBlade - dDimStrip) > dOtherMaxDept then
if bFinishWithChainSaw then if bFinishWithChainSaw then
dOffsetTopBlade = max( dWidth - dMaxDepth + ( BD.DECR_VERT_CUT or 0), dOffsetTopBlade)
dOffsetDownBlade = max( dWidth - dMaxDepthDn, dOffsetDownBlade)
local dHCutDownBlade = dWidth - dOffsetDownBlade local dHCutDownBlade = dWidth - dOffsetDownBlade
local dMaxStepDownBlade = 64 local dMaxStepDownBlade = 80
nStepDownBlade = ceil( dHCutDownBlade / dMaxStepDownBlade) nStepDownBlade = ceil( dHCutDownBlade / dMaxStepDownBlade)
dStepDownBlade = dHCutDownBlade / nStepDownBlade dStepDownBlade = dHCutDownBlade / nStepDownBlade
else else
local sErr = 'Error : side depth is bigger than underneath blade cut depth' local dDelta = dWidth - dDimStrip - ( dMainMaxDepth + dOtherMaxDept)
local sErr = 'Error : side depth is bigger than total cut depth (Diff=' .. EgtNumToString( dDelta)..')'
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
@@ -786,71 +969,67 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
if bForceUseBladeOnNotThruFace and ( bLimXmin or bLimXmax) then if bForceUseBladeOnNotThruFace and ( bLimXmin or bLimXmax) then
local nCountMilHead = 0 local nCountMilHead = 0
-- determino la massima elevazione -- determino la massima elevazione
local dElev = BL.GetFaceElevation( Proc.Id, 0, nPartId) local dElev = BL.GetFaceElevation( Proc, 0, b3Solid)
-- recupero la lavorazione -- recupero la lavorazione
local sMilling = ML.FindMilling( 'Long2Cut_H2', dElev, nil, nil, nil, not bCanUseUnderBlade, bCanUseUnderBlade) local sMilling = ML.FindMilling( 'Long2Cut_H2', dElev, nil, nil, nil, not bCanUseUnderBlade, bCanUseUnderBlade)
if not sMilling then if sMilling then
local sErr = 'Error : milling Long2Cut (_H2) not found in library' -- recupero i dati dell'utensile
EgtOutLog( sErr) local dToolDiam = 0
return false, sErr local dMaxDepth = 0
end if EgtMdbSetCurrMachining( sMilling) then
-- recupero i dati dell'utensile local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
local dToolDiam = 0 if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
local dMaxDepth = 0 dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
if EgtMdbSetCurrMachining( sMilling) then dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) end
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end end
end -- se ho facce di chiusura, per prima cosa faccio antischeggia
-- se ho facce di chiusura, per prima cosa faccio antischeggia -- come richiesto da Fabio Squaratti il 03/09/2021
-- come richiesto da Fabio Squaratti il 03/09/2021 if ( bLimXmin and not bForcedLim) or bLimXmax then
if ( bLimXmin and not bForcedLim) or bLimXmax then local bMadeASbyBld, bOk, nFacet
local bOk, nFacet bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, (( bLimXmin and not bForcedLim) and bLimXmax), vtN, nFacet, 0, sWarn, bCanUseUnderBlade, nil, sCutting)
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, (( bLimXmin and not bForcedLim) and bLimXmax), vtN, nFacet, 0, sWarn, bCanUseUnderBlade, nil, sCutting) if not bOk then return false, sWarn end
if not bOk then return false, sWarn end end
end -- eventuale lavorazione della faccia limitante l'inizio
-- eventuale lavorazione della faccia limitante l'inizio if not bStartFixed then
if not bStartFixed then local vtIni = -X_AX()
local vtIni = -X_AX() for j = 1, Proc.Fct - 1 do
for j = 1, Proc.Fct - 1 do local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT) if vtIni * vtN > 0 and nCountMilHead < 2 then
if vtIni * vtN > 0 and nCountMilHead < 2 then MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade) nCountMilHead = nCountMilHead + 1
end
end
if bForcedLim and nCountMilHead < 1 then
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
nCountMilHead = nCountMilHead + 1 nCountMilHead = nCountMilHead + 1
end end
end end
if bForcedLim and nCountMilHead < 1 then
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
nCountMilHead = nCountMilHead + 1
end
end
-- eventuale lavorazione della faccia limitante la fine -- eventuale lavorazione della faccia limitante la fine
if not bEndFixed then if not bEndFixed then
local vtFin = X_AX() local vtFin = X_AX()
for j = 1, Proc.Fct - 1 do for j = 1, Proc.Fct - 1 do
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT) local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
if vtFin * vtN > 0 and nCountMilHead < 2 then if vtFin * vtN > 0 and nCountMilHead < 2 then
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade) MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade)
nCountMilHead = nCountMilHead + 1
end
end
if bForcedLim and nCountMilHead < 2 then
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade)
nCountMilHead = nCountMilHead + 1 nCountMilHead = nCountMilHead + 1
end end
end end
if bForcedLim and nCountMilHead < 2 then else
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade) sWarn = 'Warning: milling Long2Cut (_H2) not found in library'
nCountMilHead = nCountMilHead + 1
end
end end
end end
-- inserisco tagli di lama -- inserisco tagli di lama
for i = 1, nC do for i = 1, nC do
-- Posizione braccio portatesta
local nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
-- ciclo sulle passate -- ciclo sulle passate
local dLioTang = 0 local dLioTang = 0
for k = 1, 2 do for k = 1, 2 do
local nStep = 1 local nStep = 1
if k == 2 then nStep = nStepDownBlade end if k == 2 then nStep = nStepDownBlade end
@@ -864,7 +1043,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
bAddOpposite = false bAddOpposite = false
end end
-- faccio in modo di calcolare il valore perpendicolare solo sulla faccia da sotto nel secondo passo o sulla faccia di fianco nel primo passo -- faccio in modo di calcolare il valore perpendicolare solo sulla faccia da sotto nel secondo passo o sulla faccia di fianco nel primo passo
if nSide == 1 or ( nSide == -1 and k == 1) or ( abs(nSide) == 2 and k == 2) then if nSide == 1 or ( nSide == -1 and k == 1) or ( abs(nSide) == 2 and k == 2) then
bAddOpposite = false bAddOpposite = false
end end
if bAddOpposite then if bAddOpposite then
@@ -914,36 +1093,87 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, 0}}) EgtSetMachiningGeometry( {{ Proc.Id, 0}})
-- settaggio di workside, uso faccia e eventuale inversione
-- limito opportunamente la lavorazione -- limito opportunamente la lavorazione
local dSal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC) local dSalInner, dSalOuter = - dEndAccDist - ( i - 2) * dC, -dEndDist
local dEal = EgtIf( i == 1, -dStartDist, - dStartAccDist - ( i - 2) * dC) local dEalInner, dEalOuter = - dStartAccDist - ( nC - i - 1) * dC, -dStartDist
if ( not bFront and k == 1) or ( bFront and k == 2) then local dSal = EgtIf( i == 1, dSalOuter, dSalInner)
local dEal = EgtIf( i == nC, dEalOuter, dEalInner)
if ( bFront and k == 1) or ( not bFront and k == 2) then
dSal, dEal = dEal, dSal dSal, dEal = dEal, dSal
end end
-- verifico lama in uso e imposto uso faccia
local bIsTopBladeCurrent
local nFaceUseCurrent
if bCanUseBlade and bCanUseUnderBlade then if bCanUseBlade and bCanUseUnderBlade then
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
dSal, dEal = dEal, dSal dSal, dEal = dEal, dSal
-- imposto uso della faccia if k == 1 then
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse2, nFaceUse)) bIsTopBladeCurrent = true
elseif bCanUseBlade and BD.USE_LONGCUT then nFaceUseCurrent = nFaceUse2
EgtSetMachiningParam( MCH_MP.INVERT, true) else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) bIsTopBladeCurrent = false
dSal, dEal = dEal, dSal nFaceUseCurrent = nFaceUse
-- imposto uso della faccia end
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse2, nFaceUse)) elseif bCanUseUnderBlade then
elseif bCanUseUnderBlade then if k == 1 then
if abs(nSide) ~= 2 then bIsTopBladeCurrent = false
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) nFaceUseCurrent = nFaceUse
else
bIsTopBladeCurrent = false
nFaceUseCurrent = nFaceUse2
end end
-- imposto uso della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2))
else else
-- imposto uso della faccia if k == 1 then
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2)) bIsTopBladeCurrent = true
nFaceUseCurrent = nFaceUse
else
bIsTopBladeCurrent = true
nFaceUseCurrent = nFaceUse2
end
end end
-- recupero alcune informazioni utili dalla lavorazione attuale
local bIsCurrentBladeCCW
if bIsTopBladeCurrent then
EgtMdbSetCurrMachining( sCutting)
else
EgtMdbSetCurrMachining( sCuttingDn)
end
bIsCurrentBladeCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
-- imposto la direzione di lavoro per avere scarico del truciolo ottimale
local nWorkSide, bInvert
if not bIsTopBladeCurrent and abs( nSide) ~= 2 then
if bIsCurrentBladeCCW then
nWorkSide = MCH_MILL_WS.LEFT
bInvert = true
dSal, dEal = dEal, dSal
else
nWorkSide = MCH_MILL_WS.RIGHT
bInvert = false
end
else
if bIsCurrentBladeCCW then
nWorkSide = MCH_MILL_WS.LEFT
bInvert = false
else
nWorkSide = MCH_MILL_WS.RIGHT
bInvert = true
dSal, dEal = dEal, dSal
end
end
-- step sempre positivi
local bAreCuttingStepsTowardsHead = true
-- calcolo SCC
local nSCC = ProcessLongCut.GetSCC( Proc, 0, EgtIf( bIsTopBladeCurrent, sCutting, sCuttingDn), nFaceUseCurrent, bInvert, i, nC, bAreCuttingStepsTowardsHead, bIsTopBladeCurrent, bCustUseBlade)
-- setto la lavorazione con i valori calcolati
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide)
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUseCurrent)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- imposto offset radiale -- imposto offset radiale
@@ -954,17 +1184,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp) EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp)
EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang) EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp) EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
-- se il flag uso lama custom abilitato (indica che questo script è lanciato dal ProcessCut) -- imposto posizione braccio porta testa
-- controllo se componente X versore è maggiore di un valore limite cambio la direzione della forcella
if bCustUseBlade and abs(vtN:getX()) > 0.009 + 5 * GEO.EPS_SMALL then
if BD.USE_LONGCUT then
nSCC = EgtIf( ( bFront and k == 1) or ( not bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
else
nSCC = EgtIf( ( not bFront and k == 1) or ( bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
end
-- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto angolo 3° asse rot
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( EgtIf( bIsTopBladeCurrent, sCutting, sCuttingDn), 'perpendicular', b3Raw, vtN, vtOut))
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -978,27 +1202,30 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
-- se richiesto aggiungo la lavorazione con sega a catena -- se richiesto aggiungo la lavorazione con sega a catena
if bFinishWithChainSaw then if bFinishWithChainSaw then
local dChainSawOverMaterial = 0 local dChainSawOverMaterial = 0
local dChainSawDepth = dOffsetDownBlade - dDimStrip local dChainSawDepth = dOffsetDownBlade + BD.CUT_EXTRA
dEndDist = dEndDistUp dEndDist = dEndDistUp
dEndAccDist = dEndAccDistUp dEndAccDist = dEndAccDistUp
dStartDist = dStartDistUp dStartDist = dStartDistUp
dStartAccDist = dStartAccDistUp dStartAccDist = dStartAccDistUp
for i = nC, 1, -1 do for i = nC, 1, -1 do
local dSal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC) local bFirstCut = ( i == nC)
local dEal = EgtIf( i == 1, -dStartDist, - dStartAccDist - ( i - 2) * dC) local bLastCut = ( i == 1)
local bChainSawOk, sErr = MakeSideFaceByChainSaw( Proc.Id, dChainSawDepth, dChainSawOverMaterial, dSal, dEal) local dSal = EgtIf( bFirstCut, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC)
local dEal = EgtIf( bLastCut, -dStartDist, - dStartAccDist - ( i - 2) * dC)
local bShortenStartOrEnd = true
local bChainSawOk, sErr = MakeSideFaceByChainSaw( Proc.Id, dChainSawDepth, dChainSawOverMaterial, dSal, dEal, bShortenStartOrEnd, bShortenStartOrEnd)
if not bChainSawOk then return false, sErr end if not bChainSawOk then return false, sErr end
end end
end end
-- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut -- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut
elseif ( nSide ~= - 1 or BD.DOWN_HEAD) and nUseMillOnSide == 0 then elseif ( nSide ~= - 1 or BD.DOWN_HEAD) and nUseMillOnSide == 0 then
-- determino la massima elevazione -- determino la massima elevazione
local dElev = BL.GetFaceElevation( Proc.Id, 0, nPartId) local dElev = BL.GetFaceElevation( Proc, 0, b3Solid)
-- recupero la lavorazione -- recupero la lavorazione
local bDownHead = ( nSide == - 1) local bDownHead = ( nSide == - 1)
sMchType = EgtIf( bDownHead, 'Long2Cut_H2', 'Long2Cut') sMchType = EgtIf( bDownHead, 'Long2Cut_H2', 'Long2Cut')
local bExcludeH3 = bLarghAsFace and abs( nSide) ~= 1 -- rimossa l'esclusione della terza testa a seguito di modifica della testa stessa che la rende utilizzabile in tutti i casi
--local bExcludeH3 = bLarghAsFace and abs( nSide) ~= 1
local sMilling = ML.FindMilling( sMchType, dElev, nil, nil, nil, not bDownHead, bDownHead, nil, bExcludeH3) local sMilling = ML.FindMilling( sMchType, dElev, nil, nil, nil, not bDownHead, bDownHead, nil, bExcludeH3)
if not sMilling then if not sMilling then
local sErr = 'Error : milling '..sMchType..' not found in library' local sErr = 'Error : milling '..sMchType..' not found in library'
@@ -1103,8 +1330,18 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
dEndAccDist = min( dEndAccDist, dLen/2) dEndAccDist = min( dEndAccDist, dLen/2)
dStartAccDist = dLen - dEndAccDist dStartAccDist = dLen - dEndAccDist
else else
dStartAccDist = dLen/2 -- se c'è del grezzo aggiuntivo e, considerando il grezzo mi resta abbastanza materiale per pinzare, allora faccio spezzatura asimmetrica
dEndAccDist = dStartAccDist if BD.MIN_CLAMPING_LEN and ( dBarLen - dLen) > dOvmHead + 100 * GEO.EPS_SMALL and ( dBarLen - dStartAccDist > BD.MIN_CLAMPING_LEN) then
dStartAccDist = dBarLen/2
dEndAccDist = dLen - dStartAccDist
-- se sono sul fronte, la spezzatura assimmetrica è inversa
if Proc.AffectedFaces.Front then
dStartAccDist, dEndAccDist = dEndAccDist, dStartAccDist
end
else
dStartAccDist = dLen/2
dEndAccDist = dStartAccDist
end
end end
else else
nC = 1 nC = 1
@@ -1116,17 +1353,6 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
local nM = 0 local nM = 0
local nCountMilHead = 0 local nCountMilHead = 0
for i = 1, nC do for i = 1, nC do
-- Posizione braccio portatesta
local nSCC
if not BD.TURN then
if bFront then
nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
else
nSCC = EgtIf( ( BD.C_SIMM or i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
else
nSCC = EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_DOWN, MCH_SCC.ADIR_ZP, EgtIf( nFaceUse == MCH_MILL_FU.ORTHO_FRONT, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM))
end
-- ciclo sulle passate -- ciclo sulle passate
local nO = 1 local nO = 1
local dStep = 0 local dStep = 0
@@ -1152,25 +1378,41 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
EgtSetMachiningParam( MCH_MP.LIELEV, 0) EgtSetMachiningParam( MCH_MP.LIELEV, 0)
EgtSetMachiningParam( MCH_MP.LITANG, 0) EgtSetMachiningParam( MCH_MP.LITANG, 0)
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR) EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
EgtSetMachiningParam( MCH_MP.LIPERP, dWidth + BD.CUT_EXTRA + BD.CUT_SIC or 20) EgtSetMachiningParam( MCH_MP.LIPERP, dWidth + BD.CUT_EXTRA + ( BD.CUT_SIC or 20))
end end
elseif i == nC and not bEndFixed then elseif i == nC and not bEndFixed then
if nO == 1 or EgtGetMachiningParam( MCH_MP.LOTANG) ~= 0 then if nO == 1 or EgtGetMachiningParam( MCH_MP.LOTANG) ~= 0 then
EgtSetMachiningParam( MCH_MP.LOELEV, 0) EgtSetMachiningParam( MCH_MP.LOELEV, 0)
EgtSetMachiningParam( MCH_MP.LOTANG, 0) EgtSetMachiningParam( MCH_MP.LOTANG, 0)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR) EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
EgtSetMachiningParam( MCH_MP.LOPERP, dWidth + BD.CUT_EXTRA + BD.CUT_SIC or 20) EgtSetMachiningParam( MCH_MP.LOPERP, dWidth + BD.CUT_EXTRA + ( BD.CUT_SIC or 20))
end end
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, 0}}) EgtSetMachiningGeometry( {{ Proc.Id, 0}})
-- inverto se utensile antiorario per garantire senso di percorrenza migliore
local bInvert = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) > 0
-- setto workside e eventuale inversione
if bInvert then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, false)
end
-- limito opportunamente la lavorazione -- limito opportunamente la lavorazione
local dSal = EgtIf( i == 1, -dStartDist, - dStartAccDist - ( i - 2) * dC) local dSal = EgtIf( i == 1, -dStartDist, - dStartAccDist - ( i - 2) * dC)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
local dEal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC) local dEal = EgtIf( i == nC, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC)
if bInvert then
dSal, dEal = dEal, dSal
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- imposto offset radiale -- imposto offset radiale
EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep - BD.CUT_EXTRA) EgtSetMachiningParam( MCH_MP.OFFSR, ( k - 1) * dStep - BD.CUT_EXTRA)
-- Posizione braccio portatesta
local bAreCuttingStepsTowardsHead = ( nStartSide == 0)
local nSCC = ProcessLongCut.GetSCC( Proc, 0, sMilling, nFaceUse, bInvert, i, nC, bAreCuttingStepsTowardsHead, nil, nil)
-- imposto posizione braccio porta testa per non ingombrare agli estremi -- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso della faccia -- imposto uso della faccia
@@ -1181,6 +1423,26 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
end end
local dDepth = min( 0, dMaxDepth - dElev ) local dDepth = min( 0, dMaxDepth - dElev )
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) 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)
-- aumento ingresso su spezzoni per evitare collisione durante approccio pezzo
if bFront then
-- se invertito si allunga ingresso su tutti tranne su ultimo
if bInvert and i ~= nC then
EgtSetMachiningParam( MCH_MP.LIPERP, ( nO - k) * dStep + 10)
-- se non invertito si allunga solo il primo
elseif not bInvert and i == 1 then
EgtSetMachiningParam( MCH_MP.LIPERP, ( nO - k) * dStep + 10)
end
else
-- se invertito si allunga ingresso su tutti
if bInvert then
EgtSetMachiningParam( MCH_MP.LIPERP, ( nO - k) * dStep + 10)
end
end
end
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -1246,8 +1508,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
sMilling = ML.FindMilling( sMchType) sMilling = ML.FindMilling( sMchType)
sPrefix = 'L2CS_' sPrefix = 'L2CS_'
nExtendMach = nUseMillOnSide nExtendMach = nUseMillOnSide
if nUseMillOnSide == 2 then if nUseMillOnSide == 2 then
bRemoveToolRadius = true bRemoveToolRadius = true
end end
-- se testa da sotto -- se testa da sotto
if nSide ~= 1 and BD.DOWN_HEAD then if nSide ~= 1 and BD.DOWN_HEAD then
@@ -1317,7 +1579,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
local dDistToEnd = dToolDiam / 2 local dDistToEnd = dToolDiam / 2
local dDistToEndDn = dToolDiamDn / 2 local dDistToEndDn = dToolDiamDn / 2
-- calcolo l'elevazione della faccia principale -- calcolo l'elevazione della faccia principale
local dFacElev = BL.GetFaceElevation( Proc.Id, 0, nPartId) local dFacElev = BL.GetFaceElevation( Proc, 0, b3Solid)
-- se fresa di fianco o da sotto calcolo quanto l'utensile può andare vicino all'estremo con l'elevazione della faccia minore del raggio utensile -- se fresa di fianco o da sotto calcolo quanto l'utensile può andare vicino all'estremo con l'elevazione della faccia minore del raggio utensile
if ( nUseMillOnSide <= 1 or nSide == -1) and dFacElev < dToolDiam / 2 then if ( nUseMillOnSide <= 1 or nSide == -1) and dFacElev < dToolDiam / 2 then
dDistToEnd = sqrt( dFacElev * ( dToolDiam - dFacElev)) dDistToEnd = sqrt( dFacElev * ( dToolDiam - dFacElev))
@@ -1532,13 +1794,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
local dSal = EgtIf( nPos == 1, -dEndDist, -dEndAccDist - ( nPos - 2) * dC + dOverLapExtend) local dSal = EgtIf( nPos == 1, -dEndDist, -dEndAccDist - ( nPos - 2) * dC + dOverLapExtend)
local dEal = EgtIf( nPos == nC, -dStartDist, -dStartAccDist - ( nC - nPos - 1) * dC + dOverLapExtend) local dEal = EgtIf( nPos == nC, -dStartDist, -dStartAccDist - ( nC - nPos - 1) * dC + dOverLapExtend)
-- Posizione braccio portatesta -- Posizione braccio portatesta
local nSCC --local nSCC
for k = 1, nPass do for k = 1, nPass do
if bFront then
nSCC = EgtIf( ( BD.C_SIMM or j == 1 or j == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
else
nSCC = EgtIf( ( BD.C_SIMM or j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
-- inserisco le parti di lavorazione -- inserisco le parti di lavorazione
nM = nM + 1 nM = nM + 1
local sNameF = EgtIf( vnHead[k] ~= 2, sPrefix, sPrefixDn) .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM) local sNameF = EgtIf( vnHead[k] ~= 2, sPrefix, sPrefixDn) .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM)
@@ -1550,22 +1807,22 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, 0}}) EgtSetMachiningGeometry( {{ Proc.Id, 0}})
-- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso faccia -- imposto uso faccia
local nUseFace = EgtIf( vnHead[k] ~= 2, MCH_MILL_FU.PARAL_DOWN, MCH_MILL_FU.PARAL_TOP) local nFaceUse = EgtIf( vnHead[k] ~= 2, MCH_MILL_FU.PARAL_DOWN, MCH_MILL_FU.PARAL_TOP)
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then nUseFace = MCH_MILL_FU.PARAL_BACK end if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then nFaceUse = MCH_MILL_FU.PARAL_BACK end
EgtSetMachiningParam( MCH_MP.FACEUSE, nUseFace) EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto lato di lavoro e inversione -- imposto lato di lavoro e inversione
local bInvert
if k == 1 then if k == 1 then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true) bInvert = true
else else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
bInvert = false
dSal, dEal = dEal, dSal dSal, dEal = dEal, dSal
end end
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
-- limito opportunamente la lavorazione -- limito opportunamente la lavorazione
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
@@ -1574,6 +1831,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
-- assegno attacco perpendicolare -- assegno attacco perpendicolare
EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp1) EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp1)
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp1) EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp1)
-- step sempre negativi
local bAreCuttingStepsTowardsHead = false
-- calcolo SCC
local nSCC = ProcessLongCut.GetSCC( Proc, 0, EgtIf( vnHead[k] ~= 2, sMilling, sMillingDn), nFaceUse, bInvert, j, nC, bAreCuttingStepsTowardsHead, nil, nil)
-- imposto posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
-- se feature orientata su faccia da sotto provo a cambiare l'attacco -- se feature orientata su faccia da sotto provo a cambiare l'attacco
+332 -68
View File
@@ -1,4 +1,4 @@
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2022/11/30 -- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2023/06/07
-- Gestione calcolo doppio taglio longitudinale per Travi -- Gestione calcolo doppio taglio longitudinale per Travi
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto. -- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
-- 2021/06/29 Corretta gestione caso equivalente a due smussi. -- 2021/06/29 Corretta gestione caso equivalente a due smussi.
@@ -12,6 +12,18 @@
-- 2022/11/30 Modifiche su SCC per TURN. -- 2022/11/30 Modifiche su SCC per TURN.
-- 2023/01/26 Rimossa la pulitura della faccia laterale nel caso in cui la feature abbia almeno una faccia rivolta verso il basso. -- 2023/01/26 Rimossa la pulitura della faccia laterale nel caso in cui la feature abbia almeno una faccia rivolta verso il basso.
-- 2023/01/27 In MakeSideFace il prolungamento di uscita è ora fissato a 10 mm. -- 2023/01/27 In MakeSideFace il prolungamento di uscita è ora fissato a 10 mm.
-- 2023/02/15 Migliorato verso di avanzamento della lama.
-- 2023/02/21 Verso di avanzamento della lama migliorato anche con lama LC.
-- 2023/02/22 Nuova gestione del verso di avanzamento ottimale che contempla tutti i casi.
-- 2023/03/06 Correzione per i casi con lavorazione limitata.
-- 2023/03/23 Correzione per caso con doppia lama da sotto.
-- 2023/06/07 Sistemazione SCC per macchina TURN
-- 2023/10/24 Migliorata spezzatura taglio passante con due spezzoni
-- 2023/10/25 Se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco.
-- 2023/11/24 Aggiunta Q05 per utilizzo lama anche in feature cieche conme per LongCut.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- 2024/03/21 Corretto parametro passato a funzione BL.GetBlockedAxis. Ora tiene in considerazione anche testa sotto
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessLong2Cut = {} local ProcessLong2Cut = {}
@@ -25,6 +37,7 @@ EgtOutLog( ' ProcessLongDoubleCut started', 1)
-- Dati -- Dati
local BD = require( 'BeamData') local BD = require( 'BeamData')
local ML = require( 'MachiningLib') local ML = require( 'MachiningLib')
local Topology = require( 'FeatureTopology')
local dLimMinPiece = BD.LEN_SHORT_PART or 1000 local dLimMinPiece = BD.LEN_SHORT_PART or 1000
@@ -120,9 +133,9 @@ function ProcessLong2Cut.GetLongFacesCount( Proc)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function MakeSideFace( nId, nFac, nSideLimitingFace, sMilling, dToolDiam, nL2CSide, bIsAnyFaceUpsideDown) local function MakeSideFace( nId, nFac, nSideLimitingFace, nInd, sMilling, dToolDiam, nL2CSide, bIsAnyFaceUpsideDown)
if ( not BD.DOWN_HEAD or not BD.TURN) and bIsAnyFaceUpsideDown then if ( not BD.DOWN_HEAD and not BD.TURN) and bIsAnyFaceUpsideDown then
EgtOutLog( 'Long2Cut : side face finishing skipped , down head required') EgtOutLog( 'Long2Cut : side face finishing skipped, down head required')
return true return true
end end
-- inserisco la lavorazione -- inserisco la lavorazione
@@ -136,8 +149,15 @@ local function MakeSideFace( nId, nFac, nSideLimitingFace, sMilling, dToolDiam,
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ nId, nFac}}) EgtSetMachiningGeometry( {{ nId, nFac}})
-- lato di lavoro e inversione -- lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.INVERT, false) if BD.TURN and
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) ( ( nSideLimitingFace == 1 and nInd == EgtIf( nL2CSide ~= -1, 2, 1)) or
( nSideLimitingFace == -1 and nInd == EgtIf( nL2CSide ~= -1, 1, 2))) then
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
else
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
end
-- uso della faccia -- uso della faccia
local nFaceUse = EgtIf( nSideLimitingFace == 1, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.ORTHO_LEFT) local nFaceUse = EgtIf( nSideLimitingFace == 1, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.ORTHO_LEFT)
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
@@ -146,8 +166,11 @@ local function MakeSideFace( nId, nFac, nSideLimitingFace, sMilling, dToolDiam,
-- attacco e uscita -- attacco e uscita
EgtSetMachiningParam( MCH_MP.LIPERP, 0) EgtSetMachiningParam( MCH_MP.LIPERP, 0)
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + 30) EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + 30)
EgtSetMachiningParam( MCH_MP.LOPERP, 2) EgtSetMachiningParam( MCH_MP.LOPERP, 5)
EgtSetMachiningParam( MCH_MP.LOTANG, 10) EgtSetMachiningParam( MCH_MP.LOTANG, 10)
if BD.TURN then
EgtSetMachiningParam( MCH_MP.LOELEV, 10)
end
-- se faccia di fianco e testa da sotto, aumento la sicurezza -- se faccia di fianco e testa da sotto, aumento la sicurezza
if nL2CSide == 0 and BD.DOWN_HEAD then if nL2CSide == 0 and BD.DOWN_HEAD then
EgtSetMachiningParam( MCH_MP.STARTPOS, 80) EgtSetMachiningParam( MCH_MP.STARTPOS, 80)
@@ -295,12 +318,20 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster, nUseSideToolMaster) function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster, nUseSideToolMaster)
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- carico i dati delle face già inserite nelle opportune tabelle -- carico i dati delle face già inserite nelle opportune tabelle
local nFaceLimit, tFaceLong, ptC, vtN = IdentifyFaces( Proc) local nFaceLimit, tFaceLong, ptC, vtN = IdentifyFaces( Proc)
local dLen = Proc.Box:getDimX() local dLen = Proc.Box:getDimX()
-- inizializzazione tabella con eventuali lavorazioni create a posteriori da ritornare al chiamante
local AddedIds = {}
-- recupero lunghezza grezzo totale da info sulla macchinata
local dBarLen = EgtGetInfo( EgtGetCurrMachGroup(), 'BARLEN', 'd')
local dOvmHead = b3Raw:getMax():getX() - b3Solid:getMax():getX()
-- verifico posizione (+1=sopra, -1=sotto, 0=sui lati) -- verifico posizione (+1=sopra, -1=sotto, 0=sui lati)
local nSide = 0 local nSide = 0
if vtN[1]:getZ() > 0.0175 and vtN[2]:getZ() > 0.0175 then if vtN[1]:getZ() > 0.0175 and vtN[2]:getZ() > 0.0175 then
@@ -344,11 +375,28 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
---------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------
local bUseBlade local bUseBlade
local nUseMillOnSide local nUseMillOnSide
local bForceUseBladeOnNotThruFace
-- se presenti utilizzo i parametri dell'eventuale lua "padre" -- se presenti utilizzo i parametri dell'eventuale lua "padre"
if bForcedBladeMaster ~= nil then if bForcedBladeMaster ~= nil then
bUseBlade = bForcedBladeMaster bUseBlade = bForcedBladeMaster
else else
bUseBlade = EgtGetInfo( Proc.Id, 'Q01', 'i') == 1 local nUseBlade = EgtGetInfo( Proc.Id, 'Q05', 'i')
-- funzionamento Q05 --
-- 0: fresa; 1: lama solo se feature passante, faccia verso l'alto; 2: lama solo se feature passante, qualunque orientamento faccia; 3: lama con feature sia cieca che passante, faccia verso l'alto, lavorazione non rovina pezzo successivo; 4: lama con feature sia cieca che passante, qualunque orientamento faccia, lavorazione non rovina pezzo successivo
-- feature passante
if nFaceLimit == 0 then
if nUseBlade == 2 or nUseBlade == 4 or
( nSide == 1 and ( nUseBlade == 1 or nUseBlade == 3)) then
bUseBlade = true
end
-- feature cieca
else
if nUseBlade == 4 or
( nSide == 1 and ( nUseBlade == 3)) then
bUseBlade = true
bForceUseBladeOnNotThruFace = true
end
end
end end
if nUseSideToolMaster ~= nil then if nUseSideToolMaster ~= nil then
nUseMillOnSide = nUseSideToolMaster nUseMillOnSide = nUseSideToolMaster
@@ -395,8 +443,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
_, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[1]) _, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[1])
_, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[2]) _, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[2])
-- Se senza facce limitanti, da sopra o ( da tutte i lati con testa da sotto) e taglio di lama e lunghezza facce maggiore del parametro lunghezza minima -- Se da sopra o ( da tutte i lati con testa da sotto) e taglio di lama e lunghezza facce maggiore del parametro lunghezza minima
if nFaceLimit == 0 and ( bCanUseUnderBlade or bCanUseBlade) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then if ( bCanUseUnderBlade or bCanUseBlade) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then
local sCutting local sCutting
local dToolDiam = 0 local dToolDiam = 0
@@ -442,23 +490,36 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end end
end end
end end
-- se la distanza dal pezzo successivo è inferiore della metà lama, do un warning -- se la fine (a sinistra) non è limitata e ho un pezzo successivo o grezzo riutilizzabile meno distante di metà raggio, setto la fine come limitata
if ( bCanUseBlade or bCanUseUnderBlade) and ( dDistToNextPiece < dToolDiam/2 or dDistToNextPiece < dToolDiamDn/2) then if (( bCanUseBlade or bCanUseUnderBlade) and ( dDistToNextPiece < dToolDiam/2 or dDistToNextPiece < dToolDiamDn/2)) and nFaceLimit < 2 then
sWarn = 'Warning : Cut machining can damage next piece' if bForceUseBladeOnNotThruFace then
EgtOutLog( sWarn) nFaceLimit = nFaceLimit | 2
bForcedLim = true
else
sWarn = 'Warning on saw cut : Cut machining can damage next piece'
EgtOutLog( sWarn)
end
end end
-- determino gli estremi -- determino gli estremi
local dStartAccDist local dStartAccDist
local dEndAccDist local dEndAccDist
local bStartFixed
local bEndFixed
local dStartDist
local dEndDist
local dStartDistUp = 0
local dEndDistUp = 0
local dStartDistDn = 0
local dEndDistDn = 0
local dStartAccDistUp = BD.LONGCUT_ENDLEN local dStartAccDistUp = BD.LONGCUT_ENDLEN
local dEndAccDistUp = BD.LONGCUT_ENDLEN local dEndAccDistUp = BD.LONGCUT_ENDLEN
local dStartAccDistDn = BD.LONGCUT_ENDLEN local dStartAccDistDn = BD.LONGCUT_ENDLEN
local dEndAccDistDn = BD.LONGCUT_ENDLEN local dEndAccDistDn = BD.LONGCUT_ENDLEN
local nC local nC
local dC local dC
local nCUp local nCUp
local dCUp local dCUp
-- determino numero di parti -- determino numero di parti
if bCanUseBlade then if bCanUseBlade then
nCUp = ceil( ( dLen - dStartAccDistUp - dEndAccDistUp) / BD.LONGCUT_MAXLEN) nCUp = ceil( ( dLen - dStartAccDistUp - dEndAccDistUp) / BD.LONGCUT_MAXLEN)
@@ -527,7 +588,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- Posizione braccio portatesta -- Posizione braccio portatesta
local nSCC = MCH_SCC.NONE local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then if not BD.C_SIMM then
nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
end end
local nCountToShift = 0 local nCountToShift = 0
local bChangeBlade local bChangeBlade
@@ -546,7 +607,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
local nFaceUse local nFaceUse
local nFaceUse2 local nFaceUse2
-- se ho solo lama da sotto -- se ho solo lama da sotto
if bCanUseUnderBlade and not bCanUseBlade then if bCanUseUnderBlade and not bCanUseBlade then
@@ -574,8 +635,47 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
elseif vtN[vOrd[j]]:getZ() < -0.707 then elseif vtN[vOrd[j]]:getZ() < -0.707 then
nFaceSide = -1 nFaceSide = -1
end end
-- ricavo box della faccia -- ricavo informazioni della faccia
local b3Fac = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vOrd[j]-1, GDB_BB.STANDARD) local b3Fac = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vOrd[j]-1, GDB_BB.STANDARD)
-- determino accorciamenti se lavorazione cieca
if bForceUseBladeOnNotThruFace then
if bCanUseBlade then
bStartFixed = true
-- limitato a destra
if ( nFaceLimit & 1) ~= 0 then
local dRadius = dToolDiam / 2
local dCat1 = dRadius - dOffset
dStartDistUp = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1))
bStartFixed = false
end
bEndFixed = true
-- limitato a sinistra
if ( nFaceLimit & 2) ~= 0 then
local dRadius = dToolDiam / 2
local dCat1 = dRadius - dOffset
dEndDistUp = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1))
bEndFixed = false
end
end
if bCanUseUnderBlade then
bStartFixed = true
-- limitato a destra
if ( nFaceLimit & 1) ~= 0 then
local dRadius = dToolDiamDn / 2
local dCat1 = dRadius - dOffset
dStartDistDn = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1))
bStartFixed = false
end
bEndFixed = true
-- limitato a sinistra
if ( nFaceLimit & 2) ~= 0 then
local dRadius = dToolDiamDn / 2
local dCat1 = dRadius - dOffset
dEndDistDn = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1))
bEndFixed = false
end
end
end
-- ciclo sulle passate -- ciclo sulle passate
for k = 1, 2 do for k = 1, 2 do
local dLioPerp = ( vWidth[vOrd[j]] - dDimStrip) / 2 + BD.CUT_SIC local dLioPerp = ( vWidth[vOrd[j]] - dDimStrip) / 2 + BD.CUT_SIC
@@ -592,6 +692,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- setto le variabili delle distanze dagli estremi -- setto le variabili delle distanze dagli estremi
dEndAccDist = dEndAccDistUp dEndAccDist = dEndAccDistUp
dStartAccDist = dStartAccDistUp dStartAccDist = dStartAccDistUp
dStartDist = dStartDistUp
dEndDist = dEndDistUp
elseif bCanUseUnderBlade and not bCanUseBlade then elseif bCanUseUnderBlade and not bCanUseBlade then
sNameF = 'L2CD_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring(j) .. '_' .. tostring( nM) sNameF = 'L2CD_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring(j) .. '_' .. tostring( nM)
nMchFId = EgtAddMachining( sNameF, sCuttingDn) nMchFId = EgtAddMachining( sNameF, sCuttingDn)
@@ -599,6 +701,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- setto le variabili delle distanze dagli estremi -- setto le variabili delle distanze dagli estremi
dEndAccDist = dEndAccDistDn dEndAccDist = dEndAccDistDn
dStartAccDist = dStartAccDistDn dStartAccDist = dStartAccDistDn
dStartDist = dStartDistDn
dEndDist = dEndDistDn
bMachDown = true bMachDown = true
-- entrambe le possibilità di lama -- entrambe le possibilità di lama
else else
@@ -611,6 +715,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- setto le variabili delle distanze dagli estremi -- setto le variabili delle distanze dagli estremi
dEndAccDist = dEndAccDistDn dEndAccDist = dEndAccDistDn
dStartAccDist = dStartAccDistDn dStartAccDist = dStartAccDistDn
dStartDist = dStartDistDn
dEndDist = dEndDistDn
bMachDown = true bMachDown = true
-- se di fronte e prima faccia o dietro e seconda faccia, sta lavorando quella più in basso in Z (posizione) -- se di fronte e prima faccia o dietro e seconda faccia, sta lavorando quella più in basso in Z (posizione)
elseif ( ( bFront and j == 1) or ( not bFront and j == 2)) and k == 2 then elseif ( ( bFront and j == 1) or ( not bFront and j == 2)) and k == 2 then
@@ -620,6 +726,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- setto le variabili delle distanze dagli estremi -- setto le variabili delle distanze dagli estremi
dEndAccDist = dEndAccDistDn dEndAccDist = dEndAccDistDn
dStartAccDist = dStartAccDistDn dStartAccDist = dStartAccDistDn
dStartDist = dStartDistDn
dEndDist = dEndDistDn
bMachDown = true bMachDown = true
-- se di fronte e seconda faccia o dietro e prima faccia, sta lavorando la faccia più in alto in Z (posizione) -- se di fronte e seconda faccia o dietro e prima faccia, sta lavorando la faccia più in alto in Z (posizione)
elseif ( ( bFront and j == 2) or ( not bFront and j == 1)) and k == 1 then elseif ( ( bFront and j == 2) or ( not bFront and j == 1)) and k == 1 then
@@ -629,6 +737,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- setto le variabili delle distanze dagli estremi -- setto le variabili delle distanze dagli estremi
dEndAccDist = dEndAccDistUp dEndAccDist = dEndAccDistUp
dStartAccDist = dStartAccDistUp dStartAccDist = dStartAccDistUp
dStartDist = dStartDistUp
dEndDist = dEndDistUp
-- se di fronte e seconda faccia o dietro e prima faccia, sta lavorando la faccia più in alto in Z (posizione) -- se di fronte e seconda faccia o dietro e prima faccia, sta lavorando la faccia più in alto in Z (posizione)
elseif ( ( bFront and j == 2) or ( not bFront and j == 1)) and k == 2 then elseif ( ( bFront and j == 2) or ( not bFront and j == 1)) and k == 2 then
sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring(j) .. '_' .. tostring( nM) sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring(j) .. '_' .. tostring( nM)
@@ -637,6 +747,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- setto le variabili delle distanze dagli estremi -- setto le variabili delle distanze dagli estremi
dEndAccDist = dEndAccDistUp dEndAccDist = dEndAccDistUp
dStartAccDist = dStartAccDistUp dStartAccDist = dStartAccDistUp
dStartDist = dStartDistUp
dEndDist = dEndDistUp
end end
end end
if not nMchFId then if not nMchFId then
@@ -681,46 +793,89 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, vOrd[j]-1}}) EgtSetMachiningGeometry( {{ Proc.Id, vOrd[j]-1}})
-- settaggio di workside, uso faccia e eventuale inversione
-- limito opportunamente la lavorazione -- limito opportunamente la lavorazione
local dSal = EgtIf( i == nC, 0, - dEndAccDist - ( nC - i - 1) * dC) local dSalInner, dSalOuter = - dEndAccDist - ( i - 2) * dC, -dEndDist
local dEal = EgtIf( i == 1, 0, - dStartAccDist - ( i - 2) * dC) local dEalInner, dEalOuter = - dStartAccDist - ( nC - i - 1) * dC, -dStartDist
if ( not bFront and k == 1) or ( bFront and k == 2) then local dSal = EgtIf( i == 1, dSalOuter, dSalInner)
local dEal = EgtIf( i == nC, dEalOuter, dEalInner)
if ( bFront and k == 1) or ( not bFront and k == 2) then
dSal, dEal = dEal, dSal dSal, dEal = dEal, dSal
end end
-- verifico lama in uso e imposto uso faccia
local bIsTopBladeCurrent = not bMachDown
local nFaceUseCurrent
if bCanUseBlade and bCanUseUnderBlade then if bCanUseBlade and bCanUseUnderBlade then
if bCanUseBlade and nSide == -1 then if nSide == -1 then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) dSal, dEal = dEal, dSal
-- imposto uso della faccia if k == 1 then
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse2, nFaceUse)) nFaceUseCurrent = nFaceUse2
else
nFaceUseCurrent = nFaceUse
end
else else
EgtSetMachiningParam( MCH_MP.INVERT, true) if k == 1 then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) nFaceUseCurrent = nFaceUse
-- imposto uso della faccia else
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2)) nFaceUseCurrent = nFaceUse2
end
end end
elseif bCanUseBlade and BD.USE_LONGCUT then
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
dSal, dEal = dEal, dSal
-- imposto uso della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2))
elseif bCanUseUnderBlade then elseif bCanUseUnderBlade then
if nSide ~= 0 then if k == 1 then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) nFaceUseCurrent = nFaceUse
else
nFaceUseCurrent = nFaceUse2
end end
-- imposto uso della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2))
else else
if bCanUseBlade and nSide == -1 then if k == 1 then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) nFaceUseCurrent = nFaceUse
else
nFaceUseCurrent = nFaceUse2
end end
-- imposto uso della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( k == 1, nFaceUse, nFaceUse2))
end end
-- recupero alcune informazioni utili dalla lavorazione attuale
local bIsCurrentBladeCCW
local sCuttingNameMach
if bIsTopBladeCurrent then
sCuttingNameMach = sCutting
else
sCuttingNameMach = sCuttingDn
end
EgtMdbSetCurrMachining( sCuttingNameMach)
bIsCurrentBladeCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
-- imposto la direzione di lavoro per avere scarico del truciolo ottimale
local nWorkSide, bInvert
if ( not bIsTopBladeCurrent and abs( nSide) ~= 0) or ( bCanUseBlade and bCanUseUnderBlade and nSide == -1) then
if bIsCurrentBladeCCW then
nWorkSide = MCH_MILL_WS.LEFT
bInvert = true
dSal, dEal = dEal, dSal
else
nWorkSide = MCH_MILL_WS.RIGHT
bInvert = false
end
else
if bIsCurrentBladeCCW then
nWorkSide = MCH_MILL_WS.LEFT
bInvert = false
else
nWorkSide = MCH_MILL_WS.RIGHT
bInvert = true
dSal, dEal = dEal, dSal
end
end
-- setto la lavorazione con i valori calcolati
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide)
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUseCurrent)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
-- imposto offset radiale -- imposto offset radiale
EgtSetMachiningParam( MCH_MP.OFFSR, EgtIf( nSide == -1, -dOffset, dOffset)) EgtSetMachiningParam( MCH_MP.OFFSR, EgtIf( nSide == -1, -dOffset, dOffset))
-- imposto attacco/uscita -- imposto attacco/uscita
@@ -730,6 +885,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp) EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
-- imposto posizione braccio porta testa per non ingombrare agli estremi -- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto angolo 3° asse rot
local vtOut = EgtIf( vtN[vOrd[j]]:getX() > 0, X_AX(), -X_AX())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCuttingNameMach, 'perpendicular', b3Raw, vtN, vtOut))
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -752,6 +910,43 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end end
end end
end end
-- eventuali puliture impronta lama
for j = 1, #vOrd do
if bForceUseBladeOnNotThruFace then
-- determino la massima elevazione
local dElev = 0
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[1], b3Solid)
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[2], b3Solid)
dElev = max( dFacElev1, dFacElev2)
-- recupero la lavorazione
local sMilling
local bDownHead = ( nSide == -1 and BD.DOWN_HEAD)
sMilling = ML.FindMilling( 'Long2Cut', dElev, nil, nil, nil, not bDownHead, bDownHead)
if not sMilling then
local sErr = 'Error : Long2Cut not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
local dToolDiam = 0
local dMaxDepth = 0
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
-- eventuale lavorazione della faccia limitante l'inizio (a destra)
if not bStartFixed then
MakeSideFace( Proc.Id, tFaceLong[vOrd[j]], 1, j, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown)
end
-- eventuale lavorazione della faccia limitante la fine (a sinistra)
if not bEndFixed then
MakeSideFace( Proc.Id, tFaceLong[vOrd[j]], -1, j, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown)
end
end
end
-- altrimenti concavo -- altrimenti concavo
else else
-- si percorrono i lati alto e basso della faccia -- si percorrono i lati alto e basso della faccia
@@ -783,6 +978,22 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco.
local dCheckDepth = 0
if bCanUseBlade then
dCheckDepth = dMaxDepth
elseif bCanUseUnderBlade then
dCheckDepth = dMaxDepthDn
end
if vWidth[vOrd[j]] + 100 * GEO.EPS_SMALL > dCheckDepth then
if not( ProcessLong2Cut.Identify( Proc)) then
return false
else
local sWarn2 = 'Warning in ' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. ' : elevation (' .. EgtNumToString( vWidth[vOrd[j]], 1) .. ') bigger than max saw depth (' .. EgtNumToString( dCheckDepth, 1) .. ')'
if not sWarn then sWarn = '' end
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
end
end
-- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama -- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama
if nSide <= 0 and bCanUseUnderBlade then if nSide <= 0 and bCanUseUnderBlade then
if ( vWidth[vOrd[j]] / 2) > dMaxDepthDn then if ( vWidth[vOrd[j]] / 2) > dMaxDepthDn then
@@ -794,16 +1005,27 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- ciclo sulle passate -- ciclo sulle passate
local dOffset local dOffset
local dLioPerp local dLioPerp
if j == 1 then -- il primo taglio lo faccio completo se angolo interno maggiore di 90 if j == 1 then -- il primo taglio lo faccio completo se angolo interno maggiore di 90
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0)
-- se la faccia è più grande del massimo materiale lama, allora limito lavorazione
if dMinOffsBigFace > 0 then
dOffset = dMinOffsBigFace
-- se angolo interno inferiore di 90° calcolo l'arretramento della lama + un piccolo delta di 0.3 -- se angolo interno inferiore di 90° calcolo l'arretramento della lama + un piccolo delta di 0.3
if dAng < - ( 90 + 10 * GEO.EPS_SMALL) then elseif dAng < - ( 90 + 10 * GEO.EPS_SMALL) then
dOffset = 0.3 + ((dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len() dOffset = 0.3 + ((dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len()
else else
dOffset = 0 dOffset = 0
end end
dLioPerp = vWidth[vOrd[j]] + BD.CUT_SIC dLioPerp = vWidth[vOrd[j]] + BD.CUT_SIC
else -- il secondo ridotto della distanza minima e della componente spessore della lama else -- il secondo ridotto della distanza minima e della componente spessore della lama
dOffset = dDimStrip + ((dToolThick* vtN[vOrd[1]]) - (dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len() local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0)
-- se la faccia è più grande del massimo materiale lama, allora limito lavorazione
if dMinOffsBigFace > 0 then
dOffset = dMinOffsBigFace
else
dOffset = dDimStrip + ((dToolThick* vtN[vOrd[1]]) - (dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len()
end
dLioPerp = vWidth[vOrd[j]] - dOffset + BD.CUT_SIC dLioPerp = vWidth[vOrd[j]] - dOffset + BD.CUT_SIC
end end
local dLioTang = 0 local dLioTang = 0
@@ -856,9 +1078,27 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang) EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp) EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
-- imposto posizione braccio porta testa per non ingombrare agli estremi -- imposto posizione braccio porta testa per non ingombrare agli estremi
local ptP1LineToMachine, _, ptP2LineToMachine = EgtSurfTmFacetOppositeSide( Proc.Id, vOrd[j] - 1, BL.GetVersRef( vFaceUse[vOrd[j]]), GDB_ID.ROOT)
local vtTg = ptP2LineToMachine - ptP1LineToMachine ; vtTg:normalize()
local bIsMachiningInverted = EgtGetMachiningParam( MCH_MP.INVERT)
if bIsMachiningInverted then
vtTg = -vtTg
end
if BD.C_SIMM then
if abs( vtN[vOrd[j]]:getX()) < GEO.EPS_SMALL then
nSCC = EgtIf( ( vtTg:getX() > GEO.EPS_SMALL), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
else
nSCC = MCH_SCC.NONE
end
else
nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- determino e imposto l'utilizzo della faccia -- determino e imposto l'utilizzo della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse[vOrd[j]]) EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse[vOrd[j]])
-- imposto angolo 3° asse rot
local vtOut = EgtIf( vtN[vOrd[j]]:getX() > 0, X_AX(), -X_AX())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( EgtIf( bCanUseUnderBlade, sCuttingDn, sCutting), 'perpendicular', b3Raw, vtN, vtOut))
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -873,9 +1113,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
elseif ( nSide ~= -1 or BD.DOWN_HEAD or BD.TURN) and nUseMillOnSide == 0 then elseif ( nSide ~= -1 or BD.DOWN_HEAD or BD.TURN) and nUseMillOnSide == 0 then
-- determino la massima elevazione -- determino la massima elevazione
local dElev = 0 local dElev = 0
local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[1], nPartId) local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[1], b3Solid)
local dFacElev2 = BL.GetFaceElevation( Proc.Id, tFaceLong[2], nPartId) local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[2], b3Solid)
-- 03/12/2020
-- se facce concave e a 90 gradi, prendo l'elevazione minima -- se facce concave e a 90 gradi, prendo l'elevazione minima
if bOrtho then if bOrtho then
dElev = min( dFacElev1, dFacElev2) dElev = min( dFacElev1, dFacElev2)
@@ -991,8 +1230,14 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
dEndAccDist = min( dEndAccDist, dLen/2) dEndAccDist = min( dEndAccDist, dLen/2)
dStartAccDist = dLen - dEndAccDist dStartAccDist = dLen - dEndAccDist
else else
dStartAccDist = dLen/2 -- se c'è del grezzo aggiuntivo e, considerando il grezzo mi resta abbastanza materiale per pinzare, allora faccio spezzatura asimmetrica
dEndAccDist = dStartAccDist if BD.MIN_CLAMPING_LEN and ( dBarLen - dLen) > dOvmHead + 100 * GEO.EPS_SMALL and ( dBarLen - dStartAccDist > BD.MIN_CLAMPING_LEN) then
dStartAccDist = dBarLen/2
dEndAccDist = dLen - dStartAccDist
else
dStartAccDist = dLen/2
dEndAccDist = dStartAccDist
end
end end
else else
nC = 1 nC = 1
@@ -1032,6 +1277,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end end
end end
end end
if Proc.bMoveAfterSplit then
nC = 1
dStartDist = Proc.Box:getDimX() - ( dToolDiam / 2 + 5)
dEndDist = - ( dToolDiam / 2 + 5)
end
if nIni == 2 then if nIni == 2 then
dStartDist, dEndDist = dEndDist, dStartDist dStartDist, dEndDist = dEndDist, dStartDist
dStartAccDist, dEndAccDist = dEndAccDist, dStartAccDist dStartAccDist, dEndAccDist = dEndAccDist, dStartAccDist
@@ -1049,18 +1299,21 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local nPos = EgtIf( i == 1, j, nC - j + 1) local nPos = EgtIf( i == 1, j, nC - j + 1)
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + EgtIf( bSide, dOverLapExtend, 0)) local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + EgtIf( bSide, dOverLapExtend, 0))
local dEal = EgtIf( nPos == nC, - EgtIf( i == nIni, dEndDist, dStartDist), - EgtIf( i == nIni, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC + EgtIf( bSide, dOverLapExtend, 0)) local dEal = EgtIf( nPos == nC, - EgtIf( i == nIni, dEndDist, dStartDist), - EgtIf( i == nIni, dEndAccDist, dStartAccDist) - ( nC - nPos - 1) * dC + EgtIf( bSide, dOverLapExtend, 0))
if nSide == -1 then
dSal, dEal = dEal, dSal
end
-- Posizione braccio portatesta -- Posizione braccio portatesta
local nSCC = MCH_SCC.NONE local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then if not BD.C_SIMM then
if not BD.TURN then if not BD.TURN then
nSCC = EgtIf( ( j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) nSCC = EgtIf( ( j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
else else
if nSide == 1 then if nSide == 1 or nSide == -1 then
nSCC = EgtIf( vtN[vOrd[i]]:getY() < 0, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP) local bFromYM = (( vtN[vOrd[i]]:getY() < 0 and bConvex) or ( vtN[vOrd[i]]:getY() > 0 and not bConvex))
elseif nSide == -1 then nSCC = EgtIf( bFromYM, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
nSCC = EgtIf( vtN[vOrd[i]]:getY() < 0, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
else else
nSCC = EgtIf( vtN[vOrd[i]]:getZ() < 0, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP) local bFromZM = (( vtN[vOrd[i]]:getZ() < 0 and bConvex) or ( vtN[vOrd[i]]:getZ() > 0 and not bConvex))
nSCC = EgtIf( bFromZM, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
end end
end end
end end
@@ -1132,14 +1385,27 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end end
-- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra) -- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra)
if bConvex and j == 1 and not bStartFixed then if bConvex and j == 1 and not bStartFixed then
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown) MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, i, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown)
end end
-- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra) -- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra)
if bConvex and j == nC and not bEndFixed then if bConvex and j == nC and not bEndFixed then
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown) MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, i, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown)
end end
end end
end end
if not Proc.MoveAfterSplit and not bEndFixed and not bConvex then
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error : missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
local AddProc = { Id = AddId, Grp = 0, Prc = 12, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId, bMoveAfterSplit = true}
Topology.Classify( AddProc, b3Raw)
table.insert( AddedIds, AddProc)
end
-- altrimenti lavorazione di fianco : Long2CutSide o Long2CutDown -- altrimenti lavorazione di fianco : Long2CutSide o Long2CutDown
else else
@@ -1236,8 +1502,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local dDistToEnd = dToolDiam / 2 local dDistToEnd = dToolDiam / 2
local dDistToEndDn = dToolDiamDn / 2 local dDistToEndDn = dToolDiamDn / 2
-- calcolo l'elevazione della faccia principale -- calcolo l'elevazione della faccia principale
local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[vOrd[1]], nPartId) local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[1]], b3Solid)
local dFacElev2 = BL.GetFaceElevation( Proc.Id, tFaceLong[vOrd[2]], nPartId) local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[2]], b3Solid)
-- se fresa di fianco o da sotto calcolo quanto l'utensile può andare vicino al limite se l'elevazione della faccia è minore del raggio utensile -- 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 if nUseMillOnSide <= 1 or nSide == -1 then
local dFacElev = max( dFacElev1, dFacElev2) local dFacElev = max( dFacElev1, dFacElev2)
@@ -1555,7 +1821,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepthDn - dCollSic, 1) .. ')' sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepthDn - dCollSic, 1) .. ')'
end end
dDepth = min( dMaxDepthDn - dCollSic, vWidth[vOrd[i]] + dAgg) dDepth = min( dMaxDepthDn - dCollSic, vWidth[vOrd[i]] + dAgg)
dDepth2 = vWidth[vOrd[i]] + dAgg - dDepth
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
else else
dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getZ(), vtN[vOrd[i]]:getY()) / dNz))) dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getZ(), vtN[vOrd[i]]:getY()) / dNz)))
@@ -1563,7 +1828,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - dCollSic, 1) .. ')' sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - dCollSic, 1) .. ')'
end end
dDepth = min( dMaxDepth - dCollSic, vWidth[vOrd[i]] + dAgg) dDepth = min( dMaxDepth - dCollSic, vWidth[vOrd[i]] + dAgg)
dDepth2 = vWidth[vOrd[i]] + dAgg - dDepth
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
end end
-- eseguo -- eseguo
@@ -1574,18 +1838,18 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end end
-- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra) -- se facce principali convesse, eventuale lavorazione della faccia limitante l'inizio (a destra)
if bConvex and j == 1 and not bStartFixed and bRemoveToolRadius then if bConvex and j == 1 and not bStartFixed and bRemoveToolRadius then
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, sMilling, dToolDiam) MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], 1, i, sMilling, dToolDiam)
end end
-- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra) -- se facce principali convesse, eventuale lavorazione della faccia limitante la fine (a sinistra)
if bConvex and j == nC and not bEndFixed and bRemoveToolRadius then if bConvex and j == nC and not bEndFixed and bRemoveToolRadius then
MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, sMilling, dToolDiam) MakeSideFace( Proc.Id, tFaceLong[vOrd[i]], -1, i, sMilling, dToolDiam)
end end
end end
end end
end end
return true, sWarn return true, sWarn, nil, AddedIds
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
return ProcessLong2Cut return ProcessLong2Cut
+11 -11
View File
@@ -3,6 +3,7 @@
-- 2020/05/28 Tipo di lavorazione passato da Mark a Text. -- 2020/05/28 Tipo di lavorazione passato da Mark a Text.
-- 2021/05/03 Aggiunta gestione testa da sotto. -- 2021/05/03 Aggiunta gestione testa da sotto.
-- 2022/12/05 Aggiunta gestione tipo di lavorazione Text_AT. -- 2022/12/05 Aggiunta gestione tipo di lavorazione Text_AT.
-- 2024/09/04 In Make gestione di più geometrie ausiliarie ( ora si lavora anche il testo, oltre che alle linee di marcatura)
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessMark = {} local ProcessMark = {}
@@ -50,9 +51,6 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessMark.Make( Proc, nPhase, nRawId, nPartId) function ProcessMark.Make( Proc, nPhase, nRawId, nPartId)
-- recupero eventuale geometria ausiliaria
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.Id end
-- recupero i dati della marcatura -- recupero i dati della marcatura
local vtExtr local vtExtr
if EgtGetType( Proc.Id) ~= GDB_TY.EXT_TEXT then if EgtGetType( Proc.Id) ~= GDB_TY.EXT_TEXT then
@@ -108,13 +106,15 @@ function ProcessMark.Make( Proc, nPhase, nRawId, nPartId)
EgtSetOperationMode( nMchFId, false) EgtSetOperationMode( nMchFId, false)
return false, sErr return false, sErr
end end
-- eventuale lavorazione su seconda geometria -- si verifica se ci sono altre geometrie da lavorare
if AuxId then local AdditionalGeometries = EgtSplitString( EgtGetInfo( Proc.Id, 'AUXID', 's')) or {}
for i = 1, #AdditionalGeometries do
local AuxId = Proc.Id + AdditionalGeometries[i]
-- inserisco la lavorazione di fresatura -- inserisco la lavorazione di fresatura
local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local nOtherMachiningId = EgtAddMachining( sName, sMilling)
local nMchF2Id = EgtAddMachining( sName, sMilling) if not nOtherMachiningId then
if not nMchF2Id then sName = 'Decor' .. '_' .. tostring( i) .. '_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
@@ -125,14 +125,14 @@ function ProcessMark.Make( Proc, nPhase, nRawId, nPartId)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchF2Id, false) EgtSetOperationMode( nOtherMachiningId, false)
return false, sErr return false, sErr
end end
-- se geometria a X maggiore, la sposto prima -- se geometria a X maggiore, la sposto prima
local ptS1 = EgtSP( Proc.Id, GDB_ID.ROOT) local ptS1 = EgtSP( Proc.Id, GDB_ID.ROOT)
local ptS2 = EgtSP( AuxId, GDB_ID.ROOT) local ptS2 = EgtSP( AuxId, GDB_ID.ROOT)
if ptS2:getX() > ptS1:getX() then if ptS2:getX() > ptS1:getX() then
EgtRelocateGlob( nMchF2Id, nMchFId, GDB_IN.BEFORE) EgtRelocateGlob( nOtherMachiningId, nMchFId, GDB_IN.BEFORE)
end end
end end
return true return true
+149 -23
View File
@@ -1,4 +1,4 @@
-- ProcessMortise.lua by Egaltech s.r.l. 2022/12/12 -- ProcessMortise.lua by Egaltech s.r.l. 2023/08/10
-- Gestione calcolo mortase per Travi -- Gestione calcolo mortase per Travi
-- 2021/07/20 Aggiunta gestione rinvio angolare su FAST. -- 2021/07/20 Aggiunta gestione rinvio angolare su FAST.
-- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda). -- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda).
@@ -9,6 +9,13 @@
-- 2022/12/12 Migliorato controllo necessità CleanCorners. -- 2022/12/12 Migliorato controllo necessità CleanCorners.
-- 2023/01/31 Aggiunta gestione lavorazione in doppio. -- 2023/01/31 Aggiunta gestione lavorazione in doppio.
-- 2023/01/31 Creata la funzione ConvertToClosedCurve (parte della ProcessMortise.Make) e spostata in BeamLib. -- 2023/01/31 Creata la funzione ConvertToClosedCurve (parte della ProcessMortise.Make) e spostata in BeamLib.
-- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax.
-- 2023/06/27 Esclusa la ricerca lati aperti per le mortase passanti, per le quali il contorno finisce sulla faccia e il riconoscimento sbaglia.
-- 2023/07/21 Correzioni per mortise passanti con curva Aux che guarda in basso.
-- 2023/08/10 Modificata scelta SCC per tasche in Y+/- in coda o quasi.
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- 2024/02/28 Forzata SPIRAL_IN se c'è anche un solo lato aperto
-- 2024/03/05 Aggiunta possibilità di inserire lavorazione di smusso
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessMortise = {} local ProcessMortise = {}
@@ -24,6 +31,9 @@ EgtOutLog( ' ProcessMortise started', 1)
local BD = require( 'BeamData') local BD = require( 'BeamData')
local ML = require( 'MachiningLib') local ML = require( 'MachiningLib')
-- variabili assegnazione parametri Q
local Q_DEPTH_CHAMFER = 'Q02' -- d
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Riconoscimento della feature -- Riconoscimento della feature
function ProcessMortise.Identify( Proc) function ProcessMortise.Identify( Proc)
@@ -118,11 +128,11 @@ end
local nFaceUse = BL.GetNearestParalOpposite( vtN) local nFaceUse = BL.GetNearestParalOpposite( vtN)
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) 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 -- 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
sNotes = 'Plunge=3;' local sNotes = 'Plunge=3;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
-- imposto angolo 3° asse rot -- imposto angolo 3° asse rot
local vtOrtho = BL.GetVersRef( nFaceUse) local vtOrtho = BL.GetVersRef( nFaceUse)
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1)) EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sMortising, 'perpendicular'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1)) EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
-- calcolo la lavorazione -- calcolo la lavorazione
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
@@ -132,7 +142,7 @@ end
return false, sErr return false, sErr
end end
-- impostazione alternativa angolo 3° asse rot -- impostazione alternativa angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2)) EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sMortising, 'parallel'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2)) EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2))
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -256,7 +266,7 @@ function ProcessMortise.VerifyMortiseOrPocket( Proc, dDiam, dDepth, dMaxTotLen,
sPocketing = ML.FindPocketing( sType, dDiam, 0, dMaxTotLen, bExcludeH2) sPocketing = ML.FindPocketing( sType, dDiam, 0, dMaxTotLen, bExcludeH2)
end end
if not sPocketing then if not sPocketing then
return false return nil
end end
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
local dMaxDepth = 0 local dMaxDepth = 0
@@ -271,7 +281,36 @@ function ProcessMortise.VerifyMortiseOrPocket( Proc, dDiam, dDepth, dMaxTotLen,
return sPocketing, dMaxDepth, dToolDiam return sPocketing, dMaxDepth, dToolDiam
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham, bDownHead)
local nChamfer = 0
-- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId)
-- verifico che lo smusso sia richiesto
local dDepth = EgtGetInfo( Proc.Id, Q_DEPTH_CHAMFER, 'd') or 0
if dDepth > 0 then
nChamfer = 1
end
-- recupero la lavorazione
local sMilling
if nChamfer > 0 then
if bDownHead then
sMilling = ML.FindMilling( 'Mark_H2', nil, nil, nil, nil, false, true)
else
sMilling = ML.FindMilling( 'Mark')
end
if not sMilling then
local sErr = 'Error : Mark not found in library'
EgtOutLog( sErr)
return -1, 0, sErr
end
end
return nChamfer, dDepth, sMilling
end
---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- ingombro del pezzo -- ingombro del pezzo
@@ -293,10 +332,6 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- recupero versore estrusione della curva supplementare
local vtExtr = EgtCurveExtrusion( AuxId, GDB_ID.ROOT)
-- se curva di contorno aperta la rendo chiusa
BL.ConvertToClosedCurve( Proc, AuxId)
-- verifico se frontale -- verifico se frontale
local bFront = ( Proc.Prc == 51) local bFront = ( Proc.Prc == 51)
-- recupero i dati della faccia di fondo -- recupero i dati della faccia di fondo
@@ -307,8 +342,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
ptC = frMor:getOrigin() ptC = frMor:getOrigin()
vtN = frMor:getVersZ() vtN = frMor:getVersZ()
end end
-- recupero versore estrusione della curva supplementare
local vtExtr = EgtCurveExtrusion( AuxId, GDB_ID.ROOT)
-- Confronto le direzioni dei 2 versori : se diverse la faccia 0 non è il fondo => mortasa passante -- Confronto le direzioni dei 2 versori : se diverse la faccia 0 non è il fondo => mortasa passante
local bOpenBtm = not AreSameVectorApprox( vtExtr, vtN) local bOpenBtm = not AreSameVectorApprox( vtExtr, vtN)
-- se curva di contorno aperta la rendo chiusa
local _, bModif = BL.ConvertToClosedCurve( Proc, AuxId)
-- se la mortasa passante il contorno è sulla faccia della trave e il riconoscimento lati aperti non è corretto
if not bModif and not bOpenBtm then
BL.SetOpenSide( AuxId, b3Solid)
end
if bOpenBtm then if bOpenBtm then
-- creo superficie chiusa -- creo superficie chiusa
local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05) local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05)
@@ -374,7 +417,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB)
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} 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) local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
@@ -395,6 +439,63 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local bPockUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259) local bPockUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
local bPockDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174) local bPockDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174)
local bPockAngTrasm = ( BD.ANG_TRASM and vtExtr:getZ() < -0.1) local bPockAngTrasm = ( BD.ANG_TRASM and vtExtr:getZ() < -0.1)
-- recupero i dati della curva e del profilo
local dDepth = dMorH
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
local bToolInv = ( not bDownHead and vtExtr:getZ() < -0.1 and Proc.Box:getDimZ() > b3Solid:getDimZ() - 5)
local dExtra = 2
-- verifico se servono gli smussi. Se lavorazione principale di svuotatura significa che è solo da un lato
-- generalmente sono lavorazioni non molto lunghe, quindi non si gestistono gli step
-- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva
local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true)
-- se devo inserire il chamfer
if nChamfer > 0 and Proc.Grp ~= 0 and dDepth > dDepthCham then
-- inserisco la lavorazione
local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sNameCh, sChamfer)
if not nMchId then
local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
if not bToolInv then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
end
-- assegno affondamento e offset radiale
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra - dMorH)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
if Proc.Head then
nSCC = MCH_SCC.ADIR_XP
elseif Proc.Tail then
nSCC = MCH_SCC.ADIR_XM
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
nSCC = MCH_SCC.ADIR_YP
elseif vtExtr:getY() > -0.01 then
nSCC = MCH_SCC.ADIR_YP
else
nSCC = MCH_SCC.ADIR_YM
end
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
end
end
-- recupero la lavorazione -- recupero la lavorazione
local sPockType = 'Mortise' local sPockType = 'Mortise'
local sMchExt = '' local sMchExt = ''
@@ -450,10 +551,17 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- verifico se invertire versore estrusione geometria -- verifico se invertire direzione utensile
if bRevertSide then if bRevertSide then
EgtModifyCurveExtrusion( AuxId, -vtExtr, GDB_ID.ROOT) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
end end
-- se ho anche solo un lato aperto, forzo SPIRAL-IN
local vOpen = EgtGetInfo( AuxId, 'OPEN', 'vi')
if vOpen and #vOpen > 0 then
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- sistemo la direzione di lavoro -- sistemo la direzione di lavoro
@@ -462,11 +570,14 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local nSCC = MCH_SCC.NONE local nSCC = MCH_SCC.NONE
if bPockAngTrasm then if bPockAngTrasm then
nSCC = MCH_SCC.ADIR_NEAR nSCC = MCH_SCC.ADIR_NEAR
elseif not BD.C_SIMM then elseif not BD.C_SIMM and not BD.TURN then
if abs( vtN:getX()) < GEO.EPS_SMALL and abs( vtN:getY()) < GEO.EPS_SMALL then if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
nSCC = MCH_SCC.ADIR_YM nSCC = MCH_SCC.ADIR_YM
elseif abs( vtN:getX()) < GEO.EPS_SMALL then elseif abs( vtN:getX()) < 0.1 then
nSCC = MCH_SCC.ADIR_XP local bNearTail = ( Proc.Box:getMax():getX() < b3Solid:getCenter():getX() and
Proc.Box:getMax():getX() - b3Solid:getMin():getX() < 1000)
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
nSCC = EgtIf( BL.IsPartFinalPhase( EgtGetCurrPhase()) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
elseif vtN:getY() < GEO.EPS_SMALL then elseif vtN:getY() < GEO.EPS_SMALL then
nSCC = EgtIf( bRevertSide, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) nSCC = EgtIf( bRevertSide, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
else else
@@ -493,9 +604,18 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
dMorH = dMaxDepth dMorH = dMaxDepth
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')') EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
else else
if bOpenBtm and not bForceOneSide then -- se mortasa passante setto metà profondità -- se passante e lavorabile da due lati
if bOpenBtm and not bForceOneSide then
-- imposto metà profondità
nDepthMin = -dMorH nDepthMin = -dMorH
EgtSetMachiningParam( MCH_MP.DEPTH, nDepthMin) EgtSetMachiningParam( MCH_MP.DEPTH, nDepthMin)
-- se altrimenti passante ma lavorabile solo da un lato
elseif bOpenBtm and bForceOneSide then
if bRevertSide then
EgtSetMachiningParam( MCH_MP.DEPTH, min( dMorH + BD.CUT_EXTRA, dMaxDepth))
else
EgtSetMachiningParam( MCH_MP.DEPTH, min( BD.CUT_EXTRA, dMaxDepth - dMorH))
end
end end
end end
-- imposto elevazione -- imposto elevazione
@@ -503,6 +623,9 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- se lavorazione in doppio -- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then if Proc.Double and Proc.Double > 0 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double) sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= Proc.PrevDouble then
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
end
end end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo -- eseguo
@@ -523,7 +646,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr return false, sErr
end end
-- faccio la copia e la metto nel layer dedicato alle geometrie aggiunte -- faccio la copia e la metto nel layer dedicato alle geometrie aggiunte
local AuxId_oppo = EgtCopyGlob( AuxId, BL.GetAddGroup(nPartId)) local AuxId_oppo = EgtCopyGlob( AuxId, BL.GetAddGroup(nPartId))
-- inverto la direzione estrusione di questa -- inverto la direzione estrusione di questa
EgtModifyCurveExtrusion( AuxId_oppo, - vtExtr, GDB_ID.ROOT) EgtModifyCurveExtrusion( AuxId_oppo, - vtExtr, GDB_ID.ROOT)
-- aggiungo geometria -- aggiungo geometria
@@ -532,11 +655,14 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false)) EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then if not BD.C_SIMM and not BD.TURN then
if abs( vtN:getX()) < GEO.EPS_SMALL and abs( vtN:getY()) < GEO.EPS_SMALL then if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
nSCC = MCH_SCC.ADIR_YM nSCC = MCH_SCC.ADIR_YM
elseif abs( vtN:getX()) < GEO.EPS_SMALL then elseif abs( vtN:getX()) < 0.1 then
nSCC = MCH_SCC.ADIR_XP local bNearTail = ( Proc.Box:getMax():getX() < b3Solid:getCenter():getX() and
Proc.Box:getMax():getX() - b3Solid:getMin():getX() < 1000)
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
nSCC = EgtIf( BL.IsPartFinalPhase( EgtGetCurrPhase()) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
elseif vtN:getY() < GEO.EPS_SMALL then elseif vtN:getY() < GEO.EPS_SMALL then
nSCC = MCH_SCC.ADIR_YP nSCC = MCH_SCC.ADIR_YP
else else
+4 -2
View File
@@ -9,6 +9,7 @@
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto. -- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria. -- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura. -- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessProfCamb = {} local ProcessProfCamb = {}
@@ -285,7 +286,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo piano di sgrossatura e lo lavoro -- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( AuxId, vtNF) local ptStart, vtNP = GetSawCutData( AuxId, vtNF)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId) EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura -- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
@@ -306,7 +307,8 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti applico taglio di lama -- altrimenti applico taglio di lama
else else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bOk then if not bOk then
return false, sErr return false, sErr
+61 -38
View File
@@ -1,10 +1,13 @@
-- ProcessProfConcave.lua by Egaltech s.r.l. 2022/05/28 -- ProcessProfConcave.lua by Egaltech s.r.l. 2023/07/31
-- Gestione calcolo profilo concavo per Travi -- Gestione calcolo profilo concavo per Travi
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto. -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
-- 2022/02/02 Aggiunta funzione OnlyChamfer. -- 2022/02/02 Aggiunta funzione OnlyChamfer.
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto. -- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria. -- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
-- 2023/05/25 Sistemazione SCC per TURN.
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessProfConcave = {} local ProcessProfConcave = {}
@@ -88,7 +91,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar) bFirstTrim, bLastTrim, dOffsetPar)
-- confronto il punto iniziale e finale della lavorazione con il box della feature -- confronto il punto iniziale e finale della lavorazione con il box della feature
-- e se è vicino alla parte esterna della trave inverto la lavorazione -- e se è vicino alla parte esterna della trave inverto la lavorazione
@@ -96,6 +99,9 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
local ptEp = EgtGetMachiningEndPoint() local ptEp = EgtGetMachiningEndPoint()
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE) local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
if nMachMode == 1 and ptSP and ptEp then if nMachMode == 1 and ptSP and ptEp then
-- recupero flag inversione direzione di lavorazione
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
-- verifico se da aggiustare
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) < if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
-- ottengo il lato lavoro e lo inverto -- ottengo il lato lavoro e lo inverto
@@ -103,9 +109,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
if nSideWork > 0 then if nSideWork > 0 then
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)) EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
end end
-- ottengo l'inversione e setto il contrario -- imposto il contrario dell'inversione trovata
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT) bInvertMode = not bInvertMode
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode) EgtSetMachiningParam( MCH_MP.INVERT, bInvertMode)
end
-- se lavorazione invertita rispetto a geometria, scambio dati di inizio e fine
if bInvertMode then
dLenIni, dLenLst = dLenLst, dLenIni
bFirstTrim, bLastTrim = bLastTrim, bFirstTrim
end end
-- modifico attacco e uscita -- modifico attacco e uscita
if dLenIni and dLenLst then if dLenIni and dLenLst then
@@ -119,9 +130,6 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1 dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
end end
if bFlagInvert then
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
end end
@@ -195,6 +203,25 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
return nChamfer, dDepth, sMilling, sMilling2 return nChamfer, dDepth, sMilling, sMilling2
end end
---------------------------------------------------------------------
function GetSccForTurn( vtN, sType)
local nSCC
if abs( vtN:getZ()) > abs( vtN:getY()) then
if sType == 'V' then
nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_ZM)
else
nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
end
else
if sType == 'V' then
nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
else
nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
end
return nSCC
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
@@ -227,8 +254,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- acquisisco informazioni sulle facce estreme -- acquisisco informazioni sulle facce estreme
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT) local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT) local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
-- flag percorso invertito
local bFlagInvert = false
-- verifico se in testa o coda -- verifico se in testa o coda
local bHead = ( vtN:getX() > 0) local bHead = ( vtN:getX() > 0)
EgtOutLog( 'vtN=' .. tostring( vtN), 3) EgtOutLog( 'vtN=' .. tostring( vtN), 3)
@@ -265,7 +290,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo piano di sgrossatura e lo lavoro -- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( AuxId, vtN) local ptStart, vtNP = GetSawCutData( AuxId, vtN)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId) EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura -- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
@@ -286,7 +311,8 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti applico taglio di lama -- altrimenti applico taglio di lama
else else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bOk then if not bOk then
return false, sErr return false, sErr
@@ -324,7 +350,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() > 0.1) then ( not bHead and vtExtr:getY() > 0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
-- altrimenti lavorazione dal davanti o dal dietro -- altrimenti lavorazione dal davanti o dal dietro
else else
@@ -333,14 +358,12 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if vtExtr:getZ() < 0 then if vtExtr:getZ() < 0 then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
-- se lavorazione a destra da dietro o sinistra di fronte, inverto -- se lavorazione a destra da dietro o sinistra di fronte, inverto
if ( bHead and vtN:getY() > 0.1) or if ( bHead and vtN:getY() > 0.1) or
( not bHead and vtN:getY() < -0.1) then ( not bHead and vtN:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- assegno affondamento e offset radiale -- assegno affondamento e offset radiale
@@ -358,7 +381,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione -- della feature inverto il punto di inizio della lavorazione
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra) ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
end end
-- se lavorazione da due parti, aggiungo la seconda -- se lavorazione da due parti, aggiungo la seconda
if bDoubleCham then if bDoubleCham then
@@ -373,8 +396,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- resetto il flag inversione percorso
bFlagInvert = false
-- se lavorazione da sopra o da sotto -- se lavorazione da sopra o da sotto
if nSide ~= 0 then if nSide ~= 0 then
-- se lavorazione a destra di fronte o sinistra da dietro, inverto -- se lavorazione a destra di fronte o sinistra da dietro, inverto
@@ -382,7 +403,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() < -0.1) then ( not bHead and vtExtr:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
else else
-- se lavorazione a destra di fronte o sinistra da dietro, inverto -- se lavorazione a destra di fronte o sinistra da dietro, inverto
@@ -390,7 +410,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtN:getY() < -0.1) then ( not bHead and vtN:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- assegno affondamento e offset radiale -- assegno affondamento e offset radiale
@@ -408,7 +427,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione -- della feature inverto il punto di inizio della lavorazione
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra) ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
end end
end end
end end
@@ -467,14 +486,11 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- resetto il flag inversione percorso
bFlagInvert = false
-- se lavorazione da sopra e da sotto -- se lavorazione da sopra e da sotto
if ( nSide == 0) then if ( nSide == 0) then
if vtExtr:getZ() > 0.1 then if vtExtr:getZ() > 0.1 then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = true
end end
-- altrimenti lavorazione davanti e dietro -- altrimenti lavorazione davanti e dietro
else else
@@ -483,14 +499,13 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() < -0.1) then ( not bHead and vtExtr:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = true
end end
end end
-- imposto l'affondamento -- imposto l'affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- posizione braccio porta testa -- posizione braccio porta testa
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end if BD.TURN then nSCC = GetSccForTurn( vtN) end
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale -- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
local bFinish local bFinish
@@ -514,7 +529,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco -- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
-- e uscita -- e uscita
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar) ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
end end
-- se abilitata, aggiungo lavorazione di finitura -- se abilitata, aggiungo lavorazione di finitura
if bFinish then if bFinish then
@@ -548,8 +563,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- resetto il flag inversione percorso
bFlagInvert = false
-- se lavorazione da sopra o da sotto -- se lavorazione da sopra o da sotto
if nSide ~= 0 then if nSide ~= 0 then
if not bDouble and nSide == -1 then if not bDouble and nSide == -1 then
@@ -558,7 +571,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() < -0.1) then ( not bHead and vtExtr:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
else else
-- se lavorazione a destra di fronte o sinistra da dietro, inverto -- se lavorazione a destra di fronte o sinistra da dietro, inverto
@@ -566,7 +578,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() > 0.1) then ( not bHead and vtExtr:getY() > 0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- altrimenti lavorazione dal davanti o dal dietro -- altrimenti lavorazione dal davanti o dal dietro
@@ -575,14 +586,12 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if vtExtr:getZ() < 0 then if vtExtr:getZ() < 0 then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
-- se lavorazione a destra da dietro o sinistra di fronte, inverto -- se lavorazione a destra da dietro o sinistra di fronte, inverto
if ( bHead and vtN:getY() > 0.1) or if ( bHead and vtN:getY() > 0.1) or
( not bHead and vtN:getY() < -0.1) then ( not bHead and vtN:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- se in doppio, imposto l'affondamento -- se in doppio, imposto l'affondamento
@@ -591,7 +600,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- posizione braccio porta testa -- posizione braccio porta testa
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end if BD.TURN then nSCC = GetSccForTurn( vtN) end
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale -- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
local bFinish local bFinish
@@ -611,7 +620,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco -- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
-- e uscita -- e uscita
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar) ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
end end
-- se abilitata, aggiungo lavorazione di finitura -- se abilitata, aggiungo lavorazione di finitura
if bFinish then if bFinish then
@@ -656,14 +665,25 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK) EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK)
else else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP) EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP)
EgtSetMachiningParam( MCH_MP.WORKSIDE, 1) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1)) EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1))
end end
EgtSetMachiningParam( MCH_MP.INVERT, false) EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH') EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
EgtSetMachiningParam( MCH_MP.STEP, 0) EgtSetMachiningParam( MCH_MP.STEP, 0)
EgtSetMachiningParam( MCH_MP.OFFSR, 0) EgtSetMachiningParam( MCH_MP.OFFSR, 0)
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end if BD.TURN then
local nSCC = GetSccForTurn( vtN, 'V')
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- modifico attacco e uscita per forzare risalita
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dToolDiam / 2)
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
EgtSetMachiningParam( MCH_MP.LITANG, 20)
EgtSetMachiningParam( MCH_MP.LIPERP, 20)
EgtSetMachiningParam( MCH_MP.LIELEV, 20)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dToolDiam / 2)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
end
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -697,7 +717,10 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.STEP, 0) EgtSetMachiningParam( MCH_MP.STEP, 0)
EgtSetMachiningParam( MCH_MP.OFFSR, 0) EgtSetMachiningParam( MCH_MP.OFFSR, 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1)) EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end if BD.TURN then
local nSCC = GetSccForTurn( vtN)
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
+61 -38
View File
@@ -1,10 +1,13 @@
-- ProcessProfConvex.lua by Egaltech s.r.l. 2022/05/28 -- ProcessProfConvex.lua by Egaltech s.r.l. 2023/07/31
-- Gestione calcolo profilo convesso per Travi -- Gestione calcolo profilo convesso per Travi
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto. -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
-- 2022/02/02 Aggiunta funzione OnlyChamfer. -- 2022/02/02 Aggiunta funzione OnlyChamfer.
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto. -- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria. -- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
-- 2023/05/25 Sistemazione SCC per TURN.
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessProfConvex = {} local ProcessProfConvex = {}
@@ -88,7 +91,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar) bFirstTrim, bLastTrim, dOffsetPar)
-- confronto il punto iniziale e finale della lavorazione con il box della feature -- confronto il punto iniziale e finale della lavorazione con il box della feature
-- e se è vicino alla parte esterna della trave inverto la lavorazione -- e se è vicino alla parte esterna della trave inverto la lavorazione
@@ -96,6 +99,9 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
local ptEp = EgtGetMachiningEndPoint() local ptEp = EgtGetMachiningEndPoint()
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE) local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
if nMachMode == 1 and ptSP and ptEp then if nMachMode == 1 and ptSP and ptEp then
-- recupero flag inversione direzione di lavorazione
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
-- verifico se da aggiustare
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) < if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
-- ottengo il lato lavoro e lo inverto -- ottengo il lato lavoro e lo inverto
@@ -103,9 +109,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
if nSideWork > 0 then if nSideWork > 0 then
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)) EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
end end
-- ottengo l'inversione e setto il contrario -- imposto il contrario dell'inversione trovata
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT) bInvertMode = not bInvertMode
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode) EgtSetMachiningParam( MCH_MP.INVERT, bInvertMode)
end
-- se lavorazione invertita rispetto a geometria, scambio dati di inizio e fine
if bInvertMode then
dLenIni, dLenLst = dLenLst, dLenIni
bFirstTrim, bLastTrim = bLastTrim, bFirstTrim
end end
-- modifico attacco e uscita -- modifico attacco e uscita
if dLenIni and dLenLst then if dLenIni and dLenLst then
@@ -119,9 +130,6 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1 dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
end end
if bFlagInvert then
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
end end
@@ -195,6 +203,25 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
return nChamfer, dDepth, sMilling, sMilling2 return nChamfer, dDepth, sMilling, sMilling2
end end
---------------------------------------------------------------------
function GetSccForTurn( vtN, sType)
local nSCC
if abs( vtN:getZ()) > abs( vtN:getY()) then
if sType == 'V' then
nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_ZM)
else
nSCC = EgtIf( vtN:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
end
else
if sType == 'V' then
nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
else
nSCC = EgtIf( vtN:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
end
return nSCC
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
@@ -227,8 +254,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- acquisisco informazioni sulle facce estreme -- acquisisco informazioni sulle facce estreme
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT) local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT) local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
-- flag percorso invertito
local bFlagInvert = false
-- verifico se in testa o coda -- verifico se in testa o coda
local bHead = ( vtN:getX() > 0) local bHead = ( vtN:getX() > 0)
EgtOutLog( 'vtN=' .. tostring( vtN), 3) EgtOutLog( 'vtN=' .. tostring( vtN), 3)
@@ -265,7 +290,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo piano di sgrossatura e lo lavoro -- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( AuxId, vtN) local ptStart, vtNP = GetSawCutData( AuxId, vtN)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId) EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura -- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
@@ -286,7 +311,8 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti applico taglio di lama -- altrimenti applico taglio di lama
else else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bOk then if not bOk then
return false, sErr return false, sErr
@@ -324,7 +350,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() > 0.1) then ( not bHead and vtExtr:getY() > 0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
-- altrimenti lavorazione dal davanti o dal dietro -- altrimenti lavorazione dal davanti o dal dietro
else else
@@ -333,14 +358,12 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if vtExtr:getZ() < 0 then if vtExtr:getZ() < 0 then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
-- se lavorazione a destra da dietro o sinistra di fronte, inverto -- se lavorazione a destra da dietro o sinistra di fronte, inverto
if ( bHead and vtN:getY() > 0.1) or if ( bHead and vtN:getY() > 0.1) or
( not bHead and vtN:getY() < -0.1) then ( not bHead and vtN:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- assegno affondamento e offset radiale -- assegno affondamento e offset radiale
@@ -358,7 +381,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione -- della feature inverto il punto di inizio della lavorazione
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra) ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
end end
-- se lavorazione da due parti, aggiungo la seconda -- se lavorazione da due parti, aggiungo la seconda
if bDoubleCham then if bDoubleCham then
@@ -373,8 +396,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- resetto il flag inversione percorso
bFlagInvert = false
-- se lavorazione da sopra o da sotto -- se lavorazione da sopra o da sotto
if nSide ~= 0 then if nSide ~= 0 then
-- se lavorazione a destra di fronte o sinistra da dietro, inverto -- se lavorazione a destra di fronte o sinistra da dietro, inverto
@@ -382,7 +403,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() < -0.1) then ( not bHead and vtExtr:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
else else
-- se lavorazione a destra di fronte o sinistra da dietro, inverto -- se lavorazione a destra di fronte o sinistra da dietro, inverto
@@ -390,7 +410,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtN:getY() < -0.1) then ( not bHead and vtN:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- assegno affondamento e offset radiale -- assegno affondamento e offset radiale
@@ -408,7 +427,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione -- della feature inverto il punto di inizio della lavorazione
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra) ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
end end
end end
end end
@@ -467,14 +486,11 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- resetto il flag inversione percorso
bFlagInvert = false
-- se lavorazione da sopra e da sotto -- se lavorazione da sopra e da sotto
if ( nSide == 0) then if ( nSide == 0) then
if vtExtr:getZ() > 0.1 then if vtExtr:getZ() > 0.1 then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = true
end end
-- altrimenti lavorazione davanti e dietro -- altrimenti lavorazione davanti e dietro
else else
@@ -483,14 +499,13 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() < -0.1) then ( not bHead and vtExtr:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = true
end end
end end
-- imposto l'affondamento -- imposto l'affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- posizione braccio porta testa -- posizione braccio porta testa
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end if BD.TURN then nSCC = GetSccForTurn( vtN) end
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale -- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
local bFinish local bFinish
@@ -514,7 +529,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco -- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
-- e uscita -- e uscita
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar) ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
end end
-- se abilitata, aggiungo lavorazione di finitura -- se abilitata, aggiungo lavorazione di finitura
if bFinish then if bFinish then
@@ -548,8 +563,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- resetto il flag inversione percorso
bFlagInvert = false
-- se lavorazione da sopra o da sotto -- se lavorazione da sopra o da sotto
if nSide ~= 0 then if nSide ~= 0 then
if not bDouble and nSide == -1 then if not bDouble and nSide == -1 then
@@ -558,7 +571,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() < -0.1) then ( not bHead and vtExtr:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
else else
-- se lavorazione a destra di fronte o sinistra da dietro, inverto -- se lavorazione a destra di fronte o sinistra da dietro, inverto
@@ -566,7 +578,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() > 0.1) then ( not bHead and vtExtr:getY() > 0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- altrimenti lavorazione dal davanti o dal dietro -- altrimenti lavorazione dal davanti o dal dietro
@@ -575,14 +586,12 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if vtExtr:getZ() < 0 then if vtExtr:getZ() < 0 then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
-- se lavorazione a destra da dietro o sinistra di fronte, inverto -- se lavorazione a destra da dietro o sinistra di fronte, inverto
if ( bHead and vtN:getY() > 0.1) or if ( bHead and vtN:getY() > 0.1) or
( not bHead and vtN:getY() < -0.1) then ( not bHead and vtN:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- se in doppio, imposto l'affondamento -- se in doppio, imposto l'affondamento
@@ -591,7 +600,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- posizione braccio porta testa -- posizione braccio porta testa
local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) local nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
if BD.TURN then nSCC = MCH_SCC.ADIR_ZP end if BD.TURN then nSCC = GetSccForTurn( vtN) end
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale -- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
local bFinish local bFinish
@@ -611,7 +620,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco -- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
-- e uscita -- e uscita
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar) ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
end end
-- se abilitata, aggiungo lavorazione di finitura -- se abilitata, aggiungo lavorazione di finitura
if bFinish then if bFinish then
@@ -656,14 +665,25 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK) EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_BACK)
else else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP) EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTUP_TOP)
EgtSetMachiningParam( MCH_MP.WORKSIDE, 1) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1)) EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( (dToolMaxDepth/2), 1))
end end
EgtSetMachiningParam( MCH_MP.INVERT, false) EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH') EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
EgtSetMachiningParam( MCH_MP.STEP, 0) EgtSetMachiningParam( MCH_MP.STEP, 0)
EgtSetMachiningParam( MCH_MP.OFFSR, 0) EgtSetMachiningParam( MCH_MP.OFFSR, 0)
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end if BD.TURN then
local nSCC = GetSccForTurn( vtN, 'V')
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- modifico attacco e uscita per forzare risalita
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dToolDiam / 2)
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
EgtSetMachiningParam( MCH_MP.LITANG, 20)
EgtSetMachiningParam( MCH_MP.LIPERP, 20)
EgtSetMachiningParam( MCH_MP.LIELEV, 20)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dToolDiam / 2)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
end
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -697,7 +717,10 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.STEP, 0) EgtSetMachiningParam( MCH_MP.STEP, 0)
EgtSetMachiningParam( MCH_MP.OFFSR, 0) EgtSetMachiningParam( MCH_MP.OFFSR, 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1)) EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dWidth, 1))
if BD.TURN then EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP) end if BD.TURN then
local nSCC = GetSccForTurn( vtN)
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
+6 -6
View File
@@ -5,6 +5,7 @@
-- 2022/02/02 Aggiunta funzione OnlyChamfer. -- 2022/02/02 Aggiunta funzione OnlyChamfer.
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto. -- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria. -- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessProfFront = {} local ProcessProfFront = {}
@@ -236,7 +237,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo piano di sgrossatura e lo lavoro -- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( AuxId, vtN) local ptStart, vtNP = GetSawCutData( AuxId, vtN)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId) EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura -- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
@@ -257,7 +258,8 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti applico taglio di lama -- altrimenti applico taglio di lama
else else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bOk then if not bOk then
return false, sErr return false, sErr
@@ -465,8 +467,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr return false, sErr
else else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco -- della feature inverto il punto di inizio della lavorazione
-- e uscita
ModifySideInvertLead( Proc, bHead, dToolDiam) ModifySideInvertLead( Proc, bHead, dToolDiam)
end end
-- se abilitata, aggiungo lavorazione di finitura -- se abilitata, aggiungo lavorazione di finitura
@@ -554,8 +555,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr return false, sErr
else else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco -- della feature inverto il punto di inizio della lavorazione
-- e uscita
ModifySideInvertLead( Proc, bHead, dToolDiam) ModifySideInvertLead( Proc, bHead, dToolDiam)
end end
-- se abilitata, aggiungo lavorazione di finitura -- se abilitata, aggiungo lavorazione di finitura
+22 -31
View File
@@ -1,4 +1,4 @@
-- ProcessProfHead.lua by Egaltech s.r.l. 2022/05/28 -- ProcessProfHead.lua by Egaltech s.r.l. 2023/07/31
-- Gestione calcolo profilo di testa per Travi -- Gestione calcolo profilo di testa per Travi
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa sotto. -- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa sotto.
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra. -- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
@@ -6,6 +6,8 @@
-- 2022/02/02 Aggiunta funzione OnlyChamfer. -- 2022/02/02 Aggiunta funzione OnlyChamfer.
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto. -- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria. -- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessProfHead = {} local ProcessProfHead = {}
@@ -81,7 +83,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar) bFirstTrim, bLastTrim, dOffsetPar)
-- confronto il punto iniziale e finale della lavorazione con il box della feature -- confronto il punto iniziale e finale della lavorazione con il box della feature
-- e se è vicino alla parte esterna della trave inverto la lavorazione -- e se è vicino alla parte esterna della trave inverto la lavorazione
@@ -89,6 +91,9 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
local ptEp = EgtGetMachiningEndPoint() local ptEp = EgtGetMachiningEndPoint()
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE) local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
if nMachMode == 1 and ptSP and ptEp then if nMachMode == 1 and ptSP and ptEp then
-- recupero flag inversione direzione di lavorazione
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
-- verifico se da aggiustare
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) < if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
-- ottengo il lato lavoro e lo inverto -- ottengo il lato lavoro e lo inverto
@@ -96,9 +101,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
if nSideWork > 0 then if nSideWork > 0 then
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)) EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
end end
-- ottengo l'inversione e setto il contrario -- imposto il contrario dell'inversione trovata
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT) bInvertMode = not bInvertMode
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode) EgtSetMachiningParam( MCH_MP.INVERT, bInvertMode)
end
-- se lavorazione invertita rispetto a geometria, scambio dati di inizio e fine
if bInvertMode then
dLenIni, dLenLst = dLenLst, dLenIni
bFirstTrim, bLastTrim = bLastTrim, bFirstTrim
end end
-- modifico attacco e uscita -- modifico attacco e uscita
if dLenIni and dLenLst then if dLenIni and dLenLst then
@@ -112,9 +122,6 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1 dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
end end
if bFlagInvert then
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen) EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen) EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
end end
@@ -224,8 +231,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- acquisisco informazioni sulle facce estreme -- acquisisco informazioni sulle facce estreme
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT) local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT) local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
-- flag percorso invertito
local bFlagInvert = false
-- verifico se in testa o coda -- verifico se in testa o coda
local bHead = ( vtN:getX() > 0) local bHead = ( vtN:getX() > 0)
EgtOutLog( 'vtN=' .. tostring( vtN), 3) EgtOutLog( 'vtN=' .. tostring( vtN), 3)
@@ -267,7 +272,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- aggiungo piano di sgrossatura e lo lavoro -- aggiungo piano di sgrossatura e lo lavoro
local ptStart, vtNP = GetSawCutData( AuxId, vtN) local ptStart, vtNP = GetSawCutData( AuxId, vtN)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB) local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId) EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura -- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
@@ -288,7 +293,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti applico taglio di lama -- altrimenti applico taglio di lama
else else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bOk then if not bOk then
return false, sErr return false, sErr
@@ -326,7 +332,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() > 0.1) then ( not bHead and vtExtr:getY() > 0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
-- altrimenti lavorazione dal davanti o dal dietro -- altrimenti lavorazione dal davanti o dal dietro
else else
@@ -335,14 +340,12 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if vtExtr:getZ() < 0 then if vtExtr:getZ() < 0 then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
-- se lavorazione a destra da dietro o sinistra di fronte, inverto -- se lavorazione a destra da dietro o sinistra di fronte, inverto
if ( bHead and vtN:getY() > 0.1) or if ( bHead and vtN:getY() > 0.1) or
( not bHead and vtN:getY() < -0.1) then ( not bHead and vtN:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- assegno affondamento e offset radiale -- assegno affondamento e offset radiale
@@ -361,7 +364,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione -- della feature inverto il punto di inizio della lavorazione
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni,
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dExtra) dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dExtra)
end end
-- se lavorazione da due parti, aggiungo la seconda -- se lavorazione da due parti, aggiungo la seconda
if bDoubleCham then if bDoubleCham then
@@ -376,8 +379,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- resetto il flag inversione percorso
bFlagInvert = false
-- se lavorazione da sopra o da sotto -- se lavorazione da sopra o da sotto
if nSide ~= 0 then if nSide ~= 0 then
-- se lavorazione a destra di fronte o sinistra da dietro, inverto -- se lavorazione a destra di fronte o sinistra da dietro, inverto
@@ -385,7 +386,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() < -0.1) then ( not bHead and vtExtr:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
-- altrimenti lavorazione dal davanti o dal dietro -- altrimenti lavorazione dal davanti o dal dietro
else else
@@ -394,7 +394,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtN:getY() < -0.1) then ( not bHead and vtN:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- assegno affondamento e offset radiale -- assegno affondamento e offset radiale
@@ -413,7 +412,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno -- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione -- della feature inverto il punto di inizio della lavorazione
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni,
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dExtra) dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dExtra)
end end
end end
end end
@@ -473,8 +472,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- resetto il flag inversione percorso
bFlagInvert = false
-- se lavorazione da sopra e da sotto -- se lavorazione da sopra e da sotto
if ( nSide == 0) then if ( nSide == 0) then
if vtExtr:getZ() > 0.1 then if vtExtr:getZ() > 0.1 then
@@ -517,7 +514,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco -- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
-- e uscita -- e uscita
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni,
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dOffsetPar) dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dOffsetPar)
end end
-- se abilitata, aggiungo lavorazione di finitura -- se abilitata, aggiungo lavorazione di finitura
if bFinish then if bFinish then
@@ -551,8 +548,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- resetto il flag inversione percorso
bFlagInvert = false
-- se lavorazione da sopra o da sotto -- se lavorazione da sopra o da sotto
if nSide ~= 0 then if nSide ~= 0 then
if not bDouble and nSide == -1 then if not bDouble and nSide == -1 then
@@ -561,7 +556,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() < -0.1) then ( not bHead and vtExtr:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
else else
-- se lavorazione a destra di fronte o sinistra da dietro, inverto -- se lavorazione a destra di fronte o sinistra da dietro, inverto
@@ -569,7 +563,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
( not bHead and vtExtr:getY() > 0.1) then ( not bHead and vtExtr:getY() > 0.1) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- altrimenti lavorazione dal davanti o dal dietro -- altrimenti lavorazione dal davanti o dal dietro
@@ -578,14 +571,12 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if vtExtr:getZ() < 0 then if vtExtr:getZ() < 0 then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
-- se lavorazione a destra da dietro o sinistra di fronte, inverto -- se lavorazione a destra da dietro o sinistra di fronte, inverto
if ( bHead and vtN:getY() > 0.1) or if ( bHead and vtN:getY() > 0.1) or
( not bHead and vtN:getY() < -0.1) then ( not bHead and vtN:getY() < -0.1) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, true)
bFlagInvert = not bFlagInvert
end end
end end
-- se in doppio, imposto l'affondamento -- se in doppio, imposto l'affondamento
@@ -613,7 +604,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco -- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
-- e uscita -- e uscita
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni,
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dOffsetPar) dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dOffsetPar)
end end
-- se abilitata, aggiungo lavorazione di finitura -- se abilitata, aggiungo lavorazione di finitura
if bFinish then if bFinish then
+18 -8
View File
@@ -1,4 +1,4 @@
-- ProcessRidgeLap.lua by Egaltech s.r.l. 2021/09/10 -- ProcessRidgeLap.lua by Egaltech s.r.l. 2023/08/10
-- Gestione calcolo mezzolegno di testa per Travi -- Gestione calcolo mezzolegno di testa per Travi
-- Tabella per definizione modulo -- Tabella per definizione modulo
@@ -10,6 +10,7 @@ local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw') local Fbs = require( 'FacesBySaw')
local Cut = require( 'ProcessCut') local Cut = require( 'ProcessCut')
local DC = require( 'DiceCut') local DC = require( 'DiceCut')
local LapJoint = require( 'ProcessLapJoint')
EgtOutLog( ' ProcessRidgeLap started', 1) EgtOutLog( ' ProcessRidgeLap started', 1)
@@ -26,8 +27,8 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Classificazione della feature -- Classificazione della feature
function ProcessRidgeLap.Classify( Proc, b3Raw) function ProcessRidgeLap.Classify( Proc, b3Raw)
-- se PF con testa da sotto, ammessa qualunque orientazione -- se PF con testa da sotto oppure TURN, ammessa qualunque orientazione
if BD.C_SIMM and BD.DOWN_HEAD then if ( BD.C_SIMM and BD.DOWN_HEAD) or BD.TURN then
return true, false return true, false
end end
-- Se più corta del limite si può fare anche da sotto -- Se più corta del limite si può fare anche da sotto
@@ -48,6 +49,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, 'Q04', 'i') or 0
-- recupero l'ingombro del grezzo di appartenenza -- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId) local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo -- ingombro del pezzo
@@ -132,9 +134,17 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- applico taglio di lama -- applico taglio di lama
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false) CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
if not bOk then return bOk, sErr end if BL.IsCutNeeded( CutProc, b3Raw, dOvmHead) then
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false)
if not bOk then return bOk, sErr end
elseif nForceUseBladeOnNotContinueFace > 0 then
EgtSurfTmRemoveFacet( Proc.Id, vFaceOrd[1] - 1)
Proc.Fct = Proc.Fct - 1
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end end
end end
-- recupero gruppo per geometria addizionale -- recupero gruppo per geometria addizionale
@@ -195,7 +205,7 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- aggiornamento ingombro di testa o coda -- aggiornamento ingombro di testa o coda
if Proc.Head then if Proc.Head then
local dHCI = 0 local dHCI = 0
if abs( vtN[vFaceOrd[3]]:getZ()) > 0.1 then if vtN[vFaceOrd[3]]:getZ() > 0.1 then
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD) local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
else else
@@ -204,7 +214,7 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
BL.UpdateHCING( nRawId, dHCI) BL.UpdateHCING( nRawId, dHCI)
elseif Proc.Tail then elseif Proc.Tail then
local dTCI = 0 local dTCI = 0
if abs( vtN[vFaceOrd[3]]:getZ()) > 0.1 then if vtN[vFaceOrd[3]]:getZ() > 0.1 then
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD) local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
else else
+38 -16
View File
@@ -1,4 +1,4 @@
-- ProcessRoundArch.lua by Egaltech s.r.l. 2021/01/29 -- ProcessRoundArch.lua by Egaltech s.r.l. 2023/12/07
-- Gestione calcolo archi per Travi -- Gestione calcolo archi per Travi
-- Tabella per definizione modulo -- Tabella per definizione modulo
@@ -93,6 +93,8 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
-- normale alla superficie nel mezzo
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, Proc.Fct // 2, GDB_RT.GLOB)
-- recupero e verifico l'entità curva -- recupero e verifico l'entità curva
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.Id end if AuxId then AuxId = AuxId + Proc.Id end
@@ -116,10 +118,13 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
local dMaxDepth = 0 local dMaxDepth = 0
local bCW = true
if EgtMdbSetCurrMachining( sMilling) then if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
bCW = ( dSpeed >= 0)
end end
end end
-- ne verifico la lunghezza per eventuale spezzatura e lavorazione in doppio -- ne verifico la lunghezza per eventuale spezzatura e lavorazione in doppio
@@ -178,6 +183,10 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
end end
end end
-- se lavorazione in doppio senza codolo, aggiungo sovrapposizione
if nDouble == 2 and dDimStrip < 10 * GEO.EPS_SMALL then
dDepth = dDepth + BD.MILL_OVERLAP / 2
end
-- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y- -- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y-
if vtExtr:getY() > 0.707 and nDouble == 1 and bStripOnSide then if vtExtr:getY() > 0.707 and nDouble == 1 and bStripOnSide then
bToolInv = true bToolInv = true
@@ -186,7 +195,7 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
for i = 1, nStep do for i = 1, nStep do
for j = 1, nDouble do for j = 1, nDouble do
-- inserisco la lavorazione -- inserisco la lavorazione
local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName = 'Arch_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchId = EgtAddMachining( sName, sMilling) local nMchId = EgtAddMachining( sName, sMilling)
if not nMchId then if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
@@ -210,25 +219,38 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
end end
-- se seconda passata, inverto direzione di lavoro -- se seconda passata, inverto direzione di lavoro
if j == 2 then if ( j == 1 and not bToolInv) or ( j == 2 and bToolInv) then
EgtSetMachiningParam( MCH_MP.INVERT, true) EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
else
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
end end
-- assegno affondamento -- assegno affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- assegno lato di lavoro -- assegno lato di lavoro (per avere lavorazione climb)
if bToolInv then EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
end
-- posizione braccio porta testa -- posizione braccio porta testa
if Proc.Head then local nSCC = MCH_SCC.NONE
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XP) if not BD.C_SIMM and not BD.TURN then
elseif Proc.Tail then nSCC = MCH_SCC.ADIR_XP
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_XM) if Proc.Head then
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then nSCC = MCH_SCC.ADIR_XP
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP) elseif Proc.Tail then
nSCC = MCH_SCC.ADIR_XM
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
nSCC = MCH_SCC.ADIR_YP
end
elseif BD.TURN then
if vtN:getZ() > 0.707 then
nSCC = MCH_SCC.ADIR_ZP
elseif vtN:getZ() < -0.707 then
nSCC = MCH_SCC.ADIR_ZM
elseif vtN:getY() > 0.707 then
nSCC = MCH_SCC.ADIR_YP
elseif vtN:getY() < -0.707 then
nSCC = MCH_SCC.ADIR_YM
end
end end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
+4
View File
@@ -2,6 +2,7 @@
-- Gestione calcolo taglio di lama per Travi -- Gestione calcolo taglio di lama per Travi
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe). -- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe).
-- 2022/12/19 Aggiunta gestione testa da sotto. -- 2022/12/19 Aggiunta gestione testa da sotto.
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessSawCut = {} local ProcessSawCut = {}
@@ -229,6 +230,9 @@ function ProcessSawCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTail)
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso della faccia -- imposto uso della faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto angolo 3° asse rot
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtN, vtOut))
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
+52 -8
View File
@@ -3,6 +3,8 @@
-- 2021/06/28 Aggiunto extra-taglio alle lamate orizzontali. -- 2021/06/28 Aggiunto extra-taglio alle lamate orizzontali.
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe) -- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
-- 2022/07/12 Aggiunta gestione PF1250 e TURN. -- 2022/07/12 Aggiunta gestione PF1250 e TURN.
-- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo.
-- 2024/09/03 In ApplyDiceCut, se possibile, i tagli paralleli sono fatti con un unico passaggio di fianco.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessScarfJoint = {} local ProcessScarfJoint = {}
@@ -100,7 +102,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
-- Inserisco la lavorazione del lato opposto -- Inserisco la lavorazione del lato opposto
@@ -123,7 +125,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch2Id, false)
return false, sErr return false, sErr
end end
return true return true
@@ -133,7 +135,9 @@ end
local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw, dNewDiceDim) local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw, dNewDiceDim)
local bOk = true local bOk = true
local bOk2 = true
local sErr = '' local sErr = ''
local sErr2 = ''
local vCuts = {} local vCuts = {}
if nGoodFace1 and nGoodFace4 and nGoodFace1 > 0 and nGoodFace4 > 0 then if nGoodFace1 and nGoodFace4 and nGoodFace1 > 0 and nGoodFace4 > 0 then
@@ -184,9 +188,49 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
-- extra taglio -- extra taglio
local dExtraCut = EgtIf( i % 2 == 1, 0, BD.CUT_EXTRA) local dExtraCut = EgtIf( i % 2 == 1, 0, BD.CUT_EXTRA)
-- lavoro la faccia -- lavoro la faccia
for j = 1, #vCuts[i] do local dMaxDepth = 0
bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) if EgtMdbSetCurrMachining( sCutting) then
if not bOk then return bOk, sErr end local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
local dDiceFaceMaxH = 0
local dDiceFaceMinH = GEO.INFINITO
if ( i % 2) == 0 then
for cont = 1, #vCuts[i] do
local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][cont], 0)
dDiceFaceMaxH = max( dDiceFaceMaxH, dDiceFaceH)
-- calcolo lato orizzontale minore ipotizzando sia un trapezio
local dDiceFaceH2 = ( 2 * EgtSurfArea( vCuts[i][cont]) ) / dDiceFaceV - dDiceFaceH
dDiceFaceMinH = min( dDiceFaceMinH, dDiceFaceH2)
end
end
-- se si può fare, faccio unico taglio parallelo
if ( i % 2) == 0 and ( dMaxDepth > dDiceFaceMaxH - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN) then
local bDoubleCut = false
local dCutExtra = BD.CUT_EXTRA
if dMaxDepth < dDiceFaceMaxH + BD.CUT_EXTRA then
bDoubleCut = true
dCutExtra = - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN
end
local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
local nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT
if Proc.Tail then
nFaceUseCut1, nFaceUseCut2 = nFaceUseCut2, nFaceUseCut1
end
if bDoubleCut then
bOk, sErr = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut1, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw, true)
if not bOk then return false, sErr end
end
bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw)
if not bOk2 then return false, sErr2 end
else
for j = 1, #vCuts[i] do
bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end end
end end
-- lavoro la faccia interna in ogni caso -- lavoro la faccia interna in ogni caso
@@ -200,7 +244,7 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
if vFaceOrd[3] ~= 0 then if vFaceOrd[3] ~= 0 then
-- inserisco la lavorazione -- inserisco la lavorazione
local vtOrthoO = Vector3d( vtRef) local vtOrthoO = Vector3d( vtRef)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw) bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
end end
@@ -512,7 +556,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
-- aggiornamento ingombro di testa o coda -- aggiornamento ingombro di testa o coda
if Proc.Head then if Proc.Head then
local dHCI = 0 local dHCI = 0
if abs( vtRef:getZ()) > 0.1 then if abs( vtRef:getZ()) > 0.1 and not BD.ROT90 then
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD) local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
dHCI = 0.75 * dHCI dHCI = 0.75 * dHCI
@@ -522,7 +566,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
BL.UpdateHCING( nRawId, dHCI) BL.UpdateHCING( nRawId, dHCI)
elseif Proc.Tail then elseif Proc.Tail then
local dTCI = 0 local dTCI = 0
if abs( vtRef:getZ()) > 0.1 then if abs( vtRef:getZ()) > 0.1 and not BD.ROT90 then
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD) local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
dTCI = 0.75 * dTCI dTCI = 0.75 * dTCI
+7 -5
View File
@@ -3,6 +3,8 @@
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe) -- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
-- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut. -- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut.
-- 2022/11/09 Aggiunta gestione parametro Q04 per forzare utilizzo fresa di lato e lavorare come FreeContour. -- 2022/11/09 Aggiunta gestione parametro Q04 per forzare utilizzo fresa di lato e lavorare come FreeContour.
-- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo.
-- 2024/08/05 Se assimilabile ad un taglio (1 faccia) si considerare area non pinzabile testa/coda
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessSimpleScarf = {} local ProcessSimpleScarf = {}
@@ -100,7 +102,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
-- Inserisco la lavorazione del lato opposto -- Inserisco la lavorazione del lato opposto
@@ -123,7 +125,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch2Id, false)
return false, sErr return false, sErr
end end
return true return true
@@ -147,7 +149,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
-- se ci sono meno di due facce si riduce a una normale Cut -- se ci sono meno di due facce si riduce a una normale Cut
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id) local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
if nFacetCnt < 2 then if nFacetCnt < 2 then
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, nil, nil, nil, dOvmTail) local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, nil, nil, nil, dOvmTail, true)
return bOk, sErr return bOk, sErr
end end
-- dati delle facce -- dati delle facce
@@ -317,7 +319,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
-- aggiornamento ingombro di testa o coda -- aggiornamento ingombro di testa o coda
if Proc.Head then if Proc.Head then
local dHCI = 0 local dHCI = 0
if abs( vtRef:getZ()) > 0.1 then if abs( vtRef:getZ()) > 0.1 and not BD.ROT90 then
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD) local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
else else
@@ -326,7 +328,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
BL.UpdateHCING( nRawId, dHCI) BL.UpdateHCING( nRawId, dHCI)
elseif Proc.Tail then elseif Proc.Tail then
local dTCI = 0 local dTCI = 0
if abs( vtRef:getZ()) > 0.1 then if abs( vtRef:getZ()) > 0.1 and not BD.ROT90 then
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD) local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
else else
+451 -170
View File
@@ -1,4 +1,4 @@
-- ProcessSplit.lua by Egaltech s.r.l. 2022/11/30 -- ProcessSplit.lua by Egaltech s.r.l. 2023/05/09
-- Gestione calcolo tagli di separazione per Travi -- Gestione calcolo tagli di separazione per Travi
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio con sega a catena seguito da rifinitura con lama (aggiunta funzione MakeSplitByChainSaw); gestione eventuale creazione nuova fase dall'interno della Make. -- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio con sega a catena seguito da rifinitura con lama (aggiunta funzione MakeSplitByChainSaw); gestione eventuale creazione nuova fase dall'interno della Make.
-- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita. -- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita.
@@ -8,6 +8,18 @@
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta -- 2022/11/10 Corrette finiture lama per BigSection con trave alta
-- 2022/11/16 Correzioni per travi larghe -- 2022/11/16 Correzioni per travi larghe
-- 2022/11/30 Correzione per tagli su grandi sezioni (dopo taglio con sega a catena senza finitura aggiungeva uno split con lama). -- 2022/11/30 Correzione per tagli su grandi sezioni (dopo taglio con sega a catena senza finitura aggiungeva uno split con lama).
-- 2023/04/04 Modifiche per travi con sezioni molto grandi e materiale inferiore allo spessore lama.
-- 2023/04/20 Per travi alte aggiunti tagli orizzontali per ridurre le dimensioni degli scarti.
-- 2023/05/09 Aggiunta richiesta risalita preliminare a Zmax per tagli da sopra su macchine PF e ONE.
-- 2023/06/13 Corrette note Precut e Cut per tagli aggiuntivi orizzontali.
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo.
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative.
-- 2024/01/18 Gestita lama con aggregato con asse bloccato per massimizzare capacità di taglio verticale, se da sotto
-- Implementato split per pezzi molto alti con mix sega a catena + lama
-- Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
-- 2024/01/22 Nei tagli verticali aggiuntivi si usa ora BD.MAX_LEN_DICE come dimensione (era BD.MAX_DIM_DICE).
-- 2024/01/23 Nello split con sega a catena ora si cerca di preferenza una lavorazione di tipo 'SawingForSplitting'. Se non trovata si cerca il tipo 'Sawing' come in precedenza.
-- In split con sega a catena aggiunta estensione start/end del percorso se utensile lungo, per evitare collisioni con il pezzo durante rotazione.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessSplit = {} local ProcessSplit = {}
@@ -18,6 +30,7 @@ local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw') local Fbs = require( 'FacesBySaw')
local Cut = require( 'ProcessCut') local Cut = require( 'ProcessCut')
local Pocket = require( 'FaceByPocket') local Pocket = require( 'FaceByPocket')
local Topology = require( 'FeatureTopology')
EgtOutLog( ' ProcessSplit started', 1) EgtOutLog( ' ProcessSplit started', 1)
@@ -25,6 +38,10 @@ EgtOutLog( ' ProcessSplit started', 1)
local BD = require( 'BeamData') local BD = require( 'BeamData')
local ML = require( 'MachiningLib') local ML = require( 'MachiningLib')
if BD.PRECUT_TAIL == nil then
BD.PRECUT_TAIL = true
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Riconoscimento della feature -- Riconoscimento della feature
function ProcessSplit.Identify( Proc) function ProcessSplit.Identify( Proc)
@@ -50,7 +67,7 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- lavorazione smussi -- lavorazione smussi
local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead) local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmTail)
-- verifico che lo smusso sia richiesto -- verifico che lo smusso sia richiesto
local dDepth = EgtGetInfo( nOriId, 'Q06', 'd') or 0 local dDepth = EgtGetInfo( nOriId, 'Q06', 'd') or 0
if dDepth < 0.1 then return true end if dDepth < 0.1 then return true end
@@ -121,7 +138,7 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
-- Inserisco la lavorazione del lato opposto -- Inserisco la lavorazione del lato opposto
@@ -144,7 +161,7 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
return true, nil return true, nil
@@ -152,9 +169,8 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- lavorazione con sega a catena per sezioni alte e larghe -- lavorazione con sega a catena per sezioni alte e larghe
local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs) local function MakeCutByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes, dRadialOffset, bExtendStartEnd, bInvert)
-- Recupero i dati dell'utensile -- Recupero i dati dell'utensile
local sSawing = ML.FindSawing( 'Sawing')
local dMaxMat = 0 local dMaxMat = 0
local dSawCornerRad = 0 local dSawCornerRad = 0
local dSawThick = 0 local dSawThick = 0
@@ -188,18 +204,30 @@ local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
-- imposto uso del lato faccia -- imposto uso del lato faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse) EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto angolo 3° asse rot -- imposto angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1)) EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'perpendicular'))
local _, vtN = EgtSurfTmFacetCenter( nSurfId, 0, GDB_ID.ROOT) local vtN = EgtSurfTmFacetNormVersor( nSurfId, 0, GDB_ID.ROOT)
local vtOrtho = BL.GetVersRef( nFaceUse) local vtOrtho = BL.GetVersRef( nFaceUse)
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1)) EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
-- imposto offset radiale per mantenere il materiale in coda per la finitura -- imposto offset radiale per mantenere il materiale in coda per la finitura
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset)
-- imposto allungamento percorso iniziale e finale a zero -- imposto eventuale allungamento percorso iniziale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0) local dStartAddLen = 0
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0) local dEndAddLen = 0
if bExtendStartEnd then
dStartAddLen = 100
dEndAddLen = 100
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
-- faccio in modo che l'attacco della lama sia dal lato opposto rispetto al corpo macchina -- faccio in modo che l'attacco della lama sia dal lato opposto rispetto al corpo macchina
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) if bInvert and bInvert == true then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, false)
end
if dMaxMat >= dDepth then if dMaxMat >= dDepth then
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning -- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning
@@ -218,7 +246,7 @@ local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
return false, sErr return false, sErr
end end
-- impostazione alternativa angolo 3° asse rot -- impostazione alternativa angolo 3° asse rot
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2)) EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'parallel'))
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2)) EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2))
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -235,18 +263,313 @@ local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
return true, sName, nMchFId return true, sName, nMchFId
end end
---------------------------------------------------------------------
-- split per sezioni grandi con sega a catena o mix catena + lama
function ProcessSplit.MakeBigSectionSplitting( Proc, b3Raw, dOffset, SawingData, Cutting2Data)
local sNotes = ''
if SawingData.bSplit ~= nil then
sNotes = 'Precut;'
end
local bigSectionSplitType
-- se pezzo non troppo alto, taglio singolo da sopra
if b3Raw:getDimZ() + BD.CUT_EXTRA_MIN < SawingData.dChainSawMaxMat + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "single horizontal"
-- se pezzo non troppo largo, taglio singolo da davanti
elseif b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( SawingData.dChainSawMaxMat, SawingData.dChainSawLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "single vertical"
-- se pezzo non troppo largo, tagli dai due fianchi (dietro e davanti)
elseif 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( SawingData.dChainSawMaxMat, SawingData.dChainSawLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "double vertical"
-- altrimenti taglio con sega a catena da sopra e con lama da sotto
elseif BD.DOWN_HEAD and ( b3Raw:getDimZ() + BD.CUT_EXTRA_MIN < Cutting2Data.dMaxDepth + SawingData.dChainSawMaxMat + 10 * GEO.EPS_SMALL) then
bigSectionSplitType = "double horizontal"
end
-- in base alle scelte precedenti, applico le lavorazioni
if bigSectionSplitType == "single horizontal" then
local dCutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN
local sNotesSplit = EgtIf( SawingData.bSplit, 'Split;', sNotes)
-- verifico se sega a catena lunga e devo quindi estendere ingresso e uscita perchè è probabile che non riesca a ruotare sopra al pezzo
local bExtendStartEnd
local dMinLengthLongChainSaw = 630
if SawingData.dChainSawLen > dMinLengthLongChainSaw - 10 * GEO.EPS_SMALL then
bExtendStartEnd = true
end
local bOk, sErr = MakeCutByChainSaw( Proc.Id, SawingData.sSawing, MCH_MILL_FU.PARAL_TOP, dCutDepth, sNotesSplit, dOffset, bExtendStartEnd, SawingData.bInvert)
if not bOk then return bOk, sErr end
elseif bigSectionSplitType == "single vertical" then
local dCutDepth = b3Raw:getDimY() + BD.CUT_EXTRA_MIN
local sNotesSplit = EgtIf( SawingData.bSplit, 'Split;', sNotes)
local bOk, sErr = MakeCutByChainSaw( Proc.Id, SawingData.sSawing, MCH_MILL_FU.PARAL_FRONT, dCutDepth, sNotesSplit, dOffset, nil, SawingData.bInvert)
if not bOk then return bOk, sErr end
elseif bigSectionSplitType == "double vertical" then
local dCutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
local sNotesSplit = EgtIf( SawingData.bSplit, 'Presplit;', sNotes)
local bOk, sErr = MakeCutByChainSaw( Proc.Id, SawingData.sSawing, MCH_MILL_FU.PARAL_BACK, dCutDepth, sNotesSplit, dOffset, nil, SawingData.bInvert)
if not bOk then return bOk, sErr end
sNotesSplit = EgtIf( SawingData.bSplit, 'Split;', sNotes)
bOk, sErr = MakeCutByChainSaw( Proc.Id, SawingData.sSawing, MCH_MILL_FU.PARAL_FRONT, dCutDepth, sNotesSplit, dOffset, nil, SawingData.bInvert)
if not bOk then return bOk, sErr end
elseif bigSectionSplitType == "double horizontal" then
-- sega a catena da sopra
local dChainSawCutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN - Cutting2Data.dMaxDepth
local sNotesSplit = EgtIf( SawingData.bSplit, 'Presplit;', sNotes)
local bOk, sErr = MakeCutByChainSaw( Proc.Id, SawingData.sSawing, MCH_MILL_FU.PARAL_TOP, dChainSawCutDepth, sNotesSplit, dOffset, nil, SawingData.bInvert)
if not bOk then return bOk, sErr end
-- lama da sotto
local dCutExtra = -dChainSawCutDepth + BD.CUT_EXTRA_MIN
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
local sNotes = EgtIf( SawingData.bSplit, 'Split;', sNotes)
local bMaximizeVerticalDepth = true
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting2Data.sCutting, Cutting2Data.dSawDiam, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dOffset, 0, 0, sNotes, b3Raw, nil, bMaximizeVerticalDepth)
if not bOk then return false, sErr end
-- se è comunque troppo grande per essere separato, esco
else
local sErr = 'Error : section too big for splitting'
EgtOutLog( sErr)
return false, sErr, -1
end
return true
end
---------------------------------------------------------------------
-- tagli verticali aggiuntivi
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes)
local nVerticalCuts = ceil( Proc.Face[1].WidthTrimmed / ( BD.MAX_LEN_DICE)) - 1
local dVerticalSliceHeight = Proc.Face[1].WidthTrimmed / ( nVerticalCuts + 1)
-- recupero il diametro dell'utensile
local dSawDiam = 400
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
end
end
local bOk, sErr
-- tagli verticali
for j = nVerticalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
local dVerticalCutOffset = dVerticalSliceHeight * -j
local bForceTangentLeadInOut = BD.PRESS_ROLLER
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw, nil, nil, nil, bForceTangentLeadInOut)
if not bOk then return bOk, sErr end
end
return bOk, sErr
end
---------------------------------------------------------------------
-- tagli standard
local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCutType, Cutting1Data, Cutting2Data, dStartOffset, dLenEndRaw)
if not TailCutType.sType then
TailCutType.sType = ''
end
local PrecutType = { bBigSectionCut = TailCutType.bBigSectionCut, bHorizCut = TailCutType.bHorizCut, bDoubleHorizCut = TailCutType.bDoubleHorizCut, bDoubleCut = TailCutType.bDoubleCut, bSplit = TailCutType.bSplit, sType = 'Precut', bNeedVerticalAddedCuts = false, bNeedHorizontalAddedCuts = false}
if not TailCutType.bDoubleHorizCut then
-- flag di lavorazione faccia
local nOrthoOpposite = EgtIf( TailCutType.bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_BACK)
-- calcolo extra taglio ed accorciamento
local dCutExtra = 0
local dAccStart = 0
local dAccEnd = 0
if TailCutType.bBigSectionCut and BD.C_SIMM then
-- qui arrivano sezioni molto grandi su macchine tipo PF con materiale da asportare inferiore allo spessore lama
local dSawRad = Cutting1Data.dSawDiam / 2
dCutExtra = - ( b3Raw:getDimY() - dSawRad)
dAccEnd = dSawRad
elseif b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
dCutExtra = EgtIf( TailCutType.bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
else
dCutExtra = - ( b3Raw:getDimY() - Cutting1Data.dMaxDepth)
local dSawRad = Cutting1Data.dSawDiam / 2
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
local dKL = dSawRad - Cutting1Data.dMaxDepth + EgtIf( TailCutType.bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
local dMinSawingLength = 5
if BD.C_SIMM then
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo entrata
if dAccEnd > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccStart = b3Raw:getDimZ() - dAccEnd - dMinSawingLength
end
else
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo uscita
if dAccStart > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccEnd = b3Raw:getDimZ() - dAccStart - dMinSawingLength
end
end
end
-- per travi alte faccio faccio dei tagli orizzontali aggiuntivi
if TailCutType.bNeedHorizontalAddedCuts then
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not TailCutType.bBigSectionCut and BD.PRECUT_TAIL then
dStartOffset = dLenEndRaw
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
local nHorizontalCuts = ceil ( Proc.Face[1].HeightTrimmed / BD.MAX_DIM_DICE) - 1
local dHorizontalSliceHeight = Proc.Face[1].HeightTrimmed / ( nHorizontalCuts + 1)
for i = nCuts, 1, -1 do
local dCutXOffset = ( i - 1) * dOffsetBetweenCuts
-- tagli orizzontali
for j = nHorizontalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
local bForceTangentLeadInOut = BD.PRESS_ROLLER
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , Cutting1Data.sCutting, Cutting1Data.dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
if not bOk then return false, sErr end
end
-- se necessario taglio verticale doppio, eseguo l'opposto
if TailCutType.bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStartDoubleCut, dAccEndDoubleCut, 'Precut;', b3Raw, true)
if not bOk then return false, sErr end
end
-- taglio verticale
local sInfo = 'Precut'
if i == 1 and TailCutType.sType ~= 'Precut' then
sInfo = 'Cut'
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, sInfo, b3Raw, true)
if not bOk then return false, sErr end
end
return true, sWarn
end
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not TailCutType.bBigSectionCut and BD.PRECUT_TAIL and TailCutType.bNeedVerticalAddedCuts then
dStartOffset = dLenEndRaw
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- se necessari tagli in doppio, eseguo gli opposti
if TailCutType.bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and TailCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local sNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, sNotes, b3Raw, true)
if not bOk then return false, sErr end
end
end
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
-- se trave larga effettuo tagli verticali aggiuntivi
if TailCutType.bNeedVerticalAddedCuts then
local sSpecNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, sSpecNotes)
if not bOk then return bOk, sErr end
end
if i == 1 and TailCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local sNotes
if TailCutType.bSplit then
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
else
sNotes = EgtIf( i == 1 and TailCutType.sType ~= 'Precut', 'Cut;', 'Precut;')
end
-- se primo taglio da sopra e PF o ONE richiedo risalita preliminare a Zmax
if i == nCuts and TailCutType.bHorizCut and BD.C_SIMM and not BD.DOWN_HEAD then
sNotes = EgtSetValInNotes( sNotes, 'StartZmax', 2)
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, true)
if not bOk then return false, sErr end
end
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
else
-- verifico esistenza della lavorazione con lama da sotto
if not Cutting2Data.sCutting then
local sErr = 'Error : cutting H2 not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- verifico che le due lame riescano a lavorare la sezione
local dDimZ = b3Raw:getDimZ()
local dExtra = Cutting1Data.dMaxVertDepth + Cutting2Data.dMaxDepth - dDimZ
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not TailCutType.bBigSectionCut then
local sErr = 'Error : section too big for tail cut'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo extra taglio ed accorciamento
local dCutExtra = -Cutting2Data.dMaxDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dCutExtra2 = -Cutting1Data.dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dAccStart = 0
-- limiti da sotto
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not TailCutType.bBigSectionCut and BD.PRECUT_TAIL and TailCutType.bNeedVerticalAddedCuts then
dStartOffset = dLenEndRaw
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- eseguo i tagli da sotto necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and TailCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local sNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting2Data.sCutting, Cutting2Data.dSawDiam, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw, nil, true)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and TailCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
-- se trave larga effettuo tagli verticali aggiuntivi
if TailCutType.bNeedVerticalAddedCuts then
local sSpecNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, sSpecNotes)
if not bOk then return bOk, sErr end
end
local sNotes
if TailCutType.bSplit then
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
else
sNotes = EgtIf( i == 1 and TailCutType.sType ~= 'Precut', 'Cut;', 'Precut;')
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
if not bOk then return false, sErr end
end
end
return true
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione -- Applicazione della lavorazione
function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dOvmTail) function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dOvmTail)
-- impostazione default a variabili aggiunte -- impostazione default a variabili aggiunte
if not BD.OVM_CHAIN_HBEAM then BD.OVM_CHAIN_HBEAM = 8 end if not BD.OVM_CHAIN_HBEAM then BD.OVM_CHAIN_HBEAM = 8 end
if not BD.C_SIMM_ENC then BD.C_SIMM_ENC = 180 end if not BD.C_SIMM_ENC then BD.C_SIMM_ENC = EgtIf( BD.C_SIMM, 180, 90) end
-- ingombro del grezzo -- ingombro del grezzo
local b3Raw = EgtGetRawPartBBox( nRawId) local b3Raw = EgtGetRawPartBBox( nRawId)
-- inserimento smussi -- inserimento smussi
local nOriId = EgtGetInfo( Proc.Id, 'ORI', 'i') local nOriId = EgtGetInfo( Proc.Id, 'ORI', 'i')
if nOriId then if nOriId then
local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead) local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmTail)
if not bOkc then return bOkc, sErrC end if not bOkc then return bOkc, sErrC end
end end
-- recupero la lavorazione -- recupero la lavorazione
@@ -258,114 +581,108 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
end end
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
local dSawDiam = 400 local dSawDiam = 400
local dMaxDepth = 50 local dSawMaxDepth = 50
local dSawThick = 2 local dSawThick = 2
if EgtMdbSetCurrMachining( sCutting) then if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth dSawMaxDepth = EgtTdbGetCurrToolMaxDepth() or dSawMaxDepth
dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick
end end
end end
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0) local dMaxVertDepth = dSawMaxDepth - ( BD.DECR_VERT_CUT or 0)
-- recupero la eventuale lavorazione con lama da sotto -- recupero la eventuale lavorazione con lama da sotto
local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true) local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true)
-- recupero i dati della eventuale seconda lama -- recupero i dati della eventuale seconda lama
local dSawDiam2 = 0 local dSawDiam2 = 0
local dMaxDepth2 = 0 local dSawMaxDepth2 = 0
local dSawThick2 = 0 local dSawThick2 = 0
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2 dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2 dSawMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dSawMaxDepth2
dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2 dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2
end end
end end
-- recupero dati utensile della sega a catena più lunga a disposizione
local sSawing = ML.FindSawing( 'SawingForSplitting', nil, nil, 'Longest')
if not sSawing then
sSawing = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
end
local dChainSawMaxMat = 0
local dChainSawLen = 0
if EgtMdbSetCurrMachining( sSawing or '') then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dChainSawMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dChainSawMaxMat
dChainSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dChainSawLen
end
end
-- caratteristiche taglio -- caratteristiche taglio
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM)) local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dSawMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) ( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dSawMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)) local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA))
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
-- dati geometrici del taglio -- dati geometrici del taglio
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
-- flag di lavorazione faccia
local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_BACK)
-- separazione solo se esiste grezzo successivo con pezzi o scaricabile -- separazione solo se esiste grezzo successivo con pezzi o scaricabile
local nNextRawId = EgtGetNextRawPart( nRawId) local nNextRawId = EgtGetNextRawPart( nRawId)
local bSplit = ( nNextRawId and ( EgtGetPartInRawPartCount( nNextRawId) > 0 or EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw)) local bSplit = ( nNextRawId and ( EgtGetPartInRawPartCount( nNextRawId) > 0 or EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw))
-- determino se più tagli con offset -- determino se più tagli con offset
local dLenEndRaw = dOvmTail
local nCuts = 1 local nCuts = 1
local dOffsL = 0 local dOffsL = 0
if not bSplit then if not bSplit then
-- cerco grezzo successivo che sia nella fase -- cerco grezzo successivo che sia nella fase
if nNextRawId and EgtVerifyRawPartPhase( nNextRawId, nPhase) then if nNextRawId and EgtVerifyRawPartPhase( nNextRawId, nPhase) then
local b3NextRaw = EgtGetRawPartBBox( nNextRawId) local b3NextRaw = EgtGetRawPartBBox( nNextRawId)
local dLenEndRaw = ptC:getX() - b3NextRaw:getMin():getX() dLenEndRaw = ptC:getX() - b3NextRaw:getMin():getX()
nCuts = ceil( dLenEndRaw / BD.MAX_LEN_SCRAP) nCuts = ceil( dLenEndRaw / ( EgtIf( bBigSectionCut, BD.MAX_DIM_DICE - 0.1, BD.MAX_LEN_SCRAP + 0.5)))
dOffsL = dLenEndRaw / nCuts dOffsL = dLenEndRaw / nCuts
-- aggiorno ingombro del grezzo corrente con quello del successivo -- aggiorno ingombro del grezzo corrente con quello del successivo
b3Raw:Add( b3NextRaw) b3Raw:Add( b3NextRaw)
else
dLenEndRaw = min( dOvmTail, abs( ptC:getX() - b3Raw:getMin():getX()))
end end
end end
-- determino la necessità di tagli aggiuntivi
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 ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL)
-- dati lavorazioni sopra e sotto
local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dSawMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth}
local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dSawMaxDepth2, dSawThick = dSawThick2}
local SawingData = { sSawing = sSawing, dChainSawMaxMat = dChainSawMaxMat, dChainSawLen = dChainSawLen, bSplit = bSplit or false}
-- dati sul taglio di coda da effettuare
local TailCutType = { bBigSectionCut = bBigSectionCut, bHorizCut = bHorizCut, bDoubleHorizCut = bDoubleHorizCut, bDoubleCut = bDoubleCut, bSplit = bSplit, bNeedVerticalAddedCuts = bNeedVerticalAddedCuts, bNeedHorizontalAddedCuts = bNeedHorizontalAddedCuts}
-- se taglio per pezzi alti e larghi -- se taglio per pezzi alti e larghi
local nNewPhase = 0 local nNewPhase = 0
if bBigSectionCut then if bBigSectionCut then
local bFinishingNeeded = false local bFinishingNeeded = false
if bSplit then if bSplit then
-- recupero lunghezza massima di lavoro della sega a catena -- assegno offset in lunghezza
local sSawing = ML.FindSawing( 'Sawing') local dTailOffset = 0
local dMaxMat = 0
local dTlen = 0
if EgtMdbSetCurrMachining( sSawing or '') then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
dTLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dTLen
end
end
-- assegno offset in lunghezza
local dOffs = 0
if dOvmTail > BD.OVM_CHAIN_HBEAM then if dOvmTail > BD.OVM_CHAIN_HBEAM then
dOffs = dOvmTail - BD.OVM_CHAIN_HBEAM dTailOffset = dOvmTail - BD.OVM_CHAIN_HBEAM
bFinishingNeeded = true bFinishingNeeded = true
end end
-- se pezzo non troppo alto, taglio singolo da sopra -- split per grande sezione
if b3Raw:getDimZ() < dMaxMat - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL then local bOk, sErr, nNewPhase2 = ProcessSplit.MakeBigSectionSplitting( Proc, b3Raw, dTailOffset, SawingData, Cutting2Data)
local cutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN if nNewPhase2 then
sNotesSplit = 'Split;' nNewPhase = nNewPhase2
bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_TOP, cutDepth, sNotesSplit, dOffs) end
if not bOk then return bOk, sErr, nNewPhase end if not bOk then
-- se pezzo non troppo largo, taglio singolo da davanti return bOk, sErr, nNewPhase
elseif b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( dMaxMat, dTLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
local cutDepth = b3Raw:getDimY() + BD.CUT_EXTRA_MIN
sNotesSplit = 'Split;'
bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_FRONT, cutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
-- altrimenti tagli dai due fianchi (dietro e davanti)
else
local cutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
-- se la sega a catena non può completare lo split esco
if cutDepth >= min( dMaxMat, dTLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
sErr = 'Error : section too big for splitting'
EgtOutLog( sErr)
return false, sErr, -1
end
local sNotesSplit = 'Presplit;'
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_BACK, cutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
sNotesSplit = 'Split;'
bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_FRONT, cutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
end end
-- se necessaria finitura, creo nuova fase -- se necessaria finitura, creo nuova fase
if bFinishingNeeded then if bFinishingNeeded then
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET) BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET)
nNewPhase = EgtGetCurrPhase() nNewPhase = EgtGetCurrPhase()
nDispId = EgtGetPhaseDisposition( nNewPhase) local nDispId = EgtGetPhaseDisposition( nNewPhase)
if sDownOrSideOrStd == 'down' then if sDownOrSideOrStd == 'down' then
EgtRotateRawPart( nRawId, X_AX(), 180) EgtRotateRawPart( nRawId, X_AX(), 180)
EgtSetInfo( nDispId, 'TYPE', 'MID2') EgtSetInfo( nDispId, 'TYPE', 'MID2')
@@ -396,21 +713,61 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
sNotesFinal = 'Cut;' sNotesFinal = 'Cut;'
end end
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0 local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
-- determinazione materiale da asportare
local dSawThickCheck = dSawThick
if dSawThick2 > 0 and bDoubleHorizCut then
dSawThickCheck = min( dSawThick, dSawThick2)
end
local dMaxElev = 0
if vtN:getX() > 0 then
dMaxElev = b3Raw:getMax():getX() - Proc.Box:getMin():getX()
else
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
end
-- taglio a zero (con sega a catena o mix catena + lama) per evitare problemi con grezzo più lungo del previsto
if BD.PRECUT_TAIL and not bSplit then
local dTailOffset = dLenEndRaw
local bOkPrecut, sErrPrecut = ProcessSplit.MakeBigSectionSplitting( Proc, b3Raw, dTailOffset, SawingData, Cutting2Data)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- se finitura con lama -- se finitura con lama
if nQ05 == 1 or nQ05 == 0 or not bSplit then if nQ05 < 2 or ( not bSplit and dMaxElev > dSawThickCheck) then
local dSawThickCheck = dSawThick
if dSawThick2 > 0 and bDoubleHorizCut then
dSawThickCheck = min( dSawThick, dSawThick2)
end
local dMaxElev = 0
if vtN:getX() > 0 then
dMaxElev = b3Raw:getMax():getX() - Proc.Box:getMin():getX()
else
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
end
-- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard -- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard
if bSplit or dMaxElev > dSawThickCheck then if bSplit or dMaxElev > dSawThickCheck then
local bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dLenEndRaw, nil, false, true, b3Raw, sNotes, dCurrOvmT) local bOk, sErr
if bNeedVerticalAddedCuts then
-- ad ogni offset di taglio dovrò fare prima i tagli verticali e poi i cubetti
for i = nCuts, 1, -1 do
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
-- faccia di taglio all'offset corrente
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
local AddProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId}
Topology.Classify( AddProc, b3Raw)
local dCutOffset = ( i - 1) * dOffsL
local vtMoveSurf = Vector3d( -dCutOffset, 0, 0)
EgtMove( AddId, vtMoveSurf, GDB_RT.GLOB)
-- eventuale faccia di taglio all'offset precedente, per limitare il dicing e evitare di tagliare i cubetti nel vuoto
local nLimitingSurf
if nCuts > 1 then
nLimitingSurf = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
local dLastCutOffset = i * dOffsL
local vtMoveLimitingSurf = Vector3d( -dLastCutOffset + 10 * GEO.EPS_SMALL, 0, 0)
EgtMove( nLimitingSurf, vtMoveLimitingSurf, GDB_RT.GLOB)
local vtNLimitingSurf = EgtSurfTmFacetNormVersor( nLimitingSurf, 0, GDB_ID.ROOT)
if AreOppositeVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
end
-- tagli verticali
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw, sNotes)
if not bOk then return bOk, sErr end
-- tagli a cubetti con eventuale superficie limitante
bOk, sErr = Cut.Make( AddProc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nLimitingSurf)
end
-- tagli aggiuntivi non necessari
else
bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT)
end
if sNotesFinal then if sNotesFinal then
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal) EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
end end
@@ -424,15 +781,20 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
local sPocketing = ML.FindPocketing( 'OpenPocket', nil, 0) local sPocketing, dTDiam = ML.FindPocketing( 'OpenPocket', nil, 0)
if not sPocketing then if not sPocketing then
local sErr = 'Error : pocketing not found in library' local sErr = 'Error : pocketing not found in library'
EgtOutLog( sErr) EgtOutLog( sErr)
return false, sErr return false, sErr
end end
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid) local dOpenMinSafe
if BD.C_SIMM and b3Raw:getDimZ() > 600 then
dOpenMinSafe = 230 - dTDiam / 2
end
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid, dOpenMinSafe)
if sNotesFinal then if sNotesFinal then
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal) local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) .. sNotesFinal
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
end end
return bOk, sErr, nNewPhase return bOk, sErr, nNewPhase
end end
@@ -440,92 +802,11 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
return true, nil, nNewPhase return true, nil, nNewPhase
end end
end end
-- se tagli standard
if not bDoubleHorizCut then local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, TailCutType, Cutting1Data, Cutting2Data, nil, dLenEndRaw)
-- calcolo extra taglio ed accorciamento
local dCutExtra = 0 return bOk, sErr, nNewPhase
local dAccStart = 0 end
local dAccEnd = 0
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
else
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
local dSawRad = dSawDiam / 2
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
if BD.C_SIMM then
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
else
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
end
end
-- se necessari tagli in doppio, eseguo gli opposti
if bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, sNotes, b3Raw, true)
if not bOk then return false, sErr end
end
end
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local sNotes
if bSplit then
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
else
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
if not bOk then return false, sErr end
end
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
else
-- verifico esistenza della lavorazione con lama da sotto
if not sCutting2 then
local sErr = 'Error : cutting H2 not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- verifico che le due lame riescano a lavorare la sezione
local dDimZ = b3Raw:getDimZ()
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not bBigSectionCut then
local sErr = 'Error : section too big for tail cut'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo extra taglio ed accorciamento
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dAccStart = 0
-- limiti da sotto
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
-- eseguo i tagli da sotto necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local sNotes
if bSplit then
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
else
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
if not bOk then return false, sErr end
end
end
return true, nil, nNewPhase
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
return ProcessSplit return ProcessSplit
+23 -13
View File
@@ -1,6 +1,7 @@
-- ProcessStepJoint.lua by Egaltech s.r.l. 2022/11/03 -- ProcessStepJoint.lua by Egaltech s.r.l. 2022/11/03
-- Gestione calcolo giunto a gradino per Travi -- Gestione calcolo giunto a gradino per Travi
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura. -- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
-- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessStepJoint = {} local ProcessStepJoint = {}
@@ -110,7 +111,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
-- Inserisco la lavorazione del lato opposto -- Inserisco la lavorazione del lato opposto
@@ -133,7 +134,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch2Id, false)
return false, sErr return false, sErr
end end
return true return true
@@ -211,7 +212,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetInfo( AddId, 'TASKID', Proc.TaskId) EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- applico lavorazione -- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
@@ -222,7 +224,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetInfo( AddId, 'TASKID', Proc.TaskId) EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- applico lavorazione -- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
@@ -319,10 +322,12 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
if bAdj12 then if bAdj12 then
if dAng12 < 0 then if dAng12 < 0 then
EgtSurfTmSwapFacets( Proc.Id, 0, 2) EgtSurfTmSwapFacets( Proc.Id, 0, 2)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
end end
elseif bAdj20 then elseif bAdj20 then
if dAng20 < 0 then if dAng20 < 0 then
EgtSurfTmSwapFacets( Proc.Id, 1, 2) EgtSurfTmSwapFacets( Proc.Id, 1, 2)
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
end end
end end
-- dati delle facce -- dati delle facce
@@ -389,7 +394,8 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetInfo( AddId, 'TASKID', Proc.TaskId) EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- applico lavorazione -- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
@@ -433,18 +439,22 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- Eventuale segnalazione ingombro di testa o coda -- Eventuale segnalazione ingombro di testa o coda
if Proc.Head then if Proc.Head then
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
if vtNm:getZ() > 0.5 then if not BD.ROT90 then
dOffs = 0.5 * dOffs if vtNm:getZ() > 0.5 then
elseif abs( vtNm:getZ()) > 0.35 then dOffs = 0.5 * dOffs
dOffs = 0.75 * dOffs elseif abs( vtNm:getZ()) > 0.35 then
dOffs = 0.75 * dOffs
end
end end
BL.UpdateHCING( nRawId, dOffs) BL.UpdateHCING( nRawId, dOffs)
elseif Proc.Tail then elseif Proc.Tail then
local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
if vtNm:getZ() > 0.5 then if not BD.ROT90 then
dOffs = 0.5 * dOffs if vtNm:getZ() > 0.5 then
elseif abs( vtNm:getZ()) > 0.35 then dOffs = 0.5 * dOffs
dOffs = 0.75 * dOffs elseif abs( vtNm:getZ()) > 0.35 then
dOffs = 0.75 * dOffs
end
end end
BL.UpdateTCING( nRawId, dOffs) BL.UpdateTCING( nRawId, dOffs)
end end
+17 -5
View File
@@ -1,6 +1,7 @@
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2022/11/03 -- ProcessStepJointNotch.lua by Egaltech s.r.l. 2022/11/03
-- Gestione calcolo tacca a gradino per Travi -- Gestione calcolo tacca a gradino per Travi
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura. -- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
-- 2024/06/28 In MakeFourFaces aggiunta copia del parametro PartId sulla nuova Proc
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessStepJointNotch = {} local ProcessStepJointNotch = {}
@@ -11,6 +12,7 @@ local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw') local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut') local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut') local Cut = require( 'ProcessCut')
local Topology = require( 'FeatureTopology')
EgtOutLog( ' ProcessStepJointNotch started', 1) EgtOutLog( ' ProcessStepJointNotch started', 1)
@@ -383,7 +385,9 @@ local function MakeFourFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidt
EgtSurfTmSwapFacets( AddId, 1, 3) EgtSurfTmSwapFacets( AddId, 1, 3)
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
-- applico lavorazione -- applico lavorazione
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg} local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId}
local b3Raw = EgtGetRawPartBBox( nRawId)
Topology.Classify( NewProc, b3Raw)
local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth) local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth)
if not bOk then return bOk, sErr end if not bOk then return bOk, sErr end
end end
@@ -478,7 +482,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
end end
-- se diretta verso Z -- se diretta verso Z
elseif abs( vtExtr:getZ()) > 0.99 then elseif abs( vtExtr:getZ()) > 0.99 and not ( BD.DOWN_HEAD or nTypePos == 0) then
-- se diretta verso Z+ -- se diretta verso Z+
if vtExtr:getZ() > 0 then if vtExtr:getZ() > 0 then
-- se sborda verso Z+ abilito solo la lavorazione della parte normale -- se sborda verso Z+ abilito solo la lavorazione della parte normale
@@ -503,7 +507,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
local dExtra = 2 local dExtra = 2
-- recupero la lavorazione -- recupero la lavorazione
local sMillType = 'Mark' local sMillType = 'Mark'
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1) local bDownHead = BD.DOWN_HEAD and vtExtr:getZ() < GEO.EPS_SMALL
local sMilling, bH2 local sMilling, bH2
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead) sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
if not sMilling then if not sMilling then
@@ -531,11 +535,19 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
end end
if bExeOpposite then if bExeOpposite then
bDownHead = BD.DOWN_HEAD and vtExtr:getZ() > - GEO.EPS_SMALL
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
if not sMilling then
local sErr = 'Error : milling not found in library'
EgtOutLog( sErr)
return false, sErr
end
bDownHead = ( bDownHead and bH2)
-- Inserisco la lavorazione del lato opposto -- Inserisco la lavorazione del lato opposto
local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMch2Id = EgtAddMachining( sName2, sMilling) local nMch2Id = EgtAddMachining( sName2, sMilling)
@@ -556,7 +568,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch2Id, false)
return false, sErr return false, sErr
end end
end end
+21 -11
View File
@@ -1,4 +1,4 @@
-- ProcessTenon.lua by Egaltech s.r.l. 2023/01/20 -- ProcessTenon.lua by Egaltech s.r.l. 2023/09/26
-- Gestione calcolo tenone per Travi -- Gestione calcolo tenone per Travi
-- 2021/10/04 Corretto calcolo HCING per pezzi piccoli. -- 2021/10/04 Corretto calcolo HCING per pezzi piccoli.
-- 2022/02/15 Aggiornata VerifyOrientation per macchine con testa da sotto. -- 2022/02/15 Aggiornata VerifyOrientation per macchine con testa da sotto.
@@ -9,6 +9,8 @@
-- 2022/12/12 Su macchine con rulli pressori e pinze separate si riduce di meno l'ingombro con tenoni inclinati. -- 2022/12/12 Su macchine con rulli pressori e pinze separate si riduce di meno l'ingombro con tenoni inclinati.
-- 2022/12/20 Aggiunta gestione smusso. Migliorata scelta tra sopra e sotto per il punto di inizio. In VerifyOrientation aggiunta trave medio alta. -- 2022/12/20 Aggiunta gestione smusso. Migliorata scelta tra sopra e sotto per il punto di inizio. In VerifyOrientation aggiunta trave medio alta.
-- 2023/01/20 Modificata scelta lato di attacco per pezzo piccolo su macchine con pinza speciale (pinza 5). -- 2023/01/20 Modificata scelta lato di attacco per pezzo piccolo su macchine con pinza speciale (pinza 5).
-- 2023/03/27 Migliorate condizioni scelta pretaglio con lama o fresa; gestione unificata con ProcessDtTenon. Migliorato calcolo altezza tenone.
-- 2023/09/26 Per macchina TURN si assegna SCC per privilegiare accesso dal lato corto della trave.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessTenon = {} local ProcessTenon = {}
@@ -128,8 +130,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
-- determino altezza del tenone -- determino altezza del tenone
local frTen = Frame3d( ptBC, vtExtr) local frTen = Frame3d( ptBC, vtExtr)
local b3Ten = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frTen) local b3Ten = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frTen)
local dTenH = b3Ten:getDimZ() local dTenH = b3Ten:getMax():getZ()
-- assegno centro e normale della faccia top -- assegno centro e normale della faccia top
local vtN = vtExtr local vtN = vtExtr
local ptC = ptBC + vtN * dTenH local ptC = ptBC + vtN * dTenH
@@ -180,11 +182,10 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if AddId then if AddId then
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id)) EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( AddId, 'TASKID', Proc.TaskId) EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- se pezzo piccolo, in coda, con piano inclinato verso il basso e macchina con testa da sotto applico svuotatura -- solo per macchine tipo PF e simili: se pezzo piccolo, in coda, piano inclinato attorno a Z e inclinato verso il basso applico svuotatura
if bShortPart and vtExtr:getX() < 0 and vtExtr:getZ() < -0.09 and BD.DOWN_HEAD then if b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getX() < 0 and abs( vtExtr:getY()) > 0.173 and vtExtr:getZ() < -0.1 and BD.C_SIMM then
-- recupero la lavorazione -- recupero la lavorazione
local sPockType = EgtIf( bMillDown, 'OpenPocket_H2', 'OpenPocket') local sPocketing = ML.FindPocketing( 'OpenPocket', nil, nil, nil, not bMillDown, bMillDown)
local sPocketing = ML.FindPocketing( sPockType, nil, nil, nil, not bMillDown, bMillDown)
if not sPocketing then if not sPocketing then
local sErr = 'Error : pocketing '..sPockType..' not found in library' local sErr = 'Error : pocketing '..sPockType..' not found in library'
EgtOutLog( sErr) EgtOutLog( sErr)
@@ -199,7 +200,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
else else
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD) local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg, local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bFromBottom = ( bShortPart and vtExtr:getZ() > 0.25) local bFromBottom = ( bShortPart and vtExtr:getZ() > 0.25)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
if not bOk then if not bOk then
@@ -240,7 +242,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false) EgtSetOperationMode( nMch1Id, false)
return false, sErr return false, sErr
end end
end end
@@ -307,7 +309,9 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}}) EgtSetMachiningGeometry( {{ AuxId, -1}})
-- sistemo i parametri -- sistemo i parametri
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dTenH - 100 * GEO.EPS_SMALL, 1) .. ';') local sUserNotes = EgtSetVal( '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) EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
local dOffset = ( i - 1) * dStep local dOffset = ( i - 1) * dStep
EgtSetMachiningParam( MCH_MP.OFFSR, dOffset) EgtSetMachiningParam( MCH_MP.OFFSR, dOffset)
@@ -323,7 +327,13 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
-- imposto posizione braccio porta testa -- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE local nSCC = MCH_SCC.NONE
if not BD.C_SIMM and not BD.TURN then if BD.TURN then
if b3Solid:getDimY() >= b3Solid:getDimZ() then
nSCC = MCH_SCC.ADIR_ZP
else
nSCC = MCH_SCC.ADIR_YM
end
elseif not BD.C_SIMM then
nSCC = MCH_SCC.ADIR_YM nSCC = MCH_SCC.ADIR_YM
if abs( vtExtr:getY()) > 0.088 then if abs( vtExtr:getY()) > 0.088 then
nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
+7 -4
View File
@@ -1,6 +1,7 @@
-- ProcessTyroleanDovetail.lua by Egaltech s.r.l. 2022/03/21 -- ProcessTyroleanDovetail.lua by Egaltech s.r.l. 2022/03/21
-- Gestione calcolo giunzione tirolese -- Gestione calcolo giunzione tirolese
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe) -- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
-- Tabella per definizione modulo -- Tabella per definizione modulo
local ProcessTyroleanDovetail = {} local ProcessTyroleanDovetail = {}
@@ -231,7 +232,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw,
-- se va fatto, inserisco la lavorazione -- se va fatto, inserisco la lavorazione
if bCut then if bCut then
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AuxId, 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} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
if bOk then if bOk then
@@ -329,7 +331,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw,
-- se va fatto, inserisco la lavorazione -- se va fatto, inserisco la lavorazione
if bCut then if bCut then
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, local CutProc = { Id = AuxId, 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} Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead) local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta -- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
if bOk then if bOk then
@@ -510,10 +513,10 @@ local function MakeMachByMill( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b
dStepmach = dMaxMat * 0.5 dStepmach = dMaxMat * 0.5
end end
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa -- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, sin(dSideAngle)) local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, sin(dSideAngle))
if not nFacInd or nFacInd < 0 then if not nFacInd or nFacInd < 0 then
-- provo eliminando i sottosquadra -- provo eliminando i sottosquadra
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, -2) nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, -2)
if not nFacInd or nFacInd < 0 then if not nFacInd or nFacInd < 0 then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MakeMachByMill could not find reference face' local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MakeMachByMill could not find reference face'
EgtOutLog( sErr) EgtOutLog( sErr)
+170
View File
@@ -0,0 +1,170 @@
-- ProcessVariant.lua by Egaltech s.r.l. 2023/11/08
-- Gestione calcolo Feature Custom (Variant) per Travi
-- 2023/11/08 Creazione modulo.
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
-- Tabella per definizione modulo
local ProcessVariant = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
EgtOutLog( ' ProcessVariant started', 1)
-- Dati
local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessVariant.Identify( Proc)
return (( Proc.Grp == 0 or Proc.Grp == 1 or Proc.Grp == 2 or Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 900)
end
---------------------------------------------------------------------
-- Classificazione della feature: decide se la feature è in una posizione lavorabile
local function ClassifyPocket( Proc, b3Raw)
-- recupero gli indici delle facce da lavorare
local vFace = EgtGetInfo( Proc.Id, 'Faces', 'vi')
if not vFace or #vFace == 0 then
local sErr = 'Error : missing Faces for Pocketing'
EgtOutLog( sErr)
return false
end
-- recupero le normali di tutte le facce e verifico siano uguali
local vtN
for i = 1, #vFace do
local vtNf = EgtSurfTmFacetNormVersor( Proc.Id, vFace[i], GDB_ID.ROOT)
if not vtN then
vtN = vtNf
else
if not AreSameVectorApprox( vtN, vtNf) then
local sErr = 'Error : Faces for Pocketing with different orientation'
EgtOutLog( sErr)
return false
end
end
end
local bDown = ( vtN:getZ() < - 0.5)
-- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione
if bDown and BD.ANG_TRASM then
local dMaxDiam = EgtGetInfo( Proc.Id, 'MaxDiam', 'd')
if ML.FindPocketing( 'Pocket_AT', dMaxDiam) then
bDown = false
end
end
return true, bDown, false
end
---------------------------------------------------------------------
function ProcessVariant.Classify( Proc, b3Raw)
-- recupero il codice identificativo e il tipo di lavorazione
local sCode = EgtGetInfo( Proc.Id, 'DES')
local sType = EgtGetInfo( Proc.Id, 'Type')
-- gestione in base al tipo
if sType == 'Pocket' then
return ClassifyPocket( Proc, b3Raw)
else
return false
end
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
local function MakePocket( Proc, nRawId, b3Raw, nPartId)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- recupero gli indici delle facce da lavorare
local vFace = EgtGetInfo( Proc.Id, 'Faces', 'vi')
if not vFace or #vFace == 0 then
local sErr = 'Error : missing Faces for Pocketing'
EgtOutLog( sErr)
return false
end
-- recupero i dati delle facce (le normali sono identiche)
local dTotDepth = 0
local vDepth = {}
for i = 1, #vFace do
vDepth[i] = BL.GetFaceElevation( Proc, vFace[1], b3Solid)
dTotDepth = max( dTotDepth, vDepth[i])
end
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, vFace[1], GDB_ID.ROOT)
-- recupero eventuale massimo diametro impostato
local dMaxDiam = EgtGetInfo( Proc.Id, 'MaxDiam', 'd')
-- abilitazione lavorazione da sotto
local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259)
local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.174)
local bMillAngTrasm = ( BD.ANG_TRASM and vtN:getZ() < -0.5)
-- recupero la lavorazione
local sPockType = EgtIf( not bMillAngTrasm, 'Pocket', 'Pocket_AT')
local sPocketing = ML.FindPocketing( sPockType, dMaxDiam, dTotDepth)
if not sPocketing then
sPocketing = ML.FindPocketing( sPockType, dMaxDiam, dTotDepth / 2)
if not sPocketing then
local sErr = 'Error : pocketing not found in library'
EgtOutLog( sErr)
return false, sErr
end
end
-- recupero i dati dell'utensile
local dMillDiam = 20
local dMaxDepth = 0
if EgtMdbSetCurrMachining( sPocketing) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end
end
-- se elevazione superiore a massimo affondamento della fresa, segnalo
local sWarn
if dTotDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
-- lavoro ogni faccia
for i = 1, #vFace do
-- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
local nMchFId = EgtAddMachining( sName, sPocketing)
if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, vFace[i]}})
-- imposto posizione braccio porta testa
if vtN:getY() <= 0 then
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
else
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
end
EgtSetMachiningParam( MCH_MP.DEPTH, min( 0, dMaxDepth - vDepth[i]))
-- imposto elevazione
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';')
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end
return true, sWarn
end
---------------------------------------------------------------------
function ProcessVariant.Make( Proc, nRawId, b3Raw, nPartId)
-- recupero il codice identificativo e il tipo di lavorazione
local sCode = EgtGetInfo( Proc.Id, 'DES')
local sType = EgtGetInfo( Proc.Id, 'Type')
-- gestione in base al tipo
if sType == 'Pocket' then
return MakePocket( Proc, nRawId, b3Raw, nPartId)
else
return false, 'Variant Type non recognized for machining'
end
end
---------------------------------------------------------------------
return ProcessVariant
+1 -1
View File
@@ -15,7 +15,7 @@ EgtEnableDebug( false)
--NEST.MACHINE = 'Essetre-90480019_MW' --NEST.MACHINE = 'Essetre-90480019_MW'
--NEST.FLAG = 3 --NEST.FLAG = 3
local sLog = ' +++ BeamNestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. LEN["1"] local sLog = ' +++ BeamNestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. LEN[1]
EgtOutLog( sLog) EgtOutLog( sLog)
-- flag per abilitare statistiche in log -- flag per abilitare statistiche in log
+36 -17
View File
@@ -62,7 +62,7 @@ local function MyProcessInputData()
end end
end end
if not bFound then if not bFound then
table.insert( vBeam, { Id = nPartId, Name = ( EgtGetName( nPartId) or ( 'Id=' .. tonumber( nPartId)))}) table.insert( vBeam, { Ind = #vBeam + 1, Id = nPartId, Name = ( EgtGetName( nPartId) or ( 'Id=' .. tonumber( nPartId)))})
end end
end end
nId = EgtGetNextSelectedObj() nId = EgtGetNextSelectedObj()
@@ -115,17 +115,6 @@ local function MyProcessInputData()
end end
EgtDeselectAll() EgtDeselectAll()
-- Le ordino in senso di lunghezza crescente
table.sort( vBeam, function( B1, B2) return B1.Box:getDimX() < B2.Box:getDimX() end)
do
local sOut = ''
for i = 1, #vBeam do
sOut = sOut .. vBeam[i].Name .. ', '
end
sOut = sOut:sub( 1, -3)
EgtOutLog( 'Travi ordinate : ' .. sOut, 1)
end
return true return true
end end
@@ -146,12 +135,14 @@ local function MyProcessBeams()
local dAddLen = BD.OVM_HEAD + ( #vBeam - 1) * BD.OVM_MID local dAddLen = BD.OVM_HEAD + ( #vBeam - 1) * BD.OVM_MID
EgtOutLog( 'Ltot : '..EgtNumToString( dTotLen, 1) .. ' Lagg : '..EgtNumToString( dAddLen, 1)..' MinUnloadRaw : '.. EgtNumToString( BD.MinRaw + BD.OVM_MID, 1), 1) EgtOutLog( 'Ltot : '..EgtNumToString( dTotLen, 1) .. ' Lagg : '..EgtNumToString( dAddLen, 1)..' MinUnloadRaw : '.. EgtNumToString( BD.MinRaw + BD.OVM_MID, 1), 1)
-- Richiedo lunghezza del grezzo e sovramateriale di testa -- Richiedo lunghezza del grezzo, sovramateriale di testa, forzatura verticale e ordinamento automatico secondo la lunghezza
local vsVal = EgtDialogBox( 'Lavora Travi' .. ' (Ltot='..EgtNumToString( dTotLen + dAddLen + 0.5, 0).. local vsVal = EgtDialogBox( 'Lavora Travi' .. ' (Ltot='..EgtNumToString( dTotLen + dAddLen + 0.5, 0)..
', Lmax='..EgtNumToString( BD.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BD.MinRaw + BD.OVM_MID, 0)..')', ', Lmax='..EgtNumToString( BD.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BD.MinRaw + BD.OVM_MID, 0)..')',
{'Lunghezza grezzo', EgtNumToString( BD.STD_RAW, 0)}, {'Lunghezza grezzo', EgtNumToString( BD.STD_RAW, 0)},
{'Sovramateriale di testa', EgtNumToString( BD.OVM_HEAD, 0)}, {'Sovramateriale di testa', EgtNumToString( BD.OVM_HEAD, 0)},
{'Forza sezione verticale', ' CB:true,*false'}) {'Offset intermedio', EgtNumToString( BD.OVM_MID, 0)},
{'Forza sezione verticale', ' CB:true,*false'},
{'Ordina per lunghezza', ' CB:true,*false'})
if not vsVal then if not vsVal then
EgtDraw() EgtDraw()
return return
@@ -174,9 +165,17 @@ local function MyProcessBeams()
EgtDraw() EgtDraw()
return false return false
end end
local dOvmMid = EgtEvalNumExpr( vsVal[3])
if not dOvmMid then
local sOut = 'Offset intermedio : ' .. vsVal[3]
EgtOutLog( sOut)
EgtOutBox( sOut, 'Lavora Travi', 'WARNING')
EgtDraw()
return false
end
-- Sistemo sezione barra con travi -- Sistemo sezione barra con travi
local bVert = ( vsVal[3] == 'true') local bVert = ( vsVal[4] == 'true')
if bVert then if bVert then
if dRawW > dRawH then dRawW, dRawH = dRawH, dRawW end if dRawW > dRawH then dRawW, dRawH = dRawH, dRawW end
end end
@@ -215,8 +214,28 @@ local function MyProcessBeams()
return false return false
end end
-- Se richiesto, ordino le travi in senso di lunghezza crescente
local bOrd = ( vsVal[5] == 'true')
if bOrd then
table.sort( vBeam, function( B1, B2)
if abs( B1.Box:getDimX() - B2.Box:getDimX()) < 1 then
return B1.Ind < B2.Ind
else
return B1.Box:getDimX() < B2.Box:getDimX()
end
end)
end
do
local sOut = ''
for i = 1, #vBeam do
sOut = sOut .. vBeam[i].Name .. ', '
end
sOut = sOut:sub( 1, -3)
EgtOutLog( 'Travi ordinate : ' .. sOut, 1)
end
-- Sistemo le travi nel grezzo -- Sistemo le travi nel grezzo
local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam) local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam)
if not bOk then if not bOk then
EgtOutLog( sErr) EgtOutLog( sErr)
EgtOutBox( sErr, 'Lavora Travi', 'ERROR') EgtOutBox( sErr, 'Lavora Travi', 'ERROR')
+267
View File
@@ -0,0 +1,267 @@
==== Beam Update Log ====
Versione 2.6i1 (09/09/2024)
- Added : refactoring e modifiche a HeadCut e Split per introduzione pretagli a zero sul grezzo, per evitare problemi con pezzi non lunghi quanto ci si aspetta
- Added : in Mark, gestita la lavorazione del testo
- Modif : gestione dipendenza foro-tasca in caso di fase con pezzo ribaltato
- Modif : in Headcut e Split aggiunta gestione parametro MIN_HEIGHT_ADDED_CUTS da BeamData per scegliere l'altezza minima per cui devono essere aggiunti i tagli orizzontali supplementari
- Modif : se Lapjoint attraversata da L055, la lapjoint viene fatta prima
- Modif : in ScarfJoint, in dicing, tagli paralleli fatti con unico passaggio di fianco per evitare che il cubetto rimanga appoggiato al motore
- Fixed : corretto caso di groove lunga passante a 3 facce che non veniva lavorata
- Fixed : in FacesBySaw -> MakeOne corretta gestione lato di lavoro quando il percorso è orizzontale
Versione 2.6h2 (26/08/2024)
- Added : in BatchProcess e New si verifica l'abilitazione alla generazione con EgtVerifyKeyOption
- Modif : in FacesBySaw introdotti attacchi tangenziali solo da un lato, limitati a facce con Z negative
- Modif : in LapJoint -> tunnel lo smusso funziona anche se è forzata la sega a catena
- Modif : in LapJoint -> svuotatura, se l'utente ha definito un'elevazione custom si lavora sempre la faccia standard
- Modif : in FacesBySaw -> MakeOne aggiunta la possibilità di passare una direzione di lavoro alternativa per poter rispettare contemporaneamente la direzione di lavoro concorde e la direzione di taglio.
Versione 2.6h1 (20/08/2024)
- Modif : in SimpleScarf, se assimilabile a un taglio, si considera area non pinzabile
- Modif : in LapJoint gestito smusso nel caso Groove-Blind-RightAngles-Parallel-4
- Modif : varie modifiche ai tagli di lama per evitare chiusura rulli pneumatici e finecorsa
- Modif : in BatchProcessNew, se presente flag apposito in EgtCam5, si evita la generazione
Versione 2.6g4 (19/07/2024)
- Modif : in BatchProcess e BatchProcessNew si forza ricalcolo ogni volta che si è in situazione di CHECK o CHECK + GENERATE
Versione 2.6g3 (07/07/2024)
- Added : aggiunta possibilità di funzione GetNzLimDownUp specifica per ogni macchina
- Modif : anche nel taglio a cubetti si chiama GetNzLimDownUp di macchina, se presente, per decidere limite orientamento lama verso il basso
- Modif : in BeamExec inserito controllo massimo numero di facce per lanciare GetFacetsInfo
- Fixed : in LapJoint corretto typo in nome variabile che provocava mancata impostazione asse bloccato
Versione 2.6g2 (04/07/2024)
- Modif : le lavorazioni BlockHaus, se vicine alla coda, vengono spostate dopo il taglio di separazione
Versione 2.6g1 (01/07/2024)
- Modif : in LongDoubleCut gestita correttamente SCC per lama
- Modif : in MachiningLib miglioramenti a scelta testa ottimizzata
- Modif : in ProcessDtTenon correzione in scelta testa
- Modif : In LapJoint -> VerifySideMillAsSaw modificato criterio ricerca utensile in base a normale della faccia
- Fixed : in MakeAntiSplintBySaw se non si trova adiacenza tra le facce si restituisce errore
- Fixed : In StepJointNotch, MakeFourFaces corretta copia feature con PartId mancante
Versione 2.6f2 (17/06/2024)
- Modif : correzione a tagli a cubetti (ripristinata versione pre 2.6f1)
Versione 2.6f1 (06/06/2024)
- Added : Q04 (tipo longcut) abilitato anche in RidgeLap (T30), se riconducibile a 2 facce
- Modif : migliorie al taglio a cubetti
- Modif : in LapJoint -> MakePocket abilitata Q per forzare massima elevazione
- Fixed : correzione a SCC per lama da sotto con aggregato
- Fixed : correzioni a ottimizzazione teste per macchine con teste sopra/sotto
Versione 2.6e5 (27/05/2024)
- Modif : in LapJoint corretto typo in lavorazione lamello che impediva il funzionamento corretto.
Versione 2.6e4 (20/05/2024)
- Modif : in SawPlusChain le lavorazioni di sega a catena aggiuntive (side) si fermano in mezzeria se tasca passante
- Modif : in SawPlusChain il tunnel con sega a catena viene fatto da un solo lato se possibile
Versione 2.6e3 (14/05/2024)
- Modif : in SawPlusChain aggiunta gestione lavorazioni aggiuntive lati aperti e tunnel
- Fixed : in Cut -> MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti.
Versione 2.6e2 (10/05/2024)
- Modif : in FeatureTopology aggiunta proprietà IsTrough = true anche a Cut
- Modif : LongCut : se non trova fresa per pulizia, da messaggio di warning anziché di errore
- Fixed : LongCut : allungamento percorso ingresso per evitare collisioni durante approccio pezzo quando si setta OutRaw.
Versione 2.6e1 (03/05/2024)
- Modif : in LapJoint Groove verso il basso lavorata di preferenza dal lato
- Modif : in LapJoint -> SideMillAsSaw gestito anche rabbet passante
- Fixed : in BeamExec box della feature aggiornato dopo rotazione
- Fixed : in BeamExec GetProcessAffectedFaces e GetFacetsInfo rilanciati dopo rotazione
- Fixed : In LapJoint -> MakeMoreLongFaces corretto calcolo divisione in parti per evitare problemi di ceil con interi perfetti
Versione 2.6d2 (11/04/2024)
- Added : in LapJoint aggiunta strategia per fare tasche con lama + sega a catena, attivata da Q11
Versione 2.6d1 (08/04/2024)
- Fixed : in Long2Cut corretto nome passato alla BL.GetBlockedAxis
- Fixed : in MakeTwo rimossa gestione calcolo differente su ultima passata in caso di macchina FAST
- Fixed : in LapJoint -> ForceSideMill escluso caso 4 facce senza possibilità di ingresso lungo Y.
Versione 2.6c4 (18/03/2024)
- Fixed : correzioni a gestione prefori.
Versione 2.6c3 (15/03/2024)
- Added : Aggiunta gestione prefori
- Fixed : in LapJoint correzione a calcolo ingombro per feature basse e lunghe dalla testa.
Versione 2.6c2 (12/03/2024)
- Added : in Mortase Aggiunta possibilità di inserire lavorazione di smusso
- Added : in FreeContour aggiunto smusso se lav. di svuotatura
- Added : in BeamExec creata funzione calcolo dipendenze tra feature
- Added : In BeamExec -> CollectFeatures si scrive ora Width e Height della faccia sia trimmate con il grezzo che intere
- Added : implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket
- Modif : in LapJoint migliorata ricerca pocket (VerifyPocket)
- Modif : implementato attacco esterno se tasca 4 facce sulla coda ma nessun pezzo successivo
- Modif : rimossi simboli di debug da compile
- Fixed : In FreeContour corretto caso di smusso non passante
Versione 2.6c1 (29/02/2024)
- Modif : in FacesBySaw e LapJoint migliorato calcolo area non pinzabile in testa HCING e coda TCING
- Modif : vari miglioramenti all'ordinamento delle lavorazioni
- Modif : in Mortise forzata SPIRAL_IN se c'è almeno un lato aperto
- Modif : in tenone a coda di rondine aumentato a 8 il numero massimo di passate (era 6)
- Modif : in lapjoint a due facce migliorata la scelta della lama da sotto
- Fixed : in LapJoint corretto bug che impediva l'esecuzione della lavorazion con antischeggia attivo
Versione 2.6b1 (14/02/2024)
- Fixed : corretto bug in Split in cui si chiamava la EgtSurfTmFacetNormVersor senza riferimento
- Fixed : in L20 corretta gestione 2 facce
- Modif : modifiche per limiti pinzaggio con pinze con fronte verticale (ONE, PF) anzichè inclinato (FAST) quindi parametro BD.VICE_MINH grande
- Modif : nei tagli con sega a catena ora si considera l'ingombro della testa per il calcolo della massima profondità
- Modif : in LapJoint ora i rabbet lungo X che guardano in basso sono sempre fatti con fresatura di lato per evitare di ruotare.
Versione 2.6a1 (24/01/2024)
- Added : in HeadCut e Split aggiunti tagli verticali addizionali per travi di larghezza elevata
- Added : in Split gestita separazione con sega a catena + lama
- Added : in MachiningLib è ora possibile riordinare le lavorazioni in base a lunghezza e dimensione utensile
- Added : modifiche per poter impostare offset intermedio anche se lanciato da EgtCam5
- Modif : nelle lavorazioni si gestiscono ora seghe a catena multiple
- Modif : in split con sega a catena ora si cerca di preferenza una lavorazione di tipo 'SawingForSplitting'. Se non trovata si cerca il tipo 'Sawing' come in precedenza
- Modif : in split con sega a catena aggiunta estensione start/end del percorso se utensile lungo, per evitare collisioni con il pezzo durante rotazione
- Modif : implementata funzione GetBlockedAxis per gestire l'asse bloccato per sega a catena e lama
- Modif : in DiceCut corretto calcolo cubetti con superficie limitante parallela e opposta a quella di base
Versione 2.5l3 (08/01/2023)
- Modif : modifiche per centrare i pezzi in Y sulla tavola (da flag BeamData.CENTER_BEAM)
- Modif : resi più veloci i calcoli di FeatureTopology
- Modif : migliorato calcolo attacco/uscite lame in FacesBySaw.
Versione 2.5l2 (20/12/2023)
- Modif : in Cut e DoubleCut modifica in scelta ribaltamento trave quando si è in condizioni downUp
- Modif : migliorato e esteso il funzionamento di SideMillAsSaw
- Modif : in LapJoint con più facce, nelle OpenPocket, ammesso utensile con diametro fino a 3 volte la dimensione della tasca (era 2)
- Modif : in RoundArch aggiunta gestione senso di rotazione fresa per lavorare sempre in concordanza
- Fixed : correzione a GetFaceWithMostAdj per calcoli con facce che fanno ombra
Versione 2.5l1 (01/12/2023)
- Added : in LongDoubleCut aggiunta Q05 per utilizzo lama anche in feature cieche conme per LongCut
- Modif : Migliorato e velocizzato il calcolo elevazione (EgtSurfTmFacetElevationInBBox)
- Fixed : in MakeTwo di FacesBySaw raffinamento calcolo vtRef per casi dubbi.
Versione 2.5k3 (28/11/2023)
- Added : in Long2Cut gestite lavorazioni lama con Q05 come in LongCut.
Versione 2.5k2 (06/11/2023)
- Added : in LapJoint, per L020, gestita lavorazione speciale gradino scala con fresatura + lama, attivata con Q09
- Fixed : in ProcessSplit si imposta l'ingombro asse C correttamente anche per teste con asse rotante C con un solo braccio.
Versione 2.5k1 (02/11/2023)
- Modif : in LapJoint gestito caso groove due facce >90° con fresa, se forzato da parametro Q
- Modif : in LongCut e LongDoubleCut migliorata spezzatura taglio passante con due spezzoni
- Modif : nei tagli di lama migliorata gestione con percorso bilinea
- Modif : in LapJoint 2 facce longitudinali si usa taglio di lama solo se si taglia completamente, altrimenti fresa.
Versione 2.5j1 (23/10/2023)
- Added : in Process (lancio da EgtCAM5 quindi uso praticamente solo interno) aggiunta possibilità di tenere ordine pezzi in barra come da selezione
- Modif : in Topology aggiunti casi al check solo direzione principale
- Modif : nella ricerca lavorazione da usare controllo di utensile attivo sostituito con controllo utensile presente nel setup corrente
- Fixed : piccola correzione a Classify di FeatureTopology per casi senza geometria
- Fixed : in HeadCut e Split corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
- Fixed : in Lapjoint -> MakePocket aggiunto messaggio in caso si rovini il pezzo successivo.
Versione 2.5i2 (27/09/2023)
- Added : aggiunto riconoscimento sottosquadro da facce non adiacenti
- Modif : in lavorazione tenoni per Turn si assegna SCC per privilegiare accesso dal lato corto della trave.
- Fixed : in LapJoint corretto caso tunnel lungo non lavorato correttamente
- Fixed : in foratura quando errore in applicazione lavorazione si inverte e riprova solo se singola su foro aperto
Versione 2.5i1 (12/09/2023)
- Modif : in Cut abbassato a 590 mm il limite per convertire in LongCut [Ticket #1448]
- Fixed : in LapJoint gestito correttamente il ritorno nil di GetUShapeWidth [Ticket #1354].
Versione 2.5h2 (11/08/2023)
- Modif : in LapJoint e Mortise modificata posizione braccio per FAST quando vicino alla coda della trave
- Fixed : corrette forature con aggregato quando lato aperto
- Fixed : in RidgeLap corretto ingombro lavorazione in testa e coda quando rivolta verso il basso.
Versione 2.5h1 (07/08/2023)
- Fixed : tagli doppi di lato non effettuati se macchina tipo PF e pezzo alto [Ticket #1400]
- Fixed : in split e headcut corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo [Ticket #1227]
- Fixed : in lapjoint piccola correzione al calcolo della distanza di sicurezza in base al gambo dell'utensile [Ticket #1227]
- Fixed : in Lapjoint corretto incremento della profondità pari al raggio utensile per tunnel con sega a catena [Ticket #1212]
Versione 2.5g3 (01/08/2023)
- Added : aggiunta gestione tasche chiuse ad orientamento verticale con rinvio angolare [Ticket #1333]
- Modif : in LongCut ammesso uso lama da sotto fino a Norm +3deg in verticale
- Fixed : in Cut correzione calcolo offset per taglio doppio di lato [Ticket #1400].
Versione 2.5g2 (31/07/2023)
- Added : in FreeContour, solo se pocket, aggiunta Q06 per specificare un eventuale offset radiale del contorno [Ticket #1334]
- Added : aggiunta gestione forature verticali con rinvio angolare [Ticket #1332]
- Fixed : corretta gestione antischeggia con lama su LapJoint [Ticket #1351]
- Fixed : in ProfConvex, ProfConcave e ProfHead corretto e semplificato ModifySideInvertLead per invert [Ticket #1330]
- Fixed : corretto il funzionamento delle mortase in doppio [Ticket #1404].
Versione 2.5g1 (05/07/2023)
- Modif : in DiceCut modificata scelta tagli ortogonali quando liberi (esteso caso di verticali ammessi)
- Modif : in LapJoint estesi casi riconoscimento in coda basato su lunghezza
- Fixed : nelle mortase passanti escluso il riconoscimento lati aperti che portava a lavorazioni errate [Ticket #1342]
- Fixed : in LapJoint impedito l'uso del truciolatore se la tasca è chiusa [Ticket #1361]
- Fixed : migliorato controllo fattibilità taglio di fianco con cubetti.
Versione 2.5f4 (21/06/2023)
- Added : aggiunti tagli speciali per evitare il rischio che il cubetto rimanga appoggiato al motore [Ticket #1004, #1214]
- Fixed : corretto attacco speciale in FreeContour [Ticket #1250]
Versione 2.5f3 (16/06/2023)
- Fixed : correzione scelta di approccio lama in casi speciali
- Fixed : correzione a tagli aggiuntivi orizzontali negli split.
Versione 2.5f2 (12/06/2023)
- Fixed : in LapJoint corretto il recupero dati utensile che, in alcune funzioni, puntava all'utensile errato
- Fixed : In BeamLib -> ChangeOrOpenStart corretta ricerca segmento più lungo.
Versione 2.5f1 (08/05/2023)
- Modif : in Process (esecuzione manuale da Cam5) ordinamento travi di lunghezza praticamente uguale dipende da ordine di selezione
- Modif : in LapJoint limiti su svuotature tasche a L 4 facce come per L 3 facce
- Modif : in LapJoint su svuotature aggiunto recupero UserNotes da libreria per MaxOptSize.
- Fixed : in LongDoubleCut corretta scelta SCC (orientamento braccio testa) per macchine TURN nel caso di concavi
Versione 2.5e5 (26/05/2023)
- Modif : riconoscimento fori da sotto anche dalla faccia di ingresso
- Modif : in foratura se TURN aggiunta possibilità di forare da sotto.
- Fixed : correzioni a Profili Concavo e Convesso per TURN
- Fixed : correzione a foratura per ignorare fori annegati nel pezzo
Versione 2.5e4 (23/05/2023)
- Modif : in LongCut migliorato calcolo e verifica affondamento per lavorazione con lama con codolo in mezzo
- Fixed : correzione SCC lama per macchina Turn [Ticket #1258]
Versione 2.5e3 (11/05/2023)
- Modif : in taglio di separazione aggiunta richiesta risalita preliminare a Zmax quando da sopra su macchine PF e ONE
- Fixed : in lavorazioni in doppio correzione riconoscimento per possibile lavorazione in doppio di tasche che si toccano sul fondo
- Fixed : in lavorazioni in doppio con lavorazione precedente differente forzata risalita a Zmax per vitare problemi di riposizionamento [Ticket #1062]
Versione 2.5e2 (04/05/2023)
- Modif : Piccola modifica a SCC per LongCut derivanti da Cut
Versione 2.5e1 (03/05/2023)
- Modif : in TS3v7 tolleranza su quote sezione portata a 0.1 mm
- Fixed : Corretto SCC in caso di asse utensile allineato con Z [Ticket #1232]
Versione 2.5d2 (20/04/2023)
- Added : nei tagli di testa e coda, nel caso di travi alte, aggiunti tagli orizzontali per diminuire la dimensione degli sfridi [Ticket #1175, #1185]
- Modif : unificata gestione lato testa per tagli longitudinali [Ticket #1167].
Versione 2.5d1 (06/04/23)
- Added : in svuotatura aggiunta possibilità di impostare una distanza di sicurezza minima su attacco da lato aperto
- Modif : in split per travi con sezioni molto grandi e materiale inferiore allo spessore lama, miglioramenti volti ad evitare collisioni prevedibili
- Modif : in taglio con lama piccola miglioria nella scelta della direzione di approccio per pezzi corti
- Fixed : in LapJoint correzione al calcolo della distanza di collisione nel caso in cui il gambo sia più piccolo dell'utensile [Ticket #1150]
- Fixed : corretto ordinamento per fori di coda da lasciare in coda
- Fixed : correzione per gestire la lama principale sulla testa secondaria quando questa non è una testa da sotto [Ticket #1161]
- Fixed : modifiche a Split per travi con sezioni molto grandi e materiale inferiore allo spessore lama.
Versione 2.5c8 (30/03/23)
- Modif : nei tenoni (standard e coda di rondine) migliorate e unificate condizioni scelta pretaglio con lama o fresa [Ticket #1131]
- Modif : le mortase a coda di rondine sono ora anticipate a prima dei tagli longitudinali indipendentemente dalla sovrapposizione in Y
- Modif : modificato l'ingombro dei tagli inclinati per macchine con trascinatori tipo PF
- Fixed : nelle mortase a coda di rondine corretto calcolo larghezza della mortasa per derivare numero e step passate [Ticket #1126, #1143]
- Fixed : nei tenoni a coda di rondine corretto calcolo distanza lato da lavorare quando la faccia di base è divisa in più parti.
+6
View File
@@ -0,0 +1,6 @@
-- Version.lua by Egaltech s.r.l. 2024/01/30
-- Gestione della versione di Beam
NAME = 'Beam'
VERSION = '2.6i1'
MIN_EXE = '2.6e5'
View File