Compare commits

...

170 Commits

Author SHA1 Message Date
andrea.villa a8d0bcfec4 In DtTenon, aumentato angolo limite per decidere se ribaltare trave 2025-09-25 10:01:59 +02:00
andrea.villa 459eff5610 In Long2Cut, se le due facce sono ortogonali, si predilige lavorazione perpendicolare, con minore elevazione. 2025-09-23 12:51:31 +02:00
andrea.villa a749895229 In DtTenon, si controlla grezzo successivo per decidere se è necessario tagliare dal basso per ridurre sporgenza trave. 2025-09-18 09:32:50 +02:00
andrea.villa 04489421e7 In ProcessCut, si fa taglio verso Z solo se è possibile avere una direzione di taglio orizzontale e non in verticale. Altrimenti cerca sempre di scegliere in verticale. 2025-09-18 08:42:57 +02:00
andrea.villa 0c16b5e969 In LapJoint, revert della modifica fatta 12-09-2025 . Se la feature veniva lavorata giusto prima dello scarico, la pinza di scarico, che non si poteva più spostare, andava in extra-corsa. 2025-09-17 09:20:09 +02:00
andrea.villa 9193924fbd In Long2Cut, aggiunta tolleranza per calcolo SCC 2025-09-15 17:01:24 +02:00
andrea.villa adbd5e944e In Long2Cut, se lavorazione non completa si prova a lavorare altra facia solo se la feature è composta da due facce 2025-09-12 13:21:33 +02:00
andrea.villa f76797cbd8 In LapJoint, se non è trave corta e la feature è aperta in coda, si sposta dopo separazione a patto che non sia più lunga di metà trave circa 2025-09-12 12:56:42 +02:00
andrea.villa 09e93d600d In DtMortise, se il percorso sul quale calcolare antischeggia non è piano, si salta la lavorazione. 2025-09-03 15:04:20 +02:00
andrea.villa 63f4df2a7d Merge remote-tracking branch 'origin/master' into develop 2025-09-03 10:29:07 +02:00
andrea.villa 80c5035c74 #HOTFIX# Passaggio finitura tenone P14>0
- Corretto calcolo FaceUse
- Si cicla sulle ultime 5 facce anziché solo ultima
2025-09-03 10:28:53 +02:00
luca.mazzoleni c9451e65e1 Merge tag '2.7i1' into develop
2.7i1
2025-09-03 09:25:59 +02:00
luca.mazzoleni 19706d6264 Merge branch 'release/2.7i1' 2025-09-03 09:25:48 +02:00
luca.mazzoleni 46ca7c793f update version e log 2025-09-03 09:25:31 +02:00
andrea.villa e26540193c Aggiunto passaggio di finitura in caso il tenone non cominci dal bordo della trave (P14 > 0) 2025-09-02 15:35:20 +02:00
andrea.villa af107a780e Piccola modifica a valori di ritorno della funzione GetFaceWithMostAdj 2025-09-02 11:55:27 +02:00
andrea.villa 4befa4eee3 Gestione della funzione EgtSurfTmFacetElevationInClosedSurfTm in caso ritorni nil 2025-09-02 10:50:11 +02:00
luca.mazzoleni 07db2da825 - in LapJoint miglioria a TestTwoFacesDownHead 2025-08-28 16:40:21 +02:00
luca.mazzoleni a4e6600510 Merge tag '2.7h3' into develop
2.7h3
2025-08-26 08:46:18 +02:00
luca.mazzoleni cb8465d977 Merge branch 'release/2.7h3' 2025-08-26 08:46:12 +02:00
luca.mazzoleni e867e1decf update log e version 2025-08-26 08:46:04 +02:00
luca.mazzoleni 1cd697cf80 Merge branch 'ConsiderHeadTailCutsForElevation' into develop 2025-08-21 17:40:18 +02:00
luca.mazzoleni 729143ce45 - in BeamExec sia nelle dipendenze che dopo l'ordinamento si mettono i tagli di testa e coda troncanti sempre dopo taglio di testa e coda, rispettivamente;
- in LapJoint se Front Slot sul retro e pezzo lungo si setta di coda
2025-08-21 16:47:07 +02:00
luca.mazzoleni 3f707396bb - in BeamExec si salvano gli id delle eventuali feature troncanti di testa e coda nella parte, per poterle poi usare per ricalcolare l'elevazione
- in LapJoint, per svuotature, se possibile si ricalcolano le elevazioni in caso di feature troncanti
- in BeamLib rivista IsFeatureCuttingEntireSection, allineata con BeamNew
2025-08-20 17:39:08 +02:00
luca.mazzoleni 2b3a36a496 Merge tag '2.7h2' into develop
2.7h2
2025-08-19 10:21:19 +02:00
luca.mazzoleni d9e4285748 Merge branch 'release/2.7h2' 2025-08-19 10:21:07 +02:00
luca.mazzoleni 91d5b0ac84 update log e version 2025-08-19 10:20:34 +02:00
luca.mazzoleni db5334217b - in StepJointNotch se 3 facce si chiama LapJoint
- in LapJoint -> MachineByMill, in lavorazione faccia inclinata, se utensile troppo più grande dell'originale si salta la lavorazione
2025-08-08 17:15:08 +02:00
luca.mazzoleni 54c835f717 - in LapJoint migliorata spezzatura per feature lunghe rispetto al pezzo 2025-08-08 13:04:58 +02:00
luca.mazzoleni 86e2324856 - in Lapjoint lunghe si suddivide usando sempre ENDLEN per evitare problemi di pinzaggio. In futuro (o versione nuova) trattare come LongCut e usare EndLen agli estremi e MaxLen in mezzo 2025-08-08 11:39:26 +02:00
luca.mazzoleni 36f4014969 - in ProcessDrill in foratura in doppio si riduce lo step solo se foro passante e almeno 2 step 2025-08-08 09:52:14 +02:00
luca.mazzoleni 7248c44406 - migliorie a ottimizzazione teste 2025-08-07 17:37:37 +02:00
luca.mazzoleni 044a074b76 - in LapJoint migliorie a SawPlusChain 2025-08-06 17:26:15 +02:00
luca.mazzoleni c0e3dab107 Merge tag '2.7h1' into develop
2.7h1
2025-08-05 09:16:28 +02:00
luca.mazzoleni 2b2157c971 Merge branch 'release/2.7h1' 2025-08-05 09:16:18 +02:00
luca.mazzoleni 8c697d73ac update version e log 2025-08-05 09:15:37 +02:00
luca.mazzoleni c35d032da8 Merge branch 'feature/TrimmedMortiseFix' into develop 2025-07-23 18:10:36 +02:00
luca.mazzoleni 7447d3cc1b - in Mortise implementata lavorazione contorno non trimmato in caso di trim in/out non uniforme 2025-07-23 17:20:10 +02:00
andrea.villa bfdf80a44a In ProfCamb, creato nuovo tipo di lavorazione 'Prof_end' ed eliminata gestione Q06 fatta in precedenza 2025-07-21 08:44:25 +02:00
andrea.villa 3755521d2e In LapJoint, se bUseBHSideMill, si considera feature di coda a patto che il pezzo sia più lungo di VERY_SHORT 2025-07-17 10:01:28 +02:00
andrea.villa 104663a89a In LapJoint, riduzione massimo materiale lama per lavorazioni antischeggia di lama con direzione verticale. 2025-07-15 16:46:10 +02:00
luca.mazzoleni e322c15099 Merge branch 'master' into develop 2025-07-14 12:45:36 +02:00
luca.mazzoleni 5f55bc2f42 Merge branch 'develop' 2025-07-14 12:43:48 +02:00
luca.mazzoleni 6c3a16d59c update log e version 2025-07-14 12:43:23 +02:00
andrea.villa 8218fcc438 In FaceBySaw, corretto calcolo CompLength in caso di ?PerpendicularOutraw' 2025-07-14 12:41:49 +02:00
luca.mazzoleni 6a83320321 Merge tag '2.7g4' into develop
2.7g4
2025-07-11 17:44:17 +02:00
luca.mazzoleni b8b5ab2a65 Merge branch 'release/2.7g4' 2025-07-11 17:44:09 +02:00
luca.mazzoleni e27998599b update log e version 2025-07-11 17:43:53 +02:00
andrea.villa a386c74516 Ripristinato calcolo uso lama sotto in caso di rabbet in LapJoint - TestTwoFacesDownHead 2025-07-11 17:41:31 +02:00
luca.mazzoleni bb9dc261c1 Merge tag '2.7g3' into develop
2.7g3
2025-07-11 14:40:57 +02:00
luca.mazzoleni 0e2067e802 Merge branch 'release/2.7g3' 2025-07-11 14:40:50 +02:00
luca.mazzoleni 3008196992 update log e version 2025-07-11 14:40:31 +02:00
luca.mazzoleni 876e45e1a4 - in RidgeLap correzione alla direzione di lavoro cubetti 2025-07-11 13:03:02 +02:00
luca.mazzoleni fa4d3ab9f6 Merge branch 'master' into develop 2025-07-11 09:20:46 +02:00
luca.mazzoleni 4e6c38d82c update log 2025-07-11 09:20:33 +02:00
luca.mazzoleni d3e1ac5805 update version 2025-07-11 09:17:07 +02:00
luca.mazzoleni bc017d0de7 Merge branch 'master' into develop 2025-07-10 14:57:04 +02:00
luca.mazzoleni 18e180cd12 Merge branch 'develop' 2025-07-10 14:56:33 +02:00
luca.mazzoleni 6d8d32c9fb Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2025-07-10 14:33:46 +02:00
luca.mazzoleni 20074c6ea0 - in LapJoint correzione importante a sega a catena 2025-07-10 14:33:35 +02:00
andrea.villa 806864e360 Merge remote-tracking branch 'origin/master' into develop 2025-07-09 15:42:20 +02:00
andrea.villa 052407a9be Merge branch 'develop' 2025-07-09 15:42:02 +02:00
andrea.villa b5660a8431 In LongDoubleCut corretta lavorazione aggiunta erroneamente dopo separazione 2025-07-09 15:41:35 +02:00
luca.mazzoleni 103d8d7eec Merge tag '2.7g1' into develop
2.7g1
2025-07-08 18:11:09 +02:00
luca.mazzoleni df47842888 Merge branch 'release/2.7g1' 2025-07-08 18:10:58 +02:00
luca.mazzoleni 5db475bcf7 update version e log 2025-07-08 18:10:42 +02:00
luca.mazzoleni 010e1421c7 - in LapJoint, attacco laterale con sega a catena temporaneamente disabilitato, finchè non si risolvono i problemi di movimentazione in macchina 2025-07-08 15:24:34 +02:00
luca.mazzoleni e908562ab6 Merge branch 'feature/DeepDtMortise' into develop 2025-07-02 09:51:37 +02:00
luca.mazzoleni aba4ebecc4 - in LapJoint per sega a catena con attacco laterale step minimo da sotto portato a 260 per macchine tipo PF 2025-07-02 09:51:25 +02:00
luca.mazzoleni a022ecbb7d Merge branch 'develop' into feature/DeepDtMortise 2025-07-01 12:20:04 +02:00
andrea.villa 605f0fcaf1 Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2025-06-30 17:53:47 +02:00
andrea.villa 2676d67737 Merge branch 'FinishSmallMillProf' into develop 2025-06-30 17:52:39 +02:00
andrea.villa ea64a9a3f4 In FindMachining, se c'è un criterio di selezione utensile, allora non si ottimizzano le teste. 2025-06-30 17:39:18 +02:00
luca.mazzoleni a996d4beb3 - in LapJoint correzioni a sega a catena con attacco laterale 2025-06-30 16:13:19 +02:00
luca.mazzoleni 919f71481c Merge branch 'develop' into feature/DeepDtMortise 2025-06-27 09:21:16 +02:00
andrea.villa cac9ec767c Prima versione finitura con fresa piccola su profilo caudato 2025-06-26 17:30:21 +02:00
luca.mazzoleni 85e6c3c86d - in LapJoint migliorata sega a catena con attacco laterale 2025-06-26 14:48:59 +02:00
luca.mazzoleni c548172635 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2025-06-25 15:25:51 +02:00
luca.mazzoleni 9869d1a61e - in LapJoint migliorata sega a catena con attacco laterale 2025-06-25 15:25:47 +02:00
andrea.villa e0c66df59b Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2025-06-25 11:43:32 +02:00
andrea.villa c0156a4a97 In LongDoubleCut, se la faccia scelta non è completa, si lavora l'altra faccia (se completa) 2025-06-25 11:43:27 +02:00
luca.mazzoleni 93f1bc4d0d Merge branch 'feature/MortisingAttackFromSide' into develop 2025-06-24 18:07:06 +02:00
luca.mazzoleni adaeb1e19c Merge branch 'develop' into feature/MortisingAttackFromSide 2025-06-24 17:20:13 +02:00
luca.mazzoleni 2430b4e787 - in LapJoint si contempla Q13 per forzare la non rotazione. In questo caso, per sega a catena con groove 4 lati, si accetta di entrare di lato (Plunge=10) 2025-06-24 17:19:47 +02:00
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
luca.mazzoleni b6e904845e Merge branch 'develop' into feature/MortisingAttackFromSide 2025-06-24 11:56:09 +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 d0283d7885 Merge branch 'develop' into feature/DeepDtMortise 2025-06-23 17:12:32 +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 ccf88745aa Merge branch 'develop' into feature/DeepDtMortise 2025-06-19 10:59: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
luca.mazzoleni b5145d4e99 - in MachiningLib si gestisce sortingCriterion anche per fresatura
- in DtMortise gestita lavorazione a più passate per mortasa profonda
- in DtTenon se profondità elevata si cerca una fresa più lunga
2025-06-17 09:46:18 +02:00
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
25 changed files with 1546 additions and 383 deletions
+54 -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
@@ -202,7 +217,7 @@ if bBtl and string.find( sTitle, 'Bar_', 1, true) and EgtExistsFile( sNgeFile) t
EgtEraseFile( sDiffFile)
local _, nDiff = EgtTextFileCompare( BEAM.FILE, sOriFile, ';', sDiffFile)
-- se BTL corrente coincide con originale, salto il riprocessamento
if nDiff == 0 and sFlag ~= 'CHECK' and sFlag ~= 'CHECK+GENERATE' then
if nDiff == 0 then
bToProcess = false
-- se cambiata configurazione macchina da ultima elaborazione, devo riprocessare
if EgtCompareFilesLastWriteTime( sOriFile, sMachDir .. '\\Beam\\TS3Data.lua') == -1 or
@@ -413,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)
@@ -422,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
@@ -430,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
@@ -440,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
@@ -455,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
+143 -32
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
@@ -441,7 +442,7 @@ local function CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
local b3TailBox
for i = 1, #vProc do
local Proc = vProc[i]
if Proc.Box and not Proc.Box:isEmpty() then
if Proc.Box and not Proc.Box:isEmpty() then
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then
dHeadX = Proc.Box:getCenter():getX()
@@ -466,6 +467,7 @@ end
local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
local nReplacedFeatureId = nil
local bHeadFinishingNeeded = true
local nCuttingFeatureId = nil
for i = 1, #vProc do
local Proc = vProc[i]
-- controllo se esiste già una feature taglio di testa
@@ -480,15 +482,19 @@ local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
if Proc.Head and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 340 then
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
bHeadFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
if not bHeadFinishingNeeded and ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) and ( Proc.Flg > 0) then
nCuttingFeatureId = Proc.Id
end
end
end
return bHeadFinishingNeeded, nReplacedFeatureId
return bHeadFinishingNeeded, nReplacedFeatureId, nCuttingFeatureId
end
-------------------------------------------------------------------------------------------------------------
local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
local nReplacedFeatureId = nil
local bTailFinishingNeeded = true
local nCuttingFeatureId = nil
for i = 1, #vProc do
local Proc = vProc[i]
-- controllo se esistè già una feature taglio di coda
@@ -503,9 +509,12 @@ local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
if Proc.Tail and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 350 then
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
bTailFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
if not bTailFinishingNeeded and ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) and ( Proc.Flg > 0) then
nCuttingFeatureId = Proc.Id
end
end
end
return bTailFinishingNeeded, nReplacedFeatureId
return bTailFinishingNeeded, nReplacedFeatureId, nCuttingFeatureId
end
-------------------------------------------------------------------------------------------------------------
@@ -599,6 +608,17 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
local b3Part = EgtGetBBoxGlob( Pz or GDB_ID.NULL, GDB_BB.EXACT)
local b3Solid = vBeam[i].Box
if b3Part:isEmpty() or b3Solid:isEmpty() then break end
-- analizzo le features per valutare l'esistenza di feature head/tail che renderebbero inutili le rispettive finiture o di tagli di testa/coda sostituiti da cui leggere il parametro Q05
local vProc = CollectFeatures( Pz, b3Solid, 0)
local bSFinishingNeeded, nReplacedHeadCutFeatureId, nHeadCuttingFeatureId = AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
local bEFinishingNeeded, nReplacedTailCutFeatureId, nTailCuttingFeatureId = AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
-- Scrivo gli di delle facce di taglio custom: serviranno dopo per calcolare l'elevazione rispetto a queste
if nHeadCuttingFeatureId then
EgtSetInfo( vBeam[i].Id, 'HEADCUTFEATUREID', nHeadCuttingFeatureId)
end
if nTailCuttingFeatureId then
EgtSetInfo( vBeam[i].Id, 'TAILCUTFEATUREID', nTailCuttingFeatureId)
end
if bBigSectionCut then
-- lascio in coda solo il materiale necessario; il resto verrà tolto nell'head cut successivo
local lastB3Solid = nil
@@ -611,9 +631,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
dOffset = dOvmMid
end
end
-- analizzo le features per valutare l'esistenza di feature head/tail che renderebbero inutili le rispettive finiture o di tagli di testa/coda sostituiti da cui leggere il parametro Q05
local vProc = CollectFeatures( Pz, b3Solid, 0)
local bSFinishingNeeded, nReplacedHeadCutFeatureId = AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
local iSQ05Value = nil
if nReplacedHeadCutFeatureId then
iSQ05Value = EgtGetInfo( nReplacedHeadCutFeatureId, 'Q05', 'i')
@@ -623,7 +640,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
else
DeltaSMin = BD.OVM_BLADE_HBEAM
end
local bEFinishingNeeded, nReplacedTailCutFeatureId = AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
local iEQ05Value = nil
if nReplacedTailCutFeatureId then
iEQ05Value = EgtGetInfo( nReplacedTailCutFeatureId, 'Q05', 'i')
@@ -779,7 +795,82 @@ local function PrintFeatures( vProc, b3Raw)
end
-------------------------------------------------------------------------------------------------------------
local function OrderFeatures( vProc, b3Raw)
-- mi assicuro che i tagli di testa e coda troncanti (usati per ridurre i percorsi utensile in testa e coda) siano sempre fatti per primi
local function ReorderTruncatingCuts( vProc, nPartId)
if not nPartId or #vProc == 0 then return end
local nHeadCuttingFeatureId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i')
local nTailCuttingFeatureId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i')
-- tagli di testa
-- 1: si trovano gli indici del taglio di testa e del rispettivo taglio troncante
local nHeadCutIndex, nHeadCuttingFeatureIndex
for index, value in ipairs( vProc) do
if value.Prc == 340 then
nHeadCutIndex = index
end
if value.Id == nHeadCuttingFeatureId then
nHeadCuttingFeatureIndex = index
end
end
-- 2: se non c'è il taglio di testa, il taglio troncante è il primo. Se c'è il taglio di testa, il taglio troncante lo deve seguire.
if not nHeadCutIndex and nHeadCuttingFeatureIndex then
local HeadCuttingFeature = vProc[ nHeadCuttingFeatureIndex]
table.remove( vProc, nHeadCuttingFeatureIndex)
table.insert( vProc, 1, HeadCuttingFeature)
elseif nHeadCutIndex and nHeadCuttingFeatureIndex then
if abs( nHeadCutIndex - nHeadCuttingFeatureIndex) ~= 1 then
local HeadCut = vProc[ nHeadCutIndex]
local HeadCuttingFeature = vProc[ nHeadCuttingFeatureIndex]
table.remove( vProc, nHeadCutIndex)
-- rimuovere il primo potrebbe aver cambiato l'indice del secondo
if nHeadCutIndex < nHeadCuttingFeatureIndex then
nHeadCuttingFeatureIndex = nHeadCuttingFeatureIndex - 1
end
table.remove( vProc, nHeadCuttingFeatureIndex)
table.insert( vProc, nHeadCutIndex, HeadCut)
table.insert( vProc, nHeadCutIndex + 1, HeadCuttingFeature)
end
end
-- tagli di coda
-- 1: si trovano gli indici del taglio di coda e del rispettivo taglio troncante
local nTailCutIndex, nTailCuttingFeatureIndex
for index, value in ipairs( vProc) do
if value.Prc == 350 then
nTailCutIndex = index
end
if value.Id == nTailCuttingFeatureId then
nTailCuttingFeatureIndex = index
end
end
-- 2: il taglio di coda c'è sempre. Il taglio troncante lo deve seguire.
if nTailCutIndex and nTailCuttingFeatureIndex then
if abs( nTailCutIndex - nTailCuttingFeatureIndex) ~= 1 then
local TailCut = vProc[ nTailCutIndex]
local TailCuttingFeature = vProc[ nTailCuttingFeatureIndex]
table.remove( vProc, nTailCutIndex)
-- rimuovere il primo potrebbe aver cambiato l'indice del secondo
if nTailCutIndex < nTailCuttingFeatureIndex then
nTailCuttingFeatureIndex = nTailCuttingFeatureIndex - 1
end
table.remove( vProc, nTailCuttingFeatureIndex)
table.insert( vProc, nTailCutIndex, TailCut)
table.insert( vProc, nTailCutIndex + 1, TailCuttingFeature)
end
end
return true
end
-------------------------------------------------------------------------------------------------------------
local function OrderFeatures( vProc, b3Raw, nPartId)
local dDrillPenalty = EgtIf( BD.PRESS_ROLLER, 200, 100)
local dSmallDrillRange = EgtIf( b3Raw:getDimX() < BD.LEN_SHORT_PART, BD.DRILL_RANGE_SP or 200, BD.DRILL_RANGE or 600)
@@ -1098,6 +1189,8 @@ local function OrderFeatures( vProc, b3Raw)
end
end
end
ReorderTruncatingCuts( vProc, nPartId)
end
-------------------------------------------------------------------------------------------------------------
@@ -1238,7 +1331,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
@@ -1259,12 +1352,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
@@ -1863,12 +1956,14 @@ 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)
@@ -2018,7 +2113,7 @@ local function AreDrillingsMirrored( Proc, ProcMirror, b3Raw)
end
-------------------------------------------------------------------------------------------------------------
function GetFeatureInfoAndDependency( vProc, b3Raw)
function GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
-- ciclo tutte le feature
for i = 1, #vProc do
local Proc = vProc[i]
@@ -2059,6 +2154,22 @@ function GetFeatureInfoAndDependency( vProc, b3Raw)
end
end
end
-- verifiche per tagli troncanti testa e coda: devono sempre essere subito dopo il taglio di testa e il taglio di coda, rispettivamente
local nHeadCuttingFeatureId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i')
local nTailCuttingFeatureId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i')
if Proc.Prc == 340 and ProcB == nHeadCuttingFeatureId then
Proc.Dependency = {}
Proc.Dependency.ExecBefore = ProcB
elseif Proc == nHeadCuttingFeatureId and ProcB.Prc == 340 then
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
elseif Proc.Prc == 350 and ProcB == nTailCuttingFeatureId then
Proc.Dependency = {}
Proc.Dependency.ExecBefore = ProcB
elseif Proc == nTailCuttingFeatureId and ProcB.Prc == 350 then
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
end
end
end
end
@@ -2100,7 +2211,7 @@ function BeamExec.ProcessFeatures()
-- recupero le feature di lavorazione della trave
local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
-- recupero informazioni ausiliarie feature e dipendenze tra feature stesse
GetFeatureInfoAndDependency( vProc, b3Raw)
GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
-- verifica presenza forature influenzate da lavorazioni di testa o coda
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
@@ -2112,7 +2223,7 @@ function BeamExec.ProcessFeatures()
SetMirroredFeatures( vProc, b3Raw)
end
-- le ordino lungo X
OrderFeatures( vProc, b3Raw)
OrderFeatures( vProc, b3Raw, nPartId)
-- le classifico
local bAllOk, bSomeDown, bSomeSide, bSplitRot = ClassifyFeatures( vProc, b3Raw, Stats)
if not bAllOk then
@@ -2176,19 +2287,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})
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})
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})
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})
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})
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})
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
@@ -2272,19 +2383,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})
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})
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})
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})
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})
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})
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
@@ -2356,19 +2467,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})
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})
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})
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})
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})
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})
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
+24 -3
View File
@@ -551,7 +551,7 @@ function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
local nAddGrpId = BeamLib.GetAddGroup( nPartId)
if not nAddGrpId then
EgtOutLog( 'Error : missing AddGroup')
return 0, 0, 0
return 0, 0, 0, 0
end
-- verifico eventuale intersezione tra la faccia i-1 esima e la proiezione dell'altra sulla stessa
local nShadowFacetId = EgtCopySurfTmFacet( nSurfId, j - 1, nAddGrpId)
@@ -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
@@ -899,6 +899,27 @@ function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
return nFaceIndMax, ptC, vtN
end
---------------------------------------------------------------------
function BeamLib.GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrtho)
local _, EdgesEgt = EgtSurfTmGetFacetOutlineInfo( nSurfId, nFacet, GDB_ID.ROOT)
local nEdgeIndMax = 0
local dMaxComp = - GEO.INFINITO
for i = 1, #EdgesEgt do
local vtN = EdgesEgt[i].Norm
if EdgesEgt[i].Open then
vtN = -vtN
end
local dComp = vtN * vtOrtho
if dComp > dMaxComp then
nEdgeIndMax = i -1
dMaxComp = dComp
end
end
return nEdgeIndMax
end
---------------------------------------------------------------------
function BeamLib.GetTunnelDimension( Proc, nPartId)
-- sono necessarie almeno due facce
@@ -1168,7 +1189,7 @@ end
-------------------------------------------------------------------------------------------------------------
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
function BeamLib.IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH)
return ((abs(b3Proc:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or b3Proc:getDimY() > dRawW) and (abs(b3Proc:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or b3Proc:getDimZ() > dRawH))
return ( b3Proc:getDimY() > ( dRawW - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( dRawH - 500 * GEO.EPS_SMALL))
end
-------------------------------------------------------------------------------------------------------------
+1 -1
View File
@@ -566,7 +566,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
end
end
return UltimateTable
return UltimateTable, OffsetP, OffsetO
end
----------------------------------------------------------------------------------------------------------------------------------------------------
+71 -12
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)
dLoCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)
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)
@@ -435,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
@@ -547,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
@@ -567,13 +626,13 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
EgtSetMachiningParam( MCH_MP.LOCOMPLEN, dLoCompLength)
-- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
-- imposto angolo 3° asse rot
local sBlockedAxis = EgtIf( bMaximizeVerticalDepth, 'parallel', 'perpendicular')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO))
-- eventuali note
if ( 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
@@ -643,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
+64 -43
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)
@@ -77,7 +80,7 @@ end
-- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa
local function ConfirmNextMachining()
-- utensile corrente
local sToolUuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
local sToolUuid = EgtGetMachiningParam( MCH_MP.TUUID)
local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '')
EgtTdbSetCurrTool( sToolName or '')
-- testa dell'utensile corrente
@@ -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
@@ -311,6 +331,7 @@ end
---------------------------------------------------------------------
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
local bOptimizeHeads = ( not sSortingCriterion or sSortingCriterion == '')
if bTopHead == nil and bDownHead == nil then
bTopHead = true
bDownHead = false
@@ -342,21 +363,21 @@ 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
end
if ( BEAM and BEAM.BW) or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
if bOptimizeHeads or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
_, sType = EgtEndsWith( sType, '_H2')
elseif not ( BEAM and BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then
elseif not bOptimizeHeads and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then
if not EgtEndsWith( sType, '_H2') then
sType = sType .. '_H2'
end
end
local MachineHeadUse = MachineHeadType
if not ( BEAM and BEAM.BW) and MachineHeadUse == TWO_EQUAL_HEADS then
if not bOptimizeHeads and MachineHeadUse == TWO_EQUAL_HEADS then
MachineHeadUse = ONE_HEAD
end
if MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
@@ -368,7 +389,7 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
for i = ForStart, ForEnd, ForStep do
local Machining = Machinings[i]
local sMachiningType = Machining.Type
if ( BEAM and BEAM.BW) or MachineHeadUse == TWO_EQUAL_HEADS then
if bOptimizeHeads or MachineHeadUse == TWO_EQUAL_HEADS then
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
end
-- recupero dati utensile
@@ -444,7 +465,7 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
end
end
local bH2, sOrigType = EgtEndsWith( sType, '_H2')
if ( not BEAM or not BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and bH2 and bTopHead then
if not bOptimizeHeads and MachineHeadType == TWO_UP_DOWN_HEADS and bH2 and bTopHead then
return FindMachining( MachiningType, sOrigType, Params, true, false)
end
end
@@ -455,7 +476,7 @@ function MachiningLib.FindCutting( sType, bTopHead, bDownHead, dDepth, sSortingC
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 +484,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
@@ -481,8 +502,8 @@ function MachiningLib.FindAngleDrilling( dDiam, dDepth, bTopHead, bDownHead)
end
---------------------------------------------------------------------
function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
end
---------------------------------------------------------------------
+44 -15
View File
@@ -92,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 or bDownCut) 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
@@ -261,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
@@ -373,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())
@@ -415,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
@@ -588,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
@@ -608,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 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
@@ -641,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
---------------------------------------------------------------------
@@ -829,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
@@ -866,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
---------------------------------------------------------------------
+30 -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
@@ -388,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
@@ -495,15 +515,15 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
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)
@@ -526,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
@@ -577,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
@@ -620,8 +642,8 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
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
-- Se foro passante e nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno
if bOpen and ( nNumStep > 1) and ( ( 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'
+241 -98
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)
@@ -103,7 +104,7 @@ function ProcessDtMortise.GetCutPlane( Proc)
end
---------------------------------------------------------------------
local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
local function CalcPathAtHeight( nProcId, AuxId, nAddGrpId, dHeight, dSideAng, b3Solid)
-- copio la curva di base
local NewAuxId = EgtCopyGlob( AuxId, nAddGrpId)
if not NewAuxId then return end
@@ -111,16 +112,16 @@ 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)
local dOffset = dHeight * tan( dSideAng)
if not EgtOffsetCurve( NewAuxId, dOffset) then return end
-- la limito entro la trave
local refBox = Frame3d( b3Solid:getMin())
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) * ( dHeight - 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
@@ -136,6 +137,23 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
return NewAuxId
end
---------------------------------------------------------------------
local function GetVerticalSteps( dMachiningDepth, dStep )
local MachiningSteps = {}
MachiningSteps.StepLength = 0
if dMachiningDepth <= 0 then
MachiningSteps.Count = 0
return MachiningSteps
end
MachiningSteps.Count = ceil( (dMachiningDepth - 10 * GEO.EPS_SMALL) / dStep )
MachiningSteps.StepLength = dMachiningDepth / MachiningSteps.Count
return MachiningSteps
end
---------------------------------------------------------------------
-- verifica che il box includa il punto in XY
function EnclosesPoint( b3Box, ptP)
@@ -154,6 +172,8 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local sWarn
bMakeAntiSplitPath = true
-- ingombro del pezzo
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
if not b3Solid then
@@ -273,7 +293,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,16 +303,66 @@ 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
end
-- verifico che la profondità non superi il massimo materiale dell'utensile
local bMultipleZPasses = false
-- se necessario, cerco un utensile più lungo
if dAltMort > dMaxMat + 10 * GEO.EPS_SMALL then
local sErr = 'Error : DtMortise Depth bigger than Tool Cutting edge'
EgtOutLog( sErr)
return false, sErr
-- recupero la lavorazione : prima ricerca per sola tipologia
sMilling = ML.FindMilling( sMillType..sMchExt, nil, nil, nil, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
if not sMilling and bMillUp then
sMilling = ML.FindMilling( sMillType, nil, nil, nil, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
end
if not sMilling then
local sErr = 'Milling not found in library : Error on DtMortise ' .. tostring( Proc.Id)
EgtOutLog( sErr)
return false, sErr
end
-- recupero la lavorazione : seconda ricerca con tipologia e diametro massimo
sMilling = ML.FindMilling( sMillType..sMchExt, nil, nil, 2 * dMinRad, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
if not sMilling and bMillUp then
sMilling = ML.FindMilling( sMillType, nil, nil, 2 * dMinRad, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
sMchExt = ''
end
if not sMilling then
local sErr = 'Radius too small : Error on DtMortise ' .. tostring( Proc.Id)
EgtOutLog( sErr)
return false, sErr
end
if not sMilling then
local sErr = 'Error : DtMortise Depth bigger than Tool Cutting edge'
EgtOutLog( sErr)
return false, sErr
end
-- riassegno dati utensile
dToolDiam = 100
dMaxMat = 30
dSideAng = 0
bCW = true
bMillOnAggregate = sMchExt == '_AT'
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
dToolDiam = max( dToolDiam, 10)
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
bCW = ( dSpeed >= 0)
end
end
bMultipleZPasses = true
end
-- 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 +417,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
@@ -364,93 +445,101 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr
end
-- calcolo il percorso top mortise
local nAuxId1 = CalcTopPath( Proc.Id, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
local nAuxId1 = CalcPathAtHeight( Proc.Id, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
-- se esiste il percorso
if nAuxId1 then
-- creo percorso sulla parte alta della mortasa
local dToolRadDelta = dAltMort * tan( dSideAng)
local dTopDiam = dToolDiam + 2 * dToolRadDelta
-- recupero punto iniziale e finale del percorso
local ptStart = EgtSP( nAuxId1, GDB_RT.GLOB)
local ptEnd = EgtEP( nAuxId1, GDB_RT.GLOB)
if ptStart and ptEnd then
local nId1
-- se richiesti due segmenti di linea
if not bMakeAsByArc then
-- determino il punto comune dei due segmenti
local vtDelta = ( ptEnd - ptStart) / 4
vtDelta:rotate( vtExtr, -90)
local ptMid = ( ptStart + ptEnd) / 2 + vtDelta
-- creo la spezzata formata dai due segmenti
nId1 = EgtCurveCompoFromPoints( nAddGrpId, { ptStart, ptMid, ptEnd}, GDB_RT.GLOB)
-- altrimenti richiesto arco
if EgtCurveIsFlat( nAuxId1) then
-- creo percorso sulla parte alta della mortasa
local dToolRadDelta = dAltMort * tan( dSideAng)
local dTopDiam = dToolDiam + 2 * dToolRadDelta
-- recupero punto iniziale e finale del percorso
local ptStart = EgtSP( nAuxId1, GDB_RT.GLOB)
local ptEnd = EgtEP( nAuxId1, GDB_RT.GLOB)
if ptStart and ptEnd then
local nId1
-- se richiesti due segmenti di linea
if not bMakeAsByArc then
-- determino il punto comune dei due segmenti
local vtDelta = ( ptEnd - ptStart) / 4
vtDelta:rotate( vtExtr, -90)
local ptMid = ( ptStart + ptEnd) / 2 + vtDelta
-- creo la spezzata formata dai due segmenti
nId1 = EgtCurveCompoFromPoints( nAddGrpId, { ptStart, ptMid, ptEnd}, GDB_RT.GLOB)
-- altrimenti richiesto arco
else
-- direzione del segmento
local vtDir = ptEnd - ptStart ;
local dLen = vtDir:len()
vtDir:normalize()
-- direzioni tangenti iniziale e finale
local vtStart = EgtSV( nAuxId1, GDB_RT.GLOB)
local vtEnd = EgtEV( nAuxId1, GDB_RT.GLOB)
-- angoli
local dAngStart = acos( vtStart * vtDir)
local dAngEnd = acos( vtEnd * vtDir)
local dMaxAng = min( 30, dAngStart, dAngEnd)
if dLen < dTopDiam then
dMaxAng = min( dMaxAng, asin( dLen / dTopDiam))
end
local vtTg = vtDir ; vtTg:rotate( vtExtr, -dMaxAng)
-- creo l'arco
nId1 = EgtArc2PV( nAddGrpId, ptStart, ptEnd, vtTg, GDB_RT.GLOB)
end
if not nId1 then
local sErr = 'Wrong geometry : Error on DtMortise '
EgtOutLog( sErr)
return false, sErr
end
EgtModifyCurveExtrusion( nId1, vtExtr, GDB_RT.GLOB)
-- inserisco la lavorazione di contornatura anti splint
local sNameF = 'DtMtAS_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ nId1, -1}})
-- setto affondamento pari all'altezza della mortsasa
EgtSetMachiningParam( MCH_MP.DEPTH, dAltMort)
-- setto offset radiale con aggiunto un ulteriore allargamento di 1mm
EgtSetMachiningParam( MCH_MP.OFFSR, dToolRadDelta - 1)
-- antischeggia sempre con una passata
if bMultipleZPasses then
EgtSetMachiningParam( MCH_MP.STEP, 0)
end
-- sistemo il lato e la direzione di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
-- se necessario, imposto SCC
if nSCC then
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end
-- dichiaro non si generano sfridi per VMill
local sUserNotes = 'MaxElev='.. EgtNumToString( dAltMort, 1) .. '; VMRS=0;'
-- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= nMyPrevDouble then
nMyPrevDouble = Proc.Double
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
end
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
else
-- direzione del segmento
local vtDir = ptEnd - ptStart ;
local dLen = vtDir:len()
vtDir:normalize()
-- direzioni tangenti iniziale e finale
local vtStart = EgtSV( nAuxId1, GDB_RT.GLOB)
local vtEnd = EgtEV( nAuxId1, GDB_RT.GLOB)
-- angoli
local dAngStart = acos( vtStart * vtDir)
local dAngEnd = acos( vtEnd * vtDir)
local dMaxAng = min( 30, dAngStart, dAngEnd)
if dLen < dTopDiam then
dMaxAng = min( dMaxAng, asin( dLen / dTopDiam))
end
local vtTg = vtDir ; vtTg:rotate( vtExtr, -dMaxAng)
-- creo l'arco
nId1 = EgtArc2PV( nAddGrpId, ptStart, ptEnd, vtTg, GDB_RT.GLOB)
end
if not nId1 then
local sErr = 'Wrong geometry : Error on DtMortise '
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
EgtOutLog( sErr)
return false, sErr
end
EgtModifyCurveExtrusion( nId1, vtExtr, GDB_RT.GLOB)
-- inserisco la lavorazione di contornatura anti splint
local sNameF = 'DtMtAS_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ nId1, -1}})
-- setto affondamento pari all'altezza della mortsasa
EgtSetMachiningParam( MCH_MP.DEPTH, dAltMort)
-- setto offset radiale con aggiunto un ulteriore allargamento di 1mm
EgtSetMachiningParam( MCH_MP.OFFSR, dToolRadDelta - 1)
-- sistemo il lato e la direzione di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
-- se necessario, imposto SCC
if nSCC then
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end
-- dichiaro non si generano sfridi per VMill
local sUserNotes = 'MaxElev='.. EgtNumToString( dAltMort, 1) .. '; VMRS=0;'
-- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= nMyPrevDouble then
nMyPrevDouble = Proc.Double
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
end
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
else
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
EgtOutLog( sErr)
return false, sErr
sWarn = 'Warning : skipped DoveTail mortise antisplint'
end
else
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
@@ -466,6 +555,23 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local nPass = ceil( dDist / ( 1.9 * dToolDiam))
local dStep = 0
if nPass > 1 then dStep = max( ( dDist - 2 * dToolDiam) / ( 2 * nPass - 2), 0.25 * dToolDiam) end
local dVerticalStep = 0
if bMultipleZPasses then
local dToolVerticalStep = 0
if EgtMdbSetCurrMachining( sMilling) then
dToolVerticalStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP) or 0
end
if dToolVerticalStep < 10 * GEO.EPS_SMALL then
dToolVerticalStep = dMaxMat / 3
else
dToolVerticalStep = min( dToolVerticalStep, dMaxMat / 3)
end
local VerticalSteps = GetVerticalSteps( dAltMort, dToolVerticalStep)
dVerticalStep = VerticalSteps.StepLength
nPass = VerticalSteps.Count
end
for i = nPass, 1, -1 do
-- inserisco la lavorazione di contornatura
local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)
@@ -476,10 +582,39 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
local GeomId = AuxId
if ( i > 1) and bMultipleZPasses then
local dCurrentHeight = dAltMort - ( ( nPass - i + 1) * dVerticalStep)
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error : missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
local b3MortiseNoPocket = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
GeomId = CalcPathAtHeight( Proc.Id, AuxId, nAddGrpId, dCurrentHeight, dSideAng, b3MortiseNoPocket)
if not GeomId then
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
EgtOutLog( sErr)
return false, sErr
end
end
EgtSetMachiningGeometry( {{ GeomId, -1}})
-- imposto offset
local dOffs = ( i - 1) * dStep
if bMultipleZPasses then
if i > 1 then
dOffs = 1
else
dOffs = 0
end
end
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
-- in caso di passate in Z già calcolate lo step deve essere nullo per garantire passate singole
if bMultipleZPasses then
EgtSetMachiningParam( MCH_MP.STEP, 0)
end
-- sistemo il lato e la direzione di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
@@ -512,11 +647,15 @@ 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
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
local dMaxElev = dMaxMat
if bMultipleZPasses then
dMaxElev = dVerticalStep
end
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
if bPocket then
sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3)
@@ -529,6 +668,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
@@ -537,7 +680,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr
end
end
return true
return true, sWarn
end
---------------------------------------------------------------------
+140 -12
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
@@ -64,14 +64,14 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
-- se tenone praticamente in asse, accetto fino a -22 deg
if abs( vtN:getY()) < 0.088 then
return ( vtN:getZ() >= -0.375)
-- altrimenti, accetto fino a -10 deg
-- altrimenti, accetto fino a -12.5 deg
else
return ( vtN:getZ() >= -0.174)
return ( vtN:getZ() >= -0.216)
end
-- altrimenti
else
-- accetto fino a -5deg
return ( vtN:getZ() >= -0.088)
-- accetto fino a -12.5 deg
return ( vtN:getZ() >= -0.216)
end
end
@@ -209,7 +209,15 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
-- se esiste grezzo successivo non serve tagliare dal basso
local bFromBottom
local nNextRawId = EgtGetNextRawPart( nRawId)
if nNextRawId and EgtGetRawPartBBox( nNextRawId):getDimX() > BD.MinRaw and not Proc.Tail then
bFromBottom = false
else
bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
end
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
if not bOk then return bOk, sErr end
end
@@ -236,11 +244,32 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
bCW = ( dSpeed >= 0)
end
end
-- verifico che l'altezza non superi il massimo materiale dell'utensile
-- se necessario, cerco un utensile più lungo
if dDtTenH > dMaxMat + 10 * GEO.EPS_SMALL then
local sErr = 'Error : DtTenon Height bigger than Tool Cutting edge'
EgtOutLog( sErr)
return false, sErr
sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown, nil, nil, 'Longest')
if not sMilling then
local sErr = 'Error : milling not found in library'
EgtOutLog( sErr)
return false, sErr
end
if not sMilling then
local sErr = 'Error : DtTenon Height bigger than Tool Cutting edge'
EgtOutLog( sErr)
return false, sErr
end
-- riassegno dati utensile
dTDiam = 50
dMaxMat = 30
bCW = true
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
bCW = ( dSpeed >= 0)
end
end
end
-- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0)
local dMaxDist
@@ -331,8 +360,107 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
BL.UpdateTCING( nRawId, dOffs)
end
end
-- si controllano le ultime 5 facce della feature
local nIndFace = -1
for i = 1, 5 do
if abs( vtExtr * EgtSurfTmFacetNormVersor( Proc.Id, Proc.Fct-i, GDB_ID.ROOT)) < GEO.EPS_ANG_SMALL then
nIndFace = Proc.Fct-i
end
end
-- controllo se serve passaggio di finitura in caso il tenone non cominci dal bordo della trave (P14 > 0)
if nIndFace > 0 then
-- verifico se almeno uno dei punti iniziale e finale della curva giace in uno dei piani limite del pezzo, quindi se è un lato aperto
local bOpen = false
local ptIni = EgtSP( AuxId, GDB_RT.GLOB)
local ptFin = EgtEP( AuxId, GDB_RT.GLOB)
if ( abs( ptIni:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL or abs( ptFin:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or
( abs( ptIni:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL or abs( ptFin:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or
( abs( ptIni:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL or abs( ptFin:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or
( abs( ptIni:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL or abs( ptFin:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or
( abs( ptIni:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL or abs( ptFin:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or
( abs( ptIni:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL or abs( ptFin:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL) then
bOpen = true
end
-- se entrambi i punti non sono sul limite pezzo
if not bOpen then
-- recupero la lavorazione
sMillType = 'Tenon'
sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
if not sMilling then
local sErr = 'Error : milling to finish the tenon not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
bCW = ( dSpeed >= 0)
end
-- inserisco la passata finale della lavorazione
local sNameF = 'TenF_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sNameF, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, nIndFace}})
-- sistemo i parametri
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
-- sistemo il lato e la direzione di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
EgtSetMachiningParam( MCH_MP.LITANG, 0.7 * dTDiam)
EgtSetMachiningParam( MCH_MP.LIPERP, 20)
EgtSetMachiningParam( MCH_MP.LOTANG, 0.7 * dTDiam)
EgtSetMachiningParam( MCH_MP.LOPERP, 20)
local nFaceUse
if vtExtr:getX() > -GEO.EPS_SMALL then
nFaceUse = MCH_MILL_FU.PARAL_LEFT
else
nFaceUse = MCH_MILL_FU.PARAL_RIGHT
end
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto elevazione
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dDtTenH, 1)) .. ';'
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
-- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if BD.TURN then
if abs( vtAx:getY()) > abs( vtAx:getZ()) then
nSCC = EgtIf( vtAx:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
else
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
end
elseif not BD.C_SIMM then
nSCC = MCH_SCC.ADIR_YM
if abs( vtExtr:getY()) > 0.088 then
nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
end
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end
end
end
return true
end
end
---------------------------------------------------------------------
return ProcessDtTenon
+12 -4
View File
@@ -471,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
@@ -539,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
@@ -695,7 +699,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- 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
@@ -826,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
+19 -19
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)
@@ -406,10 +406,13 @@ 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) and
@@ -417,7 +420,9 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
-- 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}
@@ -429,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
@@ -496,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
+246 -57
View File
@@ -145,6 +145,7 @@ local Q_BLADE_ON_ALONG_FACE = '' -- i
local Q_MAX_ELEVATION = '' -- d
local Q_SAW_PLUS_CHAIN = '' -- i
local Q_FORCE_CHAINSAW = '' -- i
local Q_CHAINSAW_FROM_SIDE = '' -- i
-- variabile smussi
@@ -192,6 +193,8 @@ local function AssignQIdent( Proc)
Q_STAIRCASE = ''
Q_SAW_PLUS_CHAIN = 'Q11'
Q_FORCE_CHAINSAW = 'Q12'
-- TODO da riportare a Q13 quando è sistemata la gestione del movimento in macchina nell'attacco laterale
Q_CHAINSAW_FROM_SIDE = 'Q999'
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
Q_FORCE_BLADE = 'Q01' -- i
@@ -200,6 +203,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
@@ -790,9 +794,10 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
-- verifico se è in coda
local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX()
if ( dEndDist > BD.MAX_DIST_HTFEA) or bUseBHSideMill then
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 and b3Solid:getDimX() > BD.LEN_VERY_SHORT_PART then
return true
else
-- se Front Slot e pezzo abbastanza lungo si rimanda la decisione a più avanti
elseif not ( ( Proc.Prc == 17) and ( b3Solid:getDimX() > ( BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART))) then
return false
end
end
@@ -964,6 +969,12 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
bDown = ( vtN2:getZ() < BD.NZ_MINB)
end
end
local bNoRotation = ( EgtGetInfo( Proc.Id, Q_CHAINSAW_FROM_SIDE, 'i') or 0) == 1
if bDown and bNoRotation then
bDown = false
end
return true, bDown
end
end
@@ -3086,10 +3097,20 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
return false, sErr
end
local bGoFromHead = true
-- se la lunghezza utensile non riesce ad arrivare sul fondo assegno la possibilità di lavorare di fianco (se possibile)
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
local bAttackFromSide = ( ( EgtGetInfo( Proc.Id, Q_CHAINSAW_FROM_SIDE, 'i') or 0) == 1)
and ( Proc.Fct == 4) and ( Proc.Topology == 'Groove')
-- se normale lungo Z è da sopra: si tenta attacco laterale se richiesto
if AreSameOrOppositeVectorApprox( Proc.Face[ nFacInd + 1].VtN, Z_AX()) then
if bAttackFromSide then
bGoFromHead = false
end
elseif dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
if bAttackFromSide then
bGoFromHead = false
-- continuo di testa se fessura con tre facce o non è tunnel
bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces)
else
bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces)
end
end
-- se continuo a lavorare di testa
if bGoFromHead then
@@ -3186,16 +3207,36 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
return false, sWarn
end
end
-- altrimenti sega a catena di fianco
-- altrimenti sega a catena di fianco
-- si arriva qui anche per groove 4 lati con rotazione esclusa
else
-- verifico se posso farlo con la sega-catena
local vtRef = Vector3d( vtOrtho)
if vtRef and ( vtRef:getY() > 0.5 or vtRef:getZ() < -0.1) then
vtRef = -vtRef
end
if bAttackFromSide then
dDimMin = min( Proc.Face[ nFacInd + 1].Width, Proc.Face[ nFacInd + 1].Height)
dDimMax = min( Proc.Face[ nFacAdj + 1].Width, Proc.Face[ nFacAdj + 1].Height)
nLundIdFace = nFacAdj
local nFaceZ
if not vtRef then
if Proc.AffectedFaces.Top then
vtRef = Z_AX()
nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, Z_AX())
else
vtRef = -Z_AX()
nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, -Z_AX())
end
else
nFaceZ = nFacInd
end
dDepth = Proc.Face[ nFaceZ + 1].Elevation
end
local bMakeChainSaw, sSawing2, dMaxMat2, dSawCornerRad2, dSawThick2 = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth)
if bMakeChainSaw then
-- Calcolo normale faccia da lavorare
local vtNL = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT)
-- Calcolo uso faccia
local vtRef = Vector3d( vtOrtho)
if vtRef:getY() > 0.5 or vtRef:getZ() < -0.1 then vtRef = -vtRef end
local nFaceUse = BL.GetNearestParalOpposite( vtRef, vtNL)
-- Verifico se necessarie più passate
local nStep = ceil( ( dDimMin - 100 * GEO.EPS_SMALL) / dSawThick2)
@@ -3222,21 +3263,76 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
-- imposto offset radiale
local dOffs = ( i - 1) * dStep
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
-- se possibile aumento l'affondamento pari al raggio corner + 1
if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then
EgtSetMachiningParam( MCH_MP.DEPTH, (dDepth + dSawCornerRad2 + 1))
-- se massimo affondamento supera altezza fessura, uso massimo affondamento
elseif dMaxMat2 > (dDepth + 1) then
EgtSetMachiningParam( MCH_MP.DEPTH, (dMaxMat2 - 1))
-- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning
elseif dMaxMat2 < dDepth then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat2)
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
local dMachiningDepth = dDepth
if not bAttackFromSide then
-- se possibile aumento l'affondamento pari al raggio corner + 1
if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then
dMachiningDepth = ( dDepth + dSawCornerRad2 + 1)
-- se massimo affondamento supera altezza fessura, uso massimo affondamento
elseif dMaxMat2 > ( dDepth + 1) then
dMachiningDepth = (dMaxMat2 - 1)
-- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning
elseif dMaxMat2 < dDepth then
dMachiningDepth = dMaxMat2
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
EgtSetMachiningParam( MCH_MP.DEPTH, dMachiningDepth)
else
-- se possibile si lavora tutta la profondità
if dMaxMat2 > (dDepth - 100 * GEO.EPS_SMALL) then
dMachiningDepth = dDepth
-- in alternativa si arriva al massimo materiale
else
dMachiningDepth = dMaxMat2
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
EgtSetMachiningParam( MCH_MP.DEPTH, dMachiningDepth)
-- si decidono lato di lavoro, inversione e estensione in base al lato aperto
local nEdgeIndex = BL.GetEdgeToMachineFromVector( Proc.Id, nFacAdj, vtRef)
local EdgesEgt = BL.GetEdgesInfo( Proc, Proc.Face[nFacAdj+1])
local CurrentEdge = EdgesEgt[nEdgeIndex+1]
local dStartAddLen = 0
local dEndAddLen = 0
if CurrentEdge.IsStartOpen then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.INVERT, false)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
end
dStartAddLen = dSawWidth / 2 + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + EgtMdbGetGeneralParam( MCH_GP.SAFEAGGRBOTTZ)
dEndAddLen = - dSawWidth / 2
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
end
-- in caso di attacco esterno si setta in modo da fare un primo step adeguato per evitare finecorsa
-- si riduce la feed opportunamente
if bAttackFromSide then
local dMachiningStep = EgtGetMachiningParam( MCH_MP.STEP) or 0
-- TODO qui sostituire con valore preciso da GetSetupInfo
if BD.C_SIMM then
dMachiningStep = 175
if vtRef:getZ() < - 10 * GEO.EPS_SMALL then
dMachiningStep = 260
end
end
local dActualStep = ( dMachiningDepth - dMachiningStep) / ( 2 + 1)
dElev = dMachiningDepth - dMachiningStep + dActualStep - 0.1
if dActualStep < 0 then
dActualStep = 1
dElev = 2
end
EgtSetMachiningParam( MCH_MP.STEP, dActualStep)
local dFeed = EgtGetMachiningParam( MCH_MP.FEED) / 2
EgtSetMachiningParam( MCH_MP.FEED, dFeed)
end
-- considero estremi inizio/fine chiusi
-- imposto massima elevazione
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
if bAttackFromSide then
sNotes = EgtSetValInNotes( sNotes, 'Plunge', 10)
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
@@ -3303,6 +3399,10 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
end
end
local dExtraOffs = 0
-- se il taglio è praticamente verticale, riduto massimo materiale lama
if BD.DECR_VERT_CUT and vtN:getZ() > 0.985 then
dMaxDepth = dMaxDepth - BD.DECR_VERT_CUT - BD.COLL_SIC
end
-- se profondità superiore al massimo lama modifico elevazione
if dDepth > dMaxDepth then
dExtraOffs = dMaxDepth - dDepth
@@ -3338,7 +3438,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
end
---------------------------------------------------------------------
local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw, bLapJointAngTrasm, nPhase, nRawId)
local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw, bLapJointAngTrasm, nPhase, nRawId, dCustomMaxElev)
-- distanza dal pezzo successivo
local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase)
-- calcolo l'elevazione dal punto medio
@@ -3441,11 +3541,10 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
end
end
end
-- eventuale massima elevazione imposta dall'utente
local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
if dMaxElev and dMaxElev < 1 then dMaxElev = nil end
-- eventuale massima elevazione forzata
if dCustomMaxElev and dCustomMaxElev < 1 then dCustomMaxElev = nil end
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
dElev = dMaxElev or dElev
dElev = dCustomMaxElev or dElev
local sWarn
local dDepth = dElev
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
@@ -3477,7 +3576,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
@@ -3622,7 +3721,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
EgtOutLog( sErr)
return false, sErr
else
sWarn = 'Warning : lapjoint chamfer angle machined with different tool'
sWarn = 'Warning : lapjoint angled face machined with different tool'
end
end
-- recupero i dati dell'utensile
@@ -3633,6 +3732,15 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
end
end
-- se utensile troppo più grande dell'originale salto la lavorazione
if sTuuidPk and EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then
local dTDiamOriginalTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
if dTDiam > 2 * dTDiamOriginalTool then
sWarn = 'Warning : lapjoint angled face skipped (no compatible tool)'
EgtOutLog( sWarn)
return true, sWarn
end
end
-- Calcolo uso faccia
local nFaceUse = BL.GetNearestParalOpposite( tDimAndRef[1][3]:getVersZ())
-- inserisco la lavorazione di fresatura
@@ -4984,6 +5092,7 @@ function SawPlusChain.GetBottomFaceEdges( Proc, Face)
CurrentEdge.IsOpen = vEdges[j].Open
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
CurrentEdge.Id = j - 1
if CurrentEdge.AdjacentFaceId == Proc.MainFaces.LongFace.Id then
table.insert( Edges.LongEdges, CurrentEdge)
@@ -5029,6 +5138,7 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face)
CurrentEdge.IsOpen = vEdges[j].Open
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
CurrentEdge.Id = j - 1
if Proc.Topology == 'Tunnel' then
if CurrentEdge.AdjacentFaceId > -1 then
@@ -5178,6 +5288,9 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw)
if Machining.MaxElev then
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', Machining.MaxElev)
end
if Machining.nEdgeFaceUse then
sUserNotes = EgtSetValInNotes( sUserNotes, 'EdgesFaceUse', EgtNumToString( Machining.nEdgeFaceUse))
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
local bIsApplyOk = ML.ApplyMachining( true, false)
@@ -5288,7 +5401,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)
@@ -5356,6 +5469,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
else
Cutting.Faceuse = BL.GetNearestOrthoOpposite( -EdgeToMachine.ToolDirection)
end
Cutting.nEdgeFaceUse = EdgeToMachine.Id
-- SCC
Cutting.SCC = SawPlusChain.Saw.GetSCC( EdgeToMachine.ToolDirection)
-- asse bloccato
@@ -5396,6 +5510,7 @@ end
function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
local bIsCuttingOk = false
local sCuttingOriginalMessage = Cutting.Message or ''
local sCuttingApplyMessage = ''
local dOriginalRadialOffset = Cutting.RadialOffset
@@ -5410,7 +5525,9 @@ function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
bIsCuttingOk, sCuttingApplyMessage = SawPlusChain.ApplyMachining( Cutting, b3Raw)
-- update messaggi
if sCuttingApplyMessage and #sCuttingApplyMessage > 0 then
sCuttingApplyMessage = sCuttingApplyMessage .. 'Apply : ' .. sCuttingApplyMessage .. '\n'
sCuttingApplyMessage = sCuttingOriginalMessage .. '\n' .. sCuttingApplyMessage .. 'Apply : ' .. sCuttingApplyMessage .. '\n'
else
sCuttingApplyMessage = sCuttingOriginalMessage
end
end
@@ -5667,7 +5784,7 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
return bIsCuttingOk, Cutting.Message
end
end
else
elseif Proc.IsParallel then
-- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
if Cutting.CanApply and Cutting.RadialOffset > 10 * GEO.EPS_SMALL then
-- eventuale lavorazione di lama - lato della tasca da cui inizia la lavorazione
@@ -5727,7 +5844,7 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
return bIsMortisingOk, Mortising.Message
end
end
else
elseif Proc.IsParallel then
-- se la sega a catena non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
if Mortising.LongitudinalOffset > 10 * GEO.EPS_SMALL then
-- eventuale lavorazione di sega a catena - lato della tasca da cui inizia la lavorazione
@@ -5770,6 +5887,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if not BD.MAXDIAM_POCK_CORNER then
BD.MAXDIAM_POCK_CORNER = 30
end
local nMGrpId = EgtGetCurrMachGroup()
local sWarn
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
@@ -5847,10 +5965,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
@@ -6152,9 +6271,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
@@ -6344,6 +6474,35 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
dMaxTotLen = BD.GetBottomToolMaxTotLen( vtN)
end
local dUserMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
local dCustomMaxElev
-- se esistono tagli troncanti in testa o in coda, si calcola il MaxElev da applicare
if not dUserMaxElev then
local nTailCutId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i')
local nHeadCutId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i')
if nHeadCutId or nTailCutId then
local nSurfPartId = EgtCopyGlob( EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, 'Box'), nAddGrpId)
if nHeadCutId then
local ptCCutSurf, vtNCutSurf = EgtSurfTmFacetCenter( nHeadCutId, 0, GDB_ID.ROOT)
EgtCutSurfTmPlane( nSurfPartId, ptCCutSurf, vtNCutSurf, false, GDB_RT.GLOB)
local nSurfPartIdOld = nSurfPartId
nSurfPartId = EgtSurfTmBySewing( nAddGrpId, { nSurfPartId, nHeadCutId}, false)
EgtErase( nSurfPartIdOld)
end
-- in coda si usa il troncante solo se la feature è settata da lavorare dopo separazione (Tail), altrimenti si rischia che venga fatta prima del taglio
if nTailCutId and Proc.Tail then
local ptCCutSurf, vtNCutSurf = EgtSurfTmFacetCenter( nTailCutId, 0, GDB_ID.ROOT)
EgtCutSurfTmPlane( nSurfPartId, ptCCutSurf, vtNCutSurf, false, GDB_RT.GLOB)
local nSurfPartIdOld = nSurfPartId
nSurfPartId = EgtSurfTmBySewing( nAddGrpId, { nSurfPartId, nTailCutId}, false)
EgtErase( nSurfPartIdOld)
end
dCustomMaxElev = EgtSurfTmFacetElevationInClosedSurfTm( Proc.Id, nFacInd, nSurfPartId, true)
if dCustomMaxElev then
dCustomMaxElev = dCustomMaxElev + dCollSic
end
EgtErase( nSurfPartId)
end
end
-- ricerca lavorazione
local sPocketing
local _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown)
@@ -6351,14 +6510,20 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
_, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind)
bMillDown = false
end
-- se l'utente ha definito un'elevazione custom dUserMaxElev si lavora sempre la faccia standard
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
-- se è presente un'elevazione custom dCustomMaxElev si lavora sempre la faccia standard
if sMyPocketing then
if dUserMaxElev then
dCustomMaxElev = dUserMaxElev
elseif dCustomMaxElev and ( dMyTMaxDepth < dCustomMaxElev + dCollSic - 10 * GEO.EPS_SMALL) then
dCustomMaxElev = nil
end
if ( dMyTMaxDepth > dFacElev + dCollSic - 10 * GEO.EPS_SMALL or ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic and not bIsU) or
( bIsL and nUseRoughTool == 0) or
( bIsL and Proc.Prc == 20) or
( Proc.Prc == 25 and not bIsU and not bIsL)) or
( dCustomMaxElev and dCustomMaxElev > 10 * GEO.EPS_SMALL) then
sPocketing = sMyPocketing
end
end
if bMillDown then
sMchFind = sMchFind ..'_H2'
@@ -6584,7 +6749,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
dToolMaxDiam = dToolTargetDiam
end
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap, nil, nPhase, nRawId)
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap, nil, nPhase, nRawId, dCustomMaxElev)
if not bOk then return false, sWarn2 end
if sWarn2 then
if not sWarn then sWarn = '' end
@@ -6763,6 +6928,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
nil, nil, nil, b3Solid)
if not bOk then return false, sWarn2 end
end
-- dopo aver applicato gli antischeggia ricerco la svuotatura perchè l'ottimizzazione teste deve sapere quale è la lavorazione precedente
_, sPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown)
if not sPocketing and bMillUp then
_, sPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind)
bMillDown = false
end
-- se smusso non esclusivo
if nChamfer < 2 then
-- eseguo la svuotatura della faccia principale, mi restituisce id utensile, il diametro utensile per il foro opzionale
@@ -6800,7 +6971,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if ( Proc.Fct == 4 and bTailOnSide) and ( dDistToNextPiece > dToolDiameter + 10 * GEO.EPS_SMALL) then
sMchFind = EgtIf( bMillDown, 'OpenPocket_H2', 'OpenPocket')
end
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm, nPhase, nRawId)
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm, nPhase, nRawId, dCustomMaxElev)
if not bOk then return false, sWarn2 end
if sWarn2 then
if not sWarn then sWarn = '' end
@@ -6953,8 +7124,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 = {}
@@ -6983,11 +7156,11 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
nCapIdLeftSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
if not nCapIdLeftSide then bAllWithEndCap = false end
end
if nFirstId then
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
EgtErase( nId)
end
end
if nFirstId then
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
EgtErase( nId)
end
end
end
if i > 1 then
-- taglio della superficie lato sinistro
@@ -7079,7 +7252,7 @@ local function TestTwoFacesDownHead( Proc)
end
-- recupero le caratteristiche della feature e delle facce
local vtRes = Proc.Face[1].VtN ^ Proc.Face[2].VtN
Proc.IsTopDownRabbet = abs( vtRes:getZ()) > 10 * GEO.EPS_SMALL
Proc.IsTopDownRabbet = Proc.AffectedFaces.Top and abs( vtRes:getZ()) > 10 * GEO.EPS_SMALL
for i = 1, Proc.Fct do
Proc.Face[i].IsTooDownwardForTopBlade = Proc.Face[i].VtN:getZ() < ( BD.CUT_VZ_MIN or -0.484) - 10 * GEO.EPS_SMALL
Proc.Face[i].IsTooWideForTopBlade = Proc.Face[i].WidthTrimmed > dTopBladeMaxDepth
@@ -7349,8 +7522,8 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- 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
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and ( b3Solid:getDimX() > ( BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART))) or
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then
-- una faccia
if Proc.Fct == 1 then
if bUseBlade then
@@ -7502,6 +7675,22 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
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)
+55 -15
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)
@@ -1262,10 +1280,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
nFin = 1
else
if vtN[vOrd[1]]:getZ() >= vtN[vOrd[2]]:getZ() then
if vtN[vOrd[2]]:getZ() < dLimitAngle then
nFin = 1
else
if vtN[vOrd[1]]:getZ() < dLimitAngle then
nIni = 2
else
nFin = 1
end
else
if vtN[vOrd[1]]:getZ() < dLimitAngle then
@@ -1288,6 +1306,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end
-- ciclo sulle parti
local nM = 0
local bInverted = false
for j = 1, nC do
-- su entrambe le facce
for i = nIni, nFin do
@@ -1311,8 +1330,11 @@ 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))
local bFromZM = (( vtN[vOrd[i]]:getZ() < 10 * GEO.EPS_ANG_SMALL and bConvex) or ( vtN[vOrd[i]]:getZ() > - 10 * GEO.EPS_ANG_SMALL and not bConvex))
nSCC = EgtIf( bFromZM, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
end
end
@@ -1325,7 +1347,24 @@ 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
-- verifico se posso lavorare la faccia 2
local nOtherFace = EgtIf( i == 1, 2, 1)
if Proc.Fct == 2 and j == 1 and vtN[vOrd[nOtherFace]]:getZ() > dLimitAngle and vWidth[vOrd[i]] < dMaxDepth then
vOrd[1], vOrd[2] = vOrd[2], vOrd[1]
dLargh = vWidth[vOrd[i]]
dSal, dEal = dEal, dSal
bInverted = true
else
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
elseif bInverted then
dSal, dEal = dEal, dSal
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 +1397,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))
@@ -1393,7 +1432,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end
end
end
if not Proc.bMoveAfterSplit and not bEndFixed and not bConvex then
if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left then
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
@@ -1402,7 +1441,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 +1833,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())
+51
View File
@@ -352,6 +352,57 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bModif and not bOpenBtm then
BL.SetOpenSide( AuxId, b3Solid)
end
-- caso speciale feature trimmata diversamente in/out: si ricostruisce la curva non trimmata
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error : missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
-- estrazione loop trimesh: se 1 contorno ha il fondo, se due contorni è passante.
-- se passante si deve discriminare se i due contorni sono uguali (passante standard, trimmata allo stesso modo in/out) oppure se un contorno è diverso dall'altro (e quindi non è trimmata in egual modo in/out)
-- se più di 2 contorni si rimane nel caso standard
local idCurve1, nIdCount = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
if nIdCount == 2 then
local idCurve2 = idCurve1 + 1
local dCurveLength1 = EgtCurveLength( idCurve1)
local dCurveLength2 = EgtCurveLength( idCurve2)
if abs( dCurveLength1 - dCurveLength2) > 100 * GEO.EPS_SMALL then
-- riferimento curva ausiliaria
local frAuxId = Frame3d( EgtGP( AuxId, GDB_RT.GLOB), vtExtr)
-- box dei due contorni nel riferimento della faccia di fondo
local b3Curve1 = EgtGetBBoxRef( idCurve1, GDB_BB.STANDARD, frAuxId)
local b3Curve2 = EgtGetBBoxRef( idCurve2, GDB_BB.STANDARD, frAuxId)
-- per creare la curva non trimmata si creerà un piano di intersezione con la trimesh appena sopra al contorno più vicino a AuxId, ossia a ptOffset
local ptOffset = b3Curve1:getMax()
if b3Curve1:getMin():getZ() > b3Curve2:getMin():getZ() + 10 * GEO.EPS_SMALL then
ptOffset = b3Curve2:getMax()
end
-- ptOffset si sposta appena sopra per garantire l'intersezione
ptOffset = ptOffset + Vector3d( 0, 0, 100 * GEO.EPS_SMALL)
local ptOffsetGlob = Point3d( ptOffset)
ptOffsetGlob:toGlob( frAuxId)
EgtErase( { idCurve1, idCurve2} )
-- intersezione piano a ptOffset con la trimesh: si ottiene la curva originale non trimmata
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOffsetGlob, frAuxId:getVersZ(), Proc.Id, nAddGrpId, GDB_RT.GLOB)
if nPnt == 0 and nCrv == 1 and nSrf == 0 then
EgtCloseCurveCompo( nFirstId)
local vtMove = -frAuxId:getVersZ() * ptOffset:getZ()
EgtMove( nFirstId, vtMove, GDB_RT.GLOB)
EgtErase( AuxId)
EgtChangeId( nFirstId, AuxId)
else
if nFirstId then
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
EgtErase( nId)
end
end
end
end
end
if bOpenBtm then
-- creo superficie chiusa
local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05)
+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
+84 -9
View File
@@ -206,6 +206,36 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
return nChamfer, dDepth, sMilling, sMilling2
end
---------------------------------------------------------------------
function VerifyOtherMillCanFinish( dDepthProfile, nSide)
local dToolMaxDepthFinish
-- abilitazione lavorazione da sotto
local sMillType = 'Prof_end'
local sMillingFinish, _, _, _ = ML.FindMilling( sMillType, nil, nil, nil, nil, true, nil, nil, nil)
if not sMillingFinish then
return false
end
-- Recupero i dati dell'utensile
if EgtMdbSetCurrMachining( sMillingFinish) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid)) then
dToolMaxDepthFinish = EgtTdbGetCurrToolMaxDepth()
end
else
return false
end
local bDouble = ( dDepthProfile + BD.CUT_EXTRA > dToolMaxDepthFinish)
-- se lavorazione in doppio richiesta, si verifica se richiesta testa sotto
if bDouble and nSide == 0 then
return false -- TODO macchine con BD.DOWN_HEAD potrebbero lavorare in doppio in questo caso!
end
if not bDouble or ( dDepthProfile + BD.MILL_OVERLAP < dToolMaxDepthFinish * 2) then
return true, sMillingFinish, bDouble
end
return false
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
@@ -244,7 +274,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if vtN:getZ() > 0.1 then
nSide = 1
elseif vtN:getZ() < -0.1 then
nSide = -1
nSide = -1
end
-- abilitazione lavorazione da sotto
local bMillDown = ( BD.DOWN_HEAD and nSide == -1)
@@ -468,6 +498,11 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
end
end
-- se configurata fresa di finitura
local bUseOtherMillOnFinish, sFinishMilling, bDoubleFinishMill = VerifyOtherMillCanFinish( dProfDepth, nSide)
-- se il chamfer non è esclusivo continuo con le altre lavorazioni
if nChamfer < 2 then
-- verifico se necessario lavorare in doppio
@@ -477,7 +512,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local sMillingDown
if bDouble then
if nSide == 0 then
if BD.DOWN_HEAD then
if BD.DOWN_HEAD then
-- recupero la lavorazione
sMillingDown = ML.FindMilling( 'Prof_H2', nil, nil, nil, nil, false, true)
if not sMillingDown then
@@ -537,10 +572,6 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
EgtSetMachiningParam( MCH_MP.OFFSR, ( dOriOffset + dOffsetPar))
bFinish = true
end
-- se parametro sovramateriale è maggiore di 0 lo aggiungo al sovramateriale precedente
if dOffsetPar > 0 then
EgtSetMachiningParam( MCH_MP.OFFSR, ( dOriOffset + dOffsetPar))
end
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -567,7 +598,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
nMchId = nMch2Id
end
-- se abilitata, aggiungo lavorazione di finitura
if bFinish then
if bFinish and not bUseOtherMillOnFinish then
-- inserisco la lavorazione
local sNewName = 'ProfB_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
@@ -639,7 +670,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
@@ -676,7 +713,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
nMchId = nMch2Id
end
-- se abilitata, aggiungo lavorazione di finitura
if bFinish then
if bFinish and not bUseOtherMillOnFinish then
-- inserisco la lavorazione
local sNewName = 'Prof_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
@@ -732,6 +769,44 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
return false, sErr
end
end
-- se finitura con fresa piccola
if bFinish and bUseOtherMillOnFinish then
local sDepthFinishMill = EgtIf( bDoubleFinishMill, ( dProfDepth+ BD.MILL_OVERLAP ) / 2, dProfDepth + BD.CUT_EXTRA)
local sMachName = 'Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
nMchId = EgtAddMachining( sMachName, sFinishMilling)
if not nMchId then
local sErr = 'Error adding machining ' .. sMachName .. '-' .. sFinishMilling
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- imposto l'affondamento
EgtSetMachiningParam( MCH_MP.DEPTH, sDepthFinishMill)
-- posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
end
if bDoubleFinishMill then
local sNewName = 'FinB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.INVERT, true)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
end
end
end
end
-- aggiorno ingombro testa o coda per presa
if nSide ~= 1 then -- se feature di fianco o da sotto
+5 -5
View File
@@ -173,18 +173,18 @@ 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
local vtOrtho
if i % 2 == 1 then
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
vtOrtho = vtRef
else
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef2)
vtOrtho = vtRef2
end
-- lavoro la faccia
for j = 1, #vCuts[i] do
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrtho, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
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
+36 -20
View File
@@ -196,27 +196,33 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
end
end
-- 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
-- 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 bExecJustOneCut then
@@ -522,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
+18 -17
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
@@ -631,7 +631,7 @@ 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) and
@@ -661,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}
@@ -768,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)
+13 -4
View File
@@ -13,6 +13,7 @@ local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut')
local Topology = require( 'FeatureTopology')
local LapJoint = require( 'ProcessLapJoint')
EgtOutLog( ' ProcessStepJointNotch started', 1)
@@ -49,7 +50,7 @@ function ProcessStepJointNotch.Classify( Proc)
-- numero delle facce
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
-- gestisco solo 2 o 4 facce
if nFacetCnt ~= 2 and nFacetCnt ~= 4 and nFacetCnt ~= 6 and nFacetCnt ~= 8 then
if nFacetCnt ~= 2 and nFacetCnt ~= 3 and nFacetCnt ~= 4 and nFacetCnt ~= 6 and nFacetCnt ~= 8 then
return false, false
end
-- verifico le normali delle facce
@@ -132,7 +133,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 +289,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)
@@ -578,6 +584,9 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if Proc.Fct == 3 then
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- esecuzione eventuale smusso
-- ottengo anche il flag che indica che la feature è larga come la trave
local bOkc, sErrC, nDiffWidth = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
+87 -1
View File
@@ -1,10 +1,96 @@
==== Beam Update Log ====
Versione 2.7i1 (03/09/2025)
- Added : in Tenone a coda di rondine aggiunto passaggio di finitura in caso di P14 > 0
- Modif : in LapJoint migliorata la scelta lama in caso di due facce e altre piccole correzioni
Versione 2.7h3 (26/08/2025)
- Added : in LapJoint, se possibile, si ricalcola l'elevazione in caso di feature troncanti testa/coda
- Modif : eventuali feature troncanti testa/coda sono fatte sempre subito dopo i rispettivi tagli di testa/coda
Versione 2.7h2 (19/08/2025)
- Modif : migliorata ottimizzazione teste
- Modif : migliorate forature in doppio
- Modif : in LapJoint migliorate lavorazioni lama + sega a catena
- Modif : in LapJoint migliorata spezzatura per feature lunghe rispetto al pezzo
- Modif : in LapJoint tipo BirdsMouth migliorata lavorazione faccia inclinata
- Modif : in StepJointNotch, se 3 facce si riconduce a LapJoint
Versione 2.7h1 (05/08/2025)
- Fixed : in Mortise migliorata la lavorazione in caso di feature trimmata
- Modif : in LapJoint, riduzione massimo materiale lama per lavorazioni antischeggia di lama con direzione verticale
- Modif : in LapJoint migliorie alla lavorazione tipo BlockHaus
- Modif : nei profili si usa il tipo lavorazione Prof_end per la finitura
Versione 2.7g5 (14/07/2025)
- Fixed : in tagli di testa e coda corretti attacchi
Versione 2.7g4 (11/07/2025)
- Fixed : in LapJoint 2 facce correzione nella scelta lama da sotto
Versione 2.7g3 (11/07/2025)
- Fixed : in RidgeLap corretta scelta del lato da lavorare
Versione 2.7g2 (10/07/2025)
- Fixed : in LapJoint correzione per caso in cui la sega a catena lavorava la tasca in modo errato
Versione 2.7g1 (08/07/2025)
- Added : in LapJoint, aggiunti smussi anche se lavorazione con truciolatore
- Added : per profilo caudato aggiunta finitura con fresa piccola
- Added : gestione tastatura
- Modif : nei tagli di testa e coda, compresi quelli di spezzatura, la lama evita di arretrare se non necessario
- Modif : in LongDoubleCut migliorie varie
- Modif : in RidgeLap migliorie varie
- Modif : nelle forature che attraversano un taglio ora si considera la profondità già lavorata
- Fixed : in LongDoubleCut corretta lavorazione aggiunta erroneamente dopo separazione
Versione 2.7f3 (19/06/2025)
- Modif : 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 svuotatura
- 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)
- Modif : in LapJoint se tunnel verticale lavorato solo da sopra e l'utensile non arriva, si restituisce warning
- Fixed : in taglio di separazione si riduce percorso di taglio solo se il pezzo è effettivamente alto
- Fixed : in 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
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 BacthProcess (Ts7) corretta restituzione stato feature erroneamente segnalata verde
- 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)
+2 -2
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di Beam
NAME = 'Beam'
VERSION = '2.7c1'
MIN_EXE = '2.6e5'
VERSION = '2.7i1'
MIN_EXE = '2.7f2'