Compare commits

...

188 Commits

Author SHA1 Message Date
luca.mazzoleni 2fa3ea24a5 - in DiceCut piccola correzione per Turn
- in LapJoint in lavorazione tipo BH permessa U passante non parallela agli assi principali
2025-02-20 09:43:11 +01:00
luca.mazzoleni c82a27ebae - in ProcessDrill, per le forature passanti fatte da un solo lato, eventuale inversione foro in base al lato di lavoro e al lato testa dell'utensile scelto (BD.GetSetupInfo) 2025-02-18 17:44:13 +01:00
luca.mazzoleni a7df54d8d2 - corretto log 2025-02-07 12:13:11 +01:00
luca.mazzoleni e8d11f150e Merge tag '2.7b2' into develop
2.7b2
2025-02-05 15:03:46 +01:00
luca.mazzoleni 6d8bd01266 Merge branch 'release/2.7b2' 2025-02-05 15:03:25 +01:00
luca.mazzoleni 65a256ba7b update log e version 2025-02-05 15:02:57 +01:00
luca.mazzoleni d403f9cfcf - in BeamExec si consentono DrillPocket in doppio solo se foro non passante 2025-02-05 14:59:44 +01:00
luca.mazzoleni 30cc274c2e Merge tag '2.7b1' into develop
2.7b1
2025-02-04 17:55:56 +01:00
luca.mazzoleni 6564bdc74f Merge branch 'release/2.7b1' 2025-02-04 17:55:47 +01:00
luca.mazzoleni 6cdf1583c0 update log e version 2025-02-04 17:55:18 +01:00
luca.mazzoleni 5441ff7b50 - in HeadCut e Split l'utilizzo delle lame grandi (es: 1000 su 1500MAX) è limitato a i pezzi più bassi di 300 mm e più larghi di 300 mm 2025-02-04 17:50:44 +01:00
luca.mazzoleni d03ed02b2c Merge tag '2.7a2' into develop
2.7a2
2025-01-23 10:58:29 +01:00
luca.mazzoleni 8c4000a74c Merge branch 'release/2.7a2' 2025-01-23 10:58:17 +01:00
luca.mazzoleni 4c48085e4f update version e log 2025-01-23 10:57:59 +01:00
luca.mazzoleni 37265932e9 - in BatchProcess piccola correzione 2025-01-23 10:44:28 +01:00
luca.mazzoleni 8f602fc10a - in RidgeLap aggiunta Q05 per usare la fresa (riconduce a LapJoint)
- in ScarfJoint, in caso di taglio dal lato, aggiunto offset CUT_EXTRA che mancava per errore
2025-01-22 17:09:35 +01:00
luca.mazzoleni f7ef38162b Merge branch 'master' into develop 2025-01-21 15:06:55 +01:00
luca.mazzoleni 1bc17e7bb7 - corretta versione in log 2025-01-21 15:06:47 +01:00
luca.mazzoleni 4d545c38ea Merge tag '2.7a1' into develop
2.7a1
2025-01-21 09:13:53 +01:00
luca.mazzoleni 83b9b3858d Merge branch 'release/2.7a1' 2025-01-21 09:13:44 +01:00
luca.mazzoleni 0de82a5fd9 update version 2025-01-21 09:08:11 +01:00
luca.mazzoleni 8dc16e1ed9 - in FreeContour aggiunta Q09 per inversione ultima lavorazione
- in Cut, si taglia dal basso solo se il pezzo piccolo è già staccato dalla barra
- in BatchProcess (Ts7) aggiunta scrittura id progetto e produzione in Btm
2025-01-21 08:54:31 +01:00
andrea.villa 4500f96d6d Aggiunto parametro Q09 per inversione ultimo passaggio su contorno libero 2025-01-17 16:33:28 +01:00
andrea.villa a9921f9b17 Merge commit '8c4f0e15de6c6398b35f7cfbb0524b939d6054da' into develop 2025-01-17 14:56:46 +01:00
andrea.villa 8c4f0e15de In Cut, si taglia dal basso solo se il pezzo piccolo è già staccato dalla barra 2025-01-17 14:53:57 +01:00
luca.mazzoleni 46802be7d8 Merge branch 'master' into develop 2025-01-08 09:17:09 +01:00
Dario Sassi 0a77cc2e12 DataBeam :
- aggiustata la versione a 2.6l2 nel file lua.
2025-01-07 19:00:07 +01:00
luca.mazzoleni 6d07e1638b Merge branch 'master' into develop 2025-01-07 18:30:55 +01:00
luca.mazzoleni 09d3df0fe1 Merge branch 'develop' 2025-01-07 18:30:11 +01:00
luca.mazzoleni 838671d968 corretto nome versione 2025-01-07 18:26:51 +01:00
luca.mazzoleni f286f50855 Merge branch 'master' into develop 2025-01-07 18:03:42 +01:00
luca.mazzoleni ff2dff29ee corretta data versione in log 2025-01-07 18:03:33 +01:00
luca.mazzoleni 28cdaff2d0 Merge tag '2.7a1' into develop
2.7a1
2025-01-07 18:00:57 +01:00
luca.mazzoleni 3c4d299c58 Merge branch 'release/2.7a1' 2025-01-07 18:00:47 +01:00
luca.mazzoleni f388cf47f3 update log e versione 2025-01-07 18:00:08 +01:00
andrea.villa 38b1eba03e Se foro aperto in faccia di coda (LEFT), non si considerano dipendenze 2024-12-30 12:14:44 +01:00
luca.mazzoleni 6caa4fb6b5 - in LapJoint aggiunta Q_SIDE_ROUGH_TOOL=4 per lavorare con fresa evitando tasche aperte testa/coda 2024-12-16 09:52:29 +01:00
luca.mazzoleni c1b781c142 Merge branch 'feature/SpecialBHSideMIllAggregate' into develop 2024-12-13 13:08:05 +01:00
luca.mazzoleni c219a6842b - in LapJoint la Q ForceSideMill ora funziona solo se la feature è aperta sul fronte o sul retro 2024-12-13 12:42:01 +01:00
luca.mazzoleni 677ff492e7 - correzione in LapJoint per SideMillAsBlade 2024-12-12 16:59:41 +01:00
luca.mazzoleni e4ba021482 - in LapJoint abiitata SideMillAsBlade anche da sotto 2024-12-12 09:26:35 +01:00
luca.mazzoleni 24218e8d8c Merge branch 'develop' into feature/SpecialBHSideMIllAggregate 2024-12-11 14:47:32 +01:00
luca.mazzoleni 739311a02b Merge tag '2.6l1' into develop
2.6l1
2024-12-11 13:10:53 +01:00
luca.mazzoleni 61ef5dd9ed Merge branch 'release/2.6l1' 2024-12-11 13:10:41 +01:00
luca.mazzoleni aed21e027c update log e version 2024-12-11 13:10:31 +01:00
luca.mazzoleni 1c64f500b3 - in BeamLib correzione in GetToolFromMachining 2024-12-11 11:56:57 +01:00
luca.mazzoleni 542c421ac8 - in FacesBySaw aggiuta, tramite nota lavorazione PATHINVERT, la possibilità di invertire il senso di percorrenza calcolato (e quindi lavorare in discordanza)
- in LapJoint modifiche per utilizzare aggregato speciale per fresa a disco
2024-12-11 11:26:37 +01:00
luca.mazzoleni 95e6f49e4f Merge remote-tracking branch 'origin/develop' into feature/SpecialBHSideMIllAggregate 2024-12-10 09:49:22 +01:00
luca.mazzoleni 4c19cc49e2 - in LapJoint modifiche per gestione fresa a disco su aggregato
- in BeamLib aggiunta funzione GetToolFromMachining estrapolata da SawPlusChain
2024-12-10 09:49:10 +01:00
andrea.villa 74681a1f1d In Tenon, se tenone chiuso aggiungo una piccola componente perpendicolare per approccio in miling 2024-12-10 09:27:50 +01:00
andrea.villa d7b88e738f Merge branch 'feature/Blade1000' into develop 2024-12-10 09:27:03 +01:00
andrea.villa d4c9843597 In LapJoint, la SawPlusChain è estesa alla topologia "Groove-Through-RightAngles-NotParallel-3" 2024-12-04 08:25:57 +01:00
luca.mazzoleni 077cb2c586 - in HeadCut e Split si sceglie sempre la lama primaria più grande
- in LapJoint -> SawPlusChain si sceglie la lama in base alla profondità della tasca
2024-12-02 17:51:59 +01:00
luca.mazzoleni 8e9de6026e Merge tag '2.6k2' into develop
2.6k2
2024-11-28 09:51:19 +01:00
luca.mazzoleni b382560cfa Merge branch 'release/2.6k2' 2024-11-28 09:51:03 +01:00
luca.mazzoleni 339c6acb37 update log e version 2024-11-28 09:50:47 +01:00
andrea.villa 570a65c7a1 In FacesBySaw ridotto a 15° limite per accorciare geometria bilinea 2024-11-21 12:12:09 +01:00
andrea.villa e18a816647 In LapJoint, se forma a U si ricalcola dimensione della tasca 2024-11-21 11:24:46 +01:00
andrea.villa d578194d43 In DiceCut migliorato controllo rimozione del primo cubetto molto piccolo 2024-11-20 11:50:10 +01:00
luca.mazzoleni e0f20d19f0 - in FacesBySaw migliorati i casi in cui si inverte l'SCC per facilitare la caduta del legno 2024-11-20 10:03:16 +01:00
luca.mazzoleni cff4ef0d47 Merge tag '2.6k1' into develop
2.6k1
2024-11-15 16:03:39 +01:00
luca.mazzoleni d9fb464066 Merge branch 'release/2.6k1' 2024-11-15 16:03:29 +01:00
luca.mazzoleni 9d6a5fb496 update version e log 2024-11-15 15:58:29 +01:00
luca.mazzoleni c3fab404a5 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2024-11-15 15:45:44 +01:00
luca.mazzoleni fa139c84f3 - piccola correzione in ProcessDovetail 2024-11-15 15:45:40 +01:00
andrea.villa ae6853cd3f In Drill, se foro doppio si aumenta lo step per evitare collisione tra le punte durante lavorazione. 2024-11-12 09:40:24 +01:00
luca.mazzoleni c0618cd628 Merge branch 'master' into develop 2024-11-06 10:27:53 +01:00
luca.mazzoleni 524b6a470c update log e version 2024-11-06 10:26:52 +01:00
luca.mazzoleni cd4aa8ee11 -in Drill non si riclassificano come Down i fori fatti in doppio (risolve problemi di chariot collision su macchine tipo PF) 2024-11-06 10:22:01 +01:00
luca.mazzoleni 242f5f4516 -in Drill non si riclassificano come Down i fori fatti in doppio (risolve problemi di chariot collision su macchine tipo PF) 2024-11-05 14:29:23 +01:00
luca.mazzoleni e6a3e0c519 - in Cut correzione a utilizzo Q07 (forzatura fresa)
- in LapJoint se arriva da Cut si applica sempre svuotatura
- in LapJoint se birdsmouth a L si applica svuotatura anche in caso di elevazione non raggiunta (non si tenta la fresatura che fallirebbe non trovando facce sul lato lungo)
2024-11-05 11:17:39 +01:00
luca.mazzoleni 640c8af05f - in ProcessCut lunghezza minima feature per considerare taglio lungo portata a 400 mm per macchine tipo Fast 2024-10-29 11:56:40 +01:00
luca.mazzoleni 48ceceb8e0 Merge branch 'master' into develop 2024-10-29 10:05:46 +01:00
luca.mazzoleni 5165463dbd update log 2024-10-29 10:05:36 +01:00
luca.mazzoleni 9e1d424bc7 Merge branch 'master' into develop 2024-10-29 09:28:04 +01:00
luca.mazzoleni 15c96303de Merge branch 'develop' 2024-10-29 09:25:58 +01:00
luca.mazzoleni 3211f21869 Merge branch 'master' into develop 2024-10-18 12:12:52 +02:00
luca.mazzoleni 1f4fe3597b update version e log 2024-10-18 12:10:37 +02:00
luca.mazzoleni 0749e56b9f Merge tag 'DrillTenonTail' into develop
hotfix
2024-10-18 12:08:03 +02:00
luca.mazzoleni 7424bdc147 Merge branch 'hotfix/DrillTenonTail' 2024-10-18 12:07:46 +02:00
luca.mazzoleni a623072e89 - in BeamExec -> dipendenza feature rimosso foro di coda se tenone è di coda 2024-10-18 12:07:28 +02:00
luca.mazzoleni 7f15b08b20 Merge branch 'master' into develop 2024-10-17 12:26:09 +02:00
luca.mazzoleni 82d4fadaaa update log e versione 2024-10-17 12:25:43 +02:00
luca.mazzoleni d9f4d0584a Merge tag 'DrillSideAndDown' into develop
fix
2024-10-17 12:21:52 +02:00
luca.mazzoleni 2e5b4c9976 Merge branch 'hotfix/DrillSideAndDown' 2024-10-17 12:21:37 +02:00
luca.mazzoleni 511af04c8b - in Drill con precedenza corretto caso in cui il foro veniva ripetuto in rotazioni diverse 2024-10-17 12:20:39 +02:00
luca.mazzoleni 8b1d38c451 modifiche a FacesBySaw del commit precedente estese anche a Fast 2024-10-17 08:57:52 +02:00
andrea.villa abe3465514 - In FacesBySaw, se taglio orizzontale (con componente Z del vtTg a zero) si orienta SCC aggregato lama verso l'interno. In modo che quando si stacca il pezzo non cada sopra l'aggregato.
- In LapJoint, se si utilizza fresa per BlockHaus, si considera sempre di coda
2024-10-11 12:38:28 +02:00
luca.mazzoleni fc753c47be Merge branch 'master' into develop 2024-10-10 14:31:22 +02:00
luca.mazzoleni ad8a7bf73f Merge branch 'develop' 2024-10-10 14:06:22 +02:00
luca.mazzoleni 4a21a4be36 - in ProcessCut Classify corretta lettura Q per passare a LapJoint 2024-10-10 14:05:52 +02:00
andrea.villa aafe565474 In ScarfJoint corretto problema introdotto con modifica ottimizzazione richiesta per Ticket#1992 2024-10-10 12:40:27 +02:00
luca.mazzoleni b6ef0a8d7a Merge tag '2.6j1' into develop
r
2024-10-10 10:51:49 +02:00
luca.mazzoleni 779f2105ba Merge branch 'release/2.6j1' 2024-10-10 10:51:35 +02:00
luca.mazzoleni c2b9c4b19f update log e version 2024-10-10 10:50:40 +02:00
luca.mazzoleni 8eadb81e91 Merge branch 'master' into develop 2024-10-08 12:11:09 +02:00
luca.mazzoleni 2bac228fe9 update log e version 2024-10-08 12:10:57 +02:00
luca.mazzoleni c312e72fd2 Merge tag 'RidgeLapClamping' into develop
r
2024-10-08 12:08:18 +02:00
luca.mazzoleni fd4683e4fa Merge branch 'hotfix/RidgeLapClamping' 2024-10-08 12:08:09 +02:00
luca.mazzoleni 70661aa3d2 In RidgeLap, ingombro testa coda considera inclinazione feature per pinzaggio 2024-10-08 12:08:00 +02:00
andrea.villa a82486e9fb In RidgeLap, ingombro testa coda considera inclinazione feature per pinzaggio 2024-10-07 16:11:48 +02:00
luca.mazzoleni cd4a7d3b91 - in LapJoint miglioramenti vari alla lavorazione delle facce oblique 2024-10-03 17:28:27 +02:00
luca.mazzoleni 3764c58394 - in ProcessCut aggiunta Q07 per forzare uso fresa (si passa a LapJoint)
- in LapJoint gestita feature in arrivo da Cut e piccole correzioni
2024-10-01 15:57:17 +02:00
luca.mazzoleni e49b505fbe - in ordinamento tenoni sempre fatti dopo eventuale foro secante
- in FreeContour modificati criteri pinzaggio
- in FreeContour aggiunte Q per forzare come pinzabile l'area della feature e per ignorare possibili problemi di lettura laser (taglio di testa sotto non eseguito)
2024-10-01 12:30:07 +02:00
luca.mazzoleni 72c1eb81f3 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2024-09-27 16:06:16 +02:00
luca.mazzoleni 037ac0d030 - se tenone di coda è attraversato da foro allora anche il foro deve essere di coda
- piccola correzione e TwoFacesBySaw
2024-09-27 16:06:12 +02:00
andrea.villa f1b64b1496 Se la macchina è tipo BlockHaus, i LapJpint vengono fatti prima del taglio di separazione 2024-09-27 15:44:26 +02:00
luca.mazzoleni 69ab03f3ec - in LongDoubleCut corretto typo nome variabile 2024-09-26 09:57:08 +02:00
luca.mazzoleni 3b86cd9633 Merge tag '2.6i2' into develop
release
2024-09-13 17:03:38 +02:00
luca.mazzoleni 56fc63d5ff Merge branch 'release/2.6i2' 2024-09-13 17:02:30 +02:00
luca.mazzoleni f27eeb9c3d update log e versione 2024-09-13 17:02:16 +02:00
luca.mazzoleni 5d603a57db - in HeadCut, Split modifiche ai tagli aggiuntivi orizzontali e verticali; disattivati attacchi tangenziali per tagli aggiuntivi verticali in PF1250 per evitare rischi di collisione con testa sotto che cambia utensile in tempo mascherato 2024-09-13 16:57:57 +02:00
luca.mazzoleni 6f45e63f11 Merge branch 'CheckGenerateFix' into develop 2024-09-13 12:38:07 +02:00
luca.mazzoleni eb8c78b7b1 Merge branch 'develop' into CheckGenerateFix 2024-09-13 10:03:05 +02:00
andrea.villa 4eefdf0842 In FacesBySaw per settare il FaceUse si usa il versore nelle UserNotes 2024-09-12 09:22:28 +02:00
luca.mazzoleni b536c30a88 Merge branch 'develop' into CheckGenerateFix 2024-09-11 13:51:11 +02:00
andrea.villa 9a0ea2e431 Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2024-09-11 08:13:26 +02:00
andrea.villa d61a47755c - ProcessDrill In GetData corretta gestione modifica diametro foro 2024-09-11 08:13:23 +02:00
luca.mazzoleni c6b8b74f26 - in BatchProcess riportate modifiche alla BatchProcessNew: in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check 2024-09-10 18:27:12 +02:00
luca.mazzoleni 53cd49bed1 Merge branch 'develop' into CheckGenerateFix 2024-09-10 18:18:17 +02:00
luca.mazzoleni 2f4a77c73e - in FacesBySaw si invertono gli accorciamenti solo se l'inversione del percorso non è forzata dall'esterno; adeguati HeadCut e Split 2024-09-10 18:12:47 +02:00
luca.mazzoleni 64a3f75b31 Merge branch 'develop' into CheckGenerateFix 2024-09-10 14:13:31 +02:00
luca.mazzoleni 000358b6a6 Merge remote-tracking branch 'origin/master' into develop 2024-09-10 14:12:58 +02:00
Emmanuele Sassi 6c16e7b70a - correzione in lettura array per cambio dll di lettura 2024-09-10 09:02:02 +02:00
luca.mazzoleni 1ae32451e5 Merge branch 'develop' into CheckGenerateFix 2024-09-09 14:43:55 +02:00
luca.mazzoleni 4c68955ba2 Merge tag '2.6i1' into develop
release
2024-09-09 14:42:36 +02:00
luca.mazzoleni dd80929ae1 Merge branch 'release/2.6i1' 2024-09-09 14:42:27 +02:00
luca.mazzoleni af80170976 update log e versione 2024-09-09 14:27:25 +02:00
luca.mazzoleni bf2742c6c7 - in BatchProcessNew, in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check 2024-09-09 14:04:46 +02:00
luca.mazzoleni ec09b3f70c in FacesBySaw -> MakeOne correzione a scelta inversione / lato di lavoro 2024-09-06 09:11:14 +02:00
luca.mazzoleni 952d40cb2b Merge branch 'ZeroPreCutForHeadCutSplit' into develop 2024-09-05 15:57:23 +02:00
luca.mazzoleni 0a767d1afd - in Headcut e Split aggiunta gestione parametro MIN_HEIGHT_ADDED_CUTS da BeamData per scegliere l'altezza minima per cui devono essere aggiunti i tagli orizzontali supplementari 2024-09-05 12:12:29 +02:00
luca.mazzoleni d5be638099 Merge branch 'develop' into ZeroPreCutForHeadCutSplit 2024-09-04 18:28:17 +02:00
luca.mazzoleni b6c5514f9e - in HeadCut e Split correzioni a pretaglio a zero 2024-09-04 18:27:39 +02:00
luca.mazzoleni 4fd18d377f - in split modifiche per precut 2024-09-04 17:52:37 +02:00
andrea.villa 9dff37f1f4 Gestione dipendenza foro-tasca in caso di fase con pezzo ribaltato 2024-09-04 15:54:13 +02:00
luca.mazzoleni b71ad963f1 Merge branch 'develop' into ZeroPreCutForHeadCutSplit 2024-09-04 09:17:07 +02:00
andrea.villa 3aefca4613 - In Mark, gestita la lavorazione del testo 2024-09-04 09:16:24 +02:00
luca.mazzoleni cc5117aa11 - in Split refactoring e implemento pretaglio a zero
- in HeadCut piccole migliorie in pretaglio a zero
2024-09-03 18:02:18 +02:00
andrea.villa c5a8b852d9 - in LapJpint, in MakeLongMoreFaces si aggiunge faccia di fondo anche per topologia Groove passante a 3 facce 2024-09-03 15:11:53 +02:00
andrea.villa 69514074a9 - In ScarfJoint, in ApplyDiceCut, tagli paralleli fatti con unico passaggio di fianco 2024-09-03 12:45:28 +02:00
luca.mazzoleni 6ecd613f12 - in HeadCut corrette Width e Height invertite 2024-09-02 16:54:47 +02:00
luca.mazzoleni 6e4dee29af modifiche a HeadCut per introduzione tagli a zero (PreCut) per evitare problemi con pezzi non lunghi quanto ci si aspetta 2024-09-02 10:29:08 +02:00
luca.mazzoleni da7ebc6b97 - refactoring di ProcessHeadCut 2024-08-29 18:17:08 +02:00
luca.mazzoleni 4685b6bde6 - se lapjoint attraversata da L055, la lapjoint viene fatta prima 2024-08-29 10:47:51 +02:00
luca.mazzoleni 3a063bd2cf Merge branch 'master' into develop 2024-08-26 18:10:47 +02:00
luca.mazzoleni 710a1fe070 - HotFix: in FacesBySaw -> MakeOne corretto SCC in caso di soluzione alternativa 2024-08-26 18:10:20 +02:00
luca.mazzoleni d818492d67 Merge tag '2.6h2' into develop
release
2024-08-26 15:43:59 +02:00
luca.mazzoleni e55e33c40a Merge branch 'release/2.6h2' 2024-08-26 15:43:44 +02:00
luca.mazzoleni 8cadb25261 update log e version 2024-08-26 15:43:30 +02:00
luca.mazzoleni 2622b58cad Merge branch 'OneFaceCutAlternativeDirection' into develop 2024-08-26 15:31:03 +02:00
luca.mazzoleni b5be932955 - in FacesBySaw -> MakeOne aggiunta la possibilità di passare una direzione di lavoro alternativa per poter rispettare contemporaneamente la direzione di lavoro concorde e la direzione di taglio 2024-08-26 15:17:31 +02:00
luca.mazzoleni 44ac2f8c2a Merge branch 'test' into develop 2024-08-22 16:37:55 +02:00
luca.mazzoleni 0b928e987f - in LapJoint -> svuotatura, correzione all'utilizzo dell'elevazione custom 2024-08-22 15:49:25 +02:00
luca.mazzoleni c213c3f059 - in LapJoint -> svuotatura, se l'utente ha definito un'elevazione custom si lavora sempre la faccia standard 2024-08-22 15:23:03 +02:00
luca.mazzoleni 330698b6aa in tunnel LapJoint -> tunnel lo smusso funziona anche se è forzata la sega a catena 2024-08-22 12:01:43 +02:00
luca.mazzoleni eb1ef693c4 Merge branch 'test' into develop 2024-08-22 11:25:02 +02:00
luca.mazzoleni 862751c84a - in FacesBySaw attacchi tangenziali solo da un lato limitati a facce con Z negative
- in BatchProcess e New si verifica l'abilitazione della generazione con EgtVerifyKeyOption
- in Version, MIN_EXE modificato per richiesta compatibilità con EgtVerifyKeyOption
2024-08-21 13:05:31 +02:00
luca.mazzoleni e5a30c38d3 Merge tag '2.6h1' into develop
r
2024-08-20 17:45:26 +02:00
luca.mazzoleni e83d8db1cc Merge branch 'release/2.6h1' 2024-08-20 17:45:14 +02:00
luca.mazzoleni 9de88ffe84 update log e version 2024-08-20 17:45:00 +02:00
luca.mazzoleni ffaf33c62e in BatchProcessNew se flag apposito in Cam5 la generazione è disabilitata 2024-08-20 17:34:46 +02:00
luca.mazzoleni 8c0389582b Merge branch 'ImproveDicingParallelTangentLead' into develop 2024-08-20 17:05:20 +02:00
luca.mazzoleni ebe3d79c11 - in FacesBySaw attacchi tangenziali solo da un lato limitati a facce con basse componenti Y
- in split e headcut i tagli addizionali orizzontali o verticali, se la macchina ha i ruli, si fanno sempre con attacco tangenziale
2024-08-20 17:02:37 +02:00
luca.mazzoleni f8c40739da - in attacchi tangenziali solo da un lato alcune correzioni
- aggiunta la raccolta delle Affected Faces a tutti i casi in cui si crea una feature a posteriori (non presente nel btl)
2024-08-19 17:37:16 +02:00
luca.mazzoleni fa5aac926e - attacchi tangenziali solo da un lato lasciati solo per se FacesBySaw è chiamata da ProcessCut 2024-08-09 12:02:27 +02:00
luca.mazzoleni 749cd1e2bb - in FacesBySaw limiti alle normali se attacco tangenziale dallo stesso lato 2024-08-09 12:00:20 +02:00
luca.mazzoleni 587aaaafce - in FacesBySaw->MakeOne, se attacco tangenziale e cubetti paralleli, si attacca e stacca sempre dallo stesso lato
- modificate di conseguenza funzioni significative che generano questi tipi di taglio
2024-08-08 15:20:51 +02:00
luca.mazzoleni 2cfa7caba7 Merge branch 'ImproveChamferLapJoint' into develop 2024-08-07 17:46:16 +02:00
luca.mazzoleni fc0fba5bd3 - in FacesBySaw revert delle modifiche precedenti per problemi di chiusura rulli 2024-08-07 17:45:38 +02:00
luca.mazzoleni 94159f88f3 - in FacesBySaw.MakeOne se si ha outstroke si tenta attacco alternativo 2024-08-07 16:11:38 +02:00
luca.mazzoleni 4961d2d528 - in LapJoint gestito smusso nel caso Groove-Blind-RightAngles-Parallel-4 2024-08-06 15:25:37 +02:00
luca.mazzoleni 7b22f5cc47 Merge remote-tracking branch 'origin/develop' into develop 2024-08-06 15:19:50 +02:00
andrea.villa 5047d5b652 In SimpleSarf, se assimilabile ad un taglio (1 faccia) si considerare area non pinzabile testa/coda 2024-08-05 09:24:14 +02:00
luca.mazzoleni 7f9b880ff7 Merge branch 'master' into develop 2024-07-19 18:06:44 +02:00
luca.mazzoleni 7e457a22b0 update log e versione 2024-07-19 18:06:32 +02:00
luca.mazzoleni 3c080e2b1a in BatchProcess e BatchProcessNew bToRecalc forzato se flag 3 o 4 2024-07-19 18:04:16 +02:00
luca.mazzoleni 9d3edbfb54 - in BatchProcessNew bToRecalc forzato se flasg 3 o 4
- in ProcessLapJoint si evita di tentare di lavorare con sega a catena da sotto
2024-07-19 16:08:18 +02:00
luca.mazzoleni adf465c5e2 -in SawPlusChain non non si applicano lavorazioni con lama da sotto (lama da sotto al momento non gestita)
-in SawPlusChain ora se una lavorazione non è applicabile si prosegue con le altre invece di uscire
2024-07-18 18:41:09 +02:00
luca.mazzoleni 23f695fd56 Merge branch 'master' into develop 2024-07-18 16:03:36 +02:00
luca.mazzoleni 52f347def1 update log e version 2024-07-17 16:10:37 +02:00
luca.mazzoleni 028688b88a - in SawPlusChain con tunnel passante fatto da un solo lato, se apply della sega a catena fallisce per finecorsa, si riapplica dal lato opposto 2024-07-17 16:06:26 +02:00
luca.mazzoleni cde5b137ae update log e versione per 2.6g3 2024-07-17 15:24:10 +02:00
luca.mazzoleni d0cf5887d3 -in LongCut invertito senso di rotazione truciolatore (ora è in discordanza) 2024-07-17 12:28:21 +02:00
luca.mazzoleni afc4c6aaff - corretto problema in LongDoubleCut in cui si sbagliava la riduzione di affondamento con lama da sotto
- in Lapjoint aggiunta Q_FORCE_CHAINSAW per forzare sega a catena anche in casi in cui ci passerebbe la fresa
2024-07-17 11:46:07 +02:00
luca.mazzoleni caa1875309 Merge branch 'master' into develop 2024-07-12 12:53:14 +02:00
Dario Sassi 0acd75bece DataBeam :
- inserito controllo massimo numero di facce (20) per eseguire GetFacetsInfo.
2024-07-09 18:18:56 +02:00
Dario Sassi db691cefe4 Merge commit 'd0ecd175c284b108acb1b4290cf5616b61d121c8' 2024-07-09 17:52:36 +02:00
36 changed files with 1623 additions and 681 deletions
+32 -5
View File
@@ -59,9 +59,23 @@ end
local sLog = 'BatchProcess : ' .. BEAM.FILE .. ', ' .. BEAM.MACHINE .. ', ' .. sFlag
EgtOutLog( sLog)
-- Cancello file di log specifico
local sLogFile = EgtChangePathExtension( BEAM.FILE, '.txt')
EgtEraseFile( sLogFile)
-- in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check
if BEAM.FLAG == 0 then
local hLogFile = io.open( sLogFile, 'r')
if hLogFile then
for line in hLogFile:lines() do
if EgtStartsWith( line, 'ERR') and tonumber( EgtSplitString( line, '=')[2] or 0) > 0 then
BEAM.FLAG = 4
break
end
end
hLogFile:close()
end
end
-- Cancello file di log specifico
EgtEraseFile( sLogFile)
-- Funzioni per scrittura su file di log specifico
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
@@ -108,13 +122,25 @@ end
-- Funzione per aggiornare dati ausiliari
local function UpdateAuxData( sAuxFile)
local bModif = false
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
-- Se definito LOAD90, aggiorno
local sLoad90 = EgtGetStringFromIni( 'AuxData', 'LOAD90', '', sAuxFile)
if sLoad90 ~= '' then
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
EgtSetInfo( BtlInfoId, 'LOAD90', sLoad90)
bModif = true
end
-- Se definito PROJID, aggiorno
local sProjId = EgtGetStringFromIni( 'AuxData', 'PROJID', '', sAuxFile)
if sProjId ~= '' then
EgtSetInfo( BtlInfoId, 'PROJECTNUMBER', sProjId)
bModif = true
end
-- Se definito PRODID, aggiorno
local sProdId = EgtGetStringFromIni( 'AuxData', 'PRODID', '', sAuxFile)
if sProdId ~= '' then
EgtSetInfo( BtlInfoId, 'PRODID', sProdId)
bModif = true
end
return bModif
end
@@ -461,7 +487,7 @@ else
-- Passo in modalità lavora
EgtSetCurrMachGroup( EgtGetLastMachGroup())
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
if bToRecalc then
if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
EgtImportSetup()
EgtApplyAllMachinings()
@@ -525,7 +551,8 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F
end
-- *** Genero programma CN *** ( se richiesto)
if BEAM.FLAG == 0 or BEAM.FLAG == 4 then
local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
if bIsGenerationEnabled and ( BEAM.FLAG == 0 or BEAM.FLAG == 4) then
EgtOutLog( ' +++ Generating NC part program >>>')
local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '')
if EgtGetExeVersion then
+19 -4
View File
@@ -45,9 +45,23 @@ end
local sLog = 'BatchProcess : ' .. BEAM.FILE .. ', ' .. BEAM.MACHINE .. ', ' .. sFlag
EgtOutLog( sLog)
-- Cancello file di log specifico
local sLogFile = EgtChangePathExtension( BEAM.FILE, '.txt')
EgtEraseFile( sLogFile)
-- in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check
if BEAM.FLAG == 0 then
local hLogFile = io.open( sLogFile, 'r')
if hLogFile then
for line in hLogFile:lines() do
if EgtStartsWith( line, 'ERR') and tonumber( EgtSplitString( line, '=')[2] or 0) > 0 then
BEAM.FLAG = 4
break
end
end
hLogFile:close()
end
end
-- Cancello file di log specifico
EgtEraseFile( sLogFile)
-- Funzioni per scrittura su file di log specifico
local function WriteErrToLogFile( nErr, sMsg, nRot, nCutId, nTaskId)
@@ -562,7 +576,7 @@ else
-- Passo in modalità lavora
EgtSetCurrMachGroup( EgtGetLastMachGroup())
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
if bToRecalc then
if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
EgtImportSetup()
EgtApplyAllMachinings()
@@ -626,7 +640,8 @@ if ( BEAM.FLAG == 0 and ( bToProcess or bToRecalc)) or BEAM.FLAG == 3 or BEAM.F
end
-- *** Genero programma CN *** ( se richiesto)
if BEAM.FLAG == 0 or BEAM.FLAG == 4 then
local bIsGenerationEnabled = ( EgtVerifyKeyOption( 110) == false)
if bIsGenerationEnabled and ( BEAM.FLAG == 0 or BEAM.FLAG == 4) then
EgtOutLog( ' +++ Generating NC part program >>>')
local sInfo = 'EgtCAM5' .. EgtIf( EgtIs64bit(), ' 64bit', '')
if EgtGetExeVersion then
+61 -7
View File
@@ -63,6 +63,7 @@
-- 2024/03/13 In CollectFeatures si scrive lunghezza foro su Proc e si controla se serve Predrill
-- In OrderFeature, preforo sempre prima del foro
-- 2024/04/11 In CollectFeatures aggiunta lettura info PRID, scritta in Proc.FeatureId
-- 2024/09/04 Gestione dipendenza foro-tasca in caso di fase con pezzo ribaltato
-- Tabella per definizione modulo
local BeamExec = {}
@@ -394,6 +395,8 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
Proc2.TaskId = Proc.TaskId
Proc2.AdjId = Proc.AdjId
Proc2.MainId = Proc.MainId
-- recupero l'elenco delle facce della parte interessate dalla feature
Proc2.AffectedFaces = BL.GetProcessAffectedFaces( Proc2)
table.insert( vProc, Proc2)
-- verifico se devo inserire i prefori
if Drill.IsPredrillNeeded( Proc2) then
@@ -834,16 +837,26 @@ local function OrderFeatures( vProc, b3Raw)
if B2.AdvTail and ( not Split.Identify( B1) or not B1.Tail) then
return true
end
-- se primo è foro e secondo è un ribasso, il foro va sempre prima a meno che il ribasso non sia di testa
if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2)) and B2.PassedByHole and
-- se primo è foro e secondo è un ribasso o tenone, il foro va sempre prima a meno che il ribasso non sia di testa
if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2) or Tenon.Identify(B2)) and B2.PassedByHole and
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
return true
end
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo a meno che il ribasso non sia di testa
if ( LapJoint.Identify(B1) or Mortise.Identify(B1))and B1.PassedByHole and Drill.Identify(B2) and
-- se primo è un ribasso e secondo è un foro o tenone, il ribasso va sempre dopo a meno che il ribasso non sia di testa
if ( LapJoint.Identify(B1) or Mortise.Identify(B1) or Tenon.Identify(B1)) and B1.PassedByHole and Drill.Identify(B2) and
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
return false
end
-- se primo è ribasso e secondo è una mortasa a coda di rondine, il ribasso va sempre prima a meno che la mortasa a coda di rondine non sia di testa
if LapJoint.Identify(B1) and B1.PassedByDtMortise and DtMortise.SideIdentify(B2) and
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
return true
end
-- se primo è mortasa a coda di rondine e secondo è ribasso, la mortasa a coda di rondine va sempre dopo a meno che la mortasa a coda di rondine non sia di testa
if DtMortise.SideIdentify(B1) and LapJoint.Identify(B2) and B2.PassedByDtMortise and
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
return false
end
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
if B1.Tail and ( Split.Identify( B2) or not B2.Tail) then
return false
@@ -1210,7 +1223,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
bOk, bDown, bSide = ProfHead.Classify( Proc, b3Raw)
-- se contorno libero
elseif FreeContour.Identify( Proc) then
bOk, bDown, bSide = FreeContour.Classify( Proc, b3Raw)
bOk, bDown, bSide, bDownSideOnHeadOk = FreeContour.Classify( Proc, b3Raw)
-- se decorazione
elseif Decor.Identify( Proc) then
bOk, bDown = Decor.Classify( Proc)
@@ -1220,7 +1233,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
end
-- assegno risultato
if bOk then
-- non ammessa feature di testa da lavorare ribaltata o ruotata
-- non ammessa feature di testa da lavorare ribaltata o ruotata (lettura laser)
if Proc.Head and ( bDown or bSide) and not bDownSideOnHeadOk then
Proc.Flg = 0
Proc.Down = true
@@ -1267,6 +1280,20 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
vProc[nSplitting].Down = true
bSomeDown = true
end
-- si cerca di riclassificare le feature che dipendono da altre (in caso siano su rotazioni diverse)
for i = 1, #vProc do
local Proc = vProc[i]
-- FORATURA
if Drill.Identify( Proc) and Proc.Dependency then
if Proc.Dependency.ExecBefore then
if Proc.Dependency.ExecBefore.Down then
local bMachiningSideChanged = Drill.Classify( Proc, b3Raw, 'DOWN')
end
end
end
end
return bAllOk, bSomeDown, bSomeSide, bSplitRot
end
@@ -1799,7 +1826,10 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
sDrilling, sType, dMaxDepth = ML.FindDrilling( dDiam, 0, true, false, true)
dMachiningDepth = dMaxDepth or dMachiningDepth
end
if not sDrilling or ( sType ~= 'Drill' and sType ~= 'Pocket') or not EgtMdbSetCurrMachining( sDrilling) then
if not sDrilling
or ( sType ~= 'Drill' and ( sType ~= 'Pocket'or ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)))
or not EgtMdbSetCurrMachining( sDrilling) then
return
end
local dDrillingStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP)
@@ -2001,6 +2031,19 @@ function GetFeatureInfoAndDependency( vProc, b3Raw)
local ProcB = vProc[j]
-- verifico se feature tipo LapJoint è attraversata da almeno un foro
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove' or Mortise.Identify( Proc)) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
-- se foro in coda non setto la dipendenza
if not ProcB.AffectedFaces.Left then
Proc.PassedByHole = true
ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc
end
end
-- verifico se feature tipo LapJoint è attraversata da almeno una mortasa a coda di rondine
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove') and DtMortise.SideIdentify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
Proc.PassedByDtMortise = true
end
-- se tenone è attraversato da foro allora il foro deve essere fatto prima
if Tenon.Identify( Proc) and Drill.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
Proc.PassedByHole = true
end
-- verifiche per specchiature
@@ -2076,6 +2119,17 @@ function BeamExec.ProcessFeatures()
PrintFeatures( vProc, b3Raw)
end
EgtOutLog( ' *** AddMachinings ***', 1)
-- scrivo nel RawPart se ci sono feature lavorate con trave ruotata a 90 o 180 deg
if bSomeSide then
EgtSetInfo( nRawId, 'ROTATE90', 1)
else
EgtSetInfo( nRawId, 'ROTATE90', 0)
end
if bSomeDown then
EgtSetInfo( nRawId, 'ROTATE180', 1)
else
EgtSetInfo( nRawId, 'ROTATE180', 0)
end
-- verifico se comunque necessario taglio di testa
local bNeedHCut = VerifyNeedForHeadCut( vProc, bSomeDown, bSomeSide)
-- inserisco corrispondenze di tagli coincidenti con mortase normali o a coda di rondine di testa
+78
View File
@@ -1188,6 +1188,11 @@ end
-------------------------------------------------------------------------------------------------------------
function BeamLib.GetFacetsInfo( Proc, b3Raw)
if Proc.Fct > 20 then
return nil
end
local Face = {}
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Proc.PartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
local vAdj
@@ -1234,6 +1239,40 @@ function BeamLib.GetFacetsInfo( Proc, b3Raw)
return Face
end
---------------------------------------------------------------------
function BeamLib.GetEdgesInfo( Proc, Face)
local Edges = {}
local nFaceType, vEdges = EgtSurfTmGetFacetOutlineInfo( Proc.Id, Face.Id, GDB_ID.ROOT)
if nFaceType < 1 then
for j = 1, #vEdges do
local nPreviousEdgeIndex = j - 1
if j == 1 then
nPreviousEdgeIndex = #vEdges
end
local nNextEdgeIndex = j + 1
if j == #vEdges then
nNextEdgeIndex = 1
end
local CurrentEdge = {}
CurrentEdge.AdjacentFaceId = vEdges[j].Adj
CurrentEdge.ToolDirection = Vector3d( vEdges[j].Norm)
CurrentEdge.Length = vEdges[j].Len
CurrentEdge.Elevation = vEdges[j].Elev
CurrentEdge.IsOpen = vEdges[j].Open
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
table.insert( Edges, CurrentEdge)
end
else
error( 'Face with closed hole')
end
return Edges
end
---------------------------------------------------------------------
-- restituisce la matrice delle adiacenze di Proc dove i e j sono le facce e a(ij) è l'angolo tra di esse; 0 se nessuna adiacenza
function BeamLib.GetAdjacencyMatrix( Proc)
@@ -1296,5 +1335,44 @@ function BeamLib.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail)
return true
end
-------------------------------------------------------------------------------------------------------------
function BeamLib.GetToolFromMachining( sMachiningName)
local Tool = {}
if EgtMdbSetCurrMachining( sMachiningName) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
Tool.Name = EgtTdbGetCurrToolParam( MCH_TP.NAME)
Tool.IsCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
Tool.Type = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
-- lama
if Tool.Type == MCH_TY.SAW_STD or Tool.Type == MCH_TY.SAW_FLAT then
Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or 0
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
Tool.SideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd')
-- sega a catena
elseif Tool.Type == MCH_TY.MORTISE_STD then
Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) or 0
Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0
Tool.Width = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
Tool.Thickness = EgtTdbGetCurrToolParam( MCH_TP.THICK) or 0
Tool.CornerRadius = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or 0
-- fresa (TODO al momento aggiunte solo le informazioni che servono)
elseif Tool.Type == MCH_TY.MILL_STD or MCH_TY.MILL_NOTIP then
if BD.GetSetupInfo then
Tool.IsOnAggregate = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).bToolOnAggregate
else
Tool.IsOnAggregate = false
end
-- altri utensili al momento non previsti
else
error( 'Wrong tool type')
end
end
end
return Tool
end
-------------------------------------------------------------------------------------------------------------
return BeamLib
+5 -2
View File
@@ -275,12 +275,15 @@ local function VerifyFirstOrthoCut( CutTable, OffsetP, BBoxRawPart, dNzLimDwnUp)
-- normale alla faccia ortogonale
local _, vtO = EgtSurfTmFacetCenter( CutOId, 0, GDB_ID.ROOT)
vtO = vtO - vtO * vtN1 * vtN1 ; vtO:normalize()
local dMaxElev = EgtSurfTmFacetElevationInBBox( CutOId, 0, BBoxRawPart, true, GDB_ID.ROOT)
-- calcolo lunghezza prima semi-faccia
local asseX1 = vtO
local asseY1 = vtN1 ^ asseX1
local Frame1 = Frame3d( ptC1, ptC1+asseX1, ptC1+asseY1)
local Box1 = EgtGetBBoxRef( Cut1Id, GDB_BB.STANDARD, Frame1)
local x1 = Box1:getDimX()
-- prendo il massimo tra la lugnhezza della faccia parallela e l'elevazione della corrispondente ortogonale
x1 = max( x1, dMaxElev)
-- calcolo lunghezza seconda semi-faccia
local asseX2 = vtO
local asseY2 = vtN2 ^ asseX2
@@ -404,7 +407,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
local dNzLimDwnUp = BL.GetNzLimDownUp( BBoxRawPart)
-- se non c'è testa da sotto e normali senza componenti in Y con faccia quasi verticale e trave non alta, uso per offset i limiti dei tagli di testa e coda
if not BD.DOWN_HEAD and abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then
if not BD.TURN and not BD.DOWN_HEAD and abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then
OffsetO = dOrthoMaxDim or BD.MAX_DIM_HTCUT
end
@@ -430,7 +433,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
if dElevO then
local m = ceil( dElevO / OffsetO)
OffsetO = dElevO / m
end
end
-- elenco di tutte le superfici generate dai tagli
local TabFUCHSIA = {}
+99 -23
View File
@@ -29,6 +29,7 @@
-- 2024/02/22 Migliorato calcolo area non pinzabile in testa HCING e coda TCING
-- 2024/03/27 In MakeTwo rimossa gestione calcolo differente su ultima passata in caso di macchina FAST
-- 2024/06/18 In MakeOne in caso di inversione del percorso, si scambia anche accorciamento start con end
-- 2024/09/12 In MakeOne per settare il FaceUse si usa il versore nelle UserNotes
-- Tabella per definizione modulo
local FacesBySaw = {}
@@ -45,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)
function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut)
EgtOutLog( 'FacesBySaw.MakeParallelOne', 3)
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
@@ -76,7 +77,7 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
local bLioTang
local Ktp = 1.1
if BD.KIOTP then Ktp = BD.KIOTP end
if Ktp * dLi2Tang < dLiPerp then
if bForceTangentLeadInOut or ( Ktp * dLi2Tang < dLiPerp) then
bLioTang = true
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
if BD.TURN then
@@ -192,7 +193,7 @@ 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)
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, bForceTangentLeadInOut, Par5Alternative)
-- se lama con asse parallelo alla faccia, passo alla apposita funzione
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
Par5 == MCH_MILL_FU.PARAL_TOP or
@@ -200,7 +201,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)
return MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bForceTangentLeadInOut)
end
-- la lama ha asse perpendicolare alla faccia
EgtOutLog( 'FacesBySaw.MakeOne', 3)
@@ -209,6 +210,8 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
-- risolvo parametro ambiguo
local nOrthoOpposite
local vtOrthO
local nOrthoOppositeAlternative
local vtOrthOAlternative
if isVector3d( Par5) then
nOrthoOpposite = BL.GetNearestOrthoOpposite( Par5, vtN)
vtOrthO = Vector3d( Par5)
@@ -216,13 +219,22 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
nOrthoOpposite = Par5
vtOrthO = BL.GetVersRef( Par5)
end
if Par5Alternative then
if isVector3d( Par5Alternative) then
nOrthoOppositeAlternative = BL.GetNearestOrthoOpposite( Par5Alternative, vtN)
vtOrthOAlternative = Vector3d( Par5Alternative)
else
nOrthoOppositeAlternative = Par5Alternative
vtOrthOAlternative = BL.GetVersRef( Par5Alternative)
end
end
EgtOutLog( 'VtOrthO='..tostring( vtOrthO)..' FaceUse='..tostring( nOrthoOpposite), 3)
-- verifico se testa da sotto oppure se lavorazione sotto con testa da sopra
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN, vtOrthO) end
local bDownHead = ( dVzLimDwnUp and dVzLimDwnUp < - 1.5)
local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
-- linea o bilinea di lavorazione (qui uso nOrthoOpposite per ripetere esattamente il calcolo del Mach)
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BL.GetVersRef( nOrthoOpposite), GDB_ID.ROOT)
-- linea o bilinea di lavorazione
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, vtOrthO, GDB_ID.ROOT)
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
EgtOutLog( sWarn, 1)
@@ -234,14 +246,41 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
return false
end
local bIsSawCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
-- se settato nelle note lavorazione si lavora in discordanza
EgtMdbSetCurrMachining( sCutting)
local sMachiningNotes = EgtMdbGetCurrMachiningParam( MCH_MP.USERNOTES) or ''
if ( EgtGetValInNotes( sMachiningNotes, 'PATHINVERT', 'd') or 0) == 1 then
bIsSawCCW = not bIsSawCCW
end
local bInvert = bForceInvert
-- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento
-- l'inversione può essere comandata da rotazione lama (direzione concorde, legata anche a DownUp) oppure da direzione Z del percorso (si preferisce lavorare dal basso verso l'alto per limitare le corse)
-- se c'è disaccordo tra rotazione e direzione si cambia il lato di lavoro, se possibile. Se ciò non è possbile comanda la direzione. Se percorso orizzontale comanda la rotazione.
if bInvert == nil then
if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then
if bIsSawCCW ~= bDownUp then
bInvert = ( ptP2:getZ() < ptP1:getZ() + 100 * GEO.EPS_SMALL)
local bIsMachiningDownwards = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
local bIsMachiningUpwards = ( ptP2:getZ() > ptP1:getZ() + 100 * GEO.EPS_SMALL)
if ( bIsSawCCW ~= bDownUp) and ( bIsMachiningDownwards or not ( bIsMachiningDownwards or bIsMachiningUpwards)) then
bInvert = true
elseif ( ( bIsSawCCW ~= bDownUp) ~= bIsMachiningDownwards) then
if Par5Alternative then
bInvert = true
nOrthoOpposite = nOrthoOppositeAlternative
vtOrthO = vtOrthOAlternative
-- avendo riassegnato la direzione di lavoro, i dati della linea vanno ricalcolati
ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, vtOrthO, GDB_ID.ROOT)
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
EgtOutLog( sWarn, 1)
return true, ''
end
vtV1 = - vtV1
elseif bIsMachiningDownwards or not bIsMachiningUpwards then
bInvert = true
else
bInvert = false
end
else
bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
bInvert = false
end
else
local vtTmp = ptP2 - ptP1 ; vtTmp:normalize()
@@ -251,7 +290,10 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
if bInvert then
ptP1, ptP2 = ptP2, ptP1
vtV1, vtV2 = vtV2, vtV1
dAccStart, dAccEnd = dAccEnd, dAccStart
-- se l'inversione è forzata dall'esterno, anche gli accorciamenti che arrivano dall'esterno si prendono per buoni
if bForceInvert == nil then
dAccStart, dAccEnd = dAccEnd, dAccStart
end
end
local vtTg = ptP2 - ptP1 ; vtTg:normalize()
local dAllStart = 0
@@ -273,7 +315,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
bIsBiLinea = true
local vtTg1 = ptPm - ptP1 ; vtTg1:normalize()
local vtTg2 = ptP2 - ptPm ; vtTg2:normalize()
local dCosMax = 0.951 -- cos( 18°)
local dCosMax = 0.966 -- cos( 15°)
local dLenMin = 30
local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin)
dCosAngleL1L2 = vtTg1 * vtTg2
@@ -330,8 +372,26 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptPa1, ptPa2, vtV1, vtV2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box)
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
local dLiCompLength = 0
-- attacco tangente
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptPa1, ptPa2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box)
local dLi2Tang = 0
local dLi2Perp = 0
local dLo2Tang = 0
local dLo2Perp = 0
local dLi2CompLength = 0
-- si predilige un attacco tangenziale (con calcolo automatico di quanto uscire) se faccia che guarda in giù, non troppo orientata verso X e linea non troppo inclinata in X
-- non si fa se macchina tipo PF e pezzo alto perchè la lama, uscendo da sopra, toccherebbe la traversa
-- TODO si potranno togliere i limiti sulle normali quando si implementerà un modo per calcolare Lead In / Out correttamente in tutti i casi
--
if bSpecialTangentLeadInOut and not bIsBiLinea and ( vtN:getZ() < - 0.087) and ( abs( vtN:getX()) < 0.258) and ( abs( vtTg:getX()) < 0.1736) and ( abs( vtN:getY()) < 0.5 or ( BD.MAX_DIM_HTCUT_HBEAM > 0 or ( b3Raw:getDimZ() < 420))) then
dLi2Tang = 0
dLi2Perp = BD.CUT_EXTRA
dLi2CompLength = dLen + dSawDiam / 2 + BD.COLL_SIC
dLo2Tang = dSawDiam / 2
else
dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptPa1, ptPa2, vtN, dSawDiam / 2, vtRef, dCutExtra, b3Box)
end
local dLenLi2 = abs( dLi2Tang)
local dLenLo2 = abs( dLo2Tang)
@@ -372,14 +432,14 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
local bLioTang
local Ktp = 1.1
if BD.KIOTP then Ktp = BD.KIOTP end
if ( not bDownUp or abs( vtTg:getY()) > 0.5) and
if ( bForceTangentLeadInOut 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
( abs( vtTg:getZ()) < 0.51 and b3Box:getDimZ() > 300 and BD.C_SIMM and BD.MAX_HEIGHT > 450 and b3Box:getDimX() > BD.LEN_SHORT_PART) or
( abs( vtTg:getZ()) < 0.51 and ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) or
Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo) or
( BD.TURN == 2 and vtRef:getZ() < -0.1)) then
( BD.TURN == 2 and vtRef:getZ() < -0.1))) then
if BD.TURN == 2 then
if vtTg:getY() < -0.1 then
bLioTang = 1
@@ -402,7 +462,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
dLoPerp = BD.COLL_SIC
else
bLioTang = true
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
dLiTang, dLiPerp, dLoTang, dLoPerp, dLiCompLength = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp, dLi2CompLength
end
end
-- posizione braccio
@@ -413,9 +473,19 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
if BD.C_SIMM and bMaximizeVerticalDepth then
nSCC = MCH_SCC.ADIR_ZM
elseif abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
-- se il taglio è orizzontale, si gira aggregato lama per facilitare caduta del legno
if abs( vtTg:getZ()) < 10 * GEO.EPS_SMALL and not AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
else
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
end
else
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
-- se il taglio è orizzontale, si gira aggregato lama per facilitare caduta del legno
if abs( vtTg:getZ()) < 10 * GEO.EPS_SMALL and not AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
else
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
end
else
if BD.TURN == 2 then
@@ -462,6 +532,8 @@ 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)
-- imposto posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto inversione e lato correzione
@@ -475,6 +547,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
if BD.TURN and bLioTang == 1 then EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TG_PERP) end
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
EgtSetMachiningParam( MCH_MP.LICOMPLEN, dLiCompLength)
if BD.TURN and bLioTang == 2 then EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.PERP_TG) end
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
@@ -552,8 +625,8 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
local bConvex = ( dAngT > 0)
-- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg), oppure in testa o in coda e non troppo distanti dal grezzo esterno
local bFaceOk = {}
bFaceOk[1] = ( vtN[1]:getZ() >= BD.NZ_MINB or abs( vtN[1]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[1].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
bFaceOk[2] = ( vtN[2]:getZ() >= BD.NZ_MINB or abs( vtN[2]:getY()) < 0.174 or ( Proc.AffectedFaces.Left ~= Proc.AffectedFaces.Right and Proc.Face[2].Elevation < dMaxDepth - 10 * GEO.EPS_SMALL))
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
local sErr = 'Error : TwoFacesBySaw from bottom impossible'
EgtOutLog( sErr)
@@ -624,7 +697,8 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nOtInd], vtRef[nUpInd])
-- lavoro la faccia
for j = 1, #vCuts[i] do
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then
return bOk, sErr
end
@@ -684,14 +758,16 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
end
-- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire)
if vCuts[i][j] then
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then
return bOk, sErr
end
end
-- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire)
if vCuts[i+1][j] then
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bSpecialTangentLeadInOut = ( ( i + 1) % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then
return bOk, sErr
end
+3 -3
View File
@@ -170,7 +170,7 @@ function VerifyTool( Machining, MachiningType, Params, bH2)
return VerifyDrillPocket( Machining, Params.Diam, Params.Depth, bH2)
end
elseif MachiningType == MCH_MY.SAWING then
return true, { H2 = bH2}
return ( not Params.Depth or Machining.Tool.MaxMat > Params.Depth - GEO.EPS_SMALL), { H2 = bH2}
elseif MachiningType == MCH_MY.MILLING then
return VerifyMill( Machining, Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2)
elseif MachiningType == MCH_MY.POCKETING then
@@ -450,8 +450,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
end
---------------------------------------------------------------------
function MachiningLib.FindCutting( sType, bTopHead, bDownHead)
return FindMachining( MCH_MY.SAWING, sType, nil, bTopHead, bDownHead)
function MachiningLib.FindCutting( sType, bTopHead, bDownHead, dDepth, sSortingCriterion)
return FindMachining( MCH_MY.SAWING, sType, { Depth = dDepth}, bTopHead, bDownHead, nil, nil, sSortingCriterion)
end
---------------------------------------------------------------------
+4 -2
View File
@@ -151,7 +151,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO
-- se va fatto, inserisco la lavorazione
if bCut then
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
if bOk then
@@ -242,7 +243,8 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO
-- se va fatto, inserisco la lavorazione
if bCut then
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
if bOk then
+26 -10
View File
@@ -46,7 +46,14 @@ local ML = require( 'MachiningLib')
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessCut.Identify( Proc)
return ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10)
-- se richiesto si forza fresatura
Proc.bForceMill = ( ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) and ( ( EgtGetInfo( Proc.Id, 'Q07', 'd') or 0) == 1))
if Proc.bForceMill then
return false
else
return ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10)
end
end
---------------------------------------------------------------------
@@ -254,7 +261,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione con testa da sopra
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf)
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, bForceTangentLeadInOut)
-- ingombro del grezzo
b3Raw = b3Raw or EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
@@ -265,9 +272,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN)
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
if bFromBottom == nil then
bFromBottom = ( vtN:getZ() > 0.25 and b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and vtN:getX() < 0 and abs( vtN:getY()) < 0.259)
bFromBottom = ( vtN:getZ() > 0.25 and ( b3Solid:getDimX() < BD.LEN_SHORT_PART and BL.IsSplittedPartPhase( nPhase)) and not Proc.AdvTail and vtN:getX() < 0 and abs( vtN:getY()) < 0.259)
end
local dMinFeatureLengthForLongCut = 590.000
local dMinFeatureLengthForLongCut = EgtIf( BD.C_SIMM, 590, 400)
-- verifico se da considerare taglio lungo ( non da sotto, inclinato non più di 30deg, largo come la trave e abbastanza lungo)
local bLongCut = ( not bDownCut and vtN:getZ() > 0.865 and
Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and
@@ -548,7 +555,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
dVzLimDwnUp = -0.708
end
end
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then return bOk, sErr end
end
-- tutti gli altri casi vengono saltati
@@ -575,7 +583,13 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
elseif not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then
dVzLimDwnUp = -0.708
end
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw)
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local vtOrthoOAlternative
if ( i % 2 == 0) and ( Proc.Fct == 1) and bNoPerpCuts then
vtOrthoOAlternative = - vtOrthoO
end
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)
if not bOk then return bOk, sErr end
end
end
@@ -757,14 +771,16 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire)
if vCuts[i][j] then
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then
return bOk, sErr
end
end
-- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire)
if vCuts[i+1][j] then
local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
if not bOk then return bOk, sErr end
end
end
@@ -813,7 +829,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf)
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf, bForceTangentLeadInOut)
-- sovramateriale di coda
dOvmTail = dOvmTail or BD.OVM_MID
-- ingombro del grezzo
@@ -852,7 +868,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
local bNoDicing = false
-- 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)
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, bForceTangentLeadInOut)
bNoDicing = bNoDicing2
if not bOk then return false, sErr end
-- altrimenti taglio con testa da sotto
+4 -2
View File
@@ -521,7 +521,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD)
-- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true)
if not bOk then return bOk, sErr end
end
@@ -533,7 +534,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local b3Add = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD)
-- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Add, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, bForced, b3Raw, sNotes, dOvmTail, true)
if not bOk then return bOk, sErr end
end
+4 -3
View File
@@ -1190,14 +1190,14 @@ local function Make2Faces( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol
return MakeByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Solid)
-- altrimenti provo con il truciolatore
else
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
-- se non ho la lavorazione esco
if not sMilling then
local sErr = 'Error, machining or tool not found ' .. sName .. '-' .. sMilling
local sErr = 'Error, machining or tool not found ' .. sName
EgtOutLog( sErr)
return false, sErr
end
-- inserisco la lavorazione di fresatura
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling)
if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
@@ -1433,7 +1433,8 @@ local function MakeAuxCut( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol
return true
end
-- inserisco la lavorazione
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail}
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, Head = Proc.Head, Tail = Proc.Tail, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end
-- imposto la nota nel gruppo aggiuntivo di lavorazione per evitare di tagliare una seconda volta
+55 -4
View File
@@ -22,6 +22,8 @@
-- 2023/11/06 Migliorata gestione dei fori con AngularTransmission.
-- 2024/03/13 Aggiunta gestione Predrill
-- 2024/03/18 Per Predrill corretta direzione estrusione per fori con direzione verso il basso
-- 2024/09/04 Gestione dipendenza foro-tasca in caso di fase con pezzo ribaltato
-- 2024/09/10 In GetData corretta gestione modifica diametro foro
-- Tabella per definizione modulo
local ProcessDrill = {}
@@ -101,9 +103,10 @@ function ProcessDrill.GetData( Proc, b3Raw)
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
-- verifico se foro da adattare
if EgtExistsInfo( Proc.Id, 'DiamUser') then
if AuxId then AuxId = AuxId + Proc.Id end
if AuxId and EgtGetType( AuxId) == GDB_TY.CRV_ARC and BD.USER_HOLE_DIAM and BD.USER_HOLE_DIAM > 1 then
EgtModifyArcRadius( AuxId, BD.USER_HOLE_DIAM / 2)
local nNewAuxId
if AuxId then nNewAuxId = AuxId + Proc.Id end
if AuxId and EgtGetType( nNewAuxId) == GDB_TY.CRV_ARC and BD.USER_HOLE_DIAM and BD.USER_HOLE_DIAM > 1 then
EgtModifyArcRadius( nNewAuxId, BD.USER_HOLE_DIAM / 2)
end
end
-- recupero diametro e lunghezza
@@ -213,7 +216,7 @@ end
---------------------------------------------------------------------
-- Classificazione della feature
function ProcessDrill.Classify( Proc, b3Raw)
function ProcessDrill.Classify( Proc, b3Raw, sDownOrSideOrStd)
-- recupero e verifico l'entità foro
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
if AuxId then AuxId = AuxId + Proc.Id end
@@ -243,6 +246,23 @@ function ProcessDrill.Classify( Proc, b3Raw)
local bOpen = ( Proc.Fce ~= 0)
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and abs( Proc.Flg) == 2)))
local bAngTransm = ( BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreSameOrOppositeVectorApprox( vtExtr, Z_AX()))
-- se ci sono delle dipendenze da altre feature da rispettare
if sDownOrSideOrStd then
if sDownOrSideOrStd == 'DOWN' then
-- se foro fatto in doppio entrambe le forature (valore assoluto) devono essere sopra al valore limite, se foro singolo deve essere sopra al valore limite se ribaltato
if ( abs( Proc.Flg) == 2 and ( abs( vtExtr:getZ()) < - BD.DRILL_VZ_MIN) or ( abs( Proc.Flg) ~= 2 and vtExtr:getZ() < - BD.DRILL_VZ_MIN)) then
-- in doppio non cambio di fase al foro perchè devo garantire il lato master su H1
if not( Proc.Double) or Proc.Double == 0 then
Proc.Down = true
Proc.Side = false
end
return true
end
end
return false
end
-- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco
if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then
if not bOpen then
@@ -462,6 +482,27 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- eventuale inversione foro in base al lato di lavoro e al lato testa dell'utensile scelto
-- se non già richiesta inversione e foro quasi orizzontale (15deg) passante
if not bToInvert and Proc.Flg == 1 and bOpen and abs( vtExtr:getZ()) < 0.259 and abs( vtExtr:getY()) > 0.966 then
if BD.GetSetupInfo then
if EgtMdbSetCurrMachining( sDrilling or '') then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
local sHead = ''
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid or '') or '') then
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
end
local SetupInfo = BD.GetSetupInfo( sHead)
-- lato testa e lato di lavoro devono corrispondere
if ( ( SetupInfo.bIsFrontHead == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL)
or ( ( SetupInfo.bIsBackHead == false) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then
ptCen = ptCen - vtExtr * dLen
vtExtr = - vtExtr
bToInvert = true
end
end
end
end
-- 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
@@ -584,6 +625,16 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
end
-- se lavorazione in doppio
if Proc.Double and Proc.Double > 0 then
-- calcolo gli step reali
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
local nNumStep = ceil( dDepth/dStep)
local dRealStep = dDepth / nNumStep
-- Se nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno
if ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then
dRealStep = ceil( dDepth / (nNumStep - 1))
EgtSetMachiningParam( MCH_MP.STEP, dRealStep)
sMyWarn ='Warning in drill-double : step changed to ' .. tostring(dRealStep) .. 'mm'
end
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
if Proc.Double ~= Proc.PrevDouble then
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
+2 -1
View File
@@ -210,7 +210,8 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB)
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom)
if not bOk then return bOk, sErr end
+2 -1
View File
@@ -207,7 +207,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- altrimenti applico taglio di lama
else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
if not bOk then return bOk, sErr end
+62 -17
View File
@@ -31,6 +31,9 @@ local Q_DEPTH_CHAMFER = 'Q02' -- d
local Q_OVERMAT_FOR_FINISH = 'Q03' -- d
local Q_ONLY_CHAMFER = 'Q00' -- i
local Q_RADIAL_OFFSET = 'Q06' -- d, valido solo per pocket
local Q_IGNORE_LASER_PROBLEMS = 'Q07'
local Q_FORCE_CLAMPABLE_AREA = 'Q08'
local Q_INVERT_LAST_PATH = 'Q09'
---------------------------------------------------------------------
-- Riconoscimento della feature
@@ -99,6 +102,8 @@ end
function ProcessFreeContour.Classify( Proc, b3Raw)
-- verifico se di tipo pocket
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
-- verifico se forzata esecuzione anche se di testa e ribaltata o ruotata (lettura laser)
local bDownSideOnHeadOk = ( EgtGetInfo( Proc.Id, Q_IGNORE_LASER_PROBLEMS, 'd') or 0) == 1
-- recupero la curva associata
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if not AuxId then return false end
@@ -107,23 +112,23 @@ function ProcessFreeContour.Classify( Proc, b3Raw)
-- se tasca
if bPocket then
local bDown = ( vtN:getZ() < - 0.5)
return true, bDown, false
return true, bDown, false, bDownSideOnHeadOk
-- se altrimenti profilo orizzontale
elseif abs( vtN:getZ()) < 0.5 then
return true, false, false
return true, false, false, bDownSideOnHeadOk
-- se altrimenti profilo verticale che non interessa tutta la sezione
elseif Proc.Box:getDimZ() < 0.9 * b3Raw:getDimZ() then
local bDown = ( vtN:getZ() < - 0.5)
return true, bDown, false
return true, bDown, false, bDownSideOnHeadOk
-- altrimenti è profilo verticale che interessa tutta la sezione
else
-- recupero la massima capacità di lavoro dell'utensile da utilizzare
local sMilling, dMaxDepth = ML.FindMilling( 'FreeContour')
if not sMilling then dMaxDepth = 0 end
if Proc.Box:getDimZ() > dMaxDepth and BD.ROT90 then
return true, false, true
return true, false, true, bDownSideOnHeadOk
else
return true, false, false
return true, false, false, bDownSideOnHeadOk
end
end
end
@@ -584,6 +589,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
end
-- eventuale inversione ultimo segmento
local bInvertLastPath = ( ( EgtGetInfo( Proc.Id, Q_INVERT_LAST_PATH, 'd') or 0) == 1)
-- eseguo
for i = 1, nStep do
for j = 1, nDouble do
@@ -626,35 +633,66 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- aggiungo geometria
EgtSetMachiningGeometry( {{ AuxId, -1}})
-- eventuale accorciamento di testa
local dStartAddLen, dEndAddLen, dWorkSide, bToolInvert, bInvert
if ( j == 1 and i > 1) or ( j == 2 and i < nStep) then
local dStartAddLen = EgtIf( j == 1, - ( i - 1) * dStep, - ( nStep - i) * dStep)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
dStartAddLen = EgtIf( j == 1, - ( i - 1) * dStep, - ( nStep - i) * dStep)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( j == 1, dStartAddSpec, dEndAddSpec))
dStartAddLen = EgtIf( j == 1, dStartAddSpec, dEndAddSpec)
end
-- eventuale accorciamento di coda
if ( j == 1 and i < nStep) or ( j == 2 and i > 1) then
local dEndAddLen = EgtIf( j == 1, - ( nStep - i) * dStep, - ( i - 1) * dStep)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
dEndAddLen = EgtIf( j == 1, - ( nStep - i) * dStep, - ( i - 1) * dStep)
else
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( j == 1, dEndAddSpec, dStartAddSpec))
dEndAddLen = EgtIf( j == 1, dEndAddSpec, dStartAddSpec)
end
-- se estrusione da sotto, inverto direzione fresa
if ( j == 1 and bToolInv) or ( j == 2 and not bToolInv) then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
bToolInvert = true
else
bToolInvert = false
end
-- se seconda passata, inverto direzione di lavoro
if j == 2 then
EgtSetMachiningParam( MCH_MP.INVERT, true)
bInvert = true
else
bInvert = false
end
-- assegno lato di lavoro
if Proc.Grp == 0 then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
dWorkSide = MCH_MILL_WS.CENTER
elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) or ( Proc.Grp == 1 and bToolInv) or ( Proc.Grp == 2 and bToolInv) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
dWorkSide = MCH_MILL_WS.LEFT
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) or ( Proc.Grp == 1 and not bToolInv) or ( Proc.Grp == 2 and not bToolInv) then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
dWorkSide = MCH_MILL_WS.RIGHT
end
-- se ultimo step da invertire
if i == nStep and bInvertLastPath then
-- se profilo orizzontale
if abs( vtExtr:getZ()) < 10 * GEO.EPS_SMALL then
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
bInvert = not( bInvert)
bToolInvert = not( bToolInvert)
else
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
bInvert = not( bInvert)
if dWorkSide == MCH_MILL_WS.LEFT then
dWorkSide = MCH_MILL_WS.RIGHT
elseif dWorkSide == MCH_MILL_WS.RIGHT then
dWorkSide = MCH_MILL_WS.LEFT
end
end
end
-- setto i valori
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToolInvert)
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, dWorkSide)
-- posizione braccio porta testa
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM then
@@ -713,7 +751,13 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- eventuale segnalazione ingombro di testa o coda
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
if Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ then
local bRawPartHas90Rotation = ( ( EgtGetInfo( nRawId, 'ROTATE90', 'd') or 0) == 1)
-- eventuale forzatura area feature pinzabile
local bForceClampableArea = ( ( EgtGetInfo( Proc.Id, Q_FORCE_CLAMPABLE_AREA, 'd') or 0) == 1)
-- se la feature è passante top/down oppure se è passante e si ruota di 90deg considero sempre non pinzabile; in alternativa si valuta in base all'ingombro
if not bForceClampableArea and ( ( Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ) or
( Proc.AffectedFaces.Top and Proc.AffectedFaces.Bottom and ( AreSameOrOppositeVectorApprox( vtExtr, Z_AX()))) or
( Proc.AffectedFaces.Front and Proc.AffectedFaces.Back and bRawPartHas90Rotation)) then
if Proc.Head then
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
BL.UpdateHCING( nRawId, dOffs)
@@ -722,6 +766,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
BL.UpdateTCING( nRawId, dOffs)
end
end
return true, sWarn
end
+230 -135
View File
@@ -22,6 +22,7 @@ local Fbs = require( 'FacesBySaw')
local Cut = require( 'ProcessCut')
local Pocket = require( 'FaceByPocket')
local Topology = require( 'FeatureTopology')
local Split = require( 'ProcessSplit')
EgtOutLog( ' ProcessHeadCut started', 1)
@@ -29,6 +30,10 @@ EgtOutLog( ' ProcessHeadCut started', 1)
local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
if BD.PRECUT_HEAD == nil then
BD.PRECUT_HEAD = true
end
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessHeadCut.Identify( Proc)
@@ -156,10 +161,9 @@ end
---------------------------------------------------------------------
-- tagli verticali aggiuntivi
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw )
local _, dimH = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local nVerticalCuts = ceil( dimH / ( BD.MAX_LEN_DICE)) - 1
local dVerticalSliceHeight = dimH / ( nVerticalCuts + 1)
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw)
local nVerticalCuts = ceil( Proc.Face[1].WidthTrimmed / ( BD.MAX_LEN_DICE)) - 1
local dVerticalSliceHeight = Proc.Face[1].WidthTrimmed / ( nVerticalCuts + 1)
-- recupero il diametro dell'utensile
local dSawDiam = 400
if EgtMdbSetCurrMachining( sCutting) then
@@ -173,12 +177,180 @@ local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw )
for j = nVerticalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
local dVerticalCutOffset = dVerticalSliceHeight * -j
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw)
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)
if not bOk then return bOk, sErr end
end
return bOk, sErr
end
---------------------------------------------------------------------
-- tagli standard
local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, HeadCutType, Cutting1Data, Cutting2Data, dStartOffset, dOvmHead)
local PrecutType = { bBigSectionCut = HeadCutType.bBigSectionCut, bHorizCut = HeadCutType.bHorizCut, bDoubleHorizCut = HeadCutType.bDoubleHorizCut, bDoubleCut = HeadCutType.bDoubleCut, sType = 'Precut', bNeedVerticalAddedCuts = false, bNeedHorizontalAddedCuts = false}
if not HeadCutType.bDoubleHorizCut then
-- flag di lavorazione faccia
local nOrthoOpposite = EgtIf( HeadCutType.bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_FRONT)
-- calcolo extra taglio ed accorciamento
local dCutExtra = 0
local dAccStart = 0
local dAccEnd = 0
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
dCutExtra = EgtIf( HeadCutType.bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
else
dCutExtra = - ( b3Raw:getDimY() - Cutting1Data.dMaxDepth)
local dSawRad = Cutting1Data.dSawDiam / 2
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
local dKL = dSawRad - Cutting1Data.dMaxDepth + EgtIf( HeadCutType.bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
local dMinSawingLength = 5
if BD.C_SIMM then
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo entrata
if dAccEnd > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccStart = b3Raw:getDimZ() - dAccEnd - dMinSawingLength
end
else
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo uscita
if dAccStart > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccEnd = b3Raw:getDimZ() - dAccStart - dMinSawingLength
end
end
end
-- per travi alte faccio dei tagli orizzontali aggiuntivi
if HeadCutType.bNeedHorizontalAddedCuts then
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not ( HeadCutType.bBigSectionCut) and BD.PRECUT_HEAD then
dStartOffset = dOvmHead
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
local nHorizontalCuts = ceil( Proc.Face[1].HeightTrimmed / BD.MAX_DIM_DICE) - 1
local dHorizontalSliceHeight = Proc.Face[1].HeightTrimmed / ( nHorizontalCuts + 1)
for i = nCuts, 1, -1 do
local dCutXOffset = ( i - 1) * dOffsetBetweenCuts
-- tagli orizzontali
for j = nHorizontalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
local bForceTangentLeadInOut = BD.PRESS_ROLLER
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
if not bOk then return bOk, sErr end
end
-- se necessario taglio verticale doppio, eseguo l'opposto
if HeadCutType.bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStartDoubleCut, dAccEndDoubleCut, '', b3Raw, true)
if not bOk then return false, sErr end
end
-- taglio verticale
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, '', b3Raw, true)
if not bOk then return bOk, sErr end
end
return true, sWarn
end
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not ( HeadCutType.bBigSectionCut) and BD.PRECUT_HEAD and HeadCutType.bNeedVerticalAddedCuts then
dStartOffset = dOvmHead
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- se necessari tagli in doppio, eseguo gli opposti
if HeadCutType.bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and HeadCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, '', b3Raw, true)
if not bOk then return false, sErr end
end
end
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
-- se trave larga effettuo tagli verticali aggiuntivi
if HeadCutType.bNeedVerticalAddedCuts then
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw)
if not bOk then return bOk, sErr end
end
if i == 1 and HeadCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw, true)
if not bOk then return false, sErr end
end
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
else
-- verifico esistenza della lavorazione con lama da sotto
if not Cutting2Data.sCutting then
local sErr = 'Error : cutting H2 not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- verifico che le due lame riescano a lavorare la sezione
local dDimZ = b3Raw:getDimZ()
local dExtra = Cutting1Data.dMaxVertDepth + Cutting2Data.dMaxDepth - dDimZ
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not HeadCutType.bBigSectionCut then
local sErr = 'Error : section too big for head cut'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo extra taglio ed accorciamento
local dCutExtra = -Cutting2Data.dMaxDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dCutExtra2 = -Cutting1Data.dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dAccStart = 0
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not ( HeadCutType.bBigSectionCut) and BD.PRECUT_HEAD and HeadCutType.bNeedVerticalAddedCuts then
dStartOffset = dOvmHead
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- eseguo i tagli da sotto necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and HeadCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting2Data.sCutting, Cutting2Data.dSawDiam, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw, nil, true)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and HeadCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
-- se trave larga effettuo tagli verticali aggiuntivi
if HeadCutType.bNeedVerticalAddedCuts then
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw)
if not bOk then return bOk, sErr end
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
if not bOk then return false, sErr end
end
end
return true
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut)
@@ -193,7 +365,15 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
-- eventuali informazioni sul tipo di finitura
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
-- recupero la lavorazione
local sCutting = ML.FindCutting( 'HeadSide')
-- TODO questa parte andrà cambiata quando si gestiranno i volumi liberi in cui girare da mlse
local dMinWidthForBigBlade = 300
local dMaxHeightForBigBlade = 300
local sCutting
if b3Raw:getDimY() > dMinWidthForBigBlade and b3Raw:getDimZ() < dMaxHeightForBigBlade then
sCutting = ML.FindCutting( 'HeadSide', nil, nil, nil, 'Longest')
else
sCutting = ML.FindCutting( 'HeadSide')
end
if not sCutting then
local sErr = 'Error : cutting not found in library'
EgtOutLog( sErr)
@@ -223,7 +403,7 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2
dSawThick2 = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick2
end
end
-- caratteristiche taglio
@@ -233,6 +413,15 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)
local 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)
-- verifico necessità di tagli aggiuntivi orizzontali o verticali
local dMinOvmHeadForAddeddCuts = 10.123
local bNeedVerticalAddedCuts = ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL)
local bNeedHorizontalAddedCuts = ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL)
-- dati lavorazioni sopra e sotto
local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth}
local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dMaxDepth2, dSawThick = dSawThick2}
-- dati sul taglio di testa da effettuare
local HeadCutType = { bBigSectionCut = bBigSectionCut, bHorizCut = bHorizCut, bDoubleHorizCut = bDoubleHorizCut, bDoubleCut = bDoubleCut, bNeedVerticalAddedCuts = bNeedVerticalAddedCuts, bNeedHorizontalAddedCuts = bNeedHorizontalAddedCuts}
-- dati geometrici del taglio
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
-- se non obbligatorio e coincide con inizio grezzo, non va fatto
@@ -242,8 +431,6 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
-- 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
local _, dimH, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local dMinOvmHeadForAddeddCuts = 10.123
-- se taglio per sezioni alte e larghe
if bBigSectionCut then
if dOvmHead > 0 then
@@ -259,11 +446,34 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
else
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
end
-- taglio a zero (con sega a catena o mix catena + lama) per evitare problemi con grezzo più lungo del previsto
if BD.PRECUT_HEAD then
-- recupero dati utensile della sega a catena più lunga a disposizione
local sSawing = ML.FindSawing( 'SawingForSplitting', nil, nil, 'Longest')
if not sSawing then
sSawing = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
end
local dChainSawMaxMat = 0
local dChainSawLen = 0
if EgtMdbSetCurrMachining( sSawing or '') then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dChainSawMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dChainSawMaxMat
dChainSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dChainSawLen
end
end
local SawingData = { sSawing = sSawing, dChainSawMaxMat = dChainSawMaxMat, dChainSawLen = dChainSawLen, bInvert = true}
local dOffset = dOvmHead
local bOkPrecut, sErrPrecut = Split.MakeBigSectionSplitting( Proc, b3Raw, dOffset, SawingData, Cutting2Data)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard
if dMaxElev > dSawThickCheck then
local bOk, sErr
-- se trave larga effettuo tagli verticali aggiuntivi
if ( dimH > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) then
if bNeedVerticalAddedCuts then
-- ad ogni offset di taglio dovrò fare prima i tagli verticali e poi i cubetti
for i = nCuts, 1, -1 do
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
@@ -288,11 +498,15 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw)
if not bOk then return bOk, sErr end
-- tagli a cubetti con eventuale superficie limitante
bOk, sErr = Cut.Make( AddProc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT, nil, nLimitingSurf)
bOk, sErr = Cut.Make( AddProc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nLimitingSurf)
end
-- tagli aggiuntivi non necessari
else
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT)
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)
end
return bOk, sErr
end
@@ -315,130 +529,11 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
end
end
end
-- se tagli standard
if not bDoubleHorizCut then
-- flag di lavorazione faccia
local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_FRONT)
-- calcolo extra taglio ed accorciamento
local dCutExtra = 0
local dAccStart = 0
local dAccEnd = 0
if b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
else
dCutExtra = - ( b3Raw:getDimY() - dMaxDepth)
local dSawRad = dSawDiam / 2
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
local dKL = dSawRad - dMaxDepth + EgtIf( bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
local dMinSawingLength = 5
if BD.C_SIMM then
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo entrata
if dAccEnd > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccStart = b3Raw:getDimZ() - dAccEnd - dMinSawingLength
end
else
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo uscita
if dAccStart > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccEnd = b3Raw:getDimZ() - dAccStart - dMinSawingLength
end
end
end
local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, HeadCutType, Cutting1Data, Cutting2Data, nil, dOvmHead)
-- per travi alte faccio dei tagli orizzontali aggiuntivi
local bAreHorizontalCutsNeeded = ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL)
if bAreHorizontalCutsNeeded then
local nHorizontalCuts = ceil( dimV / BD.MAX_DIM_DICE) - 1
local dHorizontalSliceHeight = dimV / ( nHorizontalCuts + 1)
for i = nCuts, 1, -1 do
local dCutXOffset = ( i - 1) * dOffsL
-- tagli orizzontali
for j = nHorizontalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw)
if not bOk then return bOk, sErr end
end
-- se necessario taglio verticale doppio, eseguo l'opposto
if bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStartDoubleCut, dAccEndDoubleCut, '', b3Raw, true)
if not bOk then return false, sErr end
end
-- taglio verticale
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, '', b3Raw)
if not bOk then return bOk, sErr end
end
return true, sWarn
end
-- se necessari tagli in doppio, eseguo gli opposti
if bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, '', b3Raw, true)
if not bOk then return false, sErr end
end
end
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
-- se trave larga effettuo tagli verticali aggiuntivi
if ( dimH > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) then
local bOk, sErr = AddVerticalPreCuts( Proc, sCutting, dCutOffset, b3Raw)
if not bOk then return bOk, sErr end
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
if not bOk then return false, sErr end
end
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
else
-- verifico esistenza della lavorazione con lama da sotto
if not sCutting2 then
local sErr = 'Error : cutting H2 not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- verifico che le due lame riescano a lavorare la sezione
local dDimZ = b3Raw:getDimZ()
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not bBigSectionCut then
local sErr = 'Error : section too big for head cut'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo extra taglio ed accorciamento
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dAccStart = 0
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
-- eseguo i tagli da sotto necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw, nil, true)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
-- se trave larga effettuo tagli verticali aggiuntivi
if ( dimH > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) then
local bOk, sErr = AddVerticalPreCuts( Proc, sCutting, dCutOffset, b3Raw)
if not bOk then return bOk, sErr end
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
if not bOk then return false, sErr end
end
end
return true
end
return bOk, sErr
end
---------------------------------------------------------------------
return ProcessHeadCut
+331 -167
View File
@@ -108,6 +108,7 @@
-- 2024/06/18 In MakeByMillAsSaw si cerca di orientare il motore verso il lato più vicino (rispetto a dove è la feature)
-- 2024/06/28 In VerifySideMillAsSaw modificato criterio ricerca utensile in base a normale della faccia
-- 2024/07/04 In IsTailFeature controllo per spostare lapjoint dopo taglio di separazione per lavorazioni tipo BH
-- 2024/09/03 In MakeLongMoreFaces si aggiunge faccia di fondo anche per topologia Groove passante a 3 facce
-- Tabella per definizione modulo
local ProcessLapJoint = {}
@@ -116,6 +117,7 @@ local ProcessLapJoint = {}
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local Fbp = require( 'FaceByPocket')
local Cut = require( 'ProcessCut')
local DoubleCut = require( 'ProcessDoubleCut')
local LongCut = require( 'ProcessLongCut')
@@ -141,6 +143,9 @@ local Q_SIDE_ROUGH_TOOL = '' -- i
local Q_ANTISPLINT_TYPE = '' -- i
local Q_BLADE_ON_ALONG_FACE = '' -- i
local Q_MAX_ELEVATION = '' -- d
local Q_SAW_PLUS_CHAIN = '' -- i
local Q_FORCE_CHAINSAW = '' -- i
-- variabile smussi
local bMadeChamfer
@@ -151,18 +156,22 @@ local bTrySidePocketAtFirst = true
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessLapJoint.Identify( Proc)
return ( (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90) or
( Proc.Grp == 4 and Proc.Prc == 37) or
( Proc.Grp == 4 and Proc.Prc == 39) or
( Proc.Grp == 4 and Proc.Prc == 120))
if Proc.bForceMill then
return true
else
return ( (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34) or
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90) or
( Proc.Grp == 4 and Proc.Prc == 37) or
( Proc.Grp == 4 and Proc.Prc == 39) or
( Proc.Grp == 4 and Proc.Prc == 120))
end
end
---------------------------------------------------------------------
@@ -182,6 +191,7 @@ local function AssignQIdent( Proc)
Q_MAX_ELEVATION = 'Q10'
Q_STAIRCASE = ''
Q_SAW_PLUS_CHAIN = 'Q11'
Q_FORCE_CHAINSAW = 'Q12'
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
Q_FORCE_BLADE = 'Q01' -- i
@@ -404,11 +414,11 @@ local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bP
end
---------------------------------------------------------------------
local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill, b3Raw)
-- se non feature BlockHausHalfLap e non abilitato parametro Q per lavorarlo di fianco e non macchina BH esco
local nUseSideTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0
if Proc.Prc ~= 37 and nUseSideTool == 0 and not BD.BH_MACHINE then
if Proc.Prc ~= 37 and not BD.BH_MACHINE and ( nUseSideTool == 0 or ( nUseSideTool == 4 and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right))) then
return false
end
@@ -434,9 +444,13 @@ local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
-- le facce devono contenere X e quelle di chiusura devono essere perpendicolari a X
local bStopY, bStopZ
if not Proc.TopologyLongName then
Topology.Classify( Proc, b3Raw)
end
for i = 1, Proc.Fct do
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
if abs( vtN:getX()) > 0.001 and abs( vtN:getX()) < 0.999962 then
-- permessa U passante non parallela agli assi principali
if abs( vtN:getX()) > 0.001 and abs( vtN:getX()) < 0.999962 and Proc.TopologyLongName ~= "Groove-Through-RightAngles-NotParallel-3" then
return false
end
if abs( vtN:getY()) > 0.866 then bStopY = true end
@@ -766,7 +780,7 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
-- in base al tipo di feature attribuisco il significato dei parametri Q
AssignQIdent( Proc)
-- se può essere fatto con utensile tipo lama
local bUseBHSideMill, bHead, bHeadDir = VerifyBHSideMill( Proc)
local bUseBHSideMill, bHead, bHeadDir = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw)
if bUseBHSideMill then
Proc.HeadDir = bHeadDir
end
@@ -774,14 +788,16 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- verifico se è in coda
local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX()
if dEndDist > BD.MAX_DIST_HTFEA then
if bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
if ( dEndDist > BD.MAX_DIST_HTFEA) or bUseBHSideMill then
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
return true
else
return false
end
end
-- se lunga come trave, oppure non è trave corta e la sua lunghezza supera il massimo o il 80% della lunghezza della trave
if Proc.Box:getDimX() > b3Solid:getDimX() - 1 or
( b3Solid:getDimX() > BD.LEN_SHORT_PART and Proc.Box:getDimX() > min( BD.MAX_LEN_HTFEA, 0.8 * b3Solid:getDimX())) then
@@ -824,7 +840,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
-- se 2 facce
elseif Proc.Fct == 2 then
-- se può essere fatto con utensile tipo lama
local bUseBHSideMill = VerifyBHSideMill( Proc)
local bUseBHSideMill = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw)
if bUseBHSideMill then
return true, false
end
@@ -861,12 +877,25 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
end
-- se è presente il rinvio angolare con lavorazioni di tasca ed è una tasca perfettamente verticale da sotto, non ruoto
if BD.ANG_TRASM and Proc.Fct >= 4 and not bClosedOrthoFaces then
local vtNBottomFace = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
if AreOppositeVectorApprox( vtNBottomFace, Z_AX()) and
if AreOppositeVectorApprox( Proc.Face[nFacInd + 1].VtN, Z_AX()) and
( Proc.Fct >= 5 and ML.FindPocketing( 'Pocket_AT') or ( Proc.Fct < 5 and ML.FindPocketing( 'OpenPocket_AT'))) then
return true, false
end
end
-- se groove da sotto e possibile fresatura tipo SideMillAsBlade non ruoto
if Proc.AllRightAngles and ( Proc.Topology == 'Groove' or Proc.Topology == 'Pocket') and not( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and AreOppositeVectorApprox( Proc.Face[nFacInd + 1].VtN, Z_AX()) then
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
local sErr = 'Error : missing AddGroup'
EgtOutLog( sErr)
return false, sErr
end
if VerifySideMillAsSaw( Proc, nAddGrpId, Proc.Face[nFacInd + 1].VtN, min( Proc.Face[nFacInd + 1].Height, Proc.Face[nFacInd + 1].Width) , Proc.Face[nFacInd + 1].Elevation) then
Proc.OkFromBottom = true
return true, false
end
end
-- se scanalatura chiusa lavoro la faccia di fondo
if Proc.Topology == 'Pocket' and ( Proc.IsParallel or Proc.AllRightAngles) and not bClosedOrthoFaces then
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, nil, 4)[1]
@@ -891,7 +920,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
-- se può essere fatto con utensile tipo lama
local bUseBHSideMill, _, _, _, _, dTDiam = VerifyBHSideMill( Proc)
local bUseBHSideMill, _, _, _, _, dTDiam = VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw)
if bUseBHSideMill then
if vtN:getZ() > -0.5 or b3Raw:getDimZ() - Proc.Box:getDimZ() < ( BD.MAX_DIST_BH_FROM_BOTTOM or 395) - dTDiam / 2 then
return true, false
@@ -910,7 +939,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
local bIsU = ( Proc.Fct == 3 and not TestElleShape3( Proc))
-- se forzata la lavorazione con fresa di lato da parametro Q03=2/3 non devo ruotare
local nSideRoughTool = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'd')
local bForceSideMill = ( ( nSideRoughTool == 2 or nSideRoughTool == 3) and ( Proc.Fct == 3 or Proc.Fct == 4))
local bForceSideMill = ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and ( nSideRoughTool == 2 or nSideRoughTool == 3) and ( Proc.Fct == 3 or Proc.Fct == 4)
if bForceSideMill then
bDown = false
elseif nFacInd2 and dElev2 < 160 and dElev2 < 2 * dElev then
@@ -981,8 +1010,11 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bUp, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.PARAL_RIGHT))
end
-- imposto lato di correzione
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
if not bUp then EgtSetMachiningParam( MCH_MP.INVERT, true) end
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
if not bUp then
EgtSetMachiningParam( MCH_MP.INVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
end
-- imposto posizione braccio porta testa
if vtN:getY() < GEO.EPS_SMALL then
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
@@ -1187,7 +1219,8 @@ local function MakePreCuts( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, nCha
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
-- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local nCutFacet = EgtSurfTmFacetCount( AddId)
if nCutFacet == 1 then
return Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
@@ -2547,7 +2580,7 @@ end
---------------------------------------------------------------------
local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
-- Se variabile globale indica che lo smusso è gi stato fatto, esco
-- Se variabile globale indica che lo smusso è già stato fatto, esco
if bMadeChamfer then
return 0
end
@@ -2561,6 +2594,7 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
end
-- ottengo le curve di contorno libero
local nAuxId1, nAuxId2, nNumIdAux
local bIsOpenPath = false
if bIs3Faces then
-- estraggo i percorsi
nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
@@ -2571,6 +2605,36 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
else
nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
if not nNumIdAux then nNumIdAux = 0 end
-- se non è una curva chiusa bisogna estrarre le sole curve da lavorare
if Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' then
local IdsToMachine = {}
bIsOpenPath = true
local nFirstId, nIdCount = EgtExplodeCurveCompo( nAuxId1)
for i = nFirstId, nFirstId + nIdCount - 1, 1 do
-- se segmento di retta
if EgtGetType( i) == GDB_TY.CRV_LINE then
local _, nEntitiesCount = EgtCurveDomain(i)
for j = 0, nEntitiesCount - 1 do
local ptStart = EgtUP( i, j, GDB_RT.GLOB)
local ptEnd = EgtUP( i, j + 1, GDB_RT.GLOB)
if ( AreSameVectorApprox( vtOrtho, X_AX()) and ( abs( ptStart:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or
AreSameVectorApprox( vtOrtho, -X_AX()) and ( abs( ptStart:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or
AreSameVectorApprox( vtOrtho, Y_AX()) and ( abs( ptStart:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or
AreSameVectorApprox( vtOrtho, -Y_AX()) and ( abs( ptStart:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or
AreSameVectorApprox( vtOrtho, Z_AX()) and ( abs( ptStart:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or
AreSameVectorApprox( vtOrtho, -Z_AX()) and ( abs( ptStart:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL and abs( ptEnd:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL)
) then
table.insert( IdsToMachine, i)
end
end
else
return 0
end
end
local ptNear = EgtSurfTmFacetCenter(Proc.Id, 0, GDB_ID.ROOT)
nAuxId1 = EgtCurveCompoByReorder( nAddGrpId, IdsToMachine, ptNear, true, GDB_ID.ROOT)
nNumIdAux = 1
end
end
local dExtra = 2
@@ -2590,13 +2654,20 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
end
else
AuxId = nAuxId1 + i - 1
vtExtr, _, _ = EgtCurveArea( AuxId)
end
if vtExtr then
if not bIs3Faces then
if bIsOpenPath then
_, vtExtr = EgtCurveIsFlat( AuxId)
else
vtExtr, _, _ = EgtCurveArea( AuxId)
end
if vtExtr then
local fFrCurve = EgtGetGlobFrame( AuxId)
vtExtr:toGlob( fFrCurve)
if bIsOpenPath and vtExtr * vtOrtho < GEO.EPS_SMALL then
vtExtr = -vtExtr
end
end
end
if vtExtr then
-- if bIs3Faces and i == nNumIdAux then
-- vtExtr = -vtExtr
-- end
@@ -2840,6 +2911,12 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
local nOk, sErr = MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
if nOk < 0 then return false, sErr end
end
-- slot aperta su due lati
elseif Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' then
if nChamfer > 0 then
local nOk, sErr = MakeChamfer( Proc, false, nAddGrpId, rfFac:getVersZ(), b3Solid, nil, dDepthCham)
if nOk < 0 then return false, sErr end
end
end
if not dDepth then dDepth = dElev end
-- Recupero le facce adiacenti alla principale
@@ -3359,7 +3436,11 @@ 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
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
dElev = dMaxElev or dElev
local sWarn
local dDepth = dElev
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
@@ -3370,11 +3451,7 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
EgtOutLog( sWarn)
end
-- imposto elevazione e dichiaro non si generano sfridi per VMill
-- eventuale massima elevazione imposta dall'utente
local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
if dMaxElev and dMaxElev < 1 then dMaxElev = nil end
dMaxElev = dMaxElev or dElev
local sNotes = 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';'
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
sNotes = sNotes .. 'VMRS=0;'
if bOpenOutRaw then
sNotes = sNotes .. 'OpenOutRaw=1;'
@@ -3422,6 +3499,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
local sMchFind = 'Pocket'
local dAngLimit = 40
local sWarn
-- se feature é larga come trave imposto openpocket
if nDiffWidth == 0 then
@@ -3435,6 +3513,15 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
-- calcolo l'angolo dalla verticale dall'angolo tra le due facce, perchè la feature potrebbe essere ruotata sulla Z locale della
-- faccia principale e quindi la componente X del versore della faccia potrebbe dare un valore non coerente
local dDiffFromSqAng = dAng + 90
-- informazioni sul lato da lavorare
local Edges = BL.GetEdgesInfo( Proc, Proc.Face[nSideFace + 1])
local EdgeToMachine = {}
for i = 1, #Edges do
local CurrentEdge = Edges[i]
if CurrentEdge.AdjacentFaceId == nBaseFace then
EdgeToMachine = CurrentEdge
end
end
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
if cos( dDiffFromSqAng) < cos( dAngLimit) then
-- applico la svuotatura
@@ -3460,14 +3547,28 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, nSideFace}})
-- imposto uso faccia
local nFaceUse = BL.GetNearestOrthoOpposite(tvtN[1])
-- imposto vettore direzione e faceUse
local vtFaceUse = EdgeToMachine.ToolDirection
local sUserNotes = ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtFaceUse', EgtNumToString( vtFaceUse:getX(),3) .. ',' .. EgtNumToString( vtFaceUse:getY(),3) .. ',' .. EgtNumToString( vtFaceUse:getZ(),3))
local nFaceUse = BL.GetNearestOrthoOpposite( vtFaceUse)
-- aggiusto i parametri
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
EgtSetMachiningParam( MCH_MP.INVERT, false)
EgtSetMachiningParam( MCH_MP.WORKSIDE, 1)
-- imposto allungamenti iniziale e finale
if EdgeToMachine.IsStartOpen then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dDiamTool / 2)
else
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dDiamTool / 2)
end
if EdgeToMachine.IsEndOpen then
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dDiamTool / 2)
else
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dDiamTool / 2)
end
-- imposto posizione braccio porta testa
if tvtN[2]:getY() < GEO.EPS_SMALL then
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
@@ -3475,9 +3576,9 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
end
-- imposto elevazione e dichiaro non si generano sfridi per VMill
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
sNotes = sNotes .. 'VMRS=0;'
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
@@ -3497,36 +3598,27 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
bOpenStart = true
bOpenEnd = true
else
local vAdj2 = EgtSurfTmFacetAdjacencies( Proc.Id, (nBaseFace))[1]
for j = 1, #vAdj2 do
if vAdj2[j] == (nSideFace) then
-- Se non esiste faccia adiacente a lato precedente -> inizio aperto
local i = EgtIf( j > 1, j - 1, #vAdj2)
while vAdj2[i] == (nSideFace) do
i = EgtIf( i > 1, i - 1, #vAdj2)
end
bOpenStart = ( vAdj2[i] < 0)
-- Se non esiste faccia adiacente a lato successivo -> fine aperto
local k = EgtIf( j < #vAdj2, j + 1, 1)
while vAdj2[k] == (nSideFace) do
k = EgtIf( k < #vAdj2, k + 1, 1)
end
bOpenEnd = ( vAdj2[k] < 0)
end
end
bOpenStart = EdgeToMachine.IsStartOpen
bOpenEnd = EdgeToMachine.IsEndOpen
end
local sMilling
if nUseRoughTool > 0 then
sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidPk)
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut') end
if not sMilling then sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk) end
else
sMilling = ML.FindMilling( 'LongSmallCut', nil, sTuuidPk)
if not sMilling then sMilling = ML.FindMilling( 'LongSmallCut') end
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut', nil, sTuuidPk) end
end
if not sMilling then
local sErr = 'Error : Long2Cut & LongSmallCut not found in library'
EgtOutLog( sErr)
return false, sErr
sMilling = ML.FindMilling( 'LongSmallCut')
if not sMilling then sMilling = ML.FindMilling( 'Long2Cut') end
if not sMilling then
local sErr = 'Error : Long2Cut & LongSmallCut not found in library'
EgtOutLog( sErr)
return false, sErr
else
sWarn = 'Warning : lapjoint chamfer angle machined with different tool'
end
end
-- recupero i dati dell'utensile
local dTDiam = 50
@@ -3552,7 +3644,11 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- sistemazione inversione del percorso
local nWrkSide = EgtGetMachiningParam( MCH_MP.WORKSIDE)
EgtSetMachiningParam( MCH_MP.INVERT, ( nWrkSide ~= MCH_MILL_WS.RIGHT))
local bInvert = nWrkSide ~= MCH_MILL_WS.RIGHT
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
if bInvert then
bOpenStart, bOpenEnd = bOpenEnd, bOpenStart
end
-- setto a 0 eventuali offset
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
-- calcolo elevazione per allungamenti attacchi con fianchi chiusi
@@ -3575,7 +3671,11 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
EgtSetMachiningParam( MCH_MP.LITANG, 0)
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
if bOpenEnd then
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
else
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
end
end
end
if bOpenEnd then
@@ -3588,8 +3688,12 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
EgtSetMachiningParam( MCH_MP.LITANG, 0)
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
if bOpenStart then
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
else
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
end
end
end
-- eseguo
@@ -3600,7 +3704,8 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
end
end
end
return true
return true, sWarn
end
---------------------------------------------------------------------
@@ -4662,6 +4767,7 @@ SawPlusChain.ApplyOnlySawblade = false
function SawPlusChain.IsTopologyOk( Proc)
if Proc.TopologyLongName == 'Pocket-Blind-RightAngles-Parallel-5' or
Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' or
Proc.TopologyLongName == 'Groove-Through-RightAngles-NotParallel-3' or
Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' or
Proc.TopologyLongName == 'Tunnel-Through-RightAngles-Parallel-4' then
@@ -4949,38 +5055,6 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face)
end
function SawPlusChain.GetToolFromMachining( sMachiningName)
local Tool = {}
if EgtMdbSetCurrMachining( sMachiningName) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
Tool.Name = EgtTdbGetCurrToolParam( MCH_TP.NAME)
Tool.IsCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
Tool.Type = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
-- lama
if Tool.Type == MCH_TY.SAW_STD or Tool.Type == MCH_TY.SAW_FLAT then
Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or 0
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
Tool.SideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd')
-- sega a catena
elseif Tool.Type == MCH_TY.MORTISE_STD then
Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) or 0
Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0
Tool.Width = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
Tool.Thickness = EgtTdbGetCurrToolParam( MCH_TP.THICK) or 0
Tool.CornerRadius = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or 0
-- altri utensili al momento non previsti
else
error( 'Wrong tool type')
end
end
end
return Tool
end
function SawPlusChain.CalculateLeadInOut( Machining, EdgeToMachine)
-- TODO implementare le funzioni di Tool Collision Avoidance (vedi wiki e FacesBysaw -> CalcLeadInOutPerpGeom)
@@ -5106,22 +5180,29 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw)
local nErr
nErr, sErr = EgtGetLastMachMgrError()
-- se mortasatura e l'errore è compatibile (Axes values not calculable) si prova con l'altra configurazione dell'asse bloccato
-- TODO valutare se c'è modo di capire preventivamente la configurazione dell'asse bloccato e quindi rimuovere questa parte di codice
if Machining.Type == MCH_OY.MORTISING and nErr == 2507 then
if Machining.BlockedAxis.Orientation == 'perpendicular' then
Machining.BlockedAxis.Orientation = 'parallel'
else
Machining.BlockedAxis.Orientation = 'perpendicular'
if Machining.Type == MCH_OY.MORTISING then
-- se errore "Axes values not calculable" si prova con l'altra configurazione dell'asse bloccato
if nErr == 2507 then
if Machining.BlockedAxis.Orientation == 'perpendicular' then
Machining.BlockedAxis.Orientation = 'parallel'
else
Machining.BlockedAxis.Orientation = 'perpendicular'
end
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, Machining.BlockedAxis.Orientation, b3Raw, Machining.BlockedAxis.VtN, Machining.BlockedAxis.VtOut))
if Machining.SuggestedAngles.Index == 1 then
Machining.SuggestedAngles.Index = 2
else
Machining.SuggestedAngles.Index = 1
end
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( Machining.SuggestedAngles.VtN, Machining.SuggestedAngles.VtOrtho, Machining.SuggestedAngles.Index))
sErr = ''
bIsApplyOk = ML.ApplyMachining( true, false)
-- se errore "Outstroke" e permesso ToolInvert provo ad invertire il lato di lavorazione
elseif Machining.AllowToolInvert and nErr == 2508 then
EgtSetMachiningParam( MCH_MP.TOOLINVERT, not Machining.ToolInvert)
sErr = ''
bIsApplyOk = ML.ApplyMachining( true, false)
end
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( Machining.Name, Machining.BlockedAxis.Orientation, b3Raw, Machining.BlockedAxis.VtN, Machining.BlockedAxis.VtOut))
if Machining.SuggestedAngles.Index == 1 then
Machining.SuggestedAngles.Index = 2
else
Machining.SuggestedAngles.Index = 1
end
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( Machining.SuggestedAngles.VtN, Machining.SuggestedAngles.VtOrtho, Machining.SuggestedAngles.Index))
sErr = ''
bIsApplyOk = ML.ApplyMachining( true, false)
end
if not bIsApplyOk then
nErr, sErr = EgtGetLastMachMgrError()
@@ -5173,23 +5254,26 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
end
-- ricerca lavorazione
Cutting.Name = ML.FindCutting( 'HeadSide', true, false)
Cutting.Name = ML.FindCutting( 'HeadSide', true, false, abs( EdgeToMachine.Elevation))
if not Cutting.Name then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found'
Cutting.CanApply = false
EgtOutLog( Cutting.Message)
return Cutting
-- ricerca lavorazione senza considerare massima elevazione
Cutting.Name = ML.FindCutting( 'HeadSide', true, false, nil, 'Longest')
if not Cutting.Name then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - saw blade not found'
Cutting.CanApply = false
EgtOutLog( Cutting.Message)
return Cutting
end
end
Cutting.Type = MCH_OY.MILLING
Cutting.Tool = SawPlusChain.GetToolFromMachining( Cutting.Name)
Cutting.Tool = BL.GetToolFromMachining( Cutting.Name)
-- verifica dimensioni tasca compatibili
-- verifica dimensioni tasca e direzione compatibili
-- se tasca meno spessa della lama la strategia non è applicabile
if Cutting.Tool.Thickness > dPocketHeight + 10 * GEO.EPS_SMALL then
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for saw blade thickness'
Cutting.CanApply = false
EgtOutLog( Cutting.Message)
return Cutting
end
if #( Proc.MainFaces.SideFaces) > 1 then
-- se tasca più stretta della lama la strategia non è applicabile
@@ -5197,9 +5281,13 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for saw blade diameter'
Cutting.CanApply = false
EgtOutLog( Cutting.Message)
return Cutting
end
end
if EdgeToMachine.ToolDirection:getZ() < BD.NZ_MINA then
Cutting.CanApply = false
Cutting.Message = 'Feature '.. Proc.FeatureId .. ' : skipped sawblade from bottom'
EgtOutLog( Cutting.Message)
end
-- parametri della lavorazione
-- inizio e fine aperti o chiusi
@@ -5330,6 +5418,7 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
Mortising.CanApply = true
Mortising.Message = ''
Mortising.ProcId = Proc.Id
Mortising.AllowToolInvert = false
local bNeedToMachineOtherSide = false
local dTestCornerRadius = 43
-- OneSide | OneSideAndExtend | BothSides | BothSidesAndExtend
@@ -5373,10 +5462,14 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - chainsaw not found'
Mortising.CanApply = false
EgtOutLog( Mortising.Message)
return Mortising
end
Mortising.Type = MCH_OY.MORTISING
Mortising.Tool = SawPlusChain.GetToolFromMachining( Mortising.Name)
Mortising.Tool = BL.GetToolFromMachining( Mortising.Name)
-- in caso di tunnel da un lato permetto eventuale inversione lato di lavoro in caso di errori di applicazione (es: Outstroke)
if Proc.Topology == 'Tunnel' and sMortisingType == 'OneSide' or sMortisingType == 'OneSideAndExtend' then
Mortising.AllowToolInvert = true
end
-- verifica dimensioni tasca compatibili
-- se tasca meno spessa della sega a catena la strategia non è applicabile
@@ -5384,7 +5477,6 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for chainsaw thickness'
Mortising.CanApply = false
EgtOutLog( Mortising.Message)
return Mortising
end
if #( Proc.MainFaces.SideFaces) > 1 then
-- se tasca più stretta della sega a catena la strategia non è applicabile
@@ -5392,9 +5484,13 @@ function SawPlusChain.Chainsaw.CalculateMachiningParameters( Proc, FaceToMachine
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : strategy ' .. SawPlusChain.Name .. ' not applicable - pocket too narrow for chainsaw width'
Mortising.CanApply = false
EgtOutLog( Mortising.Message)
return Mortising
end
end
if EdgeToMachine.ToolDirection:getZ() < - 10 * GEO.EPS_ANG_SMALL then
Mortising.CanApply = false
Mortising.Message = 'Feature '.. Proc.FeatureId .. ' : skipped chainsaw from bottom'
EgtOutLog( Mortising.Message)
end
-- parametri della lavorazione
-- inizio e fine aperti o chiusi
@@ -5551,9 +5647,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
local bIsCuttingOk = false
if Cutting.CanApply then
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
end
if not bIsCuttingOk then
return bIsCuttingOk, Cutting.Message
if not bIsCuttingOk then
return bIsCuttingOk, Cutting.Message
end
end
local dBottomDepthToMachine = Cutting.RadialOffset
-- lato opposto del tunnel
@@ -5562,22 +5658,22 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
bIsCuttingOk = false
if Cutting.CanApply then
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
end
if not bIsCuttingOk then
return bIsCuttingOk, Cutting.Message
if not bIsCuttingOk then
return bIsCuttingOk, Cutting.Message
end
end
else
-- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
if Cutting.RadialOffset > 10 * GEO.EPS_SMALL then
if Cutting.CanApply and Cutting.RadialOffset > 10 * GEO.EPS_SMALL then
-- eventuale lavorazione di lama - lato della tasca da cui inizia la lavorazione
if Proc.MainFaces.LongFace.Edges.BottomEdge.IsStartOpen then
Cutting = SawPlusChain.Saw.CalculateMachiningParameters( Proc, Proc.MainFaces.LongFace, Proc.MainFaces.LongFace.Edges.SideEdges.StartEdge)
bIsCuttingOk = false
if Cutting.CanApply then
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
end
if not bIsCuttingOk then
return bIsCuttingOk, Cutting.Message
if not bIsCuttingOk then
return bIsCuttingOk, Cutting.Message
end
end
end
-- eventuale lavorazione di lama - lato della tasca in cui finisce la lavorazione
@@ -5586,9 +5682,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
bIsCuttingOk = false
if Cutting.CanApply then
bIsCuttingOk, Cutting.Message = SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
end
if not bIsCuttingOk then
return bIsCuttingOk, Cutting.Message
if not bIsCuttingOk then
return bIsCuttingOk, Cutting.Message
end
end
end
-- la lama è arrivata sul fondo e tasca passante, non servono ulteriori lavorazioni
@@ -5622,9 +5718,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
bIsMortisingOk = false
if Mortising.CanApply then
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
end
if not bIsMortisingOk then
return bIsMortisingOk, Mortising.Message
if not bIsMortisingOk then
return bIsMortisingOk, Mortising.Message
end
end
else
-- se la sega a catena non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
@@ -5635,9 +5731,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
bIsMortisingOk = false
if Mortising.CanApply then
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
end
if not bIsMortisingOk then
return bIsMortisingOk, Mortising.Message
if not bIsMortisingOk then
return bIsMortisingOk, Mortising.Message
end
end
end
-- eventuale lavorazione di sega a catena - lato della tasca in cui finisce la lavorazione
@@ -5646,9 +5742,9 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
bIsMortisingOk = false
if Mortising.CanApply then
bIsMortisingOk, Mortising.Message = SawPlusChain.Chainsaw.ApplyAllSteps( Mortising, b3Raw)
end
if not bIsMortisingOk then
return bIsMortisingOk, Mortising.Message
if not bIsMortisingOk then
return bIsMortisingOk, Mortising.Message
end
end
end
end
@@ -5731,23 +5827,38 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if nChamfer < 0 then
return false, sErrCham
end
-- eventuale forzatura sega a catena
local bForceChainsaw = ( EgtGetInfo( Proc.Id, Q_FORCE_CHAINSAW, 'i') or 0) > 0
-- se è un tunnel provo a vedere se è possibile lavorarlo con la svuotatura o con la sega catena
if bClosedOrthoFaces then
local bTryWithBlades = true
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace
-- forzata sega a catena
if bForceChainsaw then
-- ottengo le dimensioni del tunnel
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace = BL.GetTunnelDimension( Proc, nPartId)
-- lavoro fessura con svuotature (singola o doppia contrapposta)
local sMyMchFind = 'Pocket'
local nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho,
else
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)
if nOk < 0 then
return false, sErr
elseif nOk > 0 then
bTryWithBlades = false
if nOk < 0 then
return false, sErr
elseif nOk > 0 then
bTryWithBlades = false
end
end
-- Se la svuotatura precedente non è stata fatta e chamfer non è mutuamente esclusivo provo con la sega-catena
if bTryWithBlades and nChamfer < 2 then
-- verifico se posso farlo con la sega-catena
local bMakeChainSaw, sSawing, dMaxMat, dSawCornerRad, dSawThick, _, dSawWidth = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth)
if bMakeChainSaw then
-- se forzata sega a catena devo verificare se inserire lo smusso
if bForceChainsaw and nChamfer > 0 then
local nOk, sErr = MakeChamfer( Proc, false, nAddGrpId, vtOrtho, b3Solid, nLundIdFace, dDepthCham)
if nOk < 0 then return -1, sErr end
end
-- Ricalcolo l'affondamento tenendo conto di eventuale inclinazione
local dSlDepth
local frSlDh = Frame3d( Proc.Box:getCenter(), vtOrtho)
@@ -5837,9 +5948,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2)
-- se parametro Q03=2 forzo la fresatura di lato; con Q03=3 forzo solo se la faccia di lavoro non è rivolta verso l'alto +/-10°; per rabbet che guardano in giù sempre fresatura di lato
local bIsRabbetAlongXTowardsBottom = ( Proc.TopologyLongName == 'Rabbet-Through-RightAngles-Parallel-2' and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and Proc.AffectedFaces.Bottom and Proc.AffectedFaces.Left and Proc.AffectedFaces.Right)
local bForceSideMill = bIsRabbetAlongXTowardsBottom or ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( ( Proc.Fct == 4 and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back)) or Proc.Fct == 3 or Proc.Fct == 2))
local bForceSideMill = ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) and ( bIsRabbetAlongXTowardsBottom or ( ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 2 or ( EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') == 3 and vtN:getZ() < 0.985)) and ( ( Proc.Fct == 4 and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back)) or Proc.Fct == 3 or Proc.Fct == 2)))
-- se fattibile con fresa BH di fianco e spessore utensile inferiore alla larghezza faccia
local bMakeBySideMill, bHead, bHeadDir, sMilling, dMaxMat, dToolDiam = VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
local bMakeBySideMill, bHead, bHeadDir, sMilling, dMaxMat, dToolDiam = VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill, b3Raw)
if bPrevBhSideMill == nil then
bPrevBhSideMill = bMakeBySideMill
end
@@ -5855,8 +5966,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
vtN, vtN2 = vtN2, vtN
end
end
-- informazioni utensile
local Tool = BL.GetToolFromMachining( sMilling)
-- se lavorazione da sotto e lunga, va divisa in due metà
local bDouble = ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200) and not BD.TURN)
local bDouble = not Tool.IsOnAggregate and ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200) and not BD.TURN)
-- inserisco la lavorazione di fresatura
local sName = 'BHMill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchFId = EgtAddMachining( sName, sMilling)
@@ -5924,6 +6037,22 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
end
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- impostazioni per fresa a disco su aggregato
if Tool.IsOnAggregate then
if AreSameVectorApprox( vtN, -Z_AX()) then
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_RIGHT)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
if bHeadDir then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.TOOLINVERT, false)
end
else
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_ZP)
end
end
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
@@ -6083,7 +6212,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if BD.ANG_TRASM and Proc.Fct >= 4 and AreOppositeVectorApprox( vtN, Z_AX()) then
bLapJointAngTrasm = true
-- se orientata verso il basso e non c'è testa da sotto, verifico l'alternativa
elseif vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD and nFacInd2 then
elseif vtN:getZ() < BD.NZ_MINA and not BD.DOWN_HEAD and nFacInd2 and not Proc.OkFromBottom then
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
nFacInd, nFacInd2 = nFacInd2, nFacInd
dFacElev, dFacElev2 = dFacElev2, dFacElev
@@ -6091,7 +6220,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
end
-- verifico non sia orientata verso il basso o ci sia una testa dal basso o la lavorazione sia dal lato.
local bFaceDown = ( vtN:getZ() < BD.NZ_MINA)
if bFaceDown and not BD.DOWN_HEAD and not BD.TURN and not bForceSideMill and not bLapJointAngTrasm then
if bFaceDown and not BD.DOWN_HEAD and not BD.TURN and not bForceSideMill and not bLapJointAngTrasm and not Proc.OkFromBottom then
local sErr = 'Error : LapJoint from bottom impossible'
EgtOutLog( sErr)
return false, sErr
@@ -6203,6 +6332,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if bMillDown and BD.GetBottomToolMaxTotLen then
dMaxTotLen = BD.GetBottomToolMaxTotLen( vtN)
end
local dUserMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
-- ricerca lavorazione
local sPocketing
local _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown)
@@ -6210,10 +6340,13 @@ 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
( Proc.Prc == 25 and not bIsU and not bIsL)) then
( 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
end
if bMillDown then
@@ -6232,6 +6365,10 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
if bForceSideMill then
sPocketing = nil
end
-- se forzata sega a catena
if bForceChainsaw then
sPocketing = nil
end
-- leggo parametro Q
local nQAntisplintResult = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') or 0
-- se lavorazione fresa come lama disabilito eventuale antischeggia
@@ -6270,6 +6407,21 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
bUseOtherFace = true
rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
end
-- se forma a U (recupero la larghezza della faccia perpendicolarmente alle altre)
if Proc.Fct == 3 and bIsU then
local vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, EgtIf( nFacInd == 0, 1, 0), GDB_ID.ROOT)
local vtX = vtN2 ^ vtN
if not vtX:isSmall() then
local frRef = Frame3d( ptC, ptC + 100 * vtX, ptC + 100 * vtN2)
local b3Ref = EgtSurfTmGetFacetBBoxRef( Proc.Id, nFacInd, GDB_BB.STANDARD, frRef)
if b3Ref then
dH = b3Ref:getDimX()
dV = b3Ref:getDimY()
end
end
end
-- eseguo
bOk, sWarn, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
rfFac, dH, dV, dFacElev, bForceUseBlade,
@@ -6453,8 +6605,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
end
end
-- in tutti gli altri casi lancio la MakeByPockets (lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo)
else
-- in tutti gli altri casi, a meno che non sia forzata sega a catena, lancio la MakeByPockets
-- lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo
elseif not bForceChainsaw then
-- se 2 facce setto i parametri corretti per la MakeByPockets
if bForceSideMill and Proc.Fct == 2 then
bIs3Faces = false
@@ -6758,7 +6911,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- verifico se applicare gestione speciale per tunnel
local nSurfBottomId
if Proc.Topology == 'Tunnel' then
if Proc.Topology == 'Tunnel' or ( Proc.Topology == 'Groove' and Proc.IsThrough and Proc.Fct == 3) then
bAddEndCapLeftSide = true
bAddEndCapRightSide = true
-- recupero centro e normale delle facce
@@ -6877,7 +7030,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
for i = 1, #vAddId do
local b3Box = EgtGetBBoxGlob( vAddId[i], GDB_BB.STANDARD)
local nFct = EgtSurfTmFacetCount( vAddId[i])
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg, PartId = Proc.PartId, TaskId = Proc.TaskId, FeatureId = Proc.FeatureId, IsSplittedLapJoint = true, AffectedFaces = Proc.AffectedFaces}
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg, PartId = Proc.PartId, TaskId = Proc.TaskId, FeatureId = Proc.FeatureId, IsSplittedLapJoint = true, AffectedFaces = Proc.AffectedFaces, OkFromBottom = Proc.OkFromBottom}
Topology.Classify( AddProc, b3Raw)
-- lasciare il false nel sesto parametro (perchè internamente viene verificato se diverso da nil)
local bOk, sMyWarn
@@ -7151,13 +7304,16 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- in base al tipo di feature attribuisco il significato dei parametri Q
AssignQIdent( Proc)
-- se non forzate frese, uso la lama
local bUseBlade = EgtIf( Proc.Prc == 90, false, EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1)
local bUseBlade = EgtIf( Proc.Prc == 90 or Proc.bForceMill, false, EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1)
local nForceUseBladeOnNotContinueFace
-- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature
if bUseBlade then
if Proc.Prc == 30 or Proc.Prc == 20 then
local nBladeAntisplint = EgtGetInfo( Proc.Id, Q_ANTISPLINT_TYPE, 'i') or 0
local nUseRoughToolOnSide = EgtGetInfo( Proc.Id, Q_SIDE_ROUGH_TOOL, 'i') or 0
if nUseRoughToolOnSide == 4 and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) then
nUseRoughToolOnSide = 0
end
nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, Q_BLADE_ON_ALONG_FACE, 'i') or 0
-- se antischeggia di fresa o abilitato sgrossatore di fianco
if nBladeAntisplint == 2 or nUseRoughToolOnSide > 0 then
@@ -7292,6 +7448,14 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se è una spianatura a una faccia richiamo la LongCut
elseif Proc.Prc == 90 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
-- se arriva da una cut si applica una svuotatura
elseif Proc.Prc == 10 then
local dDiam = min( Proc.Face[1].Height, Proc.Face[1].Width) * 3
local bMillUp = ( BD.DOWN_HEAD and Proc.Face[1].VtN:getZ() > -0.259)
local bMillDown = ( BD.DOWN_HEAD and Proc.Face[1].VtN:getZ() < 0.342)
local sMchFindMaster = 'OpenPocket'
local _, sPocketing = VerifyPocket( Proc, dDiam, nil, nil, sMchFindMaster, bMillUp, bMillDown)
return Fbp.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
-- altrimenti, con lama
else
return Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
@@ -7323,7 +7487,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- determino l'angolo tra le facce
local bAdj, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
-- se con BH
if VerifyBHSideMill( Proc) then
if VerifyBHSideMill( Proc, nil, nil, nil, nil, b3Raw) then
return MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, true)
-- se ortogonali e non forzata lama, con fresa
elseif not bUseBlade then
+1 -1
View File
@@ -1391,7 +1391,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
-- inverto se utensile antiorario per garantire senso di percorrenza migliore
local bInvert = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
local bInvert = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) > 0
-- setto workside e eventuale inversione
if bInvert then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
+19 -15
View File
@@ -949,18 +949,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end
-- altrimenti concavo
else
-- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco.
for k = 1, #vOrd do
if vWidth[vOrd[k]] + BD.CUT_SIC > dMaxDepth then
if not( ProcessLong2Cut.Identify( Proc)) then
return false
else
local sWarn2 = 'Warning in ' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. ' : elevation (' .. EgtNumToString( vWidth[vOrd[k]], 1) .. ') bigger than max saw depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
if not sWarn then sWarn = '' end
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
end
end
end
-- si percorrono i lati alto e basso della faccia
for i = 1, nC do
-- Posizione braccio portatesta
@@ -990,6 +978,22 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
EgtOutLog( sErr)
return false, sErr
end
-- se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco.
local dCheckDepth = 0
if bCanUseBlade then
dCheckDepth = dMaxDepth
elseif bCanUseUnderBlade then
dCheckDepth = dMaxDepthDn
end
if vWidth[vOrd[j]] + 100 * GEO.EPS_SMALL > dCheckDepth then
if not( ProcessLong2Cut.Identify( Proc)) then
return false
else
local sWarn2 = 'Warning in ' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. ' : elevation (' .. EgtNumToString( vWidth[vOrd[j]], 1) .. ') bigger than max saw depth (' .. EgtNumToString( dCheckDepth, 1) .. ')'
if not sWarn then sWarn = '' end
sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2)
end
end
-- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama
if nSide <= 0 and bCanUseUnderBlade then
if ( vWidth[vOrd[j]] / 2) > dMaxDepthDn then
@@ -1003,7 +1007,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local dLioPerp
if j == 1 then -- il primo taglio lo faccio completo se angolo interno maggiore di 90
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dMaxDepth, 0)
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0)
-- se la faccia è più grande del massimo materiale lama, allora limito lavorazione
if dMinOffsBigFace > 0 then
dOffset = dMinOffsBigFace
@@ -1015,7 +1019,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end
dLioPerp = vWidth[vOrd[j]] + BD.CUT_SIC
else -- il secondo ridotto della distanza minima e della componente spessore della lama
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dMaxDepth, 0)
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0)
-- se la faccia è più grande del massimo materiale lama, allora limito lavorazione
if dMinOffsBigFace > 0 then
dOffset = dMinOffsBigFace
@@ -1389,7 +1393,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end
end
end
if not Proc.MoveAfterSplit and not bEndFixed and not bConvex then
if not Proc.bMoveAfterSplit and not bEndFixed and not bConvex then
-- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then
+11 -11
View File
@@ -3,6 +3,7 @@
-- 2020/05/28 Tipo di lavorazione passato da Mark a Text.
-- 2021/05/03 Aggiunta gestione testa da sotto.
-- 2022/12/05 Aggiunta gestione tipo di lavorazione Text_AT.
-- 2024/09/04 In Make gestione di più geometrie ausiliarie ( ora si lavora anche il testo, oltre che alle linee di marcatura)
-- Tabella per definizione modulo
local ProcessMark = {}
@@ -50,9 +51,6 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessMark.Make( Proc, nPhase, nRawId, nPartId)
-- recupero eventuale geometria ausiliaria
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.Id end
-- recupero i dati della marcatura
local vtExtr
if EgtGetType( Proc.Id) ~= GDB_TY.EXT_TEXT then
@@ -108,13 +106,15 @@ function ProcessMark.Make( Proc, nPhase, nRawId, nPartId)
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
-- eventuale lavorazione su seconda geometria
if AuxId then
-- si verifica se ci sono altre geometrie da lavorare
local AdditionalGeometries = EgtSplitString( EgtGetInfo( Proc.Id, 'AUXID', 's')) or {}
for i = 1, #AdditionalGeometries do
local AuxId = Proc.Id + AdditionalGeometries[i]
-- inserisco la lavorazione di fresatura
local sName2 = 'Decor2_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local nMchF2Id = EgtAddMachining( sName, sMilling)
if not nMchF2Id then
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling
local nOtherMachiningId = EgtAddMachining( sName, sMilling)
if not nOtherMachiningId then
sName = 'Decor' .. '_' .. tostring( i) .. '_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
EgtOutLog( sErr)
return false, sErr
end
@@ -125,14 +125,14 @@ function ProcessMark.Make( Proc, nPhase, nRawId, nPartId)
-- eseguo
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchF2Id, false)
EgtSetOperationMode( nOtherMachiningId, false)
return false, sErr
end
-- se geometria a X maggiore, la sposto prima
local ptS1 = EgtSP( Proc.Id, GDB_ID.ROOT)
local ptS2 = EgtSP( AuxId, GDB_ID.ROOT)
if ptS2:getX() > ptS1:getX() then
EgtRelocateGlob( nMchF2Id, nMchFId, GDB_IN.BEFORE)
EgtRelocateGlob( nOtherMachiningId, nMchFId, GDB_IN.BEFORE)
end
end
return true
+2 -1
View File
@@ -417,7 +417,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, b3Solid, GDB_RT.GLOB)
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
local CutProc = { Id = AddId, Grp = Proc.Grp - 2, Prc = 10, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH, bFromBottom)
if not bOk then return bOk, sErr end
+2 -1
View File
@@ -307,7 +307,8 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti applico taglio di lama
else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bOk then
return false, sErr
+2 -1
View File
@@ -311,7 +311,8 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti applico taglio di lama
else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bOk then
return false, sErr
+2 -1
View File
@@ -311,7 +311,8 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti applico taglio di lama
else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bOk then
return false, sErr
+2 -1
View File
@@ -258,7 +258,8 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti applico taglio di lama
else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bOk then
return false, sErr
+2 -1
View File
@@ -293,7 +293,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- altrimenti applico taglio di lama
else
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bOk then
return false, sErr
+18 -3
View File
@@ -50,6 +50,7 @@ end
-- Applicazione della lavorazione
function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, 'Q04', 'i') or 0
local bUseMill = ( EgtGetInfo( Proc.Id, 'Q05', 'i') or 0) == 1
-- recupero l'ingombro del grezzo di appartenenza
local b3Raw = EgtGetRawPartBBox( nRawId)
-- ingombro del pezzo
@@ -134,10 +135,14 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- applico taglio di lama
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
if BL.IsCutNeeded( CutProc, b3Raw, dOvmHead) then
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false)
if not bOk then return bOk, sErr end
elseif bUseMill then
Proc.bForceMill = true
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
elseif nForceUseBladeOnNotContinueFace > 0 then
EgtSurfTmRemoveFacet( Proc.Id, vFaceOrd[1] - 1)
Proc.Fct = Proc.Fct - 1
@@ -208,7 +213,12 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
if b3Fac1 then dHCI = b3Raw:getMax():getX() - dOvmHead - b3Fac1:getMin():getX() end
else
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
-- se feature inclinata, si va oltre ingombro del box. Si considera metà dell'ingombro della faccia inclinata
if vtN[vFaceOrd[2]] and vtN[vFaceOrd[2]]:getZ() > 0 then
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() - ( vtN[vFaceOrd[2]]:getZ() * b3Raw:getDimZ())
else
dHCI = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
end
end
BL.UpdateHCING( nRawId, dHCI)
elseif Proc.Tail then
@@ -217,7 +227,12 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end
else
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
-- se feature inclinata, si va oltre ingombro del box. Si considera metà dell'ingombro della faccia inclinata
if vtN[vFaceOrd[2]] and vtN[vFaceOrd[2]]:getZ() > 0 then
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX() - ( vtN[vFaceOrd[2]]:getZ() * b3Raw:getDimZ())
else
dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
end
end
BL.UpdateTCING( nRawId, dTCI)
end
+67 -5
View File
@@ -4,6 +4,7 @@
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
-- 2022/07/12 Aggiunta gestione PF1250 e TURN.
-- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo.
-- 2024/09/03 In ApplyDiceCut, se possibile, i tagli paralleli sono fatti con un unico passaggio di fianco.
-- Tabella per definizione modulo
local ProcessScarfJoint = {}
@@ -134,7 +135,9 @@ end
local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw, dNewDiceDim)
local bOk = true
local bOk2 = true
local sErr = ''
local sErr2 = ''
local vCuts = {}
if nGoodFace1 and nGoodFace4 and nGoodFace1 > 0 and nGoodFace4 > 0 then
@@ -185,9 +188,68 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
-- extra taglio
local dExtraCut = EgtIf( i % 2 == 1, 0, BD.CUT_EXTRA)
-- lavoro la faccia
for j = 1, #vCuts[i] do
bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
local dMaxDepth = 0
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
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
end
end
end
end
-- se si può fare, faccio unico taglio parallelo
if bExecJustOneCut then
local bDoubleCut = false
local dCutExtra = BD.CUT_EXTRA
if dMaxDepth < dDiceFaceDim then
bDoubleCut = true
end
local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
local nFaceUseCut1, nFaceUseCut2
-- se feature rivolta verso alto setto direzione taglio davanti e dietro
if AreSameVectorApprox( vtRef, Z_AX()) then
nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT
-- altrimenti taglio da sopra
else
nFaceUseCut2 = MCH_MILL_FU.ORTHO_DOWN
end
if Proc.Tail and AreSameVectorApprox( vtRef, Z_AX()) then
nFaceUseCut1, nFaceUseCut2 = nFaceUseCut2, nFaceUseCut1
end
if bDoubleCut then
bOk, sErr = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut1, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw, true)
if not bOk then return false, sErr end
end
bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw)
if not bOk2 then return false, sErr2 end
else
for j = 1, #vCuts[i] do
bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end
end
-- lavoro la faccia interna in ogni caso
@@ -201,7 +263,7 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
if vFaceOrd[3] ~= 0 then
-- inserisco la lavorazione
local vtOrthoO = Vector3d( vtRef)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end
@@ -381,7 +443,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
if not nGoodFace1 or nGoodFace1 == 0 then
-- inserisco la lavorazione
local vtRef2 = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, Z_AX(), EgtIf( bHead, Y_AX(), -Y_AX()))
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOkd then return bOkd, sErrD end
-- lavoro la faccia opposta (definita dal parametro P11)
if vFaceOrd[3] ~= 0 then
+2 -1
View File
@@ -4,6 +4,7 @@
-- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut.
-- 2022/11/09 Aggiunta gestione parametro Q04 per forzare utilizzo fresa di lato e lavorare come FreeContour.
-- 2023/02/14 Gestite le rotazioni di 90 deg nell'aggiornamento del grezzo.
-- 2024/08/05 Se assimilabile ad un taglio (1 faccia) si considerare area non pinzabile testa/coda
-- Tabella per definizione modulo
local ProcessSimpleScarf = {}
@@ -148,7 +149,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
-- se ci sono meno di due facce si riduce a una normale Cut
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
if nFacetCnt < 2 then
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, nil, nil, nil, dOvmTail)
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, nil, nil, nil, nil, dOvmTail, true)
return bOk, sErr
end
-- dati delle facce
+351 -242
View File
@@ -38,6 +38,10 @@ EgtOutLog( ' ProcessSplit started', 1)
local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
if BD.PRECUT_TAIL == nil then
BD.PRECUT_TAIL = true
end
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessSplit.Identify( Proc)
@@ -63,7 +67,7 @@ end
---------------------------------------------------------------------
-- lavorazione smussi
local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmTail)
-- verifico che lo smusso sia richiesto
local dDepth = EgtGetInfo( nOriId, 'Q06', 'd') or 0
if dDepth < 0.1 then return true end
@@ -165,7 +169,7 @@ end
---------------------------------------------------------------------
-- lavorazione con sega a catena per sezioni alte e larghe
local function MakeSplitByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes, dOffs, bExtendStartEnd)
local function MakeCutByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes, dRadialOffset, bExtendStartEnd, bInvert)
-- Recupero i dati dell'utensile
local dMaxMat = 0
local dSawCornerRad = 0
@@ -205,7 +209,7 @@ local function MakeSplitByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes,
local vtOrtho = BL.GetVersRef( nFaceUse)
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
-- imposto offset radiale per mantenere il materiale in coda per la finitura
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset)
-- imposto eventuale allungamento percorso iniziale
local dStartAddLen = 0
local dEndAddLen = 0
@@ -217,7 +221,13 @@ local function MakeSplitByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes,
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
-- faccio in modo che l'attacco della lama sia dal lato opposto rispetto al corpo macchina
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
if bInvert and bInvert == true then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, false)
end
if dMaxMat >= dDepth then
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning
@@ -253,12 +263,82 @@ local function MakeSplitByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes,
return true, sName, nMchFId
end
---------------------------------------------------------------------
-- split per sezioni grandi con sega a catena o mix catena + lama
function ProcessSplit.MakeBigSectionSplitting( Proc, b3Raw, dOffset, SawingData, Cutting2Data)
local sNotes = ''
if SawingData.bSplit ~= nil then
sNotes = 'Precut;'
end
local bigSectionSplitType
-- se pezzo non troppo alto, taglio singolo da sopra
if b3Raw:getDimZ() + BD.CUT_EXTRA_MIN < SawingData.dChainSawMaxMat + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "single horizontal"
-- se pezzo non troppo largo, taglio singolo da davanti
elseif b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( SawingData.dChainSawMaxMat, SawingData.dChainSawLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "single vertical"
-- se pezzo non troppo largo, tagli dai due fianchi (dietro e davanti)
elseif 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( SawingData.dChainSawMaxMat, SawingData.dChainSawLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "double vertical"
-- altrimenti taglio con sega a catena da sopra e con lama da sotto
elseif BD.DOWN_HEAD and ( b3Raw:getDimZ() + BD.CUT_EXTRA_MIN < Cutting2Data.dMaxDepth + SawingData.dChainSawMaxMat + 10 * GEO.EPS_SMALL) then
bigSectionSplitType = "double horizontal"
end
-- in base alle scelte precedenti, applico le lavorazioni
if bigSectionSplitType == "single horizontal" then
local dCutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN
local sNotesSplit = EgtIf( SawingData.bSplit, 'Split;', sNotes)
-- verifico se sega a catena lunga e devo quindi estendere ingresso e uscita perchè è probabile che non riesca a ruotare sopra al pezzo
local bExtendStartEnd
local dMinLengthLongChainSaw = 630
if SawingData.dChainSawLen > dMinLengthLongChainSaw - 10 * GEO.EPS_SMALL then
bExtendStartEnd = true
end
local bOk, sErr = MakeCutByChainSaw( Proc.Id, SawingData.sSawing, MCH_MILL_FU.PARAL_TOP, dCutDepth, sNotesSplit, dOffset, bExtendStartEnd, SawingData.bInvert)
if not bOk then return bOk, sErr end
elseif bigSectionSplitType == "single vertical" then
local dCutDepth = b3Raw:getDimY() + BD.CUT_EXTRA_MIN
local sNotesSplit = EgtIf( SawingData.bSplit, 'Split;', sNotes)
local bOk, sErr = MakeCutByChainSaw( Proc.Id, SawingData.sSawing, MCH_MILL_FU.PARAL_FRONT, dCutDepth, sNotesSplit, dOffset, nil, SawingData.bInvert)
if not bOk then return bOk, sErr end
elseif bigSectionSplitType == "double vertical" then
local dCutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
local sNotesSplit = EgtIf( SawingData.bSplit, 'Presplit;', sNotes)
local bOk, sErr = MakeCutByChainSaw( Proc.Id, SawingData.sSawing, MCH_MILL_FU.PARAL_BACK, dCutDepth, sNotesSplit, dOffset, nil, SawingData.bInvert)
if not bOk then return bOk, sErr end
sNotesSplit = EgtIf( SawingData.bSplit, 'Split;', sNotes)
bOk, sErr = MakeCutByChainSaw( Proc.Id, SawingData.sSawing, MCH_MILL_FU.PARAL_FRONT, dCutDepth, sNotesSplit, dOffset, nil, SawingData.bInvert)
if not bOk then return bOk, sErr end
elseif bigSectionSplitType == "double horizontal" then
-- sega a catena da sopra
local dChainSawCutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN - Cutting2Data.dMaxDepth
local sNotesSplit = EgtIf( SawingData.bSplit, 'Presplit;', sNotes)
local bOk, sErr = MakeCutByChainSaw( Proc.Id, SawingData.sSawing, MCH_MILL_FU.PARAL_TOP, dChainSawCutDepth, sNotesSplit, dOffset, nil, SawingData.bInvert)
if not bOk then return bOk, sErr end
-- lama da sotto
local dCutExtra = -dChainSawCutDepth + BD.CUT_EXTRA_MIN
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
local sNotes = EgtIf( SawingData.bSplit, 'Split;', sNotes)
local bMaximizeVerticalDepth = true
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting2Data.sCutting, Cutting2Data.dSawDiam, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dOffset, 0, 0, sNotes, b3Raw, nil, bMaximizeVerticalDepth)
if not bOk then return false, sErr end
-- se è comunque troppo grande per essere separato, esco
else
local sErr = 'Error : section too big for splitting'
EgtOutLog( sErr)
return false, sErr, -1
end
return true
end
---------------------------------------------------------------------
-- tagli verticali aggiuntivi
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, sNotes)
local _, dimH = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local nVerticalCuts = ceil( dimH / ( BD.MAX_LEN_DICE)) - 1
local dVerticalSliceHeight = dimH / ( nVerticalCuts + 1)
local nVerticalCuts = ceil( Proc.Face[1].WidthTrimmed / ( BD.MAX_LEN_DICE)) - 1
local dVerticalSliceHeight = Proc.Face[1].WidthTrimmed / ( nVerticalCuts + 1)
-- recupero il diametro dell'utensile
local dSawDiam = 400
if EgtMdbSetCurrMachining( sCutting) then
@@ -272,12 +352,212 @@ 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
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw)
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)
if not bOk then return bOk, sErr end
end
return bOk, sErr
end
---------------------------------------------------------------------
-- tagli standard
local function MakeStandardCuts( Proc, b3Raw, nCuts, dOffsetBetweenCuts, TailCutType, Cutting1Data, Cutting2Data, dStartOffset, dLenEndRaw)
if not TailCutType.sType then
TailCutType.sType = ''
end
local PrecutType = { bBigSectionCut = TailCutType.bBigSectionCut, bHorizCut = TailCutType.bHorizCut, bDoubleHorizCut = TailCutType.bDoubleHorizCut, bDoubleCut = TailCutType.bDoubleCut, bSplit = TailCutType.bSplit, sType = 'Precut', bNeedVerticalAddedCuts = false, bNeedHorizontalAddedCuts = false}
if not TailCutType.bDoubleHorizCut then
-- flag di lavorazione faccia
local nOrthoOpposite = EgtIf( TailCutType.bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_BACK)
-- calcolo extra taglio ed accorciamento
local dCutExtra = 0
local dAccStart = 0
local dAccEnd = 0
if TailCutType.bBigSectionCut and BD.C_SIMM then
-- qui arrivano sezioni molto grandi su macchine tipo PF con materiale da asportare inferiore allo spessore lama
local dSawRad = Cutting1Data.dSawDiam / 2
dCutExtra = - ( b3Raw:getDimY() - dSawRad)
dAccEnd = dSawRad
elseif b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
dCutExtra = EgtIf( TailCutType.bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
else
dCutExtra = - ( b3Raw:getDimY() - Cutting1Data.dMaxDepth)
local dSawRad = Cutting1Data.dSawDiam / 2
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
local dKL = dSawRad - Cutting1Data.dMaxDepth + EgtIf( TailCutType.bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
local dMinSawingLength = 5
if BD.C_SIMM then
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo entrata
if dAccEnd > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccStart = b3Raw:getDimZ() - dAccEnd - dMinSawingLength
end
else
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo uscita
if dAccStart > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccEnd = b3Raw:getDimZ() - dAccStart - dMinSawingLength
end
end
end
-- per travi alte faccio faccio dei tagli orizzontali aggiuntivi
if TailCutType.bNeedHorizontalAddedCuts then
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not TailCutType.bBigSectionCut and BD.PRECUT_TAIL then
dStartOffset = dLenEndRaw
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
local nHorizontalCuts = ceil ( Proc.Face[1].HeightTrimmed / BD.MAX_DIM_DICE) - 1
local dHorizontalSliceHeight = Proc.Face[1].HeightTrimmed / ( nHorizontalCuts + 1)
for i = nCuts, 1, -1 do
local dCutXOffset = ( i - 1) * dOffsetBetweenCuts
-- tagli orizzontali
for j = nHorizontalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
local bForceTangentLeadInOut = BD.PRESS_ROLLER
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , Cutting1Data.sCutting, Cutting1Data.dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw, nil, nil, nil, bForceTangentLeadInOut)
if not bOk then return false, sErr end
end
-- se necessario taglio verticale doppio, eseguo l'opposto
if TailCutType.bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStartDoubleCut, dAccEndDoubleCut, 'Precut;', b3Raw, true)
if not bOk then return false, sErr end
end
-- taglio verticale
local sInfo = 'Precut'
if i == 1 and TailCutType.sType ~= 'Precut' then
sInfo = 'Cut'
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, sInfo, b3Raw, true)
if not bOk then return false, sErr end
end
return true, sWarn
end
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not TailCutType.bBigSectionCut and BD.PRECUT_TAIL and TailCutType.bNeedVerticalAddedCuts then
dStartOffset = dLenEndRaw
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- se necessari tagli in doppio, eseguo gli opposti
if TailCutType.bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and TailCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local sNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, sNotes, b3Raw, true)
if not bOk then return false, sErr end
end
end
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
-- se trave larga effettuo tagli verticali aggiuntivi
if TailCutType.bNeedVerticalAddedCuts then
local sSpecNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, sSpecNotes)
if not bOk then return bOk, sErr end
end
if i == 1 and TailCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local sNotes
if TailCutType.bSplit then
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
else
sNotes = EgtIf( i == 1 and TailCutType.sType ~= 'Precut', 'Cut;', 'Precut;')
end
-- se primo taglio da sopra e PF o ONE richiedo risalita preliminare a Zmax
if i == nCuts and TailCutType.bHorizCut and BD.C_SIMM and not BD.DOWN_HEAD then
sNotes = EgtSetValInNotes( sNotes, 'StartZmax', 2)
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, true)
if not bOk then return false, sErr end
end
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
else
-- verifico esistenza della lavorazione con lama da sotto
if not Cutting2Data.sCutting then
local sErr = 'Error : cutting H2 not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- verifico che le due lame riescano a lavorare la sezione
local dDimZ = b3Raw:getDimZ()
local dExtra = Cutting1Data.dMaxVertDepth + Cutting2Data.dMaxDepth - dDimZ
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not TailCutType.bBigSectionCut then
local sErr = 'Error : section too big for tail cut'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo extra taglio ed accorciamento
local dCutExtra = -Cutting2Data.dMaxDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dCutExtra2 = -Cutting1Data.dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dAccStart = 0
-- limiti da sotto
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
-- taglio a zero (con lama) per evitare problemi con grezzo più lungo del previsto. Se BigSection il pretaglio è già stato fatto.
if not TailCutType.bBigSectionCut and BD.PRECUT_TAIL and TailCutType.bNeedVerticalAddedCuts then
dStartOffset = dLenEndRaw
local bOkPrecut, sErrPrecut = MakeStandardCuts( Proc, b3Raw, 1, 0, PrecutType, Cutting1Data, Cutting2Data, dStartOffset)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- eseguo i tagli da sotto necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and TailCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
local sNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting2Data.sCutting, Cutting2Data.dSawDiam, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw, nil, true)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsetBetweenCuts
if i == 1 and TailCutType.sType =='Precut' then
dCutOffset = dStartOffset
end
-- se trave larga effettuo tagli verticali aggiuntivi
if TailCutType.bNeedVerticalAddedCuts then
local sSpecNotes = EgtIf( TailCutType.bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = AddVerticalPreCuts( Proc, Cutting1Data.sCutting, dCutOffset, b3Raw, sSpecNotes)
if not bOk then return bOk, sErr end
end
local sNotes
if TailCutType.bSplit then
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
else
sNotes = EgtIf( i == 1 and TailCutType.sType ~= 'Precut', 'Cut;', 'Precut;')
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
if not bOk then return false, sErr end
end
end
return true
end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dOvmTail)
@@ -289,11 +569,19 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
-- inserimento smussi
local nOriId = EgtGetInfo( Proc.Id, 'ORI', 'i')
if nOriId then
local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmTail)
if not bOkc then return bOkc, sErrC end
end
-- recupero la lavorazione
local sCutting = ML.FindCutting( 'TailSide')
-- TODO questa parte andrà cambiata quando si gestiranno i volumi liberi in cui girare da mlse
local dMinWidthForBigBlade = 300
local dMaxHeightForBigBlade = 300
local sCutting
if b3Raw:getDimY() > dMinWidthForBigBlade and b3Raw:getDimZ() < dMaxHeightForBigBlade then
sCutting = ML.FindCutting( 'TailSide', nil, nil, nil, 'Longest')
else
sCutting = ML.FindCutting( 'TailSide')
end
if not sCutting then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library'
EgtOutLog( sErr)
@@ -326,6 +614,20 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2
end
end
-- recupero dati utensile della sega a catena più lunga a disposizione
local sSawing = ML.FindSawing( 'SawingForSplitting', nil, nil, 'Longest')
if not sSawing then
sSawing = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
end
local dChainSawMaxMat = 0
local dChainSawLen = 0
if EgtMdbSetCurrMachining( sSawing or '') then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dChainSawMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dChainSawMaxMat
dChainSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dChainSawLen
end
end
-- caratteristiche taglio
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
@@ -335,8 +637,6 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
-- dati geometrici del taglio
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
-- flag di lavorazione faccia
local nOrthoOpposite = EgtIf( bHorizCut, MCH_MILL_FU.ORTHO_DOWN, MCH_MILL_FU.ORTHO_BACK)
-- separazione solo se esiste grezzo successivo con pezzi o scaricabile
local nNextRawId = EgtGetNextRawPart( nRawId)
local bSplit = ( nNextRawId and ( EgtGetPartInRawPartCount( nNextRawId) > 0 or EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw))
@@ -344,8 +644,6 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
local dLenEndRaw = dOvmTail
local nCuts = 1
local dOffsL = 0
local _, dimH, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
local dMinTailScrapForAdditionalCuts = 10.123
if not bSplit then
-- cerco grezzo successivo che sia nella fase
if nNextRawId and EgtVerifyRawPartPhase( nNextRawId, nPhase) then
@@ -355,94 +653,38 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
dOffsL = dLenEndRaw / nCuts
-- aggiorno ingombro del grezzo corrente con quello del successivo
b3Raw:Add( b3NextRaw)
else
dLenEndRaw = min( dOvmTail, abs( ptC:getX() - b3Raw:getMin():getX()))
end
end
-- determino la necessità di tagli aggiuntivi
local dMinTailScrapForAdditionalCuts = 10.123
local bNeedVerticalAddedCuts = not bSplit and ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL)
local bNeedHorizontalAddedCuts = not bSplit and ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL)
-- dati lavorazioni sopra e sotto
local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dSawMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth}
local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dSawMaxDepth2, dSawThick = dSawThick2}
local SawingData = { sSawing = sSawing, dChainSawMaxMat = dChainSawMaxMat, dChainSawLen = dChainSawLen, bSplit = bSplit or false}
-- dati sul taglio di coda da effettuare
local TailCutType = { bBigSectionCut = bBigSectionCut, bHorizCut = bHorizCut, bDoubleHorizCut = bDoubleHorizCut, bDoubleCut = bDoubleCut, bSplit = bSplit, bNeedVerticalAddedCuts = bNeedVerticalAddedCuts, bNeedHorizontalAddedCuts = bNeedHorizontalAddedCuts}
-- se taglio per pezzi alti e larghi
local nNewPhase = 0
if bBigSectionCut then
local bFinishingNeeded = false
if bSplit then
-- recupero dati utensile della sega a catena più lunga a disposizione
local sSawing = ML.FindSawing( 'SawingForSplitting', nil, nil, 'Longest')
if not sSawing then
sSawing = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
end
local dChainSawMaxMat = 0
local dChainSawLen = 0
if EgtMdbSetCurrMachining( sSawing or '') then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dChainSawMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dChainSawMaxMat
dChainSawLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dChainSawLen
end
end
local bigSectionSplitType
-- se pezzo non troppo alto, taglio singolo da sopra
if b3Raw:getDimZ() + BD.CUT_EXTRA_MIN < dChainSawMaxMat + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "single horizontal"
-- se pezzo non troppo largo, taglio singolo da davanti
elseif b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( dChainSawMaxMat, dChainSawLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "single vertical"
-- se pezzo non troppo largo, tagli dai due fianchi (dietro e davanti)
elseif 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( dChainSawMaxMat, dChainSawLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
bigSectionSplitType = "double vertical"
-- altrimenti taglio con sega a catena da sopra e con lama da sotto
elseif BD.DOWN_HEAD and ( b3Raw:getDimZ() + BD.CUT_EXTRA_MIN < dSawMaxDepth2 + dChainSawMaxMat + 10 * GEO.EPS_SMALL) then
bigSectionSplitType = "double horizontal"
end
-- assegno offset in lunghezza
local dOffs = 0
-- assegno offset in lunghezza
local dTailOffset = 0
if dOvmTail > BD.OVM_CHAIN_HBEAM then
dOffs = dOvmTail - BD.OVM_CHAIN_HBEAM
dTailOffset = dOvmTail - BD.OVM_CHAIN_HBEAM
bFinishingNeeded = true
end
-- in base alle scelte precedenti, applico le lavorazioni
if bigSectionSplitType == "single horizontal" then
local dCutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN
local sNotesSplit = 'Split;'
-- verifico se sega a catena lunga e devo quindi estendere ingresso e uscita perchè è probabile che non riesca a ruotare sopra al pezzo
local bExtendStartEnd
local dMinLengthLongChainSaw = 630
if dChainSawLen > dMinLengthLongChainSaw - 10 * GEO.EPS_SMALL then
bExtendStartEnd = true
end
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, sSawing, MCH_MILL_FU.PARAL_TOP, dCutDepth, sNotesSplit, dOffs, bExtendStartEnd)
if not bOk then return bOk, sErr, nNewPhase end
elseif bigSectionSplitType == "single vertical" then
local dCutDepth = b3Raw:getDimY() + BD.CUT_EXTRA_MIN
local sNotesSplit = 'Split;'
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, sSawing, MCH_MILL_FU.PARAL_FRONT, dCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
elseif bigSectionSplitType == "double vertical" then
local dCutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
local sNotesSplit = 'Presplit;'
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, sSawing, MCH_MILL_FU.PARAL_BACK, dCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
sNotesSplit = 'Split;'
bOk, sErr = MakeSplitByChainSaw( Proc.Id, sSawing, MCH_MILL_FU.PARAL_FRONT, dCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
elseif bigSectionSplitType == "double horizontal" then
-- sega a catena da sopra
local dChainSawCutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN - dSawMaxDepth2
local sNotesSplit = 'Presplit;'
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, sSawing, MCH_MILL_FU.PARAL_TOP, dChainSawCutDepth, sNotesSplit, dOffs)
if not bOk then return bOk, sErr, nNewPhase end
-- lama da sotto
local dCutExtra = -dChainSawCutDepth + BD.CUT_EXTRA_MIN
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
local sNotes = 'Split;'
local bMaximizeVerticalDepth = true
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dOffs, 0, 0, sNotes, b3Raw, nil, bMaximizeVerticalDepth)
if not bOk then return false, sErr end
-- se è comunque troppo grande per essere separato, esco
else
local sErr = 'Error : section too big for splitting'
EgtOutLog( sErr)
return false, sErr, -1
-- split per grande sezione
local bOk, sErr, nNewPhase2 = ProcessSplit.MakeBigSectionSplitting( Proc, b3Raw, dTailOffset, SawingData, Cutting2Data)
if nNewPhase2 then
nNewPhase = nNewPhase2
end
if not bOk then
return bOk, sErr, nNewPhase
end
-- se necessaria finitura, creo nuova fase
if bFinishingNeeded then
@@ -490,12 +732,20 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
else
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
end
-- taglio a zero (con sega a catena o mix catena + lama) per evitare problemi con grezzo più lungo del previsto
if BD.PRECUT_TAIL and not bSplit then
local dTailOffset = dLenEndRaw
local bOkPrecut, sErrPrecut = ProcessSplit.MakeBigSectionSplitting( Proc, b3Raw, dTailOffset, SawingData, Cutting2Data)
if not bOkPrecut then
return false, sErrPrecut
end
end
-- se finitura con lama
if nQ05 < 2 or ( not bSplit and dMaxElev > dSawThickCheck) then
-- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard
if bSplit or dMaxElev > dSawThickCheck then
local bOk, sErr
if not bSplit and ( dimH > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) then
if bNeedVerticalAddedCuts then
-- ad ogni offset di taglio dovrò fare prima i tagli verticali e poi i cubetti
for i = nCuts, 1, -1 do
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
@@ -524,7 +774,11 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
end
-- tagli aggiuntivi non necessari
else
bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT)
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)
end
if sNotesFinal then
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
@@ -560,156 +814,11 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
return true, nil, nNewPhase
end
end
-- se tagli standard
if not bDoubleHorizCut then
-- calcolo extra taglio ed accorciamento
local dCutExtra = 0
local dAccStart = 0
local dAccEnd = 0
if bBigSectionCut and BD.C_SIMM then
-- qui arrivano sezioni molto grandi su macchine tipo PF con materiale da asportare inferiore allo spessore lama
local dSawRad = dSawDiam / 2
dCutExtra = - ( b3Raw:getDimY() - dSawRad)
dAccEnd = dSawRad
elseif b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL or b3Raw:getDimY() < 2 * BD.MAX_DIM_HTCUT_HBEAM + 10 * GEO.EPS_SMALL then
dCutExtra = EgtIf( bDoubleCut, - 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN, BD.CUT_EXTRA)
else
dCutExtra = - ( b3Raw:getDimY() - dSawMaxDepth)
local dSawRad = dSawDiam / 2
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
local dKL = dSawRad - dSawMaxDepth + EgtIf( bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
local dMinSawingLength = 5
if BD.C_SIMM then
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo entrata
if dAccEnd > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccStart = b3Raw:getDimZ() - dAccEnd - dMinSawingLength
end
else
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo uscita
if dAccStart > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
dAccEnd = b3Raw:getDimZ() - dAccStart - dMinSawingLength
end
end
end
-- per travi alte faccio faccio dei tagli orizzontali aggiuntivi
local bAreHorizontalCutsNeeded = not bSplit and ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL)
if bAreHorizontalCutsNeeded then
local nHorizontalCuts = ceil ( dimV / BD.MAX_DIM_DICE) - 1
local dHorizontalSliceHeight = dimV / ( nHorizontalCuts + 1)
for i = nCuts, 1, -1 do
local dCutXOffset = ( i - 1) * dOffsL
-- tagli orizzontali
for j = nHorizontalCuts, 1, -1 do
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
local dHorizontalCutOffset = dHorizontalSliceHeight * -j
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw)
if not bOk then return false, sErr end
end
-- se necessario taglio verticale doppio, eseguo l'opposto
if bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStartDoubleCut, dAccEndDoubleCut, 'Precut;', b3Raw, true)
if not bOk then return false, sErr end
end
-- taglio verticale
local sInfo = 'PreCut;'
if i == 1 then sInfo = 'Cut;' end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, sInfo, b3Raw)
if not bOk then return false, sErr end
end
return true, sWarn, nNewPhase
end
local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, TailCutType, Cutting1Data, Cutting2Data, nil, dLenEndRaw)
-- se necessari tagli in doppio, eseguo gli opposti
if bDoubleCut then
-- gli accorciamenti vanno invertiti per il taglio opposto
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, sNotes, b3Raw, true)
if not bOk then return false, sErr end
end
end
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
-- se trave larga effettuo tagli verticali aggiuntivi
if not bSplit and ( dimH > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) then
local sSpecNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = AddVerticalPreCuts( Proc, sCutting, dCutOffset, b3Raw, sSpecNotes)
if not bOk then return bOk, sErr end
end
local sNotes
if bSplit then
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
else
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
end
-- se primo taglio da sopra e PF o ONE richiedo risalita preliminare a Zmax
if i == nCuts and bHorizCut and BD.C_SIMM and not BD.DOWN_HEAD then
sNotes = EgtSetValInNotes( sNotes, 'StartZmax', 2)
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
if not bOk then return false, sErr end
end
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
else
-- verifico esistenza della lavorazione con lama da sotto
if not sCutting2 then
local sErr = 'Error : cutting H2 not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- verifico che le due lame riescano a lavorare la sezione
local dDimZ = b3Raw:getDimZ()
local dExtra = dMaxVertDepth + dSawMaxDepth2 - dDimZ
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not bBigSectionCut then
local sErr = 'Error : section too big for tail cut'
EgtOutLog( sErr)
return false, sErr
end
-- calcolo extra taglio ed accorciamento
local dCutExtra = -dSawMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
local dAccStart = 0
-- limiti da sotto
local dVzLimDwnUp
if BD.TURN then dVzLimDwnUp = -2 end
-- eseguo i tagli da sotto necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw, nil, true)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
-- se trave larga effettuo tagli verticali aggiuntivi
if not bSplit and ( dimH > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) then
local sSpecNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = AddVerticalPreCuts( Proc, sCutting, dCutOffset, b3Raw, sSpecNotes)
if not bOk then return bOk, sErr end
end
local sNotes
if bSplit then
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
else
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
end
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
if not bOk then return false, sErr end
end
end
return true, nil, nNewPhase
end
return bOk, sErr, nNewPhase
end
---------------------------------------------------------------------
return ProcessSplit
+6 -3
View File
@@ -212,7 +212,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end
end
@@ -223,7 +224,8 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end
end
@@ -392,7 +394,8 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
-- applico lavorazione
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
if not bOk then return bOk, sErr end
end
+4 -3
View File
@@ -200,7 +200,8 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
else
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bFromBottom = ( bShortPart and vtExtr:getZ() > 0.25)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
if not bOk then
@@ -320,9 +321,9 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se contorno aperto, cambio parametri di attacco/uscita
if not bClosed then
EgtSetMachiningParam( MCH_MP.LITANG, 0.7 * dMillDiam)
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
EgtSetMachiningParam( MCH_MP.LIPERP, 20)
EgtSetMachiningParam( MCH_MP.LOTANG, 0.7 * dMillDiam)
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
EgtSetMachiningParam( MCH_MP.LOPERP, 20)
end
-- imposto posizione braccio porta testa
local nSCC = MCH_SCC.NONE
+4 -2
View File
@@ -232,7 +232,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw,
-- se va fatto, inserisco la lavorazione
if bCut then
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
if bOk then
@@ -330,7 +331,8 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw,
-- se va fatto, inserisco la lavorazione
if bCut then
local CutProc = { Id = AuxId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead)
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
if bOk then
+1 -1
View File
@@ -15,7 +15,7 @@ EgtEnableDebug( false)
--NEST.MACHINE = 'Essetre-90480019_MW'
--NEST.FLAG = 3
local sLog = ' +++ BeamNestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. LEN["1"]
local sLog = ' +++ BeamNestProcess : ' .. NEST.FILE .. ', ' .. NEST.MACHINE .. ', ' .. LEN[1]
EgtOutLog( sLog)
-- flag per abilitare statistiche in log
+108
View File
@@ -1,5 +1,113 @@
==== Beam Update Log ====
Versione 2.7xx ()
- Modif : in forature passanti orizzontali fatte da un solo lato, si inverte il lato di lavoro in base all'utensile scelto
Versione 2.7b2 (05/02/2025)
- Modif : si consentono DrillPocket in doppio solo se foro non passante
Versione 2.7b1 (04/02/2025)
- Modif : in tagli di testa e coda l'utilizzo delle lame grandi (es: 1000 su 15003TMAX) è limitato ai pezzi più bassi di 300 mm e più larghi di 300 mm
Versione 2.7a2 (23/01/2025)
- Added : in RidgeLap aggiunta Q05 per usare la fresa tipo LapJoint
- Fixed : in BatchProcess (Ts7) piccola correzione
- Fixed : in ScarfJoint, in caso di taglio dal lato, aggiunta estensione oltre il bordo
Versione 2.7a1 (21/01/2025)
- Added : in FreeContour aggiunta Q09 per inversione ultima lavorazione
- Modif : in Cut, si taglia dal basso solo se il pezzo piccolo è già staccato dalla barra
- Modif : in BatchProcess (Ts7) aggiunta scrittura id progetto e produzione in Btm
Versione 2.6l2 (07/01/2025)
- Added : in LapJoint abiitata SideMillAsBlade anche da sotto e varie migliorie
- Modif : in LapJoint L030 aggiunto Q03=4 per lavorare con fresa evitando tasche aperte testa/coda
- Modif : in LapJoint modifiche per gestione fresa a disco su aggregato
- Modif : in fresature con lama o simili aggiunta la possibilità di invertire il senso di percorrenza calcolato in automatico
- Modif : migliorie all'ordinamento
- Fixed : in LapJoint la Q per forzare lavorazione di lato funziona solo se la feature è aperta davnti o dietro
Versione 2.6l1 (11/12/2024)
- Added : aggiunta gestione slot e tagli di lama con lame molto grandi
- Modif : in lama + motosega aggiunta gestione slot aperte con lato obliquo
- Modif : modificata retrazione per tenoni aperti
Versione 2.6k2 (28/11/2024)
- Modif : nei tagli migliorati i casi in cui si inverte l'SCC per facilitare la caduta del legno
- Modif : nei tagli migliorato controllo rimozione del primo cubetto molto piccolo
- Modif : nei tagli migliorati i casi con bilinea
- Fixed : in lapjoint corretto un caso in cui si sbagliava a calcolare la dimensione della tasca
Versione 2.6k1 (15/11/2024)
- Modif : in macchine tipo Fast lunghezza minima feature per considerare taglio lungo portata a 400 mm
- Modif : in tacche si applica svuotatura anche nel caso di elevazione non raggiunta
- Modif : in forature in doppio, se necessario, si aumenta lo step per evitare collisione tra le punte durante lavorazione
- Fixed : in L010 correzione in utilizzo Q07 (forzatura frese)
- Fixed : in coda di rondine corretto bug che causava un blocco anomalo del programma
Versione 2.6j4 (06/11/2024)
- Fixed : corretto caso in cui i fori passanti fatti con due teste finiviano nella rotazione sbagliata, provocando un errore di chariot collision
Versione 2.6j3 (18/10/2024)
- Modif : nei tagli orizzontali si inverte SCC per evitare problemi di cubetti incastrati
- Modif : modifiche in ordinamento fori che intersecano tenoni
- Fixed : corretto caso con fori sul tenone spostati in coda nella fase errata
Versione 2.6j2 (17/10/2024)
- Fixed : in forature con precedenza corretto caso in cui il foro veniva ripetuto in rotazioni diverse
Versione 2.6j1 (10/10/2024)
- Modif : se la macchina è tipo BlockHaus, i LapJoint vengono fatti prima del taglio di separazione
- Modif : se tenone di coda è attraversato da foro allora anche il foro sarà di coda
- Modif : migliorato ordinamento per tenoni con foro secante
- Modif : in FreeContour migliorato pinzaggio
- Modif : in LapJoint miglioramenti vari alla lavorazione delle facce oblique
- Modif : In RidgeLap l'ingombro testa coda considera inclinazione feature per pinzaggio
- Added : in FreeContour aggiunta Q08 per forzare come pinzabile l'area della feature e Q07 per ignorare possibili problemi di lettura laser
- Added : in tagli aggiunta Q07 per forzare uso fresa
Versione 2.6i3 (08/10/2024)
- Modif : In RidgeLap, ingombro testa coda considera inclinazione feature per pinzaggio.
Versione 2.6i2 (13/09/2024)
- Modif : in FacesBySaw si invertono gli accorciamenti solo se l'inversione del percorso non è forzata dall'esterno; adeguati HeadCut e Split
- Modif : in nesting correzione in lettura array per cambio dll di lettura
- Modif : in BatchProcess e New, in caso sia richiesta generazione senza check, verifico prima che il file log specifico non contenga errori: se sì, forzo il check
- Modif : in FacesBySaw per settare il FaceUse si usa il versore nelle UserNotes
- Modif : in HeadCut, Split modifiche ai tagli aggiuntivi orizzontali e verticali; disattivati attacchi tangenziali per tagli aggiuntivi verticali in PF1250
- Fixed : in ProcessDrill In GetData corretta gestione modifica diametro foro
Versione 2.6i1 (09/09/2024)
- Added : refactoring e modifiche a HeadCut e Split per introduzione pretagli a zero sul grezzo, per evitare problemi con pezzi non lunghi quanto ci si aspetta
- Added : in Mark, gestita la lavorazione del testo
- Modif : gestione dipendenza foro-tasca in caso di fase con pezzo ribaltato
- Modif : in Headcut e Split aggiunta gestione parametro MIN_HEIGHT_ADDED_CUTS da BeamData per scegliere l'altezza minima per cui devono essere aggiunti i tagli orizzontali supplementari
- Modif : se Lapjoint attraversata da L055, la lapjoint viene fatta prima
- Modif : in ScarfJoint, in dicing, tagli paralleli fatti con unico passaggio di fianco per evitare che il cubetto rimanga appoggiato al motore
- Fixed : corretto caso di groove lunga passante a 3 facce che non veniva lavorata
- Fixed : in FacesBySaw -> MakeOne corretta gestione lato di lavoro quando il percorso è orizzontale
Versione 2.6h2 (26/08/2024)
- Added : in BatchProcess e New si verifica l'abilitazione alla generazione con EgtVerifyKeyOption
- Modif : in FacesBySaw introdotti attacchi tangenziali solo da un lato, limitati a facce con Z negative
- Modif : in LapJoint -> tunnel lo smusso funziona anche se è forzata la sega a catena
- Modif : in LapJoint -> svuotatura, se l'utente ha definito un'elevazione custom si lavora sempre la faccia standard
- Modif : in FacesBySaw -> MakeOne aggiunta la possibilità di passare una direzione di lavoro alternativa per poter rispettare contemporaneamente la direzione di lavoro concorde e la direzione di taglio.
Versione 2.6h1 (20/08/2024)
- Modif : in SimpleScarf, se assimilabile a un taglio, si considera area non pinzabile
- Modif : in LapJoint gestito smusso nel caso Groove-Blind-RightAngles-Parallel-4
- Modif : varie modifiche ai tagli di lama per evitare chiusura rulli pneumatici e finecorsa
- Modif : in BatchProcessNew, se presente flag apposito in EgtCam5, si evita la generazione
Versione 2.6g4 (19/07/2024)
- Modif : in BatchProcess e BatchProcessNew si forza ricalcolo ogni volta che si è in situazione di CHECK o CHECK + GENERATE
Versione 2.6g3 (07/07/2024)
- Added : aggiunta possibilità di funzione GetNzLimDownUp specifica per ogni macchina
- Modif : anche nel taglio a cubetti si chiama GetNzLimDownUp di macchina, se presente, per decidere limite orientamento lama verso il basso
- Modif : in BeamExec inserito controllo massimo numero di facce per lanciare GetFacetsInfo
- Fixed : in LapJoint corretto typo in nome variabile che provocava mancata impostazione asse bloccato
Versione 2.6g2 (04/07/2024)
- Modif : le lavorazioni BlockHaus, se vicine alla coda, vengono spostate dopo il taglio di separazione
+2 -2
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di Beam
NAME = 'Beam'
VERSION = '2.6g2'
MIN_EXE = '2.6e2'
VERSION = '2.7b2'
MIN_EXE = '2.6e5'