Compare commits

...

200 Commits

Author SHA1 Message Date
andrea.villa b08710451a In Drill, se foro in testa che attraversa un taglio, si setta sempre la MaxElev. Serve in caso ci sia un grande sovramateriale di testa 2025-06-24 14:50:20 +02:00
andrea.villa 4adf62069f In RidgeLap, si utilizza direzione reale della faccia. Prima era solo verso X 2025-06-24 12:34:12 +02:00
andrea.villa 118b9a88d2 Merge branch 'Probing' into develop 2025-06-24 10:33:35 +02:00
andrea.villa 73c86bd35f In MAchiningLib, le librerie di lavorazioni chiamate con pcall perchè non è detto che siano tutte presenti 2025-06-24 10:32:37 +02:00
luca.mazzoleni 5de62b9563 update versione minima 2025-06-23 17:05:29 +02:00
luca.mazzoleni a7a9a23cf3 Merge branch 'feature/OutrawBladeHeadCutSplit' into develop 2025-06-23 16:59:56 +02:00
luca.mazzoleni 21fe8ca47d - in FacesBySaw piccola correzione alla distanza tangente in caso di attacco perpendicolare con OutRaw 2025-06-23 16:58:49 +02:00
andrea.villa 0f536b07c4 Aggiornato Compile 2025-06-23 16:26:39 +02:00
andrea.villa 3e01fb36b0 Si sceglie lavorazione che utilizza la stessa testa della lavorazione 2025-06-23 15:36:20 +02:00
luca.mazzoleni 3c4af3c335 Merge branch 'develop' into feature/OutrawBladeHeadCutSplit 2025-06-23 15:35:48 +02:00
andrea.villa 9480453e57 Disattivazione finale e altre modifiche 2025-06-23 14:53:33 +02:00
luca.mazzoleni e98f924630 - in FacesBySaw piccola correzione alla distanza di compensazione in caso di attacco perpendicolare con OutRaw 2025-06-23 14:41:57 +02:00
luca.mazzoleni eabbc883e4 - in DiceCut.GetDice si ritornano anche gli OffsetP e OffsetO utilizzati
- in ProcessCut si usano gli offset reali dei cubetti per il calcolo della lunghezza di compensazione per gli attacchi perpendicolari OutRaw
2025-06-23 12:38:04 +02:00
andrea.villa 8e19e87d3f Prima versiomne funzionante tastatura. Manca disattivazione finale 2025-06-23 12:15:45 +02:00
luca.mazzoleni 0c4f57a90b - in ProcessSplit si fa attacco perpendicolare OutRaw anche per tutti i tagli con Cut.Make
- in tagli testa e coda sistemata lunghezza compensazione per caso con OutRaw
2025-06-23 11:59:42 +02:00
andrea.villa 77310576bd In LongDoubleCut, se taglio concavo rivolto verso il basso, gestione lavorazione con lama DownUp se macchina senza testa sotto 2025-06-23 09:09:50 +02:00
luca.mazzoleni 1e2f559937 - in HeadCut e Split i tagli aggiuntivi di spezzatura sono ora con attacco perpendicolare e OutRaw=3 (non tornano ogni volta indietro fino al grezzo ipotetico); risolto, presumibilmente, il caso dei rulli che si chiudono
- modificate di conseguenza Cut e FacesBySaw
2025-06-20 17:59:14 +02:00
andrea.villa 6a6dc27560 Primo commit gestione tastatura 2025-06-20 17:30:08 +02:00
luca.mazzoleni ab6ed79a0e Merge branch 'develop' into feature/OutrawBladeHeadCutSplit 2025-06-19 17:57:54 +02:00
luca.mazzoleni 7bb237f7d2 - nei tagli bForceTangentLeadInOut sostituita da sLeadInOutType per forzare il tipo di attacco 2025-06-19 17:54:50 +02:00
andrea.villa 67bb55537e In LapJoint, aggiunti smussi anche se lavorazione con truciolatore 2025-06-19 15:42:07 +02:00
luca.mazzoleni 777179d1b2 Merge branch 'develop' into feature/OutrawBladeHeadCutSplit 2025-06-19 12:08:15 +02:00
luca.mazzoleni 06adbb0b5d Merge branch 'master' into develop 2025-06-19 12:07:46 +02:00
luca.mazzoleni 872a3ec899 update version e log 2025-06-19 12:07:23 +02:00
luca.mazzoleni 5dae07e2aa Merge branch 'hotfix/StepJointNotchMilingLeadInOut' 2025-06-19 12:04:08 +02:00
luca.mazzoleni fc26a8ad4a - in StepJointNotch corretta distanza attacco in/out 2025-06-19 12:03:15 +02:00
luca.mazzoleni 04046787e3 Merge tag '2.7f2' into develop
2.7f2
2025-06-18 12:40:44 +02:00
luca.mazzoleni a12aaf86bc Merge branch 'release/2.7f2' 2025-06-18 12:40:35 +02:00
luca.mazzoleni 70d16909f5 update version e log 2025-06-18 12:40:16 +02:00
andrea.villa 5007cda21f - In StepJointNotch, se si forza truciolatore, si prende utensile più grande
- Per sovrapposizione in spezzatura LapJooint, corretto caso tipo Tunnel
2025-06-09 17:50:19 +02:00
andrea.villa 76d03160c5 In LapJoint, piccola correzione calcolo sovrapposizione trimesh per smuotatura 2025-06-09 15:35:03 +02:00
andrea.villa 534302f48e In Long2Cut, messaggio feature non completa se utensile non arriva sul fondo 2025-06-09 13:27:10 +02:00
luca.mazzoleni 60d73199e4 Merge tag '2.7f1' into develop
2.7f1
2025-06-03 14:56:29 +02:00
luca.mazzoleni 71a51e56e1 Merge branch 'release/2.7f1' 2025-06-03 14:56:11 +02:00
luca.mazzoleni bf9791ca9c update version e log 2025-06-03 14:56:03 +02:00
andrea.villa 249cb4eea5 Se fresa su aggregato e lavorazione rivolta verso Z-, si accede da lato aperto 2025-06-03 10:53:45 +02:00
andrea.villa 46cda4d472 Modificato angolo limite tenone per lavorazione sottosquadra 2025-05-28 15:02:59 +02:00
Dario Sassi 72b0e7f4a4 DataBeam :
- modifiche per sola macchina Scm-Oikos.
2025-05-27 19:56:51 +02:00
luca.mazzoleni 0e02959467 Merge tag '2.7e2' into develop
2.7e2
2025-05-23 18:30:13 +02:00
luca.mazzoleni b7837fe95c Merge branch 'release/2.7e2' 2025-05-23 18:29:59 +02:00
luca.mazzoleni d66eaf5322 - update version e log 2025-05-23 17:38:25 +02:00
andrea.villa 05ecf76312 In DTMortise, si fa trim quando il percorso è in basso. 2025-05-16 17:10:05 +02:00
andrea.villa 6e3a1ddc7a In FBS ripristinato calcolo vtFaceUse, risolto casi ambigui a 45° con nuovo comando EdgesFaceUse. 2025-05-09 12:31:11 +02:00
andrea.villa df47691da1 In ScarfJoint corretto caso in cui faccia di fondo sia più alta rispetto a faccia verticale centrale 2025-05-09 10:05:04 +02:00
andrea.villa 8a2200e0de Aumentato angolo limite per lavorazioni verso il basso, da 5° a 7° 2025-05-08 14:51:19 +02:00
luca.mazzoleni 0136ccac19 Merge tag '2.7e1' into develop
2.7e1
2025-05-05 16:58:07 +02:00
luca.mazzoleni 7ee683aeb8 Merge branch 'release/2.7e1' 2025-05-05 16:57:56 +02:00
luca.mazzoleni e81d1aef66 update log e version 2025-05-05 16:57:35 +02:00
andrea.villa 5331466c4f In BatchProcess, anche se non è da riprocessare, si setta come nota sul MachGroup il nome del codice CNC da utilizzare 2025-04-30 16:15:21 +02:00
luca.mazzoleni 7a972cccc8 - in LapJoint se tunnel verticale lavorato solo da sopra e l'utensile non arriva, si restituisce warning 2025-04-28 19:07:22 +02:00
andrea.villa 2ed5af9661 In Drill, dopo che l'utensile è stato scelto si verifica compatibilità considerando angolo foro. Se non arriva in fondo, si cerca utensile più lungo. 2025-04-28 15:08:16 +02:00
andrea.villa e25c24a33a Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2025-04-23 15:21:16 +02:00
andrea.villa aeca298feb In SplitCut, si riduce percorso di taglio solo se il pezzo è effettivamente alto 2025-04-23 15:21:13 +02:00
luca.mazzoleni a09565cfb7 Merge branch 'master' into develop 2025-04-22 11:24:33 +02:00
luca.mazzoleni 862b375ee5 update log e version 2025-04-22 11:24:22 +02:00
luca.mazzoleni a34147ce15 - #CRITICAL# in LapJoint correzione parentesi che causavano la chiamata di LongCut in casi errati 2025-04-22 11:22:13 +02:00
luca.mazzoleni cb3ad1d24c Merge tag '2.7d2' into develop
2.7d2
2025-04-17 12:24:08 +02:00
luca.mazzoleni 06e266226a Merge branch 'release/2.7d2' 2025-04-17 12:24:00 +02:00
luca.mazzoleni 74b40a6ad7 update log e version 2025-04-17 12:23:40 +02:00
andrea.villa ab7971e5f9 - Aggiunto lettura Q03 su scanalatura epr forzare fresa
- In BeamLib, si considerano simili due facce che hanno elevazione oltre l'85%
2025-04-11 13:29:37 +02:00
luca.mazzoleni e188753f49 - in Cut se lungo, una faccia e rivolto sul retro verso l'alto si forzano i cubetti per evitare di rovinare il pezzo successivo
- in Cut, se taglio di coda anticipato, aggiunto messaggio che avvisa del possibile danneggiamento del pezzo successivo
2025-04-10 17:08:02 +02:00
andrea.villa 9b12a74591 In LapJoint, per abilitare lama da sotto non si verifica se esiste testa sotto, ma se è una FAST 2025-04-10 08:49:18 +02:00
andrea.villa e17e8189f7 In LapJoint, funzione SawPlusChain lavorazione di lama da sotto abilitata se la macchina ha solo la testa sopra 2025-04-10 08:29:38 +02:00
luca.mazzoleni a5d4503180 Merge tag '2.7d1' into develop
2.7d1
2025-04-04 12:15:59 +02:00
luca.mazzoleni 41f92e9dd4 Merge branch 'release/2.7d1' 2025-04-04 12:15:52 +02:00
luca.mazzoleni c5a6300d15 update log 2025-04-04 10:39:15 +02:00
andrea.villa bf5c12ec8a In FBS non si utilizza il vtFaceUse perchè in caso di edge a 45° sbaglia a concatenare edge da lavorare. Si è tornati alla gestione vecchia 2025-04-03 16:06:11 +02:00
andrea.villa 777ba74e4d - In FBS errore 'TwoFacesBySaw from bottom impossible' solo se entrambe le facce non sono ok
- In LapJoint, si controlla direzione faccia 1 e larghezza faccia 2 (e reciproci) per capire se si può lavorare con lama testa sotto
2025-04-03 15:28:31 +02:00
luca.mazzoleni 268e578125 - in Cut.Classify correzione 2025-04-03 12:04:28 +02:00
andrea.villa 13f0545ebe In HeadCut e Split, si aggiungono tagli extra orizzontali solo se il materiale da tagliare è meno di un cubetto. Altrimenti ci sarebbe collisione. 2025-04-02 11:01:04 +02:00
luca.mazzoleni 445a76f543 Merge tag '2.7d1' into develop
2.7d1
2025-04-01 09:09:36 +02:00
luca.mazzoleni 4b52653a2e Merge branch 'release/2.7d1' 2025-04-01 09:09:25 +02:00
luca.mazzoleni ced290604a update log e version 2025-04-01 09:09:16 +02:00
andrea.villa 2c68515b93 In HeadCut e Split, per decidere se BigSection, si somma CUT_EXTRA ( prima si utilizzava CUT_EXTRA_MIN) 2025-03-31 15:15:15 +02:00
luca.mazzoleni b26ad523ab Merge branch 'master' into develop 2025-03-24 18:00:43 +01:00
luca.mazzoleni cd346b8536 - in BatchProcessN piccola correzione per pezzi a caduta 2025-03-24 17:58:39 +01:00
luca.mazzoleni 2853731c4c Merge branch 'master' into develop 2025-03-24 16:06:06 +01:00
luca.mazzoleni d31efb1f2a - in BatchProcess (Ts7), in caso di verifica di un pezzo senza modifiche al btl, si riscrive il txt con lo stato precedente (informazioni salvate in nge) 2025-03-24 16:05:12 +01:00
andrea.villa e1702d1263 Corretto calcolo direzione di lavorazione in caso verticale e orizzontale entrambi a false. Se altezza faccia minore di massimo materiale, si fa orizzontale 2025-03-24 14:47:05 +01:00
andrea.villa 236254fed6 In Drill, calcolo AffectedFaces anche su Predrill 2025-03-20 11:59:55 +01:00
luca.mazzoleni 82f20f3c87 - correzione in log 2025-03-18 11:51:31 +01:00
luca.mazzoleni adc75c0504 Merge tag '2.7c1' into develop
2.7c1
2025-03-17 17:47:39 +01:00
luca.mazzoleni 761778b87c Merge branch 'release/2.7c1' 2025-03-17 17:47:29 +01:00
luca.mazzoleni 5fa40fad99 update version e log 2025-03-17 17:47:20 +01:00
luca.mazzoleni 8e608bd623 - in BeamExec aggiunto ritorno stato e messaggi a interfaccia per Double in tutti i casi 2025-03-17 10:15:36 +01:00
andrea.villa 60a1707d43 In Cut, se taglio rivolto verso il basso e non possibile tagliare di fianco, da fare in fase ribaltata 2025-03-13 09:55:09 +01:00
luca.mazzoleni 1848ed85d0 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2025-03-12 18:19:12 +01:00
luca.mazzoleni 197673de11 - in BacthProcess (Ts7) si forza ricalcolo ad ogni check o check+generate 2025-03-12 18:19:05 +01:00
andrea.villa 19e1d4e760 - In HeadCut e Split, per decidere se fare doppio taglio verticale, si controlla anche il massimo possibile e non solo il minimo per farlo scaturire.
- In LapJoint si anticipa controllo per decidere se feature di coda
2025-03-10 13:22:30 +01:00
luca.mazzoleni abb1509314 Merge tag '2.7b3' into develop
2.7b3
2025-03-03 09:25:30 +01:00
luca.mazzoleni b9e4d9b01f Merge branch 'release/2.7b3' 2025-03-03 09:25:19 +01:00
luca.mazzoleni fcb541175a - update log e version 2025-03-03 09:24:24 +01:00
andrea.villa 99e0b9967e In LapJoint, se feature interessa la coda e il pezzo è lungo, la lavorazione viene fatta dopo separazioone. Non ha senso farla prima se non ci sono problemi di pinzaggio, meglio farla dopo. 2025-02-25 13:20:24 +01:00
luca.mazzoleni b88caa12ab - in BeamLib GetToolFromMachining aggiunte informazioni testa
- in ProcessDrill modifiche alla gestione lato preferenziale
2025-02-25 11:23:16 +01:00
andrea.villa 40912bb7b7 In FbS, per TURN, se taglio con bilinea che forma un angolo ottuso, invece di fare retrazione (in alcuni casi non completa il taglio) si segue bilinea per il tratto che manca per completare taglio e poi si esce perpendicolarmente. 2025-02-25 08:54:16 +01:00
luca.mazzoleni 7d6903d181 update log 2025-02-24 15:28:22 +01:00
luca.mazzoleni 43cf75d400 - in lavorazione tipo BHSideMIll migliorati allungamenti in caso di feature obliqua 2025-02-24 14:18:15 +01:00
luca.mazzoleni 2fa3ea24a5 - in DiceCut piccola correzione per Turn
- in LapJoint in lavorazione tipo BH permessa U passante non parallela agli assi principali
2025-02-20 09:43:11 +01:00
luca.mazzoleni c82a27ebae - in ProcessDrill, per le forature passanti fatte da un solo lato, eventuale inversione foro in base al lato di lavoro e al lato testa dell'utensile scelto (BD.GetSetupInfo) 2025-02-18 17:44:13 +01:00
luca.mazzoleni a7df54d8d2 - corretto log 2025-02-07 12:13:11 +01:00
luca.mazzoleni e8d11f150e Merge tag '2.7b2' into develop
2.7b2
2025-02-05 15:03:46 +01:00
luca.mazzoleni 6d8bd01266 Merge branch 'release/2.7b2' 2025-02-05 15:03:25 +01:00
luca.mazzoleni 65a256ba7b update log e version 2025-02-05 15:02:57 +01:00
luca.mazzoleni d403f9cfcf - in BeamExec si consentono DrillPocket in doppio solo se foro non passante 2025-02-05 14:59:44 +01:00
luca.mazzoleni 30cc274c2e Merge tag '2.7b1' into develop
2.7b1
2025-02-04 17:55:56 +01:00
luca.mazzoleni 6564bdc74f Merge branch 'release/2.7b1' 2025-02-04 17:55:47 +01:00
luca.mazzoleni 6cdf1583c0 update log e version 2025-02-04 17:55:18 +01:00
luca.mazzoleni 5441ff7b50 - in HeadCut e Split l'utilizzo delle lame grandi (es: 1000 su 1500MAX) è limitato a i pezzi più bassi di 300 mm e più larghi di 300 mm 2025-02-04 17:50:44 +01:00
luca.mazzoleni d03ed02b2c Merge tag '2.7a2' into develop
2.7a2
2025-01-23 10:58:29 +01:00
luca.mazzoleni 8c4000a74c Merge branch 'release/2.7a2' 2025-01-23 10:58:17 +01:00
luca.mazzoleni 4c48085e4f update version e log 2025-01-23 10:57:59 +01:00
luca.mazzoleni 37265932e9 - in BatchProcess piccola correzione 2025-01-23 10:44:28 +01:00
luca.mazzoleni 8f602fc10a - in RidgeLap aggiunta Q05 per usare la fresa (riconduce a LapJoint)
- in ScarfJoint, in caso di taglio dal lato, aggiunto offset CUT_EXTRA che mancava per errore
2025-01-22 17:09:35 +01:00
luca.mazzoleni f7ef38162b Merge branch 'master' into develop 2025-01-21 15:06:55 +01:00
luca.mazzoleni 1bc17e7bb7 - corretta versione in log 2025-01-21 15:06:47 +01:00
luca.mazzoleni 4d545c38ea Merge tag '2.7a1' into develop
2.7a1
2025-01-21 09:13:53 +01:00
luca.mazzoleni 83b9b3858d Merge branch 'release/2.7a1' 2025-01-21 09:13:44 +01:00
luca.mazzoleni 0de82a5fd9 update version 2025-01-21 09:08:11 +01:00
luca.mazzoleni 8dc16e1ed9 - in FreeContour aggiunta Q09 per inversione ultima lavorazione
- in Cut, si taglia dal basso solo se il pezzo piccolo è già staccato dalla barra
- in BatchProcess (Ts7) aggiunta scrittura id progetto e produzione in Btm
2025-01-21 08:54:31 +01:00
andrea.villa 4500f96d6d Aggiunto parametro Q09 per inversione ultimo passaggio su contorno libero 2025-01-17 16:33:28 +01:00
andrea.villa a9921f9b17 Merge commit '8c4f0e15de6c6398b35f7cfbb0524b939d6054da' into develop 2025-01-17 14:56:46 +01:00
andrea.villa 8c4f0e15de In Cut, si taglia dal basso solo se il pezzo piccolo è già staccato dalla barra 2025-01-17 14:53:57 +01:00
luca.mazzoleni 46802be7d8 Merge branch 'master' into develop 2025-01-08 09:17:09 +01:00
Dario Sassi 0a77cc2e12 DataBeam :
- aggiustata la versione a 2.6l2 nel file lua.
2025-01-07 19:00:07 +01:00
luca.mazzoleni 6d07e1638b Merge branch 'master' into develop 2025-01-07 18:30:55 +01:00
luca.mazzoleni 09d3df0fe1 Merge branch 'develop' 2025-01-07 18:30:11 +01:00
luca.mazzoleni 838671d968 corretto nome versione 2025-01-07 18:26:51 +01:00
luca.mazzoleni f286f50855 Merge branch 'master' into develop 2025-01-07 18:03:42 +01:00
luca.mazzoleni ff2dff29ee corretta data versione in log 2025-01-07 18:03:33 +01:00
luca.mazzoleni 28cdaff2d0 Merge tag '2.7a1' into develop
2.7a1
2025-01-07 18:00:57 +01:00
luca.mazzoleni 3c4d299c58 Merge branch 'release/2.7a1' 2025-01-07 18:00:47 +01:00
luca.mazzoleni f388cf47f3 update log e versione 2025-01-07 18:00:08 +01:00
andrea.villa 38b1eba03e Se foro aperto in faccia di coda (LEFT), non si considerano dipendenze 2024-12-30 12:14:44 +01:00
luca.mazzoleni 6caa4fb6b5 - in LapJoint aggiunta Q_SIDE_ROUGH_TOOL=4 per lavorare con fresa evitando tasche aperte testa/coda 2024-12-16 09:52:29 +01:00
luca.mazzoleni c1b781c142 Merge branch 'feature/SpecialBHSideMIllAggregate' into develop 2024-12-13 13:08:05 +01:00
luca.mazzoleni c219a6842b - in LapJoint la Q ForceSideMill ora funziona solo se la feature è aperta sul fronte o sul retro 2024-12-13 12:42:01 +01:00
luca.mazzoleni 677ff492e7 - correzione in LapJoint per SideMillAsBlade 2024-12-12 16:59:41 +01:00
luca.mazzoleni e4ba021482 - in LapJoint abiitata SideMillAsBlade anche da sotto 2024-12-12 09:26:35 +01:00
luca.mazzoleni 24218e8d8c Merge branch 'develop' into feature/SpecialBHSideMIllAggregate 2024-12-11 14:47:32 +01:00
luca.mazzoleni 739311a02b Merge tag '2.6l1' into develop
2.6l1
2024-12-11 13:10:53 +01:00
luca.mazzoleni 61ef5dd9ed Merge branch 'release/2.6l1' 2024-12-11 13:10:41 +01:00
luca.mazzoleni aed21e027c update log e version 2024-12-11 13:10:31 +01:00
luca.mazzoleni 1c64f500b3 - in BeamLib correzione in GetToolFromMachining 2024-12-11 11:56:57 +01:00
luca.mazzoleni 542c421ac8 - in FacesBySaw aggiuta, tramite nota lavorazione PATHINVERT, la possibilità di invertire il senso di percorrenza calcolato (e quindi lavorare in discordanza)
- in LapJoint modifiche per utilizzare aggregato speciale per fresa a disco
2024-12-11 11:26:37 +01:00
luca.mazzoleni 95e6f49e4f Merge remote-tracking branch 'origin/develop' into feature/SpecialBHSideMIllAggregate 2024-12-10 09:49:22 +01:00
luca.mazzoleni 4c19cc49e2 - in LapJoint modifiche per gestione fresa a disco su aggregato
- in BeamLib aggiunta funzione GetToolFromMachining estrapolata da SawPlusChain
2024-12-10 09:49:10 +01:00
andrea.villa 74681a1f1d In Tenon, se tenone chiuso aggiungo una piccola componente perpendicolare per approccio in miling 2024-12-10 09:27:50 +01:00
andrea.villa d7b88e738f Merge branch 'feature/Blade1000' into develop 2024-12-10 09:27:03 +01:00
andrea.villa d4c9843597 In LapJoint, la SawPlusChain è estesa alla topologia "Groove-Through-RightAngles-NotParallel-3" 2024-12-04 08:25:57 +01:00
luca.mazzoleni 077cb2c586 - in HeadCut e Split si sceglie sempre la lama primaria più grande
- in LapJoint -> SawPlusChain si sceglie la lama in base alla profondità della tasca
2024-12-02 17:51:59 +01:00
luca.mazzoleni 8e9de6026e Merge tag '2.6k2' into develop
2.6k2
2024-11-28 09:51:19 +01:00
luca.mazzoleni b382560cfa Merge branch 'release/2.6k2' 2024-11-28 09:51:03 +01:00
luca.mazzoleni 339c6acb37 update log e version 2024-11-28 09:50:47 +01:00
andrea.villa 570a65c7a1 In FacesBySaw ridotto a 15° limite per accorciare geometria bilinea 2024-11-21 12:12:09 +01:00
andrea.villa e18a816647 In LapJoint, se forma a U si ricalcola dimensione della tasca 2024-11-21 11:24:46 +01:00
andrea.villa d578194d43 In DiceCut migliorato controllo rimozione del primo cubetto molto piccolo 2024-11-20 11:50:10 +01:00
luca.mazzoleni e0f20d19f0 - in FacesBySaw migliorati i casi in cui si inverte l'SCC per facilitare la caduta del legno 2024-11-20 10:03:16 +01:00
luca.mazzoleni cff4ef0d47 Merge tag '2.6k1' into develop
2.6k1
2024-11-15 16:03:39 +01:00
luca.mazzoleni d9fb464066 Merge branch 'release/2.6k1' 2024-11-15 16:03:29 +01:00
luca.mazzoleni 9d6a5fb496 update version e log 2024-11-15 15:58:29 +01:00
luca.mazzoleni c3fab404a5 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2024-11-15 15:45:44 +01:00
luca.mazzoleni fa139c84f3 - piccola correzione in ProcessDovetail 2024-11-15 15:45:40 +01:00
andrea.villa ae6853cd3f In Drill, se foro doppio si aumenta lo step per evitare collisione tra le punte durante lavorazione. 2024-11-12 09:40:24 +01:00
luca.mazzoleni c0618cd628 Merge branch 'master' into develop 2024-11-06 10:27:53 +01:00
luca.mazzoleni 524b6a470c update log e version 2024-11-06 10:26:52 +01:00
luca.mazzoleni cd4aa8ee11 -in Drill non si riclassificano come Down i fori fatti in doppio (risolve problemi di chariot collision su macchine tipo PF) 2024-11-06 10:22:01 +01:00
luca.mazzoleni 242f5f4516 -in Drill non si riclassificano come Down i fori fatti in doppio (risolve problemi di chariot collision su macchine tipo PF) 2024-11-05 14:29:23 +01:00
luca.mazzoleni e6a3e0c519 - in Cut correzione a utilizzo Q07 (forzatura fresa)
- in LapJoint se arriva da Cut si applica sempre svuotatura
- in LapJoint se birdsmouth a L si applica svuotatura anche in caso di elevazione non raggiunta (non si tenta la fresatura che fallirebbe non trovando facce sul lato lungo)
2024-11-05 11:17:39 +01:00
luca.mazzoleni 640c8af05f - in ProcessCut lunghezza minima feature per considerare taglio lungo portata a 400 mm per macchine tipo Fast 2024-10-29 11:56:40 +01:00
luca.mazzoleni 48ceceb8e0 Merge branch 'master' into develop 2024-10-29 10:05:46 +01:00
luca.mazzoleni 5165463dbd update log 2024-10-29 10:05:36 +01:00
luca.mazzoleni 9e1d424bc7 Merge branch 'master' into develop 2024-10-29 09:28:04 +01:00
luca.mazzoleni 15c96303de Merge branch 'develop' 2024-10-29 09:25:58 +01:00
luca.mazzoleni 3211f21869 Merge branch 'master' into develop 2024-10-18 12:12:52 +02:00
luca.mazzoleni 1f4fe3597b update version e log 2024-10-18 12:10:37 +02:00
luca.mazzoleni 0749e56b9f Merge tag 'DrillTenonTail' into develop
hotfix
2024-10-18 12:08:03 +02:00
luca.mazzoleni 7424bdc147 Merge branch 'hotfix/DrillTenonTail' 2024-10-18 12:07:46 +02:00
luca.mazzoleni a623072e89 - in BeamExec -> dipendenza feature rimosso foro di coda se tenone è di coda 2024-10-18 12:07:28 +02:00
luca.mazzoleni 7f15b08b20 Merge branch 'master' into develop 2024-10-17 12:26:09 +02:00
luca.mazzoleni 82d4fadaaa update log e versione 2024-10-17 12:25:43 +02:00
luca.mazzoleni d9f4d0584a Merge tag 'DrillSideAndDown' into develop
fix
2024-10-17 12:21:52 +02:00
luca.mazzoleni 2e5b4c9976 Merge branch 'hotfix/DrillSideAndDown' 2024-10-17 12:21:37 +02:00
luca.mazzoleni 511af04c8b - in Drill con precedenza corretto caso in cui il foro veniva ripetuto in rotazioni diverse 2024-10-17 12:20:39 +02:00
luca.mazzoleni 8b1d38c451 modifiche a FacesBySaw del commit precedente estese anche a Fast 2024-10-17 08:57:52 +02:00
andrea.villa abe3465514 - In FacesBySaw, se taglio orizzontale (con componente Z del vtTg a zero) si orienta SCC aggregato lama verso l'interno. In modo che quando si stacca il pezzo non cada sopra l'aggregato.
- In LapJoint, se si utilizza fresa per BlockHaus, si considera sempre di coda
2024-10-11 12:38:28 +02:00
luca.mazzoleni fc753c47be Merge branch 'master' into develop 2024-10-10 14:31:22 +02:00
luca.mazzoleni ad8a7bf73f Merge branch 'develop' 2024-10-10 14:06:22 +02:00
luca.mazzoleni 4a21a4be36 - in ProcessCut Classify corretta lettura Q per passare a LapJoint 2024-10-10 14:05:52 +02:00
andrea.villa aafe565474 In ScarfJoint corretto problema introdotto con modifica ottimizzazione richiesta per Ticket#1992 2024-10-10 12:40:27 +02:00
luca.mazzoleni b6ef0a8d7a Merge tag '2.6j1' into develop
r
2024-10-10 10:51:49 +02:00
luca.mazzoleni 779f2105ba Merge branch 'release/2.6j1' 2024-10-10 10:51:35 +02:00
luca.mazzoleni c2b9c4b19f update log e version 2024-10-10 10:50:40 +02:00
luca.mazzoleni 8eadb81e91 Merge branch 'master' into develop 2024-10-08 12:11:09 +02:00
luca.mazzoleni 2bac228fe9 update log e version 2024-10-08 12:10:57 +02:00
luca.mazzoleni c312e72fd2 Merge tag 'RidgeLapClamping' into develop
r
2024-10-08 12:08:18 +02:00
luca.mazzoleni fd4683e4fa Merge branch 'hotfix/RidgeLapClamping' 2024-10-08 12:08:09 +02:00
luca.mazzoleni 70661aa3d2 In RidgeLap, ingombro testa coda considera inclinazione feature per pinzaggio 2024-10-08 12:08:00 +02:00
andrea.villa a82486e9fb In RidgeLap, ingombro testa coda considera inclinazione feature per pinzaggio 2024-10-07 16:11:48 +02:00
luca.mazzoleni cd4a7d3b91 - in LapJoint miglioramenti vari alla lavorazione delle facce oblique 2024-10-03 17:28:27 +02:00
luca.mazzoleni 3764c58394 - in ProcessCut aggiunta Q07 per forzare uso fresa (si passa a LapJoint)
- in LapJoint gestita feature in arrivo da Cut e piccole correzioni
2024-10-01 15:57:17 +02:00
26 changed files with 1226 additions and 347 deletions
+66 -6
View File
@@ -101,6 +101,21 @@ local function WriteTimeToLogFile( dTime)
hFile:close()
end
-- Funzioni per riportare stato lavorazione o pezzo in nge
local function WriteErrToNge( nProcId, sErr, sMsg, sRot, sCutId, sTaskId)
EgtSetInfo( nProcId, 'STATUS.ERR', sErr)
EgtSetInfo( nProcId, 'STATUS.MSG', sMsg)
EgtSetInfo( nProcId, 'STATUS.ROT', sRot)
EgtSetInfo( nProcId, 'CUTID', sCutId)
EgtSetInfo( nProcId, 'TASKID', sTaskId)
end
local function WriteFallToNge( nPartId, sErr, sMsg, sCutId, sFall)
EgtSetInfo( nPartId, 'STATUS.ERR', sErr)
EgtSetInfo( nPartId, 'STATUS.MSG', sMsg)
EgtSetInfo( nPartId, 'CUTID', sCutId)
EgtSetInfo( nPartId, 'STATUS.FALL', sFall)
end
-- Funzione per gestire visualizzazione dopo errore
local function PostErrView( nErr, sMsg)
if nErr ~= 0 and ( BEAM.FLAG == 1 or BEAM.FLAG == 2) then
@@ -122,13 +137,25 @@ end
-- Funzione per aggiornare dati ausiliari
local function UpdateAuxData( sAuxFile)
local bModif = false
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
-- Se definito LOAD90, aggiorno
local sLoad90 = EgtGetStringFromIni( 'AuxData', 'LOAD90', '', sAuxFile)
if sLoad90 ~= '' then
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
EgtSetInfo( BtlInfoId, 'LOAD90', sLoad90)
bModif = true
end
-- Se definito PROJID, aggiorno
local sProjId = EgtGetStringFromIni( 'AuxData', 'PROJID', '', sAuxFile)
if sProjId ~= '' then
EgtSetInfo( BtlInfoId, 'PROJECTNUMBER', sProjId)
bModif = true
end
-- Se definito PRODID, aggiorno
local sProdId = EgtGetStringFromIni( 'AuxData', 'PRODID', '', sAuxFile)
if sProdId ~= '' then
EgtSetInfo( BtlInfoId, 'PRODID', sProdId)
bModif = true
end
return bModif
end
@@ -401,6 +428,9 @@ if bToProcess then
BEAM.CUTID = Stats[i].CutId
BEAM.TASKID = Stats[i].TaskId
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
if Stats[i].ProcId then
WriteErrToNge( Stats[i].ProcId, BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
end
elseif Stats[i].Err > 0 then
nErrCnt = nErrCnt + 1
sOutput = sOutput .. string.format( '[%d,%d] %s\n', Stats[i].CutId, Stats[i].TaskId, sMsg)
@@ -410,6 +440,9 @@ if bToProcess then
BEAM.CUTID = Stats[i].CutId
BEAM.TASKID = Stats[i].TaskId
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
if Stats[i].ProcId then
WriteErrToNge( Stats[i].ProcId, BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
end
elseif Stats[i].Err < 0 then
-- se segnalazione scarico pezzo standard, incompleto o a caduta
if Stats[i].Err == -100 or Stats[i].Err == -101 or Stats[i].Err == -102 then
@@ -418,6 +451,9 @@ if bToProcess then
BEAM.CUTID = Stats[i].CutId
BEAM.FALL = abs( Stats[i].Err + 100)
WriteFallToLogFile( BEAM.ERR, BEAM.MSG, BEAM.CUTID, BEAM.FALL)
if Stats[i].ProcId then
WriteFallToNge( Stats[i].PartId, BEAM.ERR, BEAM.MSG, BEAM.CUTID, BEAM.FALL)
end
-- altri avvertimenti
else
nWarnCnt = nWarnCnt + 1
@@ -428,6 +464,9 @@ if bToProcess then
BEAM.CUTID = Stats[i].CutId
BEAM.TASKID = Stats[i].TaskId
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
if Stats[i].ProcId then
WriteErrToNge( Stats[i].ProcId, BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
end
end
end
end
@@ -443,35 +482,56 @@ if bToProcess then
PostWarnView( 19, sOutput)
end
-- Altrimenti carico il progetto salvato e dichiaro nessun errore
-- Altrimenti carico il progetto salvato, rileggo gli errori da nge e riscrivo il log txt con gli stati precedenti
else
EgtOutLog( ' +++ Loading Project already processed >>>')
-- Carico il progetto già fatto
EgtOpenFile( sNgeFile)
-- Dichiaro nessun errore
-- Riscrivo il log txt
local nPartId = EgtGetFirstPart()
while nPartId do
local nCutId = EgtGetInfo( nPartId, 'CUTID')
if nCutId then
-- stato a livello di singola feature
local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nPartId, 'Processings') or GDB_ID.NULL)
while nProcId do
local bIsFea = EgtExistsInfo( nProcId, 'GRP') and EgtExistsInfo( nProcId, 'PRC')
local nTaskId = EgtGetInfo( nProcId, 'TASKID')
local sErr = EgtGetInfo( nProcId, 'STATUS.ERR') or 0
local sMsg = EgtGetInfo( nProcId, 'STATUS.MSG') or '---'
local sRot = EgtGetInfo( nProcId, 'STATUS.ROT') or 0
if bIsFea and nTaskId then
BEAM.ERR = 0
BEAM.MSG = '---'
BEAM.ROT = 0
BEAM.ERR = sErr
BEAM.MSG = sMsg
BEAM.ROT = sRot
BEAM.CUTID = nCutId
BEAM.TASKID = nTaskId
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
end
nProcId = EgtGetNext( nProcId)
end
-- stato a livello di pezzo
local sErr = EgtGetInfo( nPartId, 'STATUS.ERR') or 0
if sErr == -100 or sErr == -101 or sErr == -102 then
local sMsg = EgtGetInfo( nPartId, 'STATUS.MSG') or '---'
local sFall = EgtGetInfo( nPartId, 'STATUS.FALL') or 0
BEAM.ERR = sErr
BEAM.MSG = sMsg
BEAM.CUTID = nCutId
BEAM.FALL = sFall
WriteFallToLogFile( BEAM.ERR, BEAM.MSG, BEAM.CUTID, BEAM.FALL)
end
end
nPartId = EgtGetNextPart( nPartId)
end
-- Aggiorno eventuali dati ausiliari
UpdateAuxData( sBtmFile)
-- Anche se non è da riprocessare, imposto nome file CN.
-- Se file TS7 importato da altro PC, 'BEAM.FILE' è cambiato da un PC all'altro. Di conseguenza si deve aggiornare nome file che si andrà a generare.
local _, sName, _ = EgtSplitPath( BEAM.FILE)
EgtSetInfo( EgtGetLastMachGroup(), 'NcName', sName .. '.cnc')
-- Passo in modalità lavora
EgtSetCurrMachGroup( EgtGetLastMachGroup())
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
+1
View File
@@ -45,6 +45,7 @@ REM Compilazione 32 e 64 bit
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua -s LuaLibs\ProcessText.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua -s LuaLibs\ProcessTyroleanDovetail.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessVariant.lua -s LuaLibs\ProcessVariant.lua
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProbing.lua -s LuaLibs\ProcessProbing.lua
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua -s BatchProcess.lua
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua -s BatchProcessNew.lua
\EgtProg\Dll32\luac54 -o bin\GetBeamData.lua -s GetBeamData.lua
+58 -29
View File
@@ -108,6 +108,7 @@ _G.package.loaded.ProcessScarfJoint = nil
_G.package.loaded.ProcessSimpleScarf = nil
_G.package.loaded.ProcessStepJoint = nil
_G.package.loaded.ProcessStepJointNotch = nil
_G.package.loaded.ProcessProbing = nil
_G.package.loaded.ProcessProfFront = nil
_G.package.loaded.ProcessProfConcave = nil
_G.package.loaded.ProcessProfConvex = nil
@@ -395,6 +396,8 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
Proc2.TaskId = Proc.TaskId
Proc2.AdjId = Proc.AdjId
Proc2.MainId = Proc.MainId
-- recupero l'elenco delle facce della parte interessate dalla feature
Proc2.AffectedFaces = BL.GetProcessAffectedFaces( Proc2)
table.insert( vProc, Proc2)
-- verifico se devo inserire i prefori
if Drill.IsPredrillNeeded( Proc2) then
@@ -1236,7 +1239,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
Proc.Flg = 0
Proc.Down = true
bAllOk = false
table.insert( Stats, {Err = 1, Msg='Error : impossible to machine by orientation', CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err = 1, Msg='Error : impossible to machine by orientation', CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id})
-- gestione feature di coda da lavorare ribaltata
elseif Proc.Tail and bDown then
Proc.Down = true
@@ -1257,12 +1260,12 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
elseif Proc.Flg == 0 then
bAllOk = false
Proc.ErrMsg = 'Error : out of the part'
table.insert( Stats, {Err = 1, Msg=Proc.ErrMsg, CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err = 1, Msg=Proc.ErrMsg, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id})
else
Proc.Flg = 0
bAllOk = false
if not Proc.ErrMsg then Proc.ErrMsg = 'Error : impossible to machine' end
table.insert( Stats, {Err = 1, Msg=Proc.ErrMsg, CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err = 1, Msg=Proc.ErrMsg, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id})
end
end
-- se necessario ribaltamento, assegno intestatura alla fase ribaltata
@@ -1824,7 +1827,10 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, 0, true, false, true)
dMachiningDepth = dMaxDepth or dMachiningDepth
end
if not sDrilling or ( sType ~= 'Drill' and sType ~= 'Pocket') or not EgtMdbSetCurrMachining( sDrilling) then
if not sDrilling
or ( sType ~= 'Drill' and ( sType ~= 'Pocket'or ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)))
or not EgtMdbSetCurrMachining( sDrilling) then
return
end
local dDrillingStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP)
@@ -1858,10 +1864,16 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
( BD.DOWN_HEAD and AreOppositeVectorApprox( vtExtr, Y_AX())) then
Proc.Double = 2
Proc.MachDepthDouble = dMachiningDepth
Proc.MirrorId = ProcToDisable.Id
Proc.MirrorCutId = ProcToDisable.CutId
Proc.MirrorTaskId = ProcToDisable.TaskId
DisableOtherDrilling( ProcToDisable, vProc)
elseif BD.DOWN_HEAD and AreSameVectorApprox( vtExtr, Z_AX()) then
Proc.Double = 3
Proc.MachDepthDouble = dMachiningDepth
Proc.MirrorId = ProcToDisable.Id
Proc.MirrorCutId = ProcToDisable.CutId
Proc.MirrorTaskId = ProcToDisable.TaskId
DisableOtherDrilling( ProcToDisable, vProc)
end
end
@@ -2026,9 +2038,12 @@ function GetFeatureInfoAndDependency( vProc, b3Raw)
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
-- se foro in coda non setto la dipendenza
if not ProcB.AffectedFaces.Left then
Proc.PassedByHole = true
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
end
end
-- verifico se feature tipo LapJoint è attraversata da almeno una mortasa a coda di rondine
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove') and DtMortise.SideIdentify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
@@ -2038,10 +2053,6 @@ function GetFeatureInfoAndDependency( vProc, b3Raw)
if Tenon.Identify( Proc) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
Proc.PassedByHole = true
end
-- se tenone di coda è attraversato da foro allora anche il foro deve essere di coda
if Tenon.Identify( Proc) and Proc.Tail and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
ProcB.Tail = true
end
-- verifiche per specchiature
if BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS then
-- forature
@@ -2168,13 +2179,19 @@ function BeamExec.ProcessFeatures()
end
if not bOk then
nTotErr = nTotErr + 1
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
elseif sMsg and #sMsg > 0 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
else
table.insert( Stats, {Err=0, Msg='', Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
if Proc.Double == 2 or Proc.Double == 3 then
table.insert( Stats, {Err=0, Msg='', Rot=-2, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId})
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
end
elseif sMsg and #sMsg > 0 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
if Proc.Double == 2 or Proc.Double == 3 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-2, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
end
else
table.insert( Stats, {Err=0, Msg='', Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
if Proc.Double == 2 or Proc.Double == 3 then
table.insert( Stats, {Err=0, Msg='', Rot=-2, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
end
end
-- se è taglio di separazione, verifico se ha già aggiunto una nuova fase oppure se è da creare
@@ -2258,13 +2275,19 @@ function BeamExec.ProcessFeatures()
end
if not bOk then
nTotErr = nTotErr + 1
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId})
elseif sMsg and #sMsg > 0 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId})
else
table.insert( Stats, {Err=0, Msg='', Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
if Proc.Double == 2 or Proc.Double == 3 then
table.insert( Stats, {Err=0, Msg='', Rot=-1, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId})
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-1, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
end
elseif sMsg and #sMsg > 0 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
if Proc.Double == 2 or Proc.Double == 3 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-1, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
end
else
table.insert( Stats, {Err=0, Msg='', Rot=-1, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
if Proc.Double == 2 or Proc.Double == 3 then
table.insert( Stats, {Err=0, Msg='', Rot=-1, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
end
end
if bOk then nSideMchOk = nSideMchOk + 1 end
@@ -2336,13 +2359,19 @@ function BeamExec.ProcessFeatures()
end
if not bOk then
nTotErr = nTotErr + 1
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
elseif sMsg and #sMsg > 0 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
else
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId})
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
if Proc.Double == 2 or Proc.Double == 3 then
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId})
table.insert( Stats, {Err=1, Msg=sMsg, Rot=0, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
end
elseif sMsg and #sMsg > 0 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
if Proc.Double == 2 or Proc.Double == 3 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=0, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
end
else
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=Proc.CutId, TaskId=Proc.TaskId, ProcId = Proc.Id, PartId = nPartId})
if Proc.Double == 2 or Proc.Double == 3 then
table.insert( Stats, {Err=0, Msg='', Rot=0, CutId=Proc.MirrorCutId, TaskId=Proc.MirrorTaskId, ProcId = Proc.MirrorId, PartId = nPartId})
end
end
-- se era taglio di separazione, aggiungo nuova fase
+80 -1
View File
@@ -642,7 +642,7 @@ function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
-- premio quella che non è sottosquadra e che ha la X minore
local bDiffSmall = true
for i = 1, #dtElev do
if dtElev[i] > dMinElev + 5 or dtElev[i] > 80 then
if ( dtElev[i] > dMinElev + 5 or dtElev[i] > 80) and dMinElev < 0.85 * dtElev[i] then
bDiffSmall = false
end
end
@@ -1239,6 +1239,40 @@ function BeamLib.GetFacetsInfo( Proc, b3Raw)
return Face
end
---------------------------------------------------------------------
function BeamLib.GetEdgesInfo( Proc, Face)
local Edges = {}
local nFaceType, vEdges = EgtSurfTmGetFacetOutlineInfo( Proc.Id, Face.Id, GDB_ID.ROOT)
if nFaceType < 1 then
for j = 1, #vEdges do
local nPreviousEdgeIndex = j - 1
if j == 1 then
nPreviousEdgeIndex = #vEdges
end
local nNextEdgeIndex = j + 1
if j == #vEdges then
nNextEdgeIndex = 1
end
local CurrentEdge = {}
CurrentEdge.AdjacentFaceId = vEdges[j].Adj
CurrentEdge.ToolDirection = Vector3d( vEdges[j].Norm)
CurrentEdge.Length = vEdges[j].Len
CurrentEdge.Elevation = vEdges[j].Elev
CurrentEdge.IsOpen = vEdges[j].Open
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
table.insert( Edges, CurrentEdge)
end
else
error( 'Face with closed hole')
end
return Edges
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)
@@ -1301,5 +1335,50 @@ function BeamLib.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail)
return true
end
-------------------------------------------------------------------------------------------------------------
function BeamLib.GetToolFromMachining( sMachiningName)
local Tool = {}
if EgtMdbSetCurrMachining( sMachiningName) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
Tool.Name = EgtTdbGetCurrToolParam( MCH_TP.NAME)
Tool.IsCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
Tool.Type = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
Tool.HeadType = {}
Tool.PreferredSide = {}
if BD.GetSetupInfo then
Tool.HeadType = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).HeadType
Tool.PreferredSide = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).PreferredSide
end
-- lama
if Tool.Type == MCH_TY.SAW_STD or Tool.Type == MCH_TY.SAW_FLAT then
Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or 0
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
Tool.SideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd')
-- sega a catena
elseif Tool.Type == MCH_TY.MORTISE_STD then
Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) or 0
Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0
Tool.Width = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
Tool.Thickness = EgtTdbGetCurrToolParam( MCH_TP.THICK) or 0
Tool.CornerRadius = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or 0
-- fresa (TODO al momento aggiunte solo le informazioni che servono)
elseif Tool.Type == MCH_TY.MILL_STD or MCH_TY.MILL_NOTIP then
if BD.GetSetupInfo then
Tool.IsOnAggregate = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).bToolOnAggregate
else
Tool.IsOnAggregate = false
end
-- altri utensili al momento non previsti
else
error( 'Wrong tool type')
end
end
end
return Tool
end
-------------------------------------------------------------------------------------------------------------
return BeamLib
+6 -3
View File
@@ -275,12 +275,15 @@ local function VerifyFirstOrthoCut( CutTable, OffsetP, BBoxRawPart, dNzLimDwnUp)
-- normale alla faccia ortogonale
local _, vtO = EgtSurfTmFacetCenter( CutOId, 0, GDB_ID.ROOT)
vtO = vtO - vtO * vtN1 * vtN1 ; vtO:normalize()
local dMaxElev = EgtSurfTmFacetElevationInBBox( CutOId, 0, BBoxRawPart, true, GDB_ID.ROOT)
-- calcolo lunghezza prima semi-faccia
local asseX1 = vtO
local asseY1 = vtN1 ^ asseX1
local Frame1 = Frame3d( ptC1, ptC1+asseX1, ptC1+asseY1)
local Box1 = EgtGetBBoxRef( Cut1Id, GDB_BB.STANDARD, Frame1)
local x1 = Box1:getDimX()
-- prendo il massimo tra la lugnhezza della faccia parallela e l'elevazione della corrispondente ortogonale
x1 = max( x1, dMaxElev)
-- calcolo lunghezza seconda semi-faccia
local asseX2 = vtO
local asseY2 = vtN2 ^ asseX2
@@ -404,7 +407,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
local dNzLimDwnUp = BL.GetNzLimDownUp( BBoxRawPart)
-- se non c'è testa da sotto e normali senza componenti in Y con faccia quasi verticale e trave non alta, uso per offset i limiti dei tagli di testa e coda
if not BD.DOWN_HEAD and abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then
if not BD.TURN and not BD.DOWN_HEAD and abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then
OffsetO = dOrthoMaxDim or BD.MAX_DIM_HTCUT
end
@@ -430,7 +433,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
if dElevO then
local m = ceil( dElevO / OffsetO)
OffsetO = dElevO / m
end
end
-- elenco di tutte le superfici generate dai tagli
local TabFUCHSIA = {}
@@ -563,7 +566,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
end
end
return UltimateTable
return UltimateTable, OffsetP, OffsetO
end
----------------------------------------------------------------------------------------------------------------------------------------------------
+111 -20
View File
@@ -46,7 +46,7 @@ local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
---------------------------------------------------------------------
function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut)
function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, sLeadInOutType, dActualElevation)
EgtOutLog( 'FacesBySaw.MakeParallelOne', 3)
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
@@ -68,16 +68,28 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
local dLiPerp = dDistX + dCutExtra + dCutSic
local dLoTang = dLiTang
local dLoPerp = dLiPerp
local dLiCompLength = 0
local dLoCompLength = 0
-- lunghezza attacco/uscita tangenti
local dLi2Tang = dSawDiam / 2 + dCutSic
local dLi2Perp = 0
local dLo2Tang = dLi2Tang
local dLo2Perp = dLi2Perp
local dLi2CompLength = 0
local dLo2CompLength = 0
-- 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
if ( sLeadInOutType == 'PerpendicularOutraw') then
bLioTang = false
dLiCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra
dLoCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra
dLiTang = 1
dLoTang = 1
dLiPerp = 0
dLoPerp = 0
elseif ( sLeadInOutType ~= 'Perpendicular') and ( ( sLeadInOutType == 'Tangent') or ( Ktp * dLi2Tang < dLiPerp)) then
bLioTang = true
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
if BD.TURN then
@@ -136,9 +148,11 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
-- imposto attacco/uscita
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
EgtSetMachiningParam( MCH_MP.LICOMPLEN, dLiCompLength)
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)
EgtSetMachiningParam( MCH_MP.LOCOMPLEN, dLoCompLength)
-- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dAccEnd)
@@ -157,6 +171,9 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtTool, vtOut))
-- eventuali note
if ( sLeadInOutType == 'PerpendicularOutraw') then
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
end
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
-- eseguo
if not ML.ApplyMachining( true, false) then
@@ -193,7 +210,28 @@ local function GetNameSolidFaceIncludingLine( b3Solid, ptP1Comp, ptP2Comp)
end
---------------------------------------------------------------------
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, bForceTangentLeadInOut, Par5Alternative)
local function AreSameOrOppositeDirApprox( vDir1, vDir2)
if abs( abs( vDir1) - abs( vDir2)) < 10 * GEO.EPS_SMALL then
return true
else
return false
end
end
---------------------------------------------------------------------
local function GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrthO)
local _, EdgesEgt = EgtSurfTmGetFacetOutlineInfo( nSurfId, nFacet, GDB_ID.ROOT)
for i = 1, #EdgesEgt do
if AreOppositeVectorApprox( EdgesEgt[i].Norm, vtOrthO) then
return ( i - 1)
end
end
return nil
end
---------------------------------------------------------------------
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, sLeadInOutType, Par5Alternative, dActualElevation)
-- 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
@@ -201,7 +239,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
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)
return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, sLeadInOutType, dActualElevation)
end
-- la lama ha asse perpendicolare alla faccia
EgtOutLog( 'FacesBySaw.MakeOne', 3)
@@ -233,8 +271,9 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5)
local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
-- 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
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
EgtOutLog( sWarn, 1)
@@ -246,6 +285,12 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
return false
end
local bIsSawCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
-- se settato nelle note lavorazione si lavora in discordanza
EgtMdbSetCurrMachining( sCutting)
local sMachiningNotes = EgtMdbGetCurrMachiningParam( MCH_MP.USERNOTES) or ''
if ( EgtGetValInNotes( sMachiningNotes, 'PATHINVERT', 'd') or 0) == 1 then
bIsSawCCW = not bIsSawCCW
end
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.
@@ -309,7 +354,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
bIsBiLinea = true
local vtTg1 = ptPm - ptP1 ; vtTg1:normalize()
local vtTg2 = ptP2 - ptPm ; vtTg2:normalize()
local dCosMax = 0.951 -- cos( 18°)
local dCosMax = 0.966 -- cos( 15°)
local dLenMin = 30
local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin)
dCosAngleL1L2 = vtTg1 * vtTg2
@@ -367,6 +412,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
local dLiCompLength = 0
local dLoCompLength = 0
-- attacco tangente
local dLi2Tang = 0
local dLi2Perp = 0
@@ -388,6 +434,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
end
local dLenLi2 = abs( dLi2Tang)
local dLenLo2 = abs( dLo2Tang)
local dBiLineaAddLength = 0
-- se il lato non lavorato della bilinea è aperto, setto entrata/uscita con la stessa direzione
if bIsBiLinea then
@@ -416,8 +463,9 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
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
dBiLineaAddLength = dDistPointToCenter - ( 0.5 * dSawDiam)
dLoTang = -dAllEnd * dCosAlpha
dLoPerp = dDist2 * dSinAlpha
dLoPerp = dDist2 * dSinAlpha
end
end
end
@@ -426,7 +474,17 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
local bLioTang
local Ktp = 1.1
if BD.KIOTP then Ktp = BD.KIOTP end
if ( bForceTangentLeadInOut or ( not bDownUp or abs( vtTg:getY()) > 0.5) and
if ( sLeadInOutType == 'PerpendicularOutraw') then
bLioTang = false
dLiCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra
dLoCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra
dLiTang = 1
dLoTang = 1
dLiPerp = 0
dLoPerp = 0
dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
elseif ( sLeadInOutType ~= 'Perpendicular') and ( ( sLeadInOutType == 'Tangent') or ( not bDownUp or abs( vtTg:getY()) > 0.5) and
( not bDownHead or abs( vtTg:getZ()) < 0.51) 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
@@ -449,11 +507,23 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
-- 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
-- se angolo bilinea ottuso si segue bilinea per un tratto per tagliare completamente cubetto a forma di rombo
if dCosAngleL1L2 > 0.707 and bIsBiLinea then
-- calcolo uscita per prolungare solo della parte mancante per completare il taglio
if dBiLineaAddLength > 0 then
dLoTang = dLoTang * ( dBiLineaAddLength + BD.COLL_SIC) / 100
dLoPerp = dLoPerp * ( dBiLineaAddLength + BD.COLL_SIC) / 100
end
-- aggiungo componente perpendicolare a percorso per ritornare dal punto di ingresso, altrimenti l'uscita viene allungata fino dall'altra parte del grezzo
dLoCompLength = 100
-- se angolo bilinea oltre 45°, faccio movimento in retrazione
else
bLioTang = 2
local dMove = dist( ptP1, ptP2)
dLoTang = -( dLiTang - dAccStart - dAccEnd + dMove)
dLoPerp = BD.COLL_SIC
end
else
bLioTang = true
dLiTang, dLiPerp, dLoTang, dLoPerp, dLiCompLength = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp, dLi2CompLength
@@ -467,9 +537,19 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
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)
-- se il taglio è orizzontale, si gira aggregato lama per facilitare caduta del legno
if abs( vtTg:getZ()) < 10 * GEO.EPS_SMALL and not AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
else
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
else
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
-- se il taglio è orizzontale, si gira aggregato lama per facilitare caduta del legno
if abs( vtTg:getZ()) < 10 * GEO.EPS_SMALL and not AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
else
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
end
else
if BD.TURN == 2 then
@@ -516,8 +596,18 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
-- imposto uso faccia
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)
-- vtFaceUse non funziona correttaemnte in caso che il lato da lavorare sia a 45°. Potrebbe ritornare una trilinea, non gestibile. Quindi si setta l'EDGE
local nEdgeFaceUse = GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrthO)
if nEdgeFaceUse and ( AreSameOrOppositeDirApprox( vtOrthO:getX(), 0.707) or AreSameOrOppositeDirApprox( vtOrthO:getY(), 0.707) or AreSameOrOppositeDirApprox( vtOrthO:getZ(), 0.707)) then
local sNoteEdgeFaceUse = 'EdgesFaceUse=' .. EgtNumToString( nEdgeFaceUse) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNoteEdgeFaceUse)
else
local sNoteVtFaceUse = 'VtFaceUse=' .. EgtNumToString( vtOrthO:getX(),3) .. ',' .. EgtNumToString( vtOrthO:getY(),3) .. ',' .. EgtNumToString( vtOrthO:getZ(),3) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNoteVtFaceUse)
-- imposto allungamenti iniziale e finale (in caso si utilizzi EDGE, non serve prolungare o accorciare)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
end
-- imposto posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto inversione e lato correzione
@@ -535,13 +625,14 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
if BD.TURN and bLioTang == 2 then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
-- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
EgtSetMachiningParam( MCH_MP.LOCOMPLEN, dLoCompLength)
-- imposto angolo 3° asse rot
local sBlockedAxis = EgtIf( bMaximizeVerticalDepth, 'parallel', 'perpendicular')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO))
-- eventuali note
if ( sLeadInOutType == 'PerpendicularOutraw') then
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
end
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
-- eseguo
if not ML.ApplyMachining( true, false) then
@@ -611,7 +702,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
local bFaceOk = {}
bFaceOk[1] = ( vtN[1]:getZ() >= ( BD.CUT_VZ_MIN or 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.CUT_VZ_MIN or 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
if not bDownHead and not bFaceOk[1] and not bFaceOk[2] then
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
EgtOutLog( sErr)
return false, sErr
+58 -38
View File
@@ -25,11 +25,14 @@ EgtOutLog( ' MachiningLib started', 1)
-- Dati
local BD = require( 'BeamData')
local Cuttings = require( 'CutData')
local Millings = require( 'MillingData')
local Pocketings = require( 'PocketingData')
local Sawings = require( 'SawingData')
local Drillings = require( 'DrillData')
-- librerie lavorazioni caricate con pcall perchè potrebbero non esserci
local Cuttings, Millings, Pocketings, Sawings, Drillings, Probing
if pcall( require, 'CutData') then Cuttings = require( 'CutData') end
if pcall( require, 'MillingData') then Millings = require( 'MillingData') end
if pcall( require, 'PocketingData') then Pocketings = require( 'PocketingData') end
if pcall( require, 'SawingData') then Sawings = require( 'SawingData') end
if pcall( require, 'DrillData') then Drillings = require( 'DrillData') end
if pcall( require, 'ProbingData') then Probing = require( 'ProbingData') end
-- tipo di teste macchina
local ONE_HEAD = 1 -- una testa (Fast, One, Turn1T)
@@ -170,7 +173,7 @@ function VerifyTool( Machining, MachiningType, Params, bH2)
return VerifyDrillPocket( Machining, Params.Diam, Params.Depth, bH2)
end
elseif MachiningType == MCH_MY.SAWING then
return true, { H2 = bH2}
return ( not Params.Depth or Machining.Tool.MaxMat > Params.Depth - GEO.EPS_SMALL), { H2 = bH2}
elseif MachiningType == MCH_MY.MILLING then
return VerifyMill( Machining, Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2)
elseif MachiningType == MCH_MY.POCKETING then
@@ -184,18 +187,32 @@ end
---------------------------------------------------------------------
function GetMachinings( MachiningType, sType)
local Machinings
local Machinings = {}
-- leggo le lavorazioni disponibili
if MachiningType == MCH_MY.DRILLING then
Machinings = Drillings
if Drillings and type( Drillings) == "table" then
Machinings = Drillings
end
elseif MachiningType == MCH_MY.SAWING then
Machinings = Cuttings
if Cuttings and type( Cuttings) == "table" then
Machinings = Cuttings
end
elseif MachiningType == MCH_MY.MILLING then
Machinings = Millings
if Millings and type( Millings) == "table" then
Machinings = Millings
end
elseif MachiningType == MCH_MY.POCKETING then
Machinings = Pocketings
if Pocketings and type( Pocketings) == "table" then
Machinings = Pocketings
end
elseif MachiningType == MCH_MY.MORTISING then
Machinings = Sawings
if Sawings and type( Sawings) == "table" then
Machinings = Sawings
end
elseif MachiningType == MCH_MY.PROBING then
if Probing and type( Probing) == "table" then
Machinings = Probing
end
end
-- scrivo i parametri utensile nella lavorazione
local validMachinings = {}
@@ -208,27 +225,30 @@ function GetMachinings( MachiningType, sType)
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'
-- se non è tastatura, recupero dati utensile
if MachiningType ~= MCH_MY.PROBING then
if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then
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
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
@@ -342,8 +362,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
local ForStart = 1
local ForEnd = #Machinings
local ForStep = 1
-- le forature vanno scorse dal diametro maggiore al minore
if MachiningType == MCH_MY.DRILLING then
-- le forature vanno scorse dal diametro maggiore al minore, a meno che non sia stato passato un ordinamento specifico
if MachiningType == MCH_MY.DRILLING and ( not sSortingCriterion or sSortingCriterion == '') then
ForStart = #Machinings
ForEnd = 1
ForStep = -1
@@ -450,12 +470,12 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
end
---------------------------------------------------------------------
function MachiningLib.FindCutting( sType, bTopHead, bDownHead)
return FindMachining( MCH_MY.SAWING, sType, nil, bTopHead, bDownHead)
function MachiningLib.FindCutting( sType, bTopHead, bDownHead, dDepth, sSortingCriterion)
return FindMachining( MCH_MY.SAWING, sType, { Depth = dDepth}, bTopHead, bDownHead, nil, nil, sSortingCriterion)
end
---------------------------------------------------------------------
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission, bIsPredrill)
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission, bIsPredrill, bExcludeH3, sSortingCriterion)
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5, sTypeMach
-- se il foro è un predrill, cerco solo punte abilitate al Predrill
if bIsPredrill then
@@ -463,9 +483,9 @@ function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExclude
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)
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, sTypeMach, { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
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)
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Pocket_AT', 'Pocket'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
end
if MachiningName and MachiningName ~= '' then
return MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5
+54 -18
View File
@@ -46,7 +46,14 @@ local ML = require( 'MachiningLib')
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessCut.Identify( Proc)
return ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10)
-- se richiesto si forza fresatura
Proc.bForceMill = ( ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) and ( ( EgtGetInfo( Proc.Id, 'Q07', 'd') or 0) == 1))
if Proc.bForceMill then
return false
else
return ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10)
end
end
---------------------------------------------------------------------
@@ -85,7 +92,7 @@ function ProcessCut.Classify( Proc, b3Raw)
-- calcolo l'ingombro orizzontale della faccia
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale)
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and abs( vtN:getY()) > 0.1 and dMaxMat < DimH + BD.CUT_EXTRA) then
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and ( abs( vtN:getY()) > 0.1) and dMaxMat < DimH + BD.CUT_EXTRA) then
return true, true
end
end
@@ -254,7 +261,8 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione con testa da sopra
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, bForceTangentLeadInOut)
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, sLeadInOutType)
local sWarn
-- ingombro del grezzo
b3Raw = b3Raw or EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
@@ -265,9 +273,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN)
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
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 BL.IsSplittedPartPhase( nPhase)) and not Proc.AdvTail and vtN:getX() < 0 and abs( vtN:getY()) < 0.259)
end
local dMinFeatureLengthForLongCut = 590.000
local dMinFeatureLengthForLongCut = EgtIf( BD.C_SIMM, 590, 400)
-- 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
Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and
@@ -366,10 +374,19 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
end
-- 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)
-- se lungo, una faccia e rivolto sul retro verso l'alto si forzano i cubetti per evitare di rovinare il pezzo successivo
local bForceDicing = ( Proc.Fct == 1 and Proc.AffectedFaces.Left and bLongCut and vtN:getZ() > 10 * GEO.EPS_SMALL and vtN:getY() < 10 * GEO.EPS_SMALL)
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
local dDicingOffsetP
local dDicingOffsetO
if ( ( not Proc.AdvTail) or bForceDicing) and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
local ptExtra, vtExtra
local bAutoCalcSurf = true
if Proc.AdvTail then
-- do avviso che la lama può sbordare nel pezzo successivo
sWarn = 'Warning : Cut machining can damage next piece'
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
end
if bFillAreaPiece or bFillTail then
local ptMiddle = ( b3Solid:getMin() + b3Solid:getMax()) / 2
ptExtra = Point3d( b3Solid:getMin():getX() + 5*GEO.EPS_SMALL, ptMiddle:getY(), ptMiddle:getZ())
@@ -408,11 +425,11 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
end
end
-- se il taglio è più spesso della lama abilito il dicing, altrimenti no
if dMaxElev > dSawThick then
vCuts = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, dNewDiceDim)
if ( dMaxElev > dSawThick) or bForceDicing then
vCuts, dDicingOffsetP = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, dNewDiceDim)
-- se taglio sborda in coda e non è stato inserito nessun taglio a cubetti, lo rilancio con le dimensioni customizzate
if ( bFillTail or bCustDiceCut) and #vCuts == 0 then
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
vCuts, dDicingOffsetP = DC.GetDice( nAddGrpId, b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
end
end
end
@@ -581,8 +598,17 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
if ( i % 2 == 0) and ( Proc.Fct == 1) and bNoPerpCuts then
vtOrthoOAlternative = - vtOrthoO
end
bForceTangentLeadInOut = bForceTangentLeadInOut and ( ( i % 2) ~= 0)
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, bForceTangentLeadInOut, vtOrthoOAlternative)
local sLeadInOutTypeFbs = 'Calculated'
if ( ( i % 2) ~= 0) then
if ( sLeadInOutType == 'Tangent') then
sLeadInOutTypeFbs = 'Tangent'
elseif ( sLeadInOutType == 'Perpendicular') then
sLeadInOutTypeFbs = 'Perpendicular'
elseif ( sLeadInOutType == 'PerpendicularOutraw') then
sLeadInOutTypeFbs = 'PerpendicularOutraw'
end
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, sLeadInOutTypeFbs, vtOrthoOAlternative, dDicingOffsetP)
if not bOk then return bOk, sErr end
end
end
@@ -601,7 +627,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
local vtOrthoO
if bFromBottom and dCutV < dMaxDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
vtOrthoO = -Z_AX()
elseif bHorizCut 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
elseif ( bHorizCut or ( dCutV < dMaxDepth - BD.CUT_EXTRA and not bVertCutOk)) and
( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or ( vtN:getX() > 0 and vtN:getZ() <= 0.708) or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then
vtOrthoO = Z_AX()
elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and
vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then
@@ -634,7 +661,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
return true
return true, sWarn
end
---------------------------------------------------------------------
@@ -822,7 +849,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf, bForceTangentLeadInOut)
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf, sLeadInOutType)
-- sovramateriale di coda
dOvmTail = dOvmTail or BD.OVM_MID
-- ingombro del grezzo
@@ -859,22 +886,31 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
return false, sErr
end
local bNoDicing = false
local sWarn
-- se taglio con testa da sopra
if not bDownHead and not bDownTurn then
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, bForceTangentLeadInOut)
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, sLeadInOutType)
bNoDicing = bNoDicing2
if not bOk then return false, sErr end
if not bOk then
return false, sErr
else
sWarn = sErr
end
-- altrimenti taglio con testa da sotto
else
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
else
sWarn = sErr
end
end
-- Aggiornamento ingombro (se vero taglio o richiesto)
-- Se lascio il cordolo (bNoDicing) non aggiorno il grezzo perchè lo scarto rimane attaccato
if ( ProcessCut.Identify( Proc) or bUpdateIng) and not bNoDicing then
UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
end
return true
return true, sWarn
end
---------------------------------------------------------------------
+2 -2
View File
@@ -1190,14 +1190,14 @@ local function Make2Faces( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol
return MakeByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Solid)
-- altrimenti provo con il truciolatore
else
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
-- se non ho la lavorazione esco
if not sMilling then
local sErr = 'Error, machining or tool not found ' .. sName .. '-' .. sMilling
local sErr = 'Error, machining or tool not found ' .. sName
EgtOutLog( sErr)
return false, sErr
end
-- inserisco la lavorazione di fresatura
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
+57 -8
View File
@@ -209,7 +209,8 @@ function ProcessDrill.AddPredrillFromDrillProc( Proc)
PredrillProc.MainId = Proc.MainId
PredrillProc.IsPredrill = true
PredrillProc.IsPredrillOf = Proc.Id
-- recupero l'elenco delle facce della parte interessate dalla feature
PredrillProc.AffectedFaces = BL.GetProcessAffectedFaces( PredrillProc)
return true, PredrillProc
end
end
@@ -250,8 +251,13 @@ function ProcessDrill.Classify( Proc, b3Raw, sDownOrSideOrStd)
-- 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
-- se foro fatto in doppio entrambe le forature (valore assoluto) devono essere sopra al valore limite, se foro singolo deve essere sopra al valore limite se ribaltato
if ( abs( Proc.Flg) == 2 and ( abs( vtExtr:getZ()) < - BD.DRILL_VZ_MIN) or ( abs( Proc.Flg) ~= 2 and vtExtr:getZ() < - BD.DRILL_VZ_MIN)) then
-- in doppio non cambio di fase al foro perchè devo garantire il lato master su H1
if not( Proc.Double) or Proc.Double == 0 then
Proc.Down = true
Proc.Side = false
end
return true
end
end
@@ -383,6 +389,25 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
-- recupero la lavorazione
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
if sDrilling then
-- Determino la faccia di inizio del foro e dati correlati
local nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
-- Calcolo acciorciamento affondamento utile per evitare collisione portautensile con faccia
local TgA = CosB / sqrt( 1 - CosB * CosB)
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
-- Per fori molto inclinati ( < 30 gradi) si usa la testa della macchina per l'accorciamento. Fast esclusa
if BD.C_SIMM and CosB > 0.866 then
dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116
end
local dMaxDepthOri = dMaxDepth
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
-- se utensile scelto non arriva in fondo, cerco il più lungo
if dMaxDepth < GEO.EPS_SMALL * 10 then
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill, nil, 'Longest')
end
end
if not sDrilling and dCheckDepth then
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
if sDrilling then dCheckDepth = nil end
@@ -477,16 +502,28 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- eventuale inversione foro in base al lato di lavoro e al lato testa dell'utensile scelto
-- se non già richiesta inversione e foro quasi orizzontale (15deg) passante
if not bToInvert and Proc.Flg == 1 and bOpen and abs( vtExtr:getZ()) < 0.259 and abs( vtExtr:getY()) > 0.966 then
local Tool = BL.GetToolFromMachining( sDrilling)
-- lato testa e lato di lavoro devono corrispondere
if ( ( Tool.PreferredSide.bFront == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL)
or ( ( Tool.PreferredSide.bBack == true) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then
ptCen = ptCen - vtExtr * dLen
vtExtr = - vtExtr
bToInvert = true
end
end
-- Determino la faccia di inizio del foro e dati correlati
local nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
-- Calcolo acciorciamento affondamento utile per evitare collisione portautensile con faccia
local TgA = CosB / sqrt( 1 - CosB * CosB)
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
TgA = CosB / sqrt( 1 - CosB * CosB)
dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
-- Per fori molto inclinati ( < 30 gradi) si usa la testa della macchina per l'accorciamento. Fast esclusa
if BD.C_SIMM and CosB > 0.866 then
dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116
end
local dMaxDepthOri = dMaxDepth
dMaxDepthOri = dMaxDepth
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
-- Verifico inclinazione foro nei limiti
local bTryDrill = EgtIf( dMaxDepth > 0, ( CosB < BD.DRILL_VX_MAX), false)
@@ -509,7 +546,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
if bIntersectionOk then
local dHoleToCutDistance = vDistance[1]
-- se il taglio accorcia realmente il foro
if dHoleToCutDistance > 10 * GEO.EPS_SMALL and dHoleToCutDistance < dLen then
if ( dHoleToCutDistance > 10 * GEO.EPS_SMALL or Proc.AffectedFaces.Right) and dHoleToCutDistance < dLen then
dMaxDepth = dMaxDepthOri
dMaxElev = dLen - dHoleToCutDistance
bTryDrill = true
@@ -560,6 +597,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
local nSCC = MCH_SCC.NONE
if bDrillAngTrasm then
nSCC = MCH_SCC.ADIR_NEAR
elseif BD.TURN == 2 then
nSCC = MCH_SCC.ADIR_ZP
elseif not BD.C_SIMM and not BD.TURN then
nSCC = MCH_SCC.ADIR_YM
if AreSameVectorApprox( vtExtr, Z_AX()) then
@@ -599,6 +638,16 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
end
-- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then
-- calcolo gli step reali
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
local nNumStep = ceil( dDepth/dStep)
local dRealStep = dDepth / nNumStep
-- Se nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno
if ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then
dRealStep = ceil( dDepth / (nNumStep - 1))
EgtSetMachiningParam( MCH_MP.STEP, dRealStep)
sMyWarn ='Warning in drill-double : step changed to ' .. tostring(dRealStep) .. 'mm'
end
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= Proc.PrevDouble then
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
+31 -9
View File
@@ -20,6 +20,7 @@ local ProcessDtMortise = {}
require( 'EgtBase')
local BL = require( 'BeamLib')
local Cut = require( 'ProcessCut')
local Probe = require( 'ProcessProbing')
EgtOutLog( ' ProcessDtMortise started', 1)
@@ -111,9 +112,6 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
EgtAddCurveCompoLineTg( NewAuxId, 100, false)
EgtAddCurveCompoLineTg( NewAuxId, 100, true)
EgtMergeCurvesInCurveCompo( NewAuxId)
-- eseguo traslazione e offset per portarla sul top
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dAltMort - 10 * GEO.EPS_SMALL)
EgtMove( NewAuxId, vtMove, GDB_RT.GLOB)
local dOffset = dAltMort * tan( dSideAng)
if not EgtOffsetCurve( NewAuxId, dOffset) then return end
-- la limito entro la trave
@@ -121,6 +119,9 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
local vtBoxDiag = b3Solid:getMax() - b3Solid:getMin()
local nCount
NewAuxId, nCount = EgtTrimFlatCurveWithBox( NewAuxId, refBox, vtBoxDiag, true, true, GDB_RT.GLOB)
-- eseguo traslazione e offset per portarla sul top
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dAltMort - 10 * GEO.EPS_SMALL)
EgtMove( NewAuxId, vtMove, GDB_RT.GLOB)
-- se divisa in più parti, le unisco congiungendole con segmenti
if nCount > 1 then
if EgtGetType( NewAuxId) ~= GDB_TY.CRV_COMPO then
@@ -273,7 +274,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local dToolDiam = 100
local dMaxMat = 30
local dSideAng = 0
local sHeadTool = 'H1'
local bCW = true
local bMillOnAggregate = sMchExt == '_AT'
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
@@ -281,6 +284,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
dToolDiam = max( dToolDiam, 10)
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
sHeadTool = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
bCW = ( dSpeed >= 0)
end
@@ -291,6 +295,11 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtOutLog( sErr)
return false, sErr
end
-- tastatura se richiesta
local Info = { vtProbe = vtExtr, ptProbe = ptBC, sType = 'DTMortise', sHead = sHeadTool}
local bProbeExecuted, sErr = Probe.Make( Proc, nPartId, Info)
-- se con tasca, la lavoro (mai in doppio)
if bPocket then
-- recupero il contorno della tasca (seconda curva ausiliaria)
@@ -345,11 +354,20 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
-- eventuale calcolo SCC
local nSCC
if BD.TURN and not bPocket then
if abs( vtAx:getY()) > abs( vtAx:getZ()) then
nSCC = EgtIf( vtAx:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
else
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
if BD.TURN then
if not bPocket then
if abs( vtAx:getY()) > abs( vtAx:getZ()) then
nSCC = EgtIf( vtAx:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
else
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
end
end
-- se aggregato e rivolto verso Z-, si accede da lato aperto
elseif bMillOnAggregate and AreSameVectorApprox( vtExtr, -Z_AX()) then
if Proc.AffectedFaces.Back then
nSCC = MCH_SCC.ADIR_YP
elseif Proc.AffectedFaces.Front then
nSCC = MCH_SCC.ADIR_YM
end
end
-- flag di mirror precedente aggiornabile localmente
@@ -512,7 +530,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
end
-- se necessario, imposto SCC
if nSCC then
if nSCC then
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end
-- dichiaro massima elevazione e assenza sfridi per VMill
@@ -529,6 +547,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
end
end
-- se c'è stata tastatura, si disattiva sull'ultima lavorazione
if bProbeExecuted and i == 1 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'END-PROBE', true)
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
+4 -4
View File
@@ -46,9 +46,9 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
-- 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 -23.5deg
else
return ( vtN:getZ() >= -0.359)
return ( vtN:getZ() >= -0.399)
end
-- se trave medio-bassa
elseif b3Raw:getDimZ() < 281 then
@@ -70,8 +70,8 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
end
-- altrimenti
else
-- accetto fino a -5deg
return ( vtN:getZ() >= -0.088)
-- accetto fino a -7deg
return ( vtN:getZ() >= -0.122)
end
end
+57 -15
View File
@@ -33,6 +33,7 @@ local Q_ONLY_CHAMFER = 'Q00' -- i
local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket
local Q_IGNORE_LASER_PROBLEMS = 'Q07'
local Q_FORCE_CLAMPABLE_AREA = 'Q08'
local Q_INVERT_LAST_PATH = 'Q09'
---------------------------------------------------------------------
-- Riconoscimento della feature
@@ -470,7 +471,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
if BD.TURN == 2 then
nSCC = MCH_SCC.ADIR_ZP
elseif not BD.C_SIMM then
if Proc.Head then
nSCC = MCH_SCC.ADIR_XP
elseif Proc.Tail then
@@ -538,7 +541,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
if BD.TURN == 2 then
nSCC = MCH_SCC.ADIR_ZP
elseif not BD.C_SIMM then
if Proc.Head then
nSCC = MCH_SCC.ADIR_XP
elseif Proc.Tail then
@@ -588,6 +593,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
end
-- eventuale inversione ultimo segmento
local bInvertLastPath = ( ( EgtGetInfo( Proc.Id, Q_INVERT_LAST_PATH, 'd') or 0) == 1)
-- eseguo
for i = 1, nStep do
for j = 1, nDouble do
@@ -630,38 +637,71 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- eventuale accorciamento di testa
local dStartAddLen, dEndAddLen, dWorkSide, bToolInvert, bInvert
if ( j == 1 and i > 1) or ( j == 2 and i < nStep) then
local dStartAddLen = EgtIf( j == 1, - ( i - 1) * dStep, - ( nStep - i) * dStep)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
dStartAddLen = EgtIf( j == 1, - ( i - 1) * dStep, - ( nStep - i) * dStep)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( j == 1, dStartAddSpec, dEndAddSpec))
dStartAddLen = EgtIf( j == 1, dStartAddSpec, dEndAddSpec)
end
-- eventuale accorciamento di coda
if ( j == 1 and i < nStep) or ( j == 2 and i > 1) then
local dEndAddLen = EgtIf( j == 1, - ( nStep - i) * dStep, - ( i - 1) * dStep)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
dEndAddLen = EgtIf( j == 1, - ( nStep - i) * dStep, - ( i - 1) * dStep)
else
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( j == 1, dEndAddSpec, dStartAddSpec))
dEndAddLen = EgtIf( j == 1, dEndAddSpec, dStartAddSpec)
end
-- se estrusione da sotto, inverto direzione fresa
if ( j == 1 and bToolInv) or ( j == 2 and not bToolInv) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
bToolInvert = true
else
bToolInvert = false
end
-- se seconda passata, inverto direzione di lavoro
if j == 2 then
EgtSetMachiningParam( MCH_MP.INVERT, true)
bInvert = true
else
bInvert = false
end
-- assegno lato di lavoro
if Proc.Grp == 0 then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
dWorkSide = MCH_MILL_WS.CENTER
elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) or ( Proc.Grp == 1 and bToolInv) or ( Proc.Grp == 2 and bToolInv) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
dWorkSide = MCH_MILL_WS.LEFT
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) or ( Proc.Grp == 1 and not bToolInv) or ( Proc.Grp == 2 and not bToolInv) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
dWorkSide = MCH_MILL_WS.RIGHT
end
-- se ultimo step da invertire
if i == nStep and bInvertLastPath then
-- se profilo orizzontale
if abs( vtExtr:getZ()) < 10 * GEO.EPS_SMALL then
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
bInvert = not( bInvert)
bToolInvert = not( bToolInvert)
else
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
bInvert = not( bInvert)
if dWorkSide == MCH_MILL_WS.LEFT then
dWorkSide = MCH_MILL_WS.RIGHT
elseif dWorkSide == MCH_MILL_WS.RIGHT then
dWorkSide = MCH_MILL_WS.LEFT
end
end
end
-- setto i valori
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToolInvert)
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, dWorkSide)
-- posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
if BD.TURN == 2 then
nSCC = MCH_SCC.ADIR_ZP
elseif not BD.C_SIMM then
if Proc.Head then
nSCC = MCH_SCC.ADIR_XP
elseif Proc.Tail then
@@ -792,7 +832,9 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
if BD.TURN == 2 then
nSCC = MCH_SCC.ADIR_ZP
elseif not BD.C_SIMM then
if Proc.Head then
nSCC = MCH_SCC.ADIR_XP
elseif Proc.Tail then
+30 -21
View File
@@ -161,7 +161,7 @@ end
---------------------------------------------------------------------
-- tagli verticali aggiuntivi
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw)
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, dOffsetBetweenCuts)
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
@@ -177,8 +177,8 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw)
for j = nVerticalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
local dVerticalCutOffset = dVerticalSliceHeight * -j
local bForceTangentLeadInOut = BD.PRESS_ROLLER and not BD.DOWN_HEAD
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)
local sLeadInOutType = 'PerpendicularOutraw'
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, sLeadInOutType, nil, dOffsetBetweenCuts)
if not bOk then return bOk, sErr end
end
@@ -240,8 +240,8 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, HeadCut
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)
local sLeadInOutType = 'PerpendicularOutraw'
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, sLeadInOutType, nil, dOffsetBetweenCuts)
if not bOk then return bOk, sErr end
end
-- se necessario taglio verticale doppio, eseguo l'opposto
@@ -284,7 +284,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, HeadCut
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)
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, dOffsetBetweenCuts)
if not bOk then return bOk, sErr end
end
if i == 1 and HeadCutType.sType =='Precut' then
@@ -340,7 +340,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, HeadCut
end
-- se trave larga effettuo tagli verticali aggiuntivi
if HeadCutType.bNeedVerticalAddedCuts then
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw)
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, dOffsetBetweenCuts)
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)
@@ -365,7 +365,15 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
-- eventuali informazioni sul tipo di finitura
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
-- recupero la lavorazione
local sCutting = ML.FindCutting( 'HeadSide')
-- TODO questa parte andrà cambiata quando si gestiranno i volumi liberi in cui girare da mlse
local dMinWidthForBigBlade = 300
local dMaxHeightForBigBlade = 300
local sCutting
if b3Raw:getDimY() > dMinWidthForBigBlade and b3Raw:getDimZ() < dMaxHeightForBigBlade then
sCutting = ML.FindCutting( 'HeadSide', nil, nil, nil, 'Longest')
else
sCutting = ML.FindCutting( 'HeadSide')
end
if not sCutting then
local sErr = 'Error : cutting not found in library'
EgtOutLog( sErr)
@@ -398,17 +406,23 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
dSawThick2 = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick2
end
end
-- determino se lo spessore del materiale da rimuovere è eccessivo e quindi vanno fatti più tagli con offset
local nCuts = max( ceil( dOvmHead / (( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP) + 0.5)), 1)
local dOffsL = dOvmHead / nCuts
-- caratteristiche taglio
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) and
( b3Raw:getDimY() < 2 * dDimYRef - BD.CUT_EXTRA_MIN + 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)
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) and
dOffsL < BD.MAX_DIM_DICE
-- 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}
@@ -420,9 +434,6 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
if not bNeedHCut and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL then
return true
end
-- determino se lo spessore del materiale da rimuovere è eccessivo e quindi vanno fatti più tagli con offset
local nCuts = max( ceil( dOvmHead / (( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP) + 0.5)), 1)
local dOffsL = dOvmHead / nCuts
-- se taglio per sezioni alte e larghe
if bBigSectionCut then
if dOvmHead > 0 then
@@ -487,18 +498,16 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
if AreSameVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
end
-- tagli verticali
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw)
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw, dOffsL)
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)
local sLeadInOutType = 'PerpendicularOutraw'
bOk, sErr = Cut.Make( AddProc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nLimitingSurf, sLeadInOutType)
end
-- tagli aggiuntivi non necessari
else
local bForceTangentLeadInOut = false
if BD.PRESS_ROLLER then
bForceTangentLeadInOut = true
end
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nil, bForceTangentLeadInOut)
local sLeadInOutType = 'PerpendicularOutraw'
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nil, sLeadInOutType)
end
return bOk, sErr
end
+230 -116
View File
@@ -117,6 +117,7 @@ local ProcessLapJoint = {}
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local Fbp = require( 'FaceByPocket')
local Cut = require( 'ProcessCut')
local DoubleCut = require( 'ProcessDoubleCut')
local LongCut = require( 'ProcessLongCut')
@@ -155,18 +156,22 @@ local bTrySidePocketAtFirst = true
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessLapJoint.Identify( Proc)
return ( (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90) or
( Proc.Grp == 4 and Proc.Prc == 37) or
( Proc.Grp == 4 and Proc.Prc == 39) or
( Proc.Grp == 4 and Proc.Prc == 120))
if Proc.bForceMill then
return true
else
return ( (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90) or
( Proc.Grp == 4 and Proc.Prc == 37) or
( Proc.Grp == 4 and Proc.Prc == 39) or
( Proc.Grp == 4 and Proc.Prc == 120))
end
end
---------------------------------------------------------------------
@@ -195,6 +200,7 @@ local function AssignQIdent( Proc)
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17 then
Q_DEPTH_CHAMFER = 'Q01' -- d
Q_ONLY_CHAMFER = 'Q02' -- i
Q_USE_MILL = 'Q03' -- i
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20 then
Q_DEPTH_CHAMFER = 'Q01' -- d
Q_USE_MILL = 'Q02' -- i
@@ -409,11 +415,11 @@ local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bP
end
---------------------------------------------------------------------
local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill, b3Raw)
-- se non feature BlockHausHalfLap e non abilitato parametro Q per lavorarlo di fianco e non macchina BH esco
local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0
if Proc.Prc ~= 37 and nUseSideTool == 0 and not BD.BH_MACHINE then
if Proc.Prc ~= 37 and not BD.BH_MACHINE and ( nUseSideTool == 0 or ( nUseSideTool == 4 and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right))) then
return false
end
@@ -439,9 +445,13 @@ local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
-- le facce devono contenere X e quelle di chiusura devono essere perpendicolari a X
local bStopY, bStopZ
if not Proc.TopologyLongName then
Topology.Classify( Proc, b3Raw)
end
for i = 1, Proc.Fct do
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
if abs( vtN:getX()) > 0.001 and abs( vtN:getX()) < 0.999962 then
-- permessa U passante non parallela agli assi principali
if abs( vtN:getX()) > 0.001 and abs( vtN:getX()) < 0.999962 and Proc.TopologyLongName ~= "Groove-Through-RightAngles-NotParallel-3" then
return false
end
if abs( vtN:getY()) > 0.866 then bStopY = true end
@@ -771,7 +781,7 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
-- in base al tipo di feature attribuisco il significato dei parametri Q
AssignQIdent( Proc)
-- se può essere fatto con utensile tipo lama
local bUseBHSideMill, bHead, bHeadDir = VerifyBHSideMill( Proc)
local bUseBHSideMill, bHead, bHeadDir = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw)
if bUseBHSideMill then
Proc.HeadDir = bHeadDir
end
@@ -780,18 +790,25 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- verifico se è in coda
local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX()
if dEndDist > BD.MAX_DIST_HTFEA then
if ( dEndDist > BD.MAX_DIST_HTFEA) or bUseBHSideMill then
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
return true
else
return false
end
end
-- se lunga come trave, oppure non è trave corta e la sua lunghezza supera il massimo o il 80% della lunghezza della trave
if Proc.Box:getDimX() > b3Solid:getDimX() - 1 or
( b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.8 * b3Solid:getDimX())) then
return false
end
-- se interessa la coda, e pezzo lungo, si sposta dopo separazione
if b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.AffectedFaces.Left and Proc.Fct >= 2 then
return true
end
-- se una o due facce e interessa veramente la coda, allora di coda
if Proc.Fct <= 2 then
if Proc.Box:getMin():getX() < b3Solid:getMin():getX() + 1. then
@@ -829,7 +846,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
-- se 2 facce
elseif Proc.Fct == 2 then
-- se può essere fatto con utensile tipo lama
local bUseBHSideMill = VerifyBHSideMill( Proc)
local bUseBHSideMill = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw)
if bUseBHSideMill then
return true, false
end
@@ -866,12 +883,25 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
end
-- se è presente il rinvio angolare con lavorazioni di tasca ed è una tasca perfettamente verticale da sotto, non ruoto
if BD.ANG_TRASM and Proc.Fct >= 4 and not bClosedOrthoFaces then
local vtNBottomFace = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
if AreOppositeVectorApprox( vtNBottomFace, Z_AX()) and
if AreOppositeVectorApprox( Proc.Face[nFacInd + 1].VtN, Z_AX()) and
( Proc.Fct >= 5 and ML.FindPocketing( 'Pocket_AT') or ( Proc.Fct < 5 and ML.FindPocketing( 'OpenPocket_AT'))) then
return true, false
end
end
-- se groove da sotto e possibile fresatura tipo SideMillAsBlade non ruoto
if Proc.AllRightAngles and ( Proc.Topology == 'Groove' or Proc.Topology == 'Pocket') and not( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and AreOppositeVectorApprox( Proc.Face[nFacInd + 1].VtN, Z_AX()) 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
if VerifySideMillAsSaw( Proc, nAddGrpId, Proc.Face[nFacInd + 1].VtN, min( Proc.Face[nFacInd + 1].Height, Proc.Face[nFacInd + 1].Width) , Proc.Face[nFacInd + 1].Elevation) then
Proc.OkFromBottom = true
return true, false
end
end
-- se scanalatura chiusa lavoro la faccia di fondo
if Proc.Topology == 'Pocket' and ( Proc.IsParallel or Proc.AllRightAngles) and not bClosedOrthoFaces then
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, nil, 4)[1]
@@ -896,7 +926,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
-- se può essere fatto con utensile tipo lama
local bUseBHSideMill, _, _, _, _, dTDiam = VerifyBHSideMill( Proc)
local bUseBHSideMill, _, _, _, _, dTDiam = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw)
if bUseBHSideMill then
if vtN:getZ() > -0.5 or b3Raw:getDimZ() - Proc.Box:getDimZ() < ( BD.MAX_DIST_BH_FROM_BOTTOM or 395) - dTDiam / 2 then
return true, false
@@ -915,7 +945,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
local bIsU = ( Proc.Fct == 3 and not TestElleShape3( Proc))
-- se forzata la lavorazione con fresa di lato da parametro Q03=2/3 non devo ruotare
local nSideRoughTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd')
local bForceSideMill = ( ( nSideRoughTool == 2 or nSideRoughTool == 3) and ( Proc.Fct == 3 or Proc.Fct == 4))
local bForceSideMill = ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and ( nSideRoughTool == 2 or nSideRoughTool == 3) and ( Proc.Fct == 3 or Proc.Fct == 4)
if bForceSideMill then
bDown = false
elseif nFacInd2 and dElev2 < 160 and dElev2 < 2 * dElev then
@@ -986,8 +1016,11 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bUp, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.PARAL_RIGHT))
end
-- imposto lato di correzione
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
if not bUp then EgtSetMachiningParam( MCH_MP.INVERT, true) end
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
if not bUp then
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
end
-- imposto posizione braccio porta testa
if vtN:getY() < GEO.EPS_SMALL then
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
@@ -3445,7 +3478,7 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
sWarn = 'Warning on pocketing ' .. sName .. ': machining can damage next piece. Minimum distance needed : ' .. ( 1 + dDiamTool / 2) .. ' mm'
EgtOutLog( sWarn)
end
if BD.TURN then
if BD.TURN and BD.TURN ~= 2 then
-- centro del pezzo
local ptCen = ORIG()
if b3Solid then ptCen = b3Solid:getCenter() end
@@ -3472,6 +3505,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
local sMchFind = 'Pocket'
local dAngLimit = 40
local sWarn
-- se feature é larga come trave imposto openpocket
if nDiffWidth == 0 then
@@ -3485,6 +3519,15 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
-- calcolo l'angolo dalla verticale dall'angolo tra le due facce, perchè la feature potrebbe essere ruotata sulla Z locale della
-- faccia principale e quindi la componente X del versore della faccia potrebbe dare un valore non coerente
local dDiffFromSqAng = dAng + 90
-- informazioni sul lato da lavorare
local Edges = BL.GetEdgesInfo( Proc, Proc.Face[nSideFace + 1])
local EdgeToMachine = {}
for i = 1, #Edges do
local CurrentEdge = Edges[i]
if CurrentEdge.AdjacentFaceId == nBaseFace then
EdgeToMachine = CurrentEdge
end
end
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
if cos( dDiffFromSqAng) < cos( dAngLimit) then
-- applico la svuotatura
@@ -3510,14 +3553,28 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, nSideFace}})
-- imposto uso faccia
local nFaceUse = BL.GetNearestOrthoOpposite(tvtN[1])
-- imposto vettore direzione e faceUse
local vtFaceUse = EdgeToMachine.ToolDirection
local sUserNotes = ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtFaceUse', EgtNumToString( vtFaceUse:getX(),3) .. ',' .. EgtNumToString( vtFaceUse:getY(),3) .. ',' .. EgtNumToString( vtFaceUse:getZ(),3))
local nFaceUse = BL.GetNearestOrthoOpposite( vtFaceUse)
-- aggiusto i parametri
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, 1)
-- imposto allungamenti iniziale e finale
if EdgeToMachine.IsStartOpen then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dDiamTool / 2)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dDiamTool / 2)
end
if EdgeToMachine.IsEndOpen then
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dDiamTool / 2)
else
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dDiamTool / 2)
end
-- imposto posizione braccio porta testa
if tvtN[2]:getY() < GEO.EPS_SMALL then
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
@@ -3525,9 +3582,9 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
end
-- imposto elevazione e dichiaro non si generano sfridi per VMill
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
sNotes = sNotes .. 'VMRS=0;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
@@ -3547,36 +3604,27 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
bOpenStart = true
bOpenEnd = true
else
local vAdj2 = EgtSurfTmFacetAdjacencies( Proc.Id, (nBaseFace))[1]
for j = 1, #vAdj2 do
if vAdj2[j] == (nSideFace) then
-- Se non esiste faccia adiacente a lato precedente -> inizio aperto
local i = EgtIf( j > 1, j - 1, #vAdj2)
while vAdj2[i] == (nSideFace) do
i = EgtIf( i > 1, i - 1, #vAdj2)
end
bOpenStart = ( vAdj2[i] < 0)
-- Se non esiste faccia adiacente a lato successivo -> fine aperto
local k = EgtIf( j < #vAdj2, j + 1, 1)
while vAdj2[k] == (nSideFace) do
k = EgtIf( k < #vAdj2, k + 1, 1)
end
bOpenEnd = ( vAdj2[k] < 0)
end
end
bOpenStart = EdgeToMachine.IsStartOpen
bOpenEnd = EdgeToMachine.IsEndOpen
end
local sMilling
if nUseRoughTool > 0 then
sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidPk)
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut') end
if not sMilling then sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk) end
else
sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk)
if not sMilling then sMilling = ML.FindMilling( 'LongSmallCut') end
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidPk) end
end
if not sMilling then
local sErr = 'Error : Long2Cut & LongSmallCut not found in library'
EgtOutLog( sErr)
return false, sErr
sMilling = ML.FindMilling( 'LongSmallCut')
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut') end
if not sMilling then
local sErr = 'Error : Long2Cut & LongSmallCut not found in library'
EgtOutLog( sErr)
return false, sErr
else
sWarn = 'Warning : lapjoint chamfer angle machined with different tool'
end
end
-- recupero i dati dell'utensile
local dTDiam = 50
@@ -3602,7 +3650,11 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- sistemazione inversione del percorso
local nWrkSide = EgtGetMachiningParam( MCH_MP.WORKSIDE)
EgtSetMachiningParam( MCH_MP.INVERT, ( nWrkSide ~= MCH_MILL_WS.RIGHT))
local bInvert = nWrkSide ~= MCH_MILL_WS.RIGHT
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
if bInvert then
bOpenStart, bOpenEnd = bOpenEnd, bOpenStart
end
-- setto a 0 eventuali offset
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
-- calcolo elevazione per allungamenti attacchi con fianchi chiusi
@@ -3625,7 +3677,11 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
EgtSetMachiningParam( MCH_MP.LITANG, 0)
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
if bOpenEnd then
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
else
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
end
end
end
if bOpenEnd then
@@ -3638,8 +3694,12 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
EgtSetMachiningParam( MCH_MP.LITANG, 0)
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
if bOpenStart then
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
else
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
end
end
end
-- eseguo
@@ -3650,7 +3710,8 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
end
end
end
return true
return true, sWarn
end
---------------------------------------------------------------------
@@ -4712,6 +4773,7 @@ SawPlusChain.ApplyOnlySawblade = false
function SawPlusChain.IsTopologyOk( Proc)
if Proc.TopologyLongName == 'Pocket-Blind-RightAngles-Parallel-5' or
Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' or
Proc.TopologyLongName == 'Groove-Through-RightAngles-NotParallel-3' or
Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' or
Proc.TopologyLongName == 'Tunnel-Through-RightAngles-Parallel-4' then
@@ -4999,38 +5061,6 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face)
end
function SawPlusChain.GetToolFromMachining( sMachiningName)
local Tool = {}
if EgtMdbSetCurrMachining( sMachiningName) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
Tool.Name = EgtTdbGetCurrToolParam( MCH_TP.NAME)
Tool.IsCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
Tool.Type = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
-- lama
if Tool.Type == MCH_TY.SAW_STD or Tool.Type == MCH_TY.SAW_FLAT then
Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or 0
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
Tool.SideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd')
-- sega a catena
elseif Tool.Type == MCH_TY.MORTISE_STD then
Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) or 0
Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0
Tool.Width = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
Tool.Thickness = EgtTdbGetCurrToolParam( MCH_TP.THICK) or 0
Tool.CornerRadius = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or 0
-- altri utensili al momento non previsti
else
error( 'Wrong tool type')
end
end
end
return Tool
end
function SawPlusChain.CalculateLeadInOut( Machining, EdgeToMachine)
-- TODO implementare le funzioni di Tool Collision Avoidance (vedi wiki e FacesBysaw -> CalcLeadInOutPerpGeom)
@@ -5230,14 +5260,19 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
end
-- ricerca lavorazione
Cutting.Name = ML.FindCutting( 'HeadSide', true, false)
Cutting.Name = ML.FindCutting( 'HeadSide', true, false, abs( EdgeToMachine.Elevation))
if not Cutting.Name then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found'
Cutting.CanApply = false
EgtOutLog( Cutting.Message)
-- ricerca lavorazione senza considerare massima elevazione
Cutting.Name = ML.FindCutting( 'HeadSide', true, false, nil, 'Longest')
if not Cutting.Name then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found'
Cutting.CanApply = false
EgtOutLog( Cutting.Message)
return Cutting
end
end
Cutting.Type = MCH_OY.MILLING
Cutting.Tool = SawPlusChain.GetToolFromMachining( Cutting.Name)
Cutting.Tool = BL.GetToolFromMachining( Cutting.Name)
-- verifica dimensioni tasca e direzione compatibili
-- se tasca meno spessa della lama la strategia non è applicabile
@@ -5254,7 +5289,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
EgtOutLog( Cutting.Message)
end
end
if EdgeToMachine.ToolDirection:getZ() < BD.NZ_MINA then
if EdgeToMachine.ToolDirection:getZ() < BD.NZ_MINA and BD.C_SIMM then
Cutting.CanApply = false
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : skipped sawblade from bottom'
EgtOutLog( Cutting.Message)
@@ -5435,7 +5470,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
EgtOutLog( Mortising.Message)
end
Mortising.Type = MCH_OY.MORTISING
Mortising.Tool = SawPlusChain.GetToolFromMachining( Mortising.Name)
Mortising.Tool = BL.GetToolFromMachining( Mortising.Name)
-- in caso di tunnel da un lato permetto eventuale inversione lato di lavoro in caso di errori di applicazione (es: Outstroke)
if Proc.Topology == 'Tunnel' and sMortisingType == 'OneSide' or sMortisingType == 'OneSideAndExtend' then
@@ -5635,7 +5670,7 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
end
else
-- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
if Cutting.RadialOffset > 10 * GEO.EPS_SMALL then
if Cutting.CanApply and Cutting.RadialOffset > 10 * GEO.EPS_SMALL then
-- eventuale lavorazione di lama - lato della tasca da cui inizia la lavorazione
if Proc.MainFaces.LongFace.Edges.BottomEdge.IsStartOpen then
Cutting = SawPlusChain.Saw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.SideEdges.StartEdge)
@@ -5813,10 +5848,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local sMyMchFind = 'Pocket'
local nOk, sErr
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
nLundIdFace = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
nLundIdFace, sErr = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, false, b3Solid, bClosedOrthoFaces)
if nOk < 0 then
return false, sErr
elseif nOk > 0 then
sWarn = sErr
bTryWithBlades = false
end
end
@@ -5919,9 +5955,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2)
-- se parametro Q03=2 forzo la fresatura di lato; con Q03=3 forzo solo se la faccia di lavoro non è rivolta verso l'alto +/-10°; per rabbet che guardano in giù sempre fresatura di lato
local bIsRabbetAlongXTowardsBottom = ( Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and Proc.AffectedFaces.Bottom and Proc.AffectedFaces.Left and Proc.AffectedFaces.Right)
local bForceSideMill = bIsRabbetAlongXTowardsBottom or ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( ( Proc.Fct == 4 and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back)) or Proc.Fct == 3 or Proc.Fct == 2))
local bForceSideMill = ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and ( bIsRabbetAlongXTowardsBottom or ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( ( Proc.Fct == 4 and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back)) or Proc.Fct == 3 or Proc.Fct == 2)))
-- se fattibile con fresa BH di fianco e spessore utensile inferiore alla larghezza faccia
local bMakeBySideMill, bHead, bHeadDir, sMilling, dMaxMat, dToolDiam = VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
local bMakeBySideMill, bHead, bHeadDir, sMilling, dMaxMat, dToolDiam = VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill, b3Raw)
if bPrevBhSideMill == nil then
bPrevBhSideMill = bMakeBySideMill
end
@@ -5937,8 +5973,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
vtN, vtN2 = vtN2, vtN
end
end
-- informazioni utensile
local Tool = BL.GetToolFromMachining( sMilling)
-- se lavorazione da sotto e lunga, va divisa in due metà
local bDouble = ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200) and not BD.TURN)
local bDouble = not Tool.IsOnAggregate and ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200) and not BD.TURN)
-- inserisco la lavorazione di fresatura
local sName = 'BHMill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling)
@@ -5974,6 +6012,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
EgtSetMachiningParam( MCH_MP.LITANG, 0)
EgtSetMachiningParam( MCH_MP.LIPERP, dFacElev + BD.CUT_SIC)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, EgtIf( nFacInd == 0, 1, 0), GDB_ID.ROOT)
if vtN2 then
local AddLen = sqrt( dV^2 * ( ( 1 / abs( vtN2:getX())^2) - 1)) + BD.CUT_SIC
EgtSetMachiningParam( MCH_MP.STARTADDLEN, AddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, AddLen)
end
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
EgtSetMachiningParam( MCH_MP.LITANG, dToolDiam / 2 + BD.CUT_SIC)
@@ -6006,6 +6050,22 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- impostazioni per fresa a disco su aggregato
if Tool.IsOnAggregate then
if AreSameVectorApprox( vtN, -Z_AX()) then
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_RIGHT)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
if bHeadDir then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, false)
end
else
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP)
end
end
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -6094,9 +6154,20 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
vtN, vtN2 = vtN2, vtN
sPocketing = ML.FindPocketing( sMchFind, dDiam2, dFacElev2 + dCollSic2)
if not sPocketing then
local sErr = 'Error : '..sMchFind..' not found in library'
EgtOutLog( sErr)
return false, sErr
dDiam, dDiam2 = dDiam2, dDiam
dCollSic, dCollSic2 = dCollSic2, dCollSic
nFacInd, nFacInd2 = nFacInd2, nFacInd
dH, dH2 = dH2, dH
dV, dV2 = dV2, dV
dFacElev, dFacElev2 = dFacElev2, dFacElev
rfFac, rfFac2 = rfFac2, rfFac
vtN, vtN2 = vtN2, vtN
sPocketing = ML.FindPocketing( sMchFind, dDiam2, nil, nil, nil, nil, nil, nil, 'Longest')
if not sPocketing then
local sErr = 'Error : '..sMchFind..' not found in library'
EgtOutLog( sErr)
return false, sErr
end
end
end
-- provo con contornatura
@@ -6165,7 +6236,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if BD.ANG_TRASM and Proc.Fct >= 4 and AreOppositeVectorApprox( vtN, Z_AX()) then
bLapJointAngTrasm = true
-- se orientata verso il basso e non c'è testa da sotto, verifico l'alternativa
elseif vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD and nFacInd2 then
elseif vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD and nFacInd2 and not Proc.OkFromBottom then
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
nFacInd, nFacInd2 = nFacInd2, nFacInd
dFacElev, dFacElev2 = dFacElev2, dFacElev
@@ -6173,7 +6244,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
-- verifico non sia orientata verso il basso o ci sia una testa dal basso o la lavorazione sia dal lato.
local bFaceDown = ( vtN:getZ() < BD.NZ_MINA)
if bFaceDown and not BD.DOWN_HEAD and not BD.TURN and not bForceSideMill and not bLapJointAngTrasm then
if bFaceDown and not BD.DOWN_HEAD and not BD.TURN and not bForceSideMill and not bLapJointAngTrasm and not Proc.OkFromBottom then
local sErr = 'Error : LapJoint from bottom impossible'
EgtOutLog( sErr)
return false, sErr
@@ -6297,6 +6368,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if sMyPocketing and
( dMyTMaxDepth > dFacElev + dCollSic - 10 * GEO.EPS_SMALL or ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic and not bIsU) or
( bIsL and nUseRoughTool == 0) or
( bIsL and Proc.Prc == 20) or
( Proc.Prc == 25 and not bIsU and not bIsL)) or
( dUserMaxElev and dUserMaxElev > 10 * GEO.EPS_SMALL) then
sPocketing = sMyPocketing
@@ -6359,6 +6431,21 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
bUseOtherFace = true
rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
end
-- se forma a U (recupero la larghezza della faccia perpendicolarmente alle altre)
if Proc.Fct == 3 and bIsU then
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, EgtIf( nFacInd == 0, 1, 0), GDB_ID.ROOT)
local vtX = vtN2 ^ vtN
if not vtX:isSmall() then
local frRef = Frame3d( ptC, ptC + 100 * vtX, ptC + 100 * vtN2)
local b3Ref = EgtSurfTmGetFacetBBoxRef( Proc.Id, nFacInd, GDB_BB.STANDARD, frRef)
if b3Ref then
dH = b3Ref:getDimX()
dV = b3Ref:getDimY()
end
end
end
-- eseguo
bOk, sWarn, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
rfFac, dH, dV, dFacElev, bForceUseBlade,
@@ -6879,8 +6966,10 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- superficie di fondo
nSurfBottomId = EgtSurfTmPlaneInBBox( nAddGrpId, ptMaxBox, vtOrtho, b3SolidExtended, GDB_ID.ROOT)
-- calcolo di quanto allargare le superfici
local dWidth = EgtIf( Proc.AffectedFaces.Front, Proc.Box:getDimZ(), Proc.Box:getDimY())
dAddLen = min( dWidth, 100) / 2
if dAddLen == 0 then
local dWidth = EgtIf( Proc.AffectedFaces.Front, Proc.Box:getDimZ(), Proc.Box:getDimY())
dAddLen = min( dWidth, 100) / 2
end
end
-- la divido in parti lungo X
local vAddId = {}
@@ -6967,7 +7056,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
for i = 1, #vAddId do
local b3Box = EgtGetBBoxGlob( vAddId[i], GDB_BB.STANDARD)
local nFct = EgtSurfTmFacetCount( vAddId[i])
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg, PartId = Proc.PartId, TaskId = Proc.TaskId, FeatureId = Proc.FeatureId, IsSplittedLapJoint = true, AffectedFaces = Proc.AffectedFaces}
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg, PartId = Proc.PartId, TaskId = Proc.TaskId, FeatureId = Proc.FeatureId, IsSplittedLapJoint = true, AffectedFaces = Proc.AffectedFaces, OkFromBottom = Proc.OkFromBottom}
Topology.Classify( AddProc, b3Raw)
-- lasciare il false nel sesto parametro (perchè internamente viene verificato se diverso da nil)
local bOk, sMyWarn
@@ -7014,11 +7103,9 @@ local function TestTwoFacesDownHead( Proc)
if not ( Proc.Face[1].IsTooDownwardForTopBlade or Proc.Face[2].IsTooDownwardForTopBlade) then
bDownHeadBlade = false
else
for i = 1, Proc.Fct do
if Proc.Face[i].IsTooDownwardForTopBlade and ( not Proc.IsTopDownRabbet or Proc.Face[i].IsTooWideForTopBlade) then
bDownHeadBlade = true
break
end
if ( Proc.Face[1].IsTooDownwardForTopBlade and Proc.Face[2].IsTooWideForTopBlade) or
( Proc.Face[2].IsTooDownwardForTopBlade and Proc.Face[1].IsTooWideForTopBlade) then
bDownHeadBlade = true
end
end
end
@@ -7241,13 +7328,16 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- in base al tipo di feature attribuisco il significato dei parametri Q
AssignQIdent( Proc)
-- se non forzate frese, uso la lama
local bUseBlade = EgtIf( Proc.Prc == 90, false, EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1)
local bUseBlade = EgtIf( Proc.Prc == 90 or Proc.bForceMill, false, EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1)
local nForceUseBladeOnNotContinueFace
-- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature
if bUseBlade then
if Proc.Prc == 30 or Proc.Prc == 20 then
local nBladeAntisplint = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') or 0
local nUseRoughToolOnSide = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0
if nUseRoughToolOnSide == 4 and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) then
nUseRoughToolOnSide = 0
end
nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, Q_BLADE_ON_ALONG_FACE, 'i') or 0
-- se antischeggia di fresa o abilitato sgrossatore di fianco
if nBladeAntisplint == 2 or nUseRoughToolOnSide > 0 then
@@ -7273,7 +7363,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se lunghezza richiede spezzatura
if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) or
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > BD.LEN_SHORT_PART or 1000)) then
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then
-- una faccia
if Proc.Fct == 1 then
if bUseBlade then
@@ -7382,6 +7472,14 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se è una spianatura a una faccia richiamo la LongCut
elseif Proc.Prc == 90 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
-- se arriva da una cut si applica una svuotatura
elseif Proc.Prc == 10 then
local dDiam = min( Proc.Face[1].Height, Proc.Face[1].Width) * 3
local bMillUp = ( BD.DOWN_HEAD and Proc.Face[1].VtN:getZ() > -0.259)
local bMillDown = ( BD.DOWN_HEAD and Proc.Face[1].VtN:getZ() < 0.342)
local sMchFindMaster = 'OpenPocket'
local _, sPocketing = VerifyPocket( Proc, dDiam, nil, nil, sMchFindMaster, bMillUp, bMillDown)
return Fbp.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
-- altrimenti, con lama
else
return Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
@@ -7413,10 +7511,26 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- determino l'angolo tra le facce
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
-- se con BH
if VerifyBHSideMill( Proc) then
if VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw) then
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, true)
-- se ortogonali e non forzata lama, con fresa
elseif not bUseBlade then
-- verifico se devo fare prima gli smussi
-- 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
-- verifiche per smusso
local nChamfer, dDepthCham, sErrCham = EvaluateQParam( Proc)
-- se smusso da fare
if nChamfer > 0 then
local _, _, _, vtOrtho, _, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
if nOk < 0 then return false, sErr end
end
-- se piccole
if Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN) and bAdj and abs( dAng + 90) < 1 then
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHeadMill)
+38 -10
View File
@@ -286,9 +286,11 @@ local function CalcBladeUse( bUseBlade, bDown_Head, nSide, vtN1, vtN2, bConvex,
end
end
else
if ( vtN1 and vtN1:getZ() >= EgtIf( dCustomAngle, dCustomAngle, -0.5)) and ( not vtN2 or vtN2:getZ() >= -0.5) then
bCanUseBlade = true
end
--if ( vtN1 and vtN1:getZ() >= EgtIf( dCustomAngle, dCustomAngle, -0.5)) and ( not vtN2 or vtN2:getZ() >= -0.5) then
-- bCanUseBlade = true
--end
-- viene abilitata sempre lama da sotto
bCanUseBlade = true
end
end
end
@@ -423,12 +425,22 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- analisi del taglio
local vOrd = {}
local vFaceUse = {}
local bIsMachDownUp = false
if nSide == 1 or ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN)) then
vOrd = EgtIf( ptC[1]:getY() < ptRef:getY(), { 1, 2}, { 2, 1})
vFaceUse = { BL.GetNearestOrthoOpposite( ptC[1] - ptM), BL.GetNearestOrthoOpposite( ptC[2] - ptM)}
elseif nSide == -1 then
vOrd = EgtIf( ptC[1]:getY() < ptRef:getY(), { 1, 2}, { 2, 1})
vFaceUse = { BL.GetNearestParalOpposite( ptC[1] - ptM), BL.GetNearestParalOpposite( ptC[2] - ptM)}
local vtFaceUse1, vtFaceUse2
if bCanUseBlade and not BD.DOWN_HEAD then
bIsMachDownUp = true
vtFaceUse1 = BL.GetOrtupOpposite( BL.GetNearestOrthoOpposite( ptC[1] - ptM))
vtFaceUse2 = BL.GetOrtupOpposite( BL.GetNearestOrthoOpposite( ptC[2] - ptM))
else
vtFaceUse1 = BL.GetNearestParalOpposite( ptC[1] - ptM)
vtFaceUse2 = BL.GetNearestParalOpposite( ptC[2] - ptM)
end
vFaceUse = { vtFaceUse1, vtFaceUse2}
else
local bFront = ( ( vtN[1]:getY() + vtN[2]:getY()) < 0)
if bFront then
@@ -442,6 +454,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local vWidth = {}
_, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[1])
_, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[2])
local vElevation = { vWidth[2], vWidth[1]}
-- 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 ( bCanUseUnderBlade or bCanUseBlade) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then
@@ -850,7 +863,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- 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
if bIsCurrentBladeCCW and not bIsMachDownUp then
nWorkSide = MCH_MILL_WS.LEFT
bInvert = true
dSal, dEal = dEal, dSal
@@ -859,7 +872,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
bInvert = false
end
else
if bIsCurrentBladeCCW then
if bIsCurrentBladeCCW and not bIsMachDownUp then
nWorkSide = MCH_MILL_WS.LEFT
bInvert = false
else
@@ -1066,6 +1079,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
if nSide == -1 and BD.DOWN_HEAD then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
elseif nSide == -1 and not BD.DOWN_HEAD and bIsMachDownUp then
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( EgtGetMachiningParam( MCH_MP.INVERT), false, true))
dOffset = 5
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
@@ -1311,6 +1329,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
if nSide == 1 or nSide == -1 then
local bFromYM = (( vtN[vOrd[i]]:getY() < 0 and bConvex) or ( vtN[vOrd[i]]:getY() > 0 and not bConvex))
nSCC = EgtIf( bFromYM, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
if BD.TURN == 2 and not bFromYM then
nSCC = EgtIf( nSide == -1, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
end
else
local bFromZM = (( vtN[vOrd[i]]:getZ() < 0 and bConvex) or ( vtN[vOrd[i]]:getZ() > 0 and not bConvex))
nSCC = EgtIf( bFromZM, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
@@ -1325,7 +1346,13 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local dStep = 0
local dAgg = EgtIf( bConvex, 2 * BD.CUT_EXTRA, BD.CUT_EXTRA)
local dLargh = vWidth[vOrd[i]]
if not bSide and dLargh > 0.8 * dToolDiam then
-- controllo se lavorazione completa
local dMachDepth = vElevation[vOrd[i]]
if dMachDepth > dMaxDepth - 10 * GEO.EPS_ANG_SMALL then
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
if not bSide and dLargh > 0.8 * dToolDiam then
nO = ceil( dLargh / ( 0.6 * dToolDiam))
if nO > 1 then
dStep = dLargh / nO
@@ -1358,7 +1385,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
--EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, BL.GetParallelOpposite( vFaceUse[vOrd[i]]), vFaceUse[vOrd[i]]))
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, MCH_MILL_FU.PARAL_DOWN, vFaceUse[vOrd[i]]))
-- imposto lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bIsMachDownUp, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bSide, true, false))
-- imposto offset radiale (nullo se concavo o di lato)
local dOffsR = EgtIf( k < nO, ( nO - k) * dStep, EgtIf( bConvex, - BD.CUT_EXTRA, 0))
@@ -1402,7 +1429,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
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}
local AddProc = { Id = AddId, Grp = 0, Prc = 12, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
PartId = Proc.PartId, TaskId = Proc.TaskId, CutId = Proc.CutId, bMoveAfterSplit = true}
Topology.Classify( AddProc, b3Raw)
table.insert( AddedIds, AddProc)
end
@@ -1793,7 +1821,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end
end
-- imposto lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bIsMachDownUp, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
EgtSetMachiningParam( MCH_MP.INVERT, true)
-- calcolo la componente dNz non in base alla classificazione della feature (sopra, sotto, fianchi) ma alla componente maggiore
-- local dNz = EgtIf( nSide == 0, vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
+103
View File
@@ -0,0 +1,103 @@
-- ProcessSplit.lua by Egaltech s.r.l. 2025/06/20
-- Gestione tastatura
-- Tabella per definizione modulo
local ProcessProbing = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
-- Dati
local ML = require( 'MachiningLib')
---------------------------------------------------------------------
local function GetProbingMachining( Machinings, sHead)
local sProbeMachining, sHeadTool
-- TODO questa associazione "testa utensile"-"testa tastatore" dovrebbe essere spostata nella macchina.
-- Non è detto che se testa utensile inizia con "H2" allora bisogna prendere lavorazione con "_H2"
-- se la testa utilizzata dalla lavorazione inizia con H2, dovrebbe essere la seconda testa
if EgtStartsWith( sHead, 'H2') then
sHeadTool = '_H2'
else
sHeadTool = '_H1'
end
for i = 1, #Machinings do
if EgtEndsWith( Machinings[i].Name, sHeadTool) then
sProbeMachining = Machinings[i]
return sProbeMachining
end
end
sProbeMachining = Machinings[1]
return sProbeMachining
end
---------------------------------------------------------------------
local function MoveProbePointToRawFaces( ptProbe, vtProbe, nPartId)
local b3BoxPart = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- si porta linea di tastatura su grezzo
if AreSameVectorApprox( vtProbe, Z_AX()) then
ptProbe[3] = b3BoxPart:getMax():getZ()
elseif AreSameVectorApprox( vtProbe, -Z_AX()) then
ptProbe[3] = b3BoxPart:getMin():getZ()
elseif AreSameVectorApprox( vtProbe, Y_AX()) then
ptProbe[2] = b3BoxPart:getMax():getY()
elseif AreSameVectorApprox( vtProbe, -Y_AX()) then
ptProbe[2] = b3BoxPart:getMin():getY()
end
return ptProbe
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessProbing.Make( Proc, nPartId, Info)
local bOk, sErr
-- per eseguire tastatura servono tutti i dati, altriemnti impossibile
if Info.vtProbe and Info.ptProbe and Info.sType then
Info.ptProbe = MoveProbePointToRawFaces( Info.ptProbe, Info.vtProbe, nPartId)
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
local nIdLine = EgtLinePVL( nAddGrpId, Info.ptProbe, Info.vtProbe, 10, GDB_RT.GLOB) -- TODO lunghezza da portare fuori come parametro
local Machinings = GetMachinings( MCH_MY.PROBING, Info.sType)
-- se c'è almeno una lavorazione, allora devo fare tastatura
if Machinings and #Machinings > 0 then
local sProbing = GetProbingMachining( Machinings, Info.sHead)
-- se c'è la linea e la lavorazione, applico
if sProbing and nIdLine then
local sName = 'DtMtProbe_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sProbing.Name)
-- si inverte la direzione della linea, deve essere entrante, oppostaa vettore estrusione
EgtInvertCurve( nIdLine)
-- aggiungo geometria
EgtSetMachiningGeometry( {{ nIdLine, -1}})
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
else
bOk = true
end
else
bOk = false
sErr = 'Error on probing'
end
-- altrimenti tastatura non richiesta, esco
else
return true
end
else
bOk = false
sErr = 'Error on probing'
end
return bOk, sErr
end
---------------------------------------------------------------------
return ProcessProbing
+7 -1
View File
@@ -639,7 +639,13 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
end
-- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
local nSCC = MCH_SCC.ADIR_NONE
if BD.TURN == 2 then
nSCC = MCH_SCC.ADIR_ZP
else
nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
local ptSP, ptEp
local bFinish
+17 -3
View File
@@ -50,6 +50,7 @@ end
-- Applicazione della lavorazione
function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, 'Q04', 'i') or 0
local bUseMill = ( EgtGetInfo( Proc.Id, 'Q05', 'i') or 0) == 1
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
@@ -139,6 +140,9 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
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 bUseMill then
Proc.bForceMill = true
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
elseif nForceUseBladeOnNotContinueFace > 0 then
EgtSurfTmRemoveFacet( Proc.Id, vFaceOrd[1] - 1)
Proc.Fct = Proc.Fct - 1
@@ -169,7 +173,7 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- calcolo riferimenti per facce inclinate
local vtRef = Vector3d( vtN[vFaceOrd[3]])
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
local vtRef2 = Vector3d( vtN[vFaceOrd[2]])
-- eseguo
for i = 1, #vCuts do
local nOrthoOpposite
@@ -209,7 +213,12 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
else
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
-- se feature inclinata, si va oltre ingombro del box. Si considera metà dell'ingombro della faccia inclinata
if vtN[vFaceOrd[2]] and vtN[vFaceOrd[2]]:getZ() > 0 then
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() - ( vtN[vFaceOrd[2]]:getZ() * b3Raw:getDimZ())
else
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
end
end
BL.UpdateHCING( nRawId, dHCI)
elseif Proc.Tail then
@@ -218,7 +227,12 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
else
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
-- se feature inclinata, si va oltre ingombro del box. Si considera metà dell'ingombro della faccia inclinata
if vtN[vFaceOrd[2]] and vtN[vFaceOrd[2]]:getZ() > 0 then
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX() - ( vtN[vFaceOrd[2]]:getZ() * b3Raw:getDimZ())
else
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
end
end
BL.UpdateTCING( nRawId, dTCI)
end
+2
View File
@@ -239,6 +239,8 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
nSCC = MCH_SCC.ADIR_YP
end
elseif BD.TURN == 2 then
nSCC = MCH_SCC.ADIR_ZP
elseif BD.TURN then
if vtN:getZ() > 0.707 then
nSCC = MCH_SCC.ADIR_ZP
+52 -17
View File
@@ -196,28 +196,53 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
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)
-- se non ho intersezione con la faccia tappo posso fare il taglio sul fianco
if not nGoodFace1 or nGoodFace1 == 0 then
-- controllo per eseguire solo un taglio ottimizzato
local bExecJustOneCut = false
local dDiceFaceDim = GEO.INFINITO
if ( i % 2) == 0 then
for cont = 1, #vCuts[i] do
local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][cont], 0)
-- se feature verso Z, si ammette anche lavorazione in doppio
if AreSameVectorApprox( vtRef, Z_AX()) then
if dMaxDepth * 2 > dDiceFaceH + BD.CUT_EXTRA then
bExecJustOneCut = true
dDiceFaceDim = dDiceFaceH
break
end
elseif AreSameVectorApprox( vtRef, Y_AX()) or AreSameVectorApprox( vtRef, -Y_AX()) then
if dMaxDepth > dDiceFaceV + BD.CUT_EXTRA then
bExecJustOneCut = true
dDiceFaceDim = dDiceFaceV
break
end
end
end
end
-- se c'è intersezione non ci deve essere ExtraCut
else
dExtraCut = 0
end
-- se si può fare, faccio unico taglio parallelo
if ( i % 2) == 0 and ( dMaxDepth > dDiceFaceMaxH - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN) then
if bExecJustOneCut then
local bDoubleCut = false
local dCutExtra = BD.CUT_EXTRA
if dMaxDepth < dDiceFaceMaxH + BD.CUT_EXTRA then
if dMaxDepth < dDiceFaceDim 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
local nFaceUseCut1, nFaceUseCut2
-- se feature rivolta verso alto setto direzione taglio davanti e dietro
if AreSameVectorApprox( vtRef, Z_AX()) then
nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT
-- altrimenti taglio da sopra
else
nFaceUseCut2 = MCH_MILL_FU.ORTHO_DOWN
end
if Proc.Tail and AreSameVectorApprox( vtRef, Z_AX()) then
nFaceUseCut1, nFaceUseCut2 = nFaceUseCut2, nFaceUseCut1
end
if bDoubleCut then
@@ -424,7 +449,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
if not nGoodFace1 or nGoodFace1 == 0 then
-- inserisco la lavorazione
local vtRef2 = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, Z_AX(), EgtIf( bHead, Y_AX(), -Y_AX()))
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOkd then return bOkd, sErrD end
-- lavoro la faccia opposta (definita dal parametro P11)
if vFaceOrd[3] ~= 0 then
@@ -503,10 +528,20 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
else
dDiamMax = EgtIf( abs( frMor:getVersX():getY()) < abs( frMor:getVersY():getY()), dL, dW)
end
-- determino la distanza tra le due facce inclinate
-- determino la distanza tra le due facce inclinate per determinare elevazione
local dDistFaces
if vFaceOrd[4] ~= 0 then
dDistFaces = abs((ptC[vFaceOrd[2]]-ptC[vFaceOrd[4]])*vtN[vFaceOrd[2]])
local nElevationFace1 = 0
-- controllo estensione faccia 1
if vFaceOrd[1] ~= 0 then
frMor, dL, dW = EgtSurfTmFacetMinAreaRectangle( Proc.Id, vFaceOrd[1]-1, GDB_ID.ROOT)
if abs(vtRef:getY()) > 0.866 then
nElevationFace1 = EgtIf( abs( frMor:getVersX():getZ()) < abs( frMor:getVersY():getY()), dL, dW)
else
nElevationFace1 = EgtIf( abs( frMor:getVersX():getY()) < abs( frMor:getVersY():getY()), dL, dW)
end
end
dDistFaces = max( abs((ptC[vFaceOrd[2]]-ptC[vFaceOrd[4]])*vtN[vFaceOrd[2]]), nElevationFace1)
end
-- recupero la lavorazione. considerando l dimensione del lato e l'affondamento
local sPocketing
+29 -19
View File
@@ -336,7 +336,7 @@ end
---------------------------------------------------------------------
-- tagli verticali aggiuntivi
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes)
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes, dOffsetBetweenCuts)
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
@@ -352,8 +352,8 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes)
for j = nVerticalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
local dVerticalCutOffset = dVerticalSliceHeight * -j
local bForceTangentLeadInOut = BD.PRESS_ROLLER and not BD.DOWN_HEAD
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)
local sLeadInOutType = 'PerpendicularOutraw'
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, sLeadInOutType, nil, dOffsetBetweenCuts)
if not bOk then return bOk, sErr end
end
@@ -374,7 +374,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCut
local dCutExtra = 0
local dAccStart = 0
local dAccEnd = 0
if TailCutType.bBigSectionCut and BD.C_SIMM then
if TailCutType.bBigSectionCut and BD.C_SIMM and b3Raw:getDimZ() > BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL 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)
@@ -422,8 +422,8 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCut
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)
local sLeadInOutType = 'PerpendicularOutraw'
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, sLeadInOutType, nil, dOffsetBetweenCuts)
if not bOk then return false, sErr end
end
-- se necessario taglio verticale doppio, eseguo l'opposto
@@ -472,7 +472,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCut
-- 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)
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, sSpecNotes, dOffsetBetweenCuts)
if not bOk then return bOk, sErr end
end
if i == 1 and TailCutType.sType =='Precut' then
@@ -541,7 +541,7 @@ local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCut
-- 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)
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, sSpecNotes, dOffsetBetweenCuts)
if not bOk then return bOk, sErr end
end
local sNotes
@@ -573,7 +573,15 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
if not bOkc then return bOkc, sErrC end
end
-- recupero la lavorazione
local sCutting = ML.FindCutting( 'TailSide')
-- TODO questa parte andrà cambiata quando si gestiranno i volumi liberi in cui girare da mlse
local dMinWidthForBigBlade = 300
local dMaxHeightForBigBlade = 300
local sCutting
if b3Raw:getDimY() > dMinWidthForBigBlade and b3Raw:getDimZ() < dMaxHeightForBigBlade then
sCutting = ML.FindCutting( 'TailSide', nil, nil, nil, 'Longest')
else
sCutting = ML.FindCutting( 'TailSide')
end
if not sCutting then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library'
EgtOutLog( sErr)
@@ -623,10 +631,11 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
-- caratteristiche taglio
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dSawMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dSawMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dSawMaxDepth2) - 2 * BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA))
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) and
( b3Raw:getDimY() < 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
-- dati geometrici del taglio
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
-- separazione solo se esiste grezzo successivo con pezzi o scaricabile
@@ -652,7 +661,10 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
-- 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)
local bNeedHorizontalAddedCuts = not bSplit and not bBigSectionCut and
( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and
( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) and
dOffsL < BD.MAX_DIM_DICE
-- 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}
@@ -759,18 +771,16 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
if AreOppositeVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
end
-- tagli verticali
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw, sNotes)
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw, sNotes, dOffsL)
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)
local sLeadInOutType = 'PerpendicularOutraw'
bOk, sErr = Cut.Make( AddProc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nLimitingSurf, sLeadInOutType)
end
-- tagli aggiuntivi non necessari
else
local bForceTangentLeadInOut = false
if BD.PRESS_ROLLER then
bForceTangentLeadInOut = true
end
bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nil, bForceTangentLeadInOut)
local sLeadInOutType = 'PerpendicularOutraw'
bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nil, sLeadInOutType)
end
if sNotesFinal then
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
+8 -3
View File
@@ -132,7 +132,12 @@ local function MakePocket( Proc, nPartId, ptPs, vtN, nFaceRef, nDiffWidth, sMchF
-- calcolo il diametro utensile
local dDiamTool
if nUseRoughTool == 1 then
dDiamTool = max( 80, min( tBHx[nFaceRef][1], tBHx[nFaceRef][2]))
-- se feature passante prendo utensile più grande possibile
if ( Proc.AffectedFaces.Top and Proc.AffectedFaces.Bottom) or ( Proc.AffectedFaces.Front and Proc.AffectedFaces.Back) then
dDiamTool = nil
else
dDiamTool = max( 80, min( tBHx[nFaceRef][1], tBHx[nFaceRef][2]))
end
else
-- se non uso truciolatore prendo il valore dalle dimensioni minime delle facce
dDiamTool = min( tBHx[nFaceRef][1], tBHx[nFaceRef][2])
@@ -283,8 +288,8 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN,
-- setto a 0 eventuali offset
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
-- applico gli allungamenti o accorciamenti considerando che la lavorazione è invertita
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, dTDiam / 2, - dTDiam / 2))
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, dTDiam / 2, - dTDiam / 2))
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, dTDiam / 2 + 10, - dTDiam / 2))
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, dTDiam / 2 + 10, - dTDiam / 2))
-- attacchi e uscite lineari con parte tg nulla
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
EgtSetMachiningParam( MCH_MP.LITANG, 0)
+2 -2
View File
@@ -321,9 +321,9 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se contorno aperto, cambio parametri di attacco/uscita
if not bClosed then
EgtSetMachiningParam( MCH_MP.LITANG, 0.7 * dMillDiam)
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
EgtSetMachiningParam( MCH_MP.LIPERP, 20)
EgtSetMachiningParam( MCH_MP.LOTANG, 0.7 * dMillDiam)
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
EgtSetMachiningParam( MCH_MP.LOPERP, 20)
end
-- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE
+121
View File
@@ -1,5 +1,126 @@
==== Beam Update Log ====
Versione 2.7f3 (19/06/2025)
- Modifx : in StepJointNotch corretta distanza attacco in/out
Versione 2.7f2 (18/06/2025)
- Modif : in LongDoubleCut aggiunto messaggio feature non completa se utensile non arriva sul fondo
- Modif : in StepJointNotch, se si forza truciolatore, si prende utensile più grande
- Fixed : in LapJoint, piccola correzione calcolo sovrapposizione trimesh per smuotatura
- Fixed : in LapJoint, per sovrapposizione in spezzatura, corretto caso tipo Tunnel
Versione 2.7f1 (03/06/2025)
- Modif : in tenone coda di rondine modificato angolo limite tenone per lavorazione in sottosquadro
- Modif : migliorie per lavorazioni su aggregato
Versione 2.7e2 (23/05/2025)
- Modif : in tagli di lama migliorie alla scelta del lato da lavorare
- Modif : in mortasa coda di rondine migliorati i percorsi
- Modif : in tenone coda di rondine migliorate le lavorazioni da sotto
- Fixed : in Scarf Joint correzione alla scelta faccia da lavorare
Versione 2.7e1 (05/05/2025)
- Fixed : in taglio di separazione si riduce percorso di taglio solo se il pezzo è effettivamente alto
- Fixed : in foratura corretto caso in cui non si sceglieva l'utensile più lungo disponibile
- Fixed : In BatchProcess (Ts7) corretta generazione in caso di progetto senza ricalcolo
- Modif : in LapJoint se tunnel verticale lavorato solo da sopra e l'utensile non arriva, si restituisce warning
Versione 2.7d3 (22/04/2025)
- Fixed : in LapJoint corretta gestione errata Q04
Versione 2.7d2 (17/04/2025)
- Added : in scanalatura aggiunta Q03 per forzare fresa
- Modif : in slot con lama + sega a catena abilitata lavorazione da sotto per macchine con testa sopra
- Modif : nei tagli modifche in caso di tagli di coda anticipati
- Modif : in lavorazioni tipo tacca ma 3 facce migliorata la scelta faccia
Versione 2.7d1 (04/04/2025)
- Fixed : in PreDrill piccola correzione
- Fixed : nei tagli varie correzioni
- Fixed : in HeadCut e Split corretto calcolo lunghezza extra di taglio
Versione 2.7c2 (24/03/2025)
- Fixed : in BatchProcess (Ts7) riabilitata modifica barra erroneamente rimossa
Versione 2.7c1 (17/03/2025)
- Modif : in HeadCut e Split, per decidere se fare doppio taglio verticale, si controlla anche il massimo possibile e non solo il minimo
- Modif : in LapJoint migliorato controllo per decidere se feature di coda
- Modif : nei tagli, se taglio rivolto verso il basso e non possibile tagliare di fianco, si fa in fase ribaltata
- Fixed : in BatchProcess (Ts7) corretta restituzione stato feature erroneamente segnalata verde
- Fixed : corretta restituzione stato feature lavorata in doppio
Versione 2.7b3 (03/03/2025)
- Modif : in forature passanti orizzontali fatte da un solo lato, si inverte il lato di lavoro in base all'utensile scelto
- Modif : in LapJoint in lavorazione tipo BH permessa U passante non parallela agli assi principali; attacchi migliorati
- Modif : in LapJoint le feature di coda con pezzo lungo vengono spostate sempre dopo separazione
- Fixed : in macchine tipo Turn piccoli miglioramenti ai tagli di lama
Versione 2.7b2 (05/02/2025)
- Modif : si consentono DrillPocket in doppio solo se foro non passante
Versione 2.7b1 (04/02/2025)
- Modif : in tagli di testa e coda l'utilizzo delle lame grandi (es: 1000 su 15003TMAX) è limitato ai pezzi più bassi di 300 mm e più larghi di 300 mm
Versione 2.7a2 (23/01/2025)
- Added : in RidgeLap aggiunta Q05 per usare la fresa tipo LapJoint
- Fixed : in BatchProcess (Ts7) piccola correzione
- Fixed : in ScarfJoint, in caso di taglio dal lato, aggiunta estensione oltre il bordo
Versione 2.7a1 (21/01/2025)
- Added : in FreeContour aggiunta Q09 per inversione ultima lavorazione
- Modif : in Cut, si taglia dal basso solo se il pezzo piccolo è già staccato dalla barra
- Modif : in BatchProcess (Ts7) aggiunta scrittura id progetto e produzione in Btm
Versione 2.6l2 (07/01/2025)
- Added : in LapJoint abiitata SideMillAsBlade anche da sotto e varie migliorie
- Modif : in LapJoint L030 aggiunto Q03=4 per lavorare con fresa evitando tasche aperte testa/coda
- Modif : in LapJoint modifiche per gestione fresa a disco su aggregato
- Modif : in fresature con lama o simili aggiunta la possibilità di invertire il senso di percorrenza calcolato in automatico
- Modif : migliorie all'ordinamento
- Fixed : in LapJoint la Q per forzare lavorazione di lato funziona solo se la feature è aperta davnti o dietro
Versione 2.6l1 (11/12/2024)
- Added : aggiunta gestione slot e tagli di lama con lame molto grandi
- Modif : in lama + motosega aggiunta gestione slot aperte con lato obliquo
- Modif : modificata retrazione per tenoni aperti
Versione 2.6k2 (28/11/2024)
- Modif : nei tagli migliorati i casi in cui si inverte l'SCC per facilitare la caduta del legno
- Modif : nei tagli migliorato controllo rimozione del primo cubetto molto piccolo
- Modif : nei tagli migliorati i casi con bilinea
- Fixed : in lapjoint corretto un caso in cui si sbagliava a calcolare la dimensione della tasca
Versione 2.6k1 (15/11/2024)
- Modif : in macchine tipo Fast lunghezza minima feature per considerare taglio lungo portata a 400 mm
- Modif : in tacche si applica svuotatura anche nel caso di elevazione non raggiunta
- Modif : in forature in doppio, se necessario, si aumenta lo step per evitare collisione tra le punte durante lavorazione
- Fixed : in L010 correzione in utilizzo Q07 (forzatura frese)
- Fixed : in coda di rondine corretto bug che causava un blocco anomalo del programma
Versione 2.6j4 (06/11/2024)
- Fixed : corretto caso in cui i fori passanti fatti con due teste finiviano nella rotazione sbagliata, provocando un errore di chariot collision
Versione 2.6j3 (18/10/2024)
- Modif : nei tagli orizzontali si inverte SCC per evitare problemi di cubetti incastrati
- Modif : modifiche in ordinamento fori che intersecano tenoni
- Fixed : corretto caso con fori sul tenone spostati in coda nella fase errata
Versione 2.6j2 (17/10/2024)
- Fixed : in forature con precedenza corretto caso in cui il foro veniva ripetuto in rotazioni diverse
Versione 2.6j1 (10/10/2024)
- Modif : se la macchina è tipo BlockHaus, i LapJoint vengono fatti prima del taglio di separazione
- Modif : se tenone di coda è attraversato da foro allora anche il foro sarà di coda
- Modif : migliorato ordinamento per tenoni con foro secante
- Modif : in FreeContour migliorato pinzaggio
- Modif : in LapJoint miglioramenti vari alla lavorazione delle facce oblique
- Modif : In RidgeLap l'ingombro testa coda considera inclinazione feature per pinzaggio
- Added : in FreeContour aggiunta Q08 per forzare come pinzabile l'area della feature e Q07 per ignorare possibili problemi di lettura laser
- Added : in tagli aggiunta Q07 per forzare uso fresa
Versione 2.6i3 (08/10/2024)
- Modif : In RidgeLap, ingombro testa coda considera inclinazione feature per pinzaggio.
Versione 2.6i2 (13/09/2024)
- Modif : in FacesBySaw si invertono gli accorciamenti solo se l'inversione del percorso non è forzata dall'esterno; adeguati HeadCut e Split
- Modif : in nesting correzione in lettura array per cambio dll di lettura
+2 -2
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di Beam
NAME = 'Beam'
VERSION = '2.6i2'
MIN_EXE = '2.6e5'
VERSION = '2.7f3'
MIN_EXE = '2.7f2'