Compare commits
806 Commits
2.5f2
...
Ticket#2035
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cd697cf80 | |||
| 729143ce45 | |||
| 3f707396bb | |||
| 2b3a36a496 | |||
| d9e4285748 | |||
| 91d5b0ac84 | |||
| db5334217b | |||
| 54c835f717 | |||
| 86e2324856 | |||
| 36f4014969 | |||
| 7248c44406 | |||
| 044a074b76 | |||
| c0e3dab107 | |||
| 2b2157c971 | |||
| 8c697d73ac | |||
| c35d032da8 | |||
| 7447d3cc1b | |||
| bfdf80a44a | |||
| 3755521d2e | |||
| 104663a89a | |||
| e322c15099 | |||
| 5f55bc2f42 | |||
| 6c3a16d59c | |||
| 8218fcc438 | |||
| 6a83320321 | |||
| b8b5ab2a65 | |||
| e27998599b | |||
| a386c74516 | |||
| bb9dc261c1 | |||
| 0e2067e802 | |||
| 3008196992 | |||
| 876e45e1a4 | |||
| fa4d3ab9f6 | |||
| 4e6c38d82c | |||
| d3e1ac5805 | |||
| bc017d0de7 | |||
| 18e180cd12 | |||
| 6d8d32c9fb | |||
| 20074c6ea0 | |||
| 806864e360 | |||
| 052407a9be | |||
| b5660a8431 | |||
| 103d8d7eec | |||
| df47842888 | |||
| 5db475bcf7 | |||
| 010e1421c7 | |||
| e908562ab6 | |||
| aba4ebecc4 | |||
| a022ecbb7d | |||
| 605f0fcaf1 | |||
| 2676d67737 | |||
| ea64a9a3f4 | |||
| a996d4beb3 | |||
| 919f71481c | |||
| cac9ec767c | |||
| 85e6c3c86d | |||
| c548172635 | |||
| 9869d1a61e | |||
| e0c66df59b | |||
| c0156a4a97 | |||
| 93f1bc4d0d | |||
| adaeb1e19c | |||
| 2430b4e787 | |||
| b08710451a | |||
| 4adf62069f | |||
| b6e904845e | |||
| 118b9a88d2 | |||
| 73c86bd35f | |||
| d0283d7885 | |||
| 5de62b9563 | |||
| a7a9a23cf3 | |||
| 21fe8ca47d | |||
| 0f536b07c4 | |||
| 3e01fb36b0 | |||
| 3c4af3c335 | |||
| 9480453e57 | |||
| e98f924630 | |||
| eabbc883e4 | |||
| 8e19e87d3f | |||
| 0c4f57a90b | |||
| 77310576bd | |||
| 1e2f559937 | |||
| 6a6dc27560 | |||
| ab6ed79a0e | |||
| 7bb237f7d2 | |||
| 67bb55537e | |||
| 777179d1b2 | |||
| 06adbb0b5d | |||
| 872a3ec899 | |||
| 5dae07e2aa | |||
| fc26a8ad4a | |||
| ccf88745aa | |||
| 04046787e3 | |||
| a12aaf86bc | |||
| 70d16909f5 | |||
| b5145d4e99 | |||
| 5007cda21f | |||
| 76d03160c5 | |||
| 534302f48e | |||
| 60d73199e4 | |||
| 71a51e56e1 | |||
| bf9791ca9c | |||
| 249cb4eea5 | |||
| 46cda4d472 | |||
| 72b0e7f4a4 | |||
| 0e02959467 | |||
| b7837fe95c | |||
| d66eaf5322 | |||
| 05ecf76312 | |||
| 6e3a1ddc7a | |||
| df47691da1 | |||
| 8a2200e0de | |||
| 0136ccac19 | |||
| 7ee683aeb8 | |||
| e81d1aef66 | |||
| 5331466c4f | |||
| 7a972cccc8 | |||
| 2ed5af9661 | |||
| e25c24a33a | |||
| aeca298feb | |||
| a09565cfb7 | |||
| 862b375ee5 | |||
| a34147ce15 | |||
| cb3ad1d24c | |||
| 06e266226a | |||
| 74b40a6ad7 | |||
| ab7971e5f9 | |||
| e188753f49 | |||
| 9b12a74591 | |||
| e17e8189f7 | |||
| a5d4503180 | |||
| 41f92e9dd4 | |||
| c5a6300d15 | |||
| bf5c12ec8a | |||
| 777ba74e4d | |||
| 268e578125 | |||
| 13f0545ebe | |||
| 445a76f543 | |||
| 4b52653a2e | |||
| ced290604a | |||
| 2c68515b93 | |||
| b26ad523ab | |||
| cd346b8536 | |||
| 2853731c4c | |||
| d31efb1f2a | |||
| e1702d1263 | |||
| 236254fed6 | |||
| 82f20f3c87 | |||
| adc75c0504 | |||
| 761778b87c | |||
| 5fa40fad99 | |||
| 8e608bd623 | |||
| 60a1707d43 | |||
| 1848ed85d0 | |||
| 197673de11 | |||
| 19e1d4e760 | |||
| abb1509314 | |||
| b9e4d9b01f | |||
| fcb541175a | |||
| 99e0b9967e | |||
| b88caa12ab | |||
| 40912bb7b7 | |||
| 7d6903d181 | |||
| 43cf75d400 | |||
| 2fa3ea24a5 | |||
| c82a27ebae | |||
| a7df54d8d2 | |||
| e8d11f150e | |||
| 6d8bd01266 | |||
| 65a256ba7b | |||
| d403f9cfcf | |||
| 30cc274c2e | |||
| 6564bdc74f | |||
| 6cdf1583c0 | |||
| 5441ff7b50 | |||
| d03ed02b2c | |||
| 8c4000a74c | |||
| 4c48085e4f | |||
| 37265932e9 | |||
| 8f602fc10a | |||
| f7ef38162b | |||
| 1bc17e7bb7 | |||
| 4d545c38ea | |||
| 83b9b3858d | |||
| 0de82a5fd9 | |||
| 8dc16e1ed9 | |||
| 4500f96d6d | |||
| a9921f9b17 | |||
| 8c4f0e15de | |||
| 46802be7d8 | |||
| 0a77cc2e12 | |||
| 6d07e1638b | |||
| 09d3df0fe1 | |||
| 838671d968 | |||
| f286f50855 | |||
| ff2dff29ee | |||
| 28cdaff2d0 | |||
| 3c4d299c58 | |||
| f388cf47f3 | |||
| 38b1eba03e | |||
| 6caa4fb6b5 | |||
| c1b781c142 | |||
| c219a6842b | |||
| 677ff492e7 | |||
| e4ba021482 | |||
| 24218e8d8c | |||
| 739311a02b | |||
| 61ef5dd9ed | |||
| aed21e027c | |||
| 1c64f500b3 | |||
| 542c421ac8 | |||
| 95e6f49e4f | |||
| 4c19cc49e2 | |||
| 74681a1f1d | |||
| d7b88e738f | |||
| d4c9843597 | |||
| 077cb2c586 | |||
| 8e9de6026e | |||
| b382560cfa | |||
| 339c6acb37 | |||
| 570a65c7a1 | |||
| e18a816647 | |||
| d578194d43 | |||
| e0f20d19f0 | |||
| cff4ef0d47 | |||
| d9fb464066 | |||
| 9d6a5fb496 | |||
| c3fab404a5 | |||
| fa139c84f3 | |||
| ae6853cd3f | |||
| c0618cd628 | |||
| 524b6a470c | |||
| cd4aa8ee11 | |||
| 242f5f4516 | |||
| e6a3e0c519 | |||
| 640c8af05f | |||
| 48ceceb8e0 | |||
| 5165463dbd | |||
| 9e1d424bc7 | |||
| 15c96303de | |||
| 3211f21869 | |||
| 1f4fe3597b | |||
| 0749e56b9f | |||
| 7424bdc147 | |||
| a623072e89 | |||
| 7f15b08b20 | |||
| 82d4fadaaa | |||
| d9f4d0584a | |||
| 2e5b4c9976 | |||
| 511af04c8b | |||
| 8b1d38c451 | |||
| abe3465514 | |||
| fc753c47be | |||
| ad8a7bf73f | |||
| 4a21a4be36 | |||
| aafe565474 | |||
| b6ef0a8d7a | |||
| 779f2105ba | |||
| c2b9c4b19f | |||
| 8eadb81e91 | |||
| 2bac228fe9 | |||
| c312e72fd2 | |||
| fd4683e4fa | |||
| 70661aa3d2 | |||
| a82486e9fb | |||
| cd4a7d3b91 | |||
| 3764c58394 | |||
| e49b505fbe | |||
| 72c1eb81f3 | |||
| 037ac0d030 | |||
| f1b64b1496 | |||
| 69ab03f3ec | |||
| 3b86cd9633 | |||
| 56fc63d5ff | |||
| f27eeb9c3d | |||
| 5d603a57db | |||
| 6f45e63f11 | |||
| eb8c78b7b1 | |||
| 4eefdf0842 | |||
| b536c30a88 | |||
| 9a0ea2e431 | |||
| d61a47755c | |||
| c6b8b74f26 | |||
| 53cd49bed1 | |||
| 2f4a77c73e | |||
| 64a3f75b31 | |||
| 000358b6a6 | |||
| 6c16e7b70a | |||
| 1ae32451e5 | |||
| 4c68955ba2 | |||
| dd80929ae1 | |||
| af80170976 | |||
| bf2742c6c7 | |||
| ec09b3f70c | |||
| 952d40cb2b | |||
| 0a767d1afd | |||
| d5be638099 | |||
| b6c5514f9e | |||
| 4fd18d377f | |||
| 9dff37f1f4 | |||
| b71ad963f1 | |||
| 3aefca4613 | |||
| cc5117aa11 | |||
| c5a8b852d9 | |||
| 69514074a9 | |||
| 6ecd613f12 | |||
| 6e4dee29af | |||
| da7ebc6b97 | |||
| 4685b6bde6 | |||
| 3a063bd2cf | |||
| 710a1fe070 | |||
| d818492d67 | |||
| e55e33c40a | |||
| 8cadb25261 | |||
| 2622b58cad | |||
| b5be932955 | |||
| 44ac2f8c2a | |||
| 0b928e987f | |||
| c213c3f059 | |||
| 330698b6aa | |||
| eb1ef693c4 | |||
| 862751c84a | |||
| e5a30c38d3 | |||
| e83d8db1cc | |||
| 9de88ffe84 | |||
| ffaf33c62e | |||
| 8c0389582b | |||
| ebe3d79c11 | |||
| f8c40739da | |||
| fa5aac926e | |||
| 749cd1e2bb | |||
| 587aaaafce | |||
| 2cfa7caba7 | |||
| fc0fba5bd3 | |||
| 94159f88f3 | |||
| 4961d2d528 | |||
| 7b22f5cc47 | |||
| 5047d5b652 | |||
| 7f9b880ff7 | |||
| 7e457a22b0 | |||
| 3c080e2b1a | |||
| 9d3edbfb54 | |||
| adf465c5e2 | |||
| 23f695fd56 | |||
| 52f347def1 | |||
| 028688b88a | |||
| cde5b137ae | |||
| d0cf5887d3 | |||
| afc4c6aaff | |||
| caa1875309 | |||
| 2e2c2188ce | |||
| 0acd75bece | |||
| db691cefe4 | |||
| d0ecd175c2 | |||
| 7e6d4189ef | |||
| abbc200504 | |||
| 9e4597b739 | |||
| d84d146701 | |||
| 00ff8818da | |||
| d5c582f890 | |||
| bc8b0490b7 | |||
| 5aad9dcbf2 | |||
| 8a582f512f | |||
| 1fde2e5fec | |||
| 7a89501cc9 | |||
| 89acdcc8f8 | |||
| f7c082e5b1 | |||
| 938c46b9d8 | |||
| 917bf5ec4b | |||
| 27d4ab3309 | |||
| 0ece2d91f4 | |||
| e08b53d5cf | |||
| a330b2fd7f | |||
| acdd4e10fb | |||
| ee6afb65c1 | |||
| ea9db1631b | |||
| 6513e75408 | |||
| 0e7d878f10 | |||
| 8bd0e5d145 | |||
| d8ecfc8463 | |||
| e52a9c66b6 | |||
| f3785f8644 | |||
| 350aaabbbe | |||
| 4eb3b38dd4 | |||
| e9534b4eee | |||
| da061a05e5 | |||
| ba432f5029 | |||
| 812397a047 | |||
| cbb42ec088 | |||
| 0c802464e1 | |||
| 498c65b006 | |||
| d81a0e8fbd | |||
| 47fde315a3 | |||
| 3ac61219c9 | |||
| bad0018381 | |||
| 48261c36d8 | |||
| 4f9093b1d2 | |||
| 52830876e9 | |||
| 4513833fb3 | |||
| 26cc812ed1 | |||
| cc3ff75ea2 | |||
| b150c75e96 | |||
| cc3b0da9e5 | |||
| 6c8e3017d0 | |||
| 8613072ea2 | |||
| a89ad10f0b | |||
| 91e0214243 | |||
| f01790e725 | |||
| 648fa1d9bf | |||
| 33be9ccaf0 | |||
| 1b6c1721c5 | |||
| d6c08628fb | |||
| ce68e29112 | |||
| e936f90086 | |||
| 6c62ec1fe4 | |||
| 481cebb207 | |||
| 126e3f6f92 | |||
| 21349b690b | |||
| 93f9af85e7 | |||
| 366a93dedf | |||
| 3e83035483 | |||
| efb805cf98 | |||
| 1572648a7e | |||
| 3dea3d9be2 | |||
| 0af620ba76 | |||
| 1fc7aeba75 | |||
| 6711a2c166 | |||
| 6a4a53ccd6 | |||
| acdf228d52 | |||
| 769c73765d | |||
| ec48260d73 | |||
| 06461550c3 | |||
| f45bcd7651 | |||
| 05fe546e38 | |||
| 63c5d39112 | |||
| f8e56d8f49 | |||
| b07f2f6b19 | |||
| eefd8ba037 | |||
| 076178db2c | |||
| 3699daf998 | |||
| 617058cdda | |||
| d7a517160d | |||
| 139579dbef | |||
| 72033c8b9f | |||
| cc30f3aeb9 | |||
| 969f4cb6a0 | |||
| c05e58a61e | |||
| 37026c548d | |||
| bfaeb8e414 | |||
| 3bd780d005 | |||
| 1ffa11b2c1 | |||
| 3548d8593a | |||
| 0eac98ecaa | |||
| a950807979 | |||
| 7676693f66 | |||
| e03896cfef | |||
| b5094daa43 | |||
| 5f1aaac719 | |||
| 57d696e2fc | |||
| 99c0ada098 | |||
| a828ca9804 | |||
| 88baf851ee | |||
| 1e094aac56 | |||
| 51b5c7ac80 | |||
| e3f8783c18 | |||
| d0015d8252 | |||
| 5ebdda4abd | |||
| 436dcf69ea | |||
| b7b9ea2065 | |||
| 8b1d3a0efb | |||
| 3d0adbdd39 | |||
| 8b51f9dca8 | |||
| f589464063 | |||
| fc7150f9b0 | |||
| 5c83095891 | |||
| fe76f4b859 | |||
| 1d2eb24903 | |||
| 0bb90513b5 | |||
| 2fa68977bf | |||
| 092ad0cb4c | |||
| 3953d079c1 | |||
| ddcea6524c | |||
| fe78df8c26 | |||
| 7a70f623d9 | |||
| b8ac0ef249 | |||
| f456ea3c2a | |||
| 8732c2fc66 | |||
| 6a135228b8 | |||
| 653557a23d | |||
| 036ea8bcc8 | |||
| b620aef7b8 | |||
| 58eb8df247 | |||
| 38ab9d4a40 | |||
| 4b7c533ae3 | |||
| d54c9c98d7 | |||
| d0d5ff3917 | |||
| afb72bcf48 | |||
| 0d6566e2cc | |||
| db5503f828 | |||
| 0cfa1207ec | |||
| d415034d1c | |||
| 06964c5a34 | |||
| 68921b5df5 | |||
| 7801a50ae0 | |||
| c418f5b92a | |||
| 3aa7979be4 | |||
| 4fdf3ebdfa | |||
| e25ad8e4a4 | |||
| d5a45917ec | |||
| eb401d2695 | |||
| 604ffc6a35 | |||
| 43da69863d | |||
| f7b484d6bf | |||
| 4a8576bcb2 | |||
| a2854beb8d | |||
| aa9f7c577c | |||
| 6fb5c3803f | |||
| 7d11c76bef | |||
| 8f8dc23096 | |||
| 2e2c897b47 | |||
| 2c98483de0 | |||
| 8660ae3742 | |||
| 3c0d1c9593 | |||
| 005bb0a384 | |||
| 897fa66d33 | |||
| 3069366ef2 | |||
| ec485c1c62 | |||
| 4acaab29f7 | |||
| 9b35408ef9 | |||
| d420e630ce | |||
| 8a9e198c43 | |||
| d1f1429eb5 | |||
| 9184fa23ac | |||
| 0950eac628 | |||
| 1f730989b3 | |||
| 63169a3859 | |||
| f59dac3029 | |||
| 5a089a737c | |||
| 2ed2e28e8a | |||
| 21144825dc | |||
| 2aba85f3c9 | |||
| 301cc10022 | |||
| 63a3d62807 | |||
| c3b3a8e09a | |||
| 23c31aa0be | |||
| 4ba4ddb698 | |||
| 4a408e3f61 | |||
| c3c767b839 | |||
| 0400878279 | |||
| 418fb4e284 | |||
| 337e13dbde | |||
| 8d80f389d3 | |||
| 91608ce3f0 | |||
| dbf0d3cf01 | |||
| e5bab7f1ab | |||
| b8fb6816a6 | |||
| ffb7580a65 | |||
| 6255b4c1cb | |||
| 3ae3bcf1d3 | |||
| a01733defd | |||
| ba9df21ab1 | |||
| 6a58e94af0 | |||
| eb93769055 | |||
| 0acffe8d52 | |||
| f2c28f3810 | |||
| 0a830c7f4b | |||
| 0778516765 | |||
| 334d8d369e | |||
| 4a6b3accb1 | |||
| e22db4a989 | |||
| 6021a50136 | |||
| 748a6e295a | |||
| 2bd563293c | |||
| cc099fb54c | |||
| 22c74c3252 | |||
| 3acebbd892 | |||
| bc04b680d4 | |||
| 6e8cd5f3bb | |||
| 91aa9d049f | |||
| 5f7f988552 | |||
| 7d65813c32 | |||
| 42d68d968d | |||
| 01f0182ef5 | |||
| e0f27b9abe | |||
| c8b29241ca | |||
| b0dea42f31 | |||
| a9462e189c | |||
| 27ee10d1ec | |||
| d73f535a55 | |||
| 5ae487cb20 | |||
| a3dcabf860 | |||
| 7b854c87c0 | |||
| d2fc60b7f1 | |||
| 286816e8e9 | |||
| 01fbcbbd01 | |||
| d1c014e20c | |||
| 92a924dde1 | |||
| d033fee929 | |||
| 1070910b8c | |||
| 306b5b6dff | |||
| d2a6d7e75c | |||
| 6309092689 | |||
| 2ec0d8162e | |||
| 60919c595d | |||
| 0638e3c6f3 | |||
| de80902a86 | |||
| 9fbd4a5156 | |||
| 6bd2e5ffb4 | |||
| f89129d2e8 | |||
| e0e2f630d2 | |||
| 1664513c8f | |||
| c701d4132f | |||
| a9052c1d72 | |||
| 593fdcfc24 | |||
| b9c8921cb2 | |||
| b3bb386ec7 | |||
| c69f80a903 | |||
| d8de7467b0 | |||
| 42c043fcd7 | |||
| 344467a500 | |||
| e82a8c9c1f | |||
| 85585c0b80 | |||
| 24e853ff92 | |||
| 0bcdf65656 | |||
| 1e442c7a01 | |||
| 24e38cdad5 | |||
| a239a096cd | |||
| 737abe7d30 | |||
| b7b701f9d2 | |||
| 5974edf8b1 | |||
| 7fcf169b6b | |||
| f30558db04 | |||
| cb17b9737e | |||
| 5315b63163 | |||
| a87c9f5789 | |||
| 1dc4efa397 | |||
| 50917a61b2 | |||
| a843ef2e25 | |||
| fc3f6f22ac | |||
| 84bc8d7bd7 | |||
| 7c7fa26b8d | |||
| 54fcc27c49 | |||
| a5a8a0e98b | |||
| 27df151d3d | |||
| 34b4867a0d | |||
| 2bf15f2958 | |||
| bfa26e7610 | |||
| 398ea82d2b | |||
| 6f8c94705b | |||
| a77d0b2652 | |||
| 6c14b873f9 | |||
| 15d85e174b | |||
| a2ba993709 | |||
| e90a4db38c | |||
| 5820ccb455 | |||
| 57fa9bb8b3 | |||
| 3fe16f87b7 | |||
| 15af95a77e | |||
| a9e378c468 | |||
| a524a60a41 | |||
| fdb897ec68 | |||
| 4e4a1eca4d | |||
| 03bf116341 | |||
| 82d9d4dfde | |||
| d39148a9e8 | |||
| a7e0c5a33d | |||
| 8ddf1f260a | |||
| 8671415d5e | |||
| e496feff2c | |||
| 73431c52ca | |||
| 5420bc5165 | |||
| 3ccc382d5b | |||
| 29af699ad5 | |||
| 5865192e23 | |||
| 374d99ffd9 | |||
| a31c026430 | |||
| 982b07ad32 | |||
| 869683c99a | |||
| f147f77133 | |||
| 9c5b23d15d | |||
| 62b1c186f7 | |||
| 55f4effbb6 | |||
| 70b9f9fe89 | |||
| 2ff160f555 | |||
| 7ff3a8eba6 | |||
| 59934d0fdf | |||
| df99424632 | |||
| 61b1375c00 | |||
| 07c76f60c8 | |||
| 2c88c295c8 | |||
| f0bd3d2e6f | |||
| a0d3bb9114 | |||
| 8f890f35e2 | |||
| 30e2028ebf | |||
| 04454ac44f | |||
| d73dbfbffb | |||
| b7ec0031e1 | |||
| d5f2422729 | |||
| 1c25ca7667 | |||
| f54cfa7eb3 | |||
| 8cef86ffd5 | |||
| 7402062859 | |||
| 36a663199c | |||
| b628a4200d | |||
| 0d3b3d1f04 | |||
| c490d5d388 | |||
| bc401eef07 | |||
| a93326e3cd | |||
| 6b5d7525a1 | |||
| 111a733365 | |||
| 7ce6ca9f13 | |||
| 6902620f5d | |||
| 7c6b5cf12c | |||
| 9c0d2111f5 | |||
| 19d8be5c9e | |||
| 41a05b4199 | |||
| ab48827689 | |||
| a859f170aa | |||
| 06f7fdb385 | |||
| 36d0e0c198 | |||
| e1dc521fe5 | |||
| 30fc2ab1a4 | |||
| dacf2c5860 | |||
| abb7735f9d | |||
| 2fb4338d50 | |||
| b0150f5b03 | |||
| 5802f26bbf | |||
| 3be500974a | |||
| 199c327151 | |||
| 5b6ed18a8e | |||
| f34367da55 | |||
| 6665209c66 | |||
| ea7e9dedac | |||
| b7b8f30a8c | |||
| 9ea1c502e8 | |||
| 4a4c5e7349 | |||
| 2c1831a678 | |||
| 5c4b609a56 | |||
| 295f8059c4 | |||
| b375b56f21 | |||
| 4a5d097256 | |||
| 9acb252f1b | |||
| 70505bcf29 | |||
| 35337836a5 | |||
| 12bfe2ac27 | |||
| 3ec2618f9b | |||
| b0e307d89d | |||
| 834a1261c5 | |||
| 0eea92b13d | |||
| 29f1af5216 | |||
| b18f7da20a | |||
| e9a82086e3 | |||
| d09069ad78 | |||
| 00078c65c1 | |||
| 303a69cbb3 | |||
| c762706e89 | |||
| 73f90eefe5 | |||
| 4951a4c5c2 | |||
| 688d43e463 | |||
| 300dea8f2c | |||
| ad6c7ef6af | |||
| bc33759c14 | |||
| 36cf8f6de8 | |||
| e6837d160b | |||
| 6c81ad1f1b | |||
| 5cde095b8e | |||
| 76381e27f7 | |||
| 73a970bc20 | |||
| bf6b888d27 | |||
| 4768c065ef | |||
| 133720bc34 | |||
| bad5b4aaa4 | |||
| 21768ed542 | |||
| e80e4e8a5d | |||
| c6566478e6 | |||
| 84d16b12a9 | |||
| 43900018dd | |||
| d6249a1f0f | |||
| 0954e86cc9 | |||
| 79b210def9 | |||
| acdceeb97f | |||
| 641aa5807d | |||
| f3c0987bc1 | |||
| 676815c32b | |||
| bcde9ae19c | |||
| 5004bc97b6 | |||
| c9cefa618e | |||
| dedf1366e6 | |||
| d72943e20b | |||
| 915f8973db | |||
| 6ee0d46ff5 | |||
| a4d06ff6c6 | |||
| bf9d0d2b8f | |||
| 0443133557 | |||
| 5c8f7dee7c | |||
| dabd2d2681 | |||
| 8bdde9e2bf | |||
| 2eccd38463 | |||
| 952190d792 | |||
| 9b32d12934 | |||
| a339d49066 | |||
| 260b8f36bb | |||
| 0e0c78edf4 | |||
| 5e9ff056c2 | |||
| dbbdd9f0df | |||
| df1cb76993 |
@@ -20,3 +20,4 @@
|
||||
/bin/LuaLibs/*.lua
|
||||
/bin/Images/*.png
|
||||
.vscode/settings.json
|
||||
bin/Images/.placeholder
|
||||
|
||||
+4
-4
@@ -24,14 +24,14 @@ variables:
|
||||
$FileList = Get-ChildItem("*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua54 -o bin\$FileName $FileName
|
||||
echo "lua54 -o bin\$FileName $FileName"
|
||||
lua54 -o bin\$FileName -s $FileName
|
||||
echo "lua54 -o bin\$FileName -s $FileName"
|
||||
}
|
||||
$FileList = Get-ChildItem("LuaLibs\*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName
|
||||
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
|
||||
lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName
|
||||
echo "lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName"
|
||||
}
|
||||
|
||||
# helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI
|
||||
|
||||
+86
-11
@@ -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)
|
||||
@@ -87,6 +101,21 @@ local function WriteTimeToLogFile( dTime)
|
||||
hFile:close()
|
||||
end
|
||||
|
||||
-- Funzioni per riportare stato lavorazione o pezzo in nge
|
||||
local function WriteErrToNge( nProcId, sErr, sMsg, sRot, sCutId, sTaskId)
|
||||
EgtSetInfo( nProcId, 'STATUS.ERR', sErr)
|
||||
EgtSetInfo( nProcId, 'STATUS.MSG', sMsg)
|
||||
EgtSetInfo( nProcId, 'STATUS.ROT', sRot)
|
||||
EgtSetInfo( nProcId, 'CUTID', sCutId)
|
||||
EgtSetInfo( nProcId, 'TASKID', sTaskId)
|
||||
end
|
||||
local function WriteFallToNge( nPartId, sErr, sMsg, sCutId, sFall)
|
||||
EgtSetInfo( nPartId, 'STATUS.ERR', sErr)
|
||||
EgtSetInfo( nPartId, 'STATUS.MSG', sMsg)
|
||||
EgtSetInfo( nPartId, 'CUTID', sCutId)
|
||||
EgtSetInfo( nPartId, 'STATUS.FALL', sFall)
|
||||
end
|
||||
|
||||
-- Funzione per gestire visualizzazione dopo errore
|
||||
local function PostErrView( nErr, sMsg)
|
||||
if nErr ~= 0 and ( BEAM.FLAG == 1 or BEAM.FLAG == 2) then
|
||||
@@ -108,13 +137,25 @@ end
|
||||
-- Funzione per aggiornare dati ausiliari
|
||||
local function UpdateAuxData( sAuxFile)
|
||||
local bModif = false
|
||||
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
|
||||
-- Se definito LOAD90, aggiorno
|
||||
local sLoad90 = EgtGetStringFromIni( 'AuxData', 'LOAD90', '', sAuxFile)
|
||||
if sLoad90 ~= '' then
|
||||
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
|
||||
EgtSetInfo( BtlInfoId, 'LOAD90', sLoad90)
|
||||
bModif = true
|
||||
end
|
||||
-- Se definito PROJID, aggiorno
|
||||
local sProjId = EgtGetStringFromIni( 'AuxData', 'PROJID', '', sAuxFile)
|
||||
if sProjId ~= '' then
|
||||
EgtSetInfo( BtlInfoId, 'PROJECTNUMBER', sProjId)
|
||||
bModif = true
|
||||
end
|
||||
-- Se definito PRODID, aggiorno
|
||||
local sProdId = EgtGetStringFromIni( 'AuxData', 'PRODID', '', sAuxFile)
|
||||
if sProdId ~= '' then
|
||||
EgtSetInfo( BtlInfoId, 'PRODID', sProdId)
|
||||
bModif = true
|
||||
end
|
||||
return bModif
|
||||
end
|
||||
|
||||
@@ -357,7 +398,7 @@ if bToProcess then
|
||||
local dOvmHead = vBeam[1].PosX or 0
|
||||
|
||||
-- Sistemo le travi nel grezzo
|
||||
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
|
||||
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, nil, vBeam)
|
||||
if not bPbOk then
|
||||
BEAM.ERR = 18
|
||||
BEAM.MSG = sPbErr
|
||||
@@ -387,6 +428,9 @@ if bToProcess then
|
||||
BEAM.CUTID = Stats[i].CutId
|
||||
BEAM.TASKID = Stats[i].TaskId
|
||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||
if Stats[i].ProcId then
|
||||
WriteErrToNge( Stats[i].ProcId, BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||
end
|
||||
elseif Stats[i].Err > 0 then
|
||||
nErrCnt = nErrCnt + 1
|
||||
sOutput = sOutput .. string.format( '[%d,%d] %s\n', Stats[i].CutId, Stats[i].TaskId, sMsg)
|
||||
@@ -396,6 +440,9 @@ if bToProcess then
|
||||
BEAM.CUTID = Stats[i].CutId
|
||||
BEAM.TASKID = Stats[i].TaskId
|
||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||
if Stats[i].ProcId then
|
||||
WriteErrToNge( Stats[i].ProcId, BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||
end
|
||||
elseif Stats[i].Err < 0 then
|
||||
-- se segnalazione scarico pezzo standard, incompleto o a caduta
|
||||
if Stats[i].Err == -100 or Stats[i].Err == -101 or Stats[i].Err == -102 then
|
||||
@@ -404,6 +451,9 @@ if bToProcess then
|
||||
BEAM.CUTID = Stats[i].CutId
|
||||
BEAM.FALL = abs( Stats[i].Err + 100)
|
||||
WriteFallToLogFile( BEAM.ERR, BEAM.MSG, BEAM.CUTID, BEAM.FALL)
|
||||
if Stats[i].ProcId then
|
||||
WriteFallToNge( Stats[i].PartId, BEAM.ERR, BEAM.MSG, BEAM.CUTID, BEAM.FALL)
|
||||
end
|
||||
-- altri avvertimenti
|
||||
else
|
||||
nWarnCnt = nWarnCnt + 1
|
||||
@@ -414,6 +464,9 @@ if bToProcess then
|
||||
BEAM.CUTID = Stats[i].CutId
|
||||
BEAM.TASKID = Stats[i].TaskId
|
||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||
if Stats[i].ProcId then
|
||||
WriteErrToNge( Stats[i].ProcId, BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -429,39 +482,60 @@ if bToProcess then
|
||||
PostWarnView( 19, sOutput)
|
||||
end
|
||||
|
||||
-- Altrimenti carico il progetto salvato e dichiaro nessun errore
|
||||
-- Altrimenti carico il progetto salvato, rileggo gli errori da nge e riscrivo il log txt con gli stati precedenti
|
||||
else
|
||||
EgtOutLog( ' +++ Loading Project already processed >>>')
|
||||
-- Carico il progetto già fatto
|
||||
EgtOpenFile( sNgeFile)
|
||||
-- Dichiaro nessun errore
|
||||
-- Riscrivo il log txt
|
||||
local nPartId = EgtGetFirstPart()
|
||||
while nPartId do
|
||||
local nCutId = EgtGetInfo( nPartId, 'CUTID')
|
||||
if nCutId then
|
||||
-- stato a livello di singola feature
|
||||
local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nPartId, 'Processings') or GDB_ID.NULL)
|
||||
while nProcId do
|
||||
local bIsFea = EgtExistsInfo( nProcId, 'GRP') and EgtExistsInfo( nProcId, 'PRC')
|
||||
local nTaskId = EgtGetInfo( nProcId, 'TASKID')
|
||||
local sErr = EgtGetInfo( nProcId, 'STATUS.ERR') or 0
|
||||
local sMsg = EgtGetInfo( nProcId, 'STATUS.MSG') or '---'
|
||||
local sRot = EgtGetInfo( nProcId, 'STATUS.ROT') or 0
|
||||
if bIsFea and nTaskId then
|
||||
BEAM.ERR = 0
|
||||
BEAM.MSG = '---'
|
||||
BEAM.ROT = 0
|
||||
BEAM.ERR = sErr
|
||||
BEAM.MSG = sMsg
|
||||
BEAM.ROT = sRot
|
||||
BEAM.CUTID = nCutId
|
||||
BEAM.TASKID = nTaskId
|
||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID)
|
||||
end
|
||||
nProcId = EgtGetNext( nProcId)
|
||||
end
|
||||
-- stato a livello di pezzo
|
||||
local sErr = EgtGetInfo( nPartId, 'STATUS.ERR') or 0
|
||||
if sErr == -100 or sErr == -101 or sErr == -102 then
|
||||
local sMsg = EgtGetInfo( nPartId, 'STATUS.MSG') or '---'
|
||||
local sFall = EgtGetInfo( nPartId, 'STATUS.FALL') or 0
|
||||
BEAM.ERR = sErr
|
||||
BEAM.MSG = sMsg
|
||||
BEAM.CUTID = nCutId
|
||||
BEAM.FALL = sFall
|
||||
WriteFallToLogFile( BEAM.ERR, BEAM.MSG, BEAM.CUTID, BEAM.FALL)
|
||||
end
|
||||
end
|
||||
nPartId = EgtGetNextPart( nPartId)
|
||||
end
|
||||
-- Aggiorno eventuali dati ausiliari
|
||||
UpdateAuxData( sBtmFile)
|
||||
|
||||
-- Anche se non è da riprocessare, imposto nome file CN.
|
||||
-- Se file TS7 importato da altro PC, 'BEAM.FILE' è cambiato da un PC all'altro. Di conseguenza si deve aggiornare nome file che si andrà a generare.
|
||||
local _, sName, _ = EgtSplitPath( BEAM.FILE)
|
||||
EgtSetInfo( EgtGetLastMachGroup(), 'NcName', sName .. '.cnc')
|
||||
|
||||
-- Passo in modalità lavora
|
||||
EgtSetCurrMachGroup( EgtGetLastMachGroup())
|
||||
-- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni
|
||||
if bToRecalc then
|
||||
if bToRecalc or BEAM.FLAG == 3 or BEAM.FLAG == 4 then
|
||||
EgtOutLog( ' +++ Recalculating all dispositions and machinings >>>')
|
||||
EgtImportSetup()
|
||||
EgtApplyAllMachinings()
|
||||
@@ -525,7 +599,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
|
||||
|
||||
+28
-10
@@ -1,4 +1,4 @@
|
||||
-- BatchProcessNew.lua by Egaltech s.r.l. 2022/08/01
|
||||
-- BatchProcessNew.lua by Egaltech s.r.l. 2024/01/10
|
||||
-- Gestione calcolo batch disposizione e lavorazioni per Travi
|
||||
-- 2021/01/07 Per nuova interfaccia Egt.
|
||||
-- 2021/01/15 CREATE_BAR ora FLAG = 6 (prima 5).
|
||||
@@ -12,6 +12,7 @@
|
||||
-- 2022/04/28 In info generazione aggiunta indicazione se 64bit.
|
||||
-- 2022/07/24 Modifica per cancellare lavorazioni con ricalcolo e barra già definita.
|
||||
-- 2022/08/01 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL).
|
||||
-- 2024/01/10 Modifiche per centrare i pezzi in Y sulla tavola (come in BeamExec).
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
@@ -44,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)
|
||||
@@ -209,10 +224,7 @@ if bToProcess then
|
||||
EgtSetCurrMachGroup()
|
||||
-- Area tavola
|
||||
local b3Tab = EgtGetTableArea()
|
||||
-- Calcolo posizione estremo TR o BR della tavola rispetto a sua origine in BL
|
||||
BD.OriXR = Point3d( b3Tab:getDimX(), EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()), 0)
|
||||
BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
|
||||
-- Calcolo minimo grezzo scaricabile
|
||||
-- Sezione del grezzo
|
||||
local nRawId = EgtGetFirstRawPart()
|
||||
if not nRawId then
|
||||
BEAM.ERR = 14
|
||||
@@ -222,6 +234,11 @@ if bToProcess then
|
||||
return
|
||||
end
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- Calcolo posizione estremo TR o BR della tavola rispetto a sua origine in BL
|
||||
local dPosY = EgtIf( BD.CENTER_BEAM, ( b3Tab:getDimY() + b3Raw:getDimY() * EgtIf( BD.RIGHT_LOAD, -1, 1)) / 2, EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY()))
|
||||
BD.OriXR = Point3d( b3Tab:getDimX(), dPosY, 0)
|
||||
BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
|
||||
-- Calcolo minimo grezzo scaricabile
|
||||
BE.CalcMinUnloadableRaw( b3Raw:getDimY(), b3Raw:getDimZ())
|
||||
-- altrimenti devo recuperare i pezzi per creare la barra
|
||||
else
|
||||
@@ -402,7 +419,7 @@ if bToProcess then
|
||||
end
|
||||
|
||||
-- Sistemo le travi nel grezzo
|
||||
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, BEAM.FLAG == 6)
|
||||
local bPbOk, sPbErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, nil, vBeam, BEAM.FLAG == 6)
|
||||
if not bPbOk then
|
||||
BEAM.ERR = 18
|
||||
BEAM.MSG = sPbErr
|
||||
@@ -559,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()
|
||||
@@ -623,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
|
||||
|
||||
+51
-48
@@ -1,53 +1,56 @@
|
||||
|
||||
REM Compilazione degli script Beam Egaltech 2023.02.27
|
||||
REM Compilazione degli script Beam Egaltech 2023.11.08
|
||||
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
||||
|
||||
REM Compilazione 32 e 64 bit
|
||||
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamExec.lua LuaLibs\BeamExec.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamLib.lua LuaLibs\BeamLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\DiceCut.lua LuaLibs\DiceCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FaceByPocket.lua LuaLibs\FaceByPocket.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FacesBySaw.lua LuaLibs\FacesBySaw.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\MachiningLib.lua LuaLibs\MachiningLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessBlockHausFront.lua LuaLibs\ProcessBlockHausFront.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessChamfer.lua LuaLibs\ProcessChamfer.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessCut.lua LuaLibs\ProcessCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDecor.lua LuaLibs\ProcessDecor.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDoubleCut.lua LuaLibs\ProcessDoubleCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDovetail.lua LuaLibs\ProcessDovetail.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDrill.lua LuaLibs\ProcessDrill.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtMortise.lua LuaLibs\ProcessDtMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtTenon.lua LuaLibs\ProcessDtTenon.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFreeContour.lua LuaLibs\ProcessFreeContour.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFrenchRidgeLap.lua LuaLibs\ProcessFrenchRidgeLap.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessHeadCut.lua LuaLibs\ProcessHeadCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLapJoint.lua LuaLibs\ProcessLapJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongCut.lua LuaLibs\ProcessLongCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongDoubleCut.lua LuaLibs\ProcessLongDoubleCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMark.lua LuaLibs\ProcessMark.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMortise.lua LuaLibs\ProcessMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfCamb.lua LuaLibs\ProcessProfCamb.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConcave.lua LuaLibs\ProcessProfConcave.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConvex.lua LuaLibs\ProcessProfConvex.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfFront.lua LuaLibs\ProcessProfFront.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfHead.lua LuaLibs\ProcessProfHead.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRidgeLap.lua LuaLibs\ProcessRidgeLap.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRoundArch.lua LuaLibs\ProcessRoundArch.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSawCut.lua LuaLibs\ProcessSawCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessScarfJoint.lua LuaLibs\ProcessScarfJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSimpleScarf.lua LuaLibs\ProcessSimpleScarf.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSplit.lua LuaLibs\ProcessSplit.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJoint.lua LuaLibs\ProcessStepJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJointNotch.lua LuaLibs\ProcessStepJointNotch.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTenon.lua LuaLibs\ProcessTenon.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua LuaLibs\ProcessText.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua LuaLibs\ProcessTyroleanDovetail.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua BatchProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua BatchProcessNew.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\GetBeamData.lua GetBeamData.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\NestProcess.lua NestProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Process.lua Process.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Rotate.lua Rotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Swap.lua Swap.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Version.lua Version.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamExec.lua -s LuaLibs\BeamExec.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\BeamLib.lua -s LuaLibs\BeamLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\DiceCut.lua -s LuaLibs\DiceCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FaceByPocket.lua -s LuaLibs\FaceByPocket.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FacesBySaw.lua -s LuaLibs\FacesBySaw.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FeatureTopology.lua -s LuaLibs\FeatureTopology.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\MachiningLib.lua -s LuaLibs\MachiningLib.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessBlockHausFront.lua -s LuaLibs\ProcessBlockHausFront.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessChamfer.lua -s LuaLibs\ProcessChamfer.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessCut.lua -s LuaLibs\ProcessCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDecor.lua -s LuaLibs\ProcessDecor.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDoubleCut.lua -s LuaLibs\ProcessDoubleCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDovetail.lua -s LuaLibs\ProcessDovetail.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDrill.lua -s LuaLibs\ProcessDrill.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtMortise.lua -s LuaLibs\ProcessDtMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessDtTenon.lua -s LuaLibs\ProcessDtTenon.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFreeContour.lua -s LuaLibs\ProcessFreeContour.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessFrenchRidgeLap.lua -s LuaLibs\ProcessFrenchRidgeLap.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessHeadCut.lua -s LuaLibs\ProcessHeadCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLapJoint.lua -s LuaLibs\ProcessLapJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongCut.lua -s LuaLibs\ProcessLongCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessLongDoubleCut.lua -s LuaLibs\ProcessLongDoubleCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMark.lua -s LuaLibs\ProcessMark.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessMortise.lua -s LuaLibs\ProcessMortise.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfCamb.lua -s LuaLibs\ProcessProfCamb.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConcave.lua -s LuaLibs\ProcessProfConcave.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfConvex.lua -s LuaLibs\ProcessProfConvex.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfFront.lua -s LuaLibs\ProcessProfFront.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProfHead.lua -s LuaLibs\ProcessProfHead.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRidgeLap.lua -s LuaLibs\ProcessRidgeLap.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessRoundArch.lua -s LuaLibs\ProcessRoundArch.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSawCut.lua -s LuaLibs\ProcessSawCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessScarfJoint.lua -s LuaLibs\ProcessScarfJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSimpleScarf.lua -s LuaLibs\ProcessSimpleScarf.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessSplit.lua -s LuaLibs\ProcessSplit.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJoint.lua -s LuaLibs\ProcessStepJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessStepJointNotch.lua -s LuaLibs\ProcessStepJointNotch.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTenon.lua -s LuaLibs\ProcessTenon.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua -s LuaLibs\ProcessText.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua -s LuaLibs\ProcessTyroleanDovetail.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessVariant.lua -s LuaLibs\ProcessVariant.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProbing.lua -s LuaLibs\ProcessProbing.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcess.lua -s BatchProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua -s BatchProcessNew.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\GetBeamData.lua -s GetBeamData.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\NestProcess.lua -s NestProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Process.lua -s Process.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Rotate.lua -s Rotate.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Swap.lua -s Swap.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\Version.lua -s Version.lua
|
||||
|
||||
+593
-118
File diff suppressed because it is too large
Load Diff
+444
-101
@@ -1,4 +1,4 @@
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2023/03/22
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2023/12/15
|
||||
-- Libreria globale per Travi
|
||||
-- 2020/07/28 Corretto calcolo attacchi e uscite di lame per non uscire dalla faccia sotto.
|
||||
-- 2020/08/18 Aggiunto a GetNearestParalOpposite e GetNearestOrthoOpposite parametro opzionale vtNorm.
|
||||
@@ -22,6 +22,14 @@
|
||||
-- 2023/01/31 Aggiunta funzione ConvertToClosedCurve, precedentemente parte di ProcessMortise.Make
|
||||
-- 2023/02/22 Modifiche a SetOpenSide, aggiunte ChangeOrOpenStart e CurveWithOnlyStraightLines.
|
||||
-- 2023/06/12 In ChangeOrOpenStart corretta ricerca segmento più lungo.
|
||||
-- 2023/09/13 Aggiunte funzioni Is3EdgesApprox e GetProcessAffectedFaces.
|
||||
-- 2023/09/25 In GetFaceWithMostAdj aggiunta verifica sottosquadro anche per facce non adiacenti.
|
||||
-- 2023/09/26 In GetFaceWithMostAdj gestito primo parametro anche come Proc; gestito caso strip con facce tutte in sottosquadro.
|
||||
-- 2023/09/26 Spostata qui funzione IsFeatureCuttingEntireSection da BeamExec.
|
||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation. Se l'elevazione è già calcolata la recupera da Proc, altrimenti la calcola al momento.
|
||||
-- 2023/12/15 Correzione a GetFaceWithMostAdj per calcoli con facce che fanno ombra.
|
||||
-- 2024/01/08 Correzione a Is3EdgesApprox per casi in cui nAddGroup non esista ancora.
|
||||
-- 2024/01/18 Aggiunta funzione GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local BeamLib = {}
|
||||
@@ -436,54 +444,22 @@ function BeamLib.GetBoxFaceNorm( b3Box, ptP, vtV)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetFaceElevation( nSurfId, nFac, nPartId)
|
||||
-- centro e normale della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFac, GDB_ID.ROOT)
|
||||
if not ptC or not vtN then return 0 end
|
||||
-- riferimento OCS della faccia per ricavare elevazione rispetto alla faccia della superficie
|
||||
local frOCS = Frame3d( ptC, vtN)
|
||||
local b3Box = EgtGetBBoxRef( nSurfId, GDB_BB.STANDARD, frOCS)
|
||||
local dElev = b3Box:getMax():getZ()
|
||||
-- se definito identificativo di pezzo
|
||||
if nPartId then
|
||||
-- se superficie con più facce
|
||||
if EgtSurfTmFacetCount( nSurfId) > 1 then
|
||||
-- determino elevazione del centro faccia rispetto al box del pezzo
|
||||
local _, dCenElev = BeamLib.GetPointDirDepth( nPartId, ptC, vtN)
|
||||
if dCenElev and dCenElev > dElev then
|
||||
dElev = dCenElev
|
||||
end
|
||||
-- altrimenti superficie ad una sola faccia
|
||||
else
|
||||
-- determino elevazione box del pezzo rispetto alla faccia
|
||||
local b3Solid = EgtGetBBoxRef( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD, frOCS)
|
||||
local dSolidElev = b3Solid:getMax():getZ()
|
||||
if b3Solid and dSolidElev > dElev then
|
||||
dElev = dSolidElev
|
||||
end
|
||||
end
|
||||
function BeamLib.GetFaceElevation( procOrProcId, nFacet, b3Solid)
|
||||
local Proc, nProcId
|
||||
if type( procOrProcId) == "table" then
|
||||
Proc = procOrProcId
|
||||
nProcId = Proc.Id
|
||||
else
|
||||
nProcId = procOrProcId
|
||||
end
|
||||
local dElevation
|
||||
if not Proc or not Proc.Face or not Proc.Face[nFacet + 1].Elevation then
|
||||
dElevation = EgtSurfTmFacetElevationInBBox( nProcId, nFacet, b3Solid, true, GDB_ID.ROOT)
|
||||
else
|
||||
dElevation = Proc.Face[nFacet + 1].Elevation
|
||||
end
|
||||
return dElev
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetOtherFaceElevation( nSurfId, nOtherSurfId, nOtherFac, nPartId)
|
||||
-- centro e normale della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nOtherSurfId, nOtherFac, GDB_ID.ROOT)
|
||||
if not ptC or not vtN then return 0 end
|
||||
-- riferimento OCS della faccia per ricavare elevazione rispetto alla faccia della superficie
|
||||
local frOCS = Frame3d( ptC, vtN)
|
||||
local b3Box = EgtGetBBoxRef( nSurfId, GDB_BB.STANDARD, frOCS)
|
||||
local dElev = b3Box:getMax():getZ()
|
||||
-- se definito identificativo di pezzo
|
||||
if nPartId then
|
||||
-- determino elevazione del centro faccia rispetto al box del pezzo
|
||||
local _, dCenElev = BeamLib.GetPointDirDepth( nPartId, ptC, vtN)
|
||||
if dCenElev and dCenElev > dElev then
|
||||
dElev = dCenElev
|
||||
end
|
||||
end
|
||||
return dElev
|
||||
return dElevation
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -509,7 +485,9 @@ function BeamLib.GetFaceElevationFromPointDir( nSurfId, nPartId, ptC, vtN, nIdGe
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
|
||||
local nSurfId = Proc.Id
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
-- verifica che la superficie non sia chiusa e quindi non lavorabile
|
||||
if EgtSurfIsClosed( nSurfId) then
|
||||
return
|
||||
@@ -521,14 +499,17 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
end
|
||||
-- recupero le normali delle facce
|
||||
local vvtN = {}
|
||||
local vPtC = {}
|
||||
for i = 1, nFacCnt do
|
||||
local vtN = EgtSurfTmFacetNormVersor( nSurfId, i - 1, GDB_ID.ROOT)
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, i - 1, GDB_ID.ROOT)
|
||||
vvtN[i] = vtN ;
|
||||
vPtC[i] = ptC
|
||||
end
|
||||
-- adiacenze e sottosquadra delle facce
|
||||
local vAdj = {}
|
||||
local vUcut = {}
|
||||
local vOrtho = {}
|
||||
local nFacesWithUnderCut = 0
|
||||
for i = 1, nFacCnt do
|
||||
-- recupero le adiacenze del loop esterno
|
||||
local vFacAdj = EgtSurfTmFacetAdjacencies( nSurfId, i - 1)[1]
|
||||
@@ -540,7 +521,7 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
end
|
||||
end
|
||||
vAdj[i] = nCount
|
||||
-- ne determino eventuale sottosquadra ( dal valore passato o - 3deg) e ortogonalità
|
||||
-- ne determino eventuale sottosquadro ( dal valore passato o - 3deg) e ortogonalità, per facce adiacenti
|
||||
local bUcut = false
|
||||
local bOrtho = true
|
||||
for j = 1, #vFacAdj do
|
||||
@@ -556,39 +537,63 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- determino evenutale sottosquadro per facce non adiacenti
|
||||
for j = 1, nFacCnt do
|
||||
local bIsFaceAdjacent = false
|
||||
for k = 1, #vFacAdj do
|
||||
if j - 1 == vFacAdj[k] then
|
||||
bIsFaceAdjacent = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if not ( bIsFaceAdjacent or ( j == i)) then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BeamLib.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
EgtOutLog( 'Error : missing AddGroup')
|
||||
return 0, 0, 0
|
||||
end
|
||||
-- verifico eventuale intersezione tra la faccia i-1 esima e la proiezione dell'altra sulla stessa
|
||||
local nShadowFacetId = EgtCopySurfTmFacet( nSurfId, j - 1, nAddGrpId)
|
||||
local nMasterContourId = EgtExtractSurfTmFacetLoops( nSurfId, i - 1, nAddGrpId)
|
||||
local nShadowContourId = EgtExtractSurfTmLoops( nShadowFacetId, nAddGrpId)
|
||||
EgtCutSurfTmPlane( nShadowFacetId, vPtC[i], -vvtN[i], false, GDB_RT.GLOB)
|
||||
if nMasterContourId and nShadowContourId then
|
||||
local nMasterSurfFlatId = EgtSurfFlatRegion( nAddGrpId, nMasterContourId)
|
||||
local frOCSMaster = Frame3d( vPtC[i], vvtN[i])
|
||||
EgtScale( nShadowContourId, frOCSMaster, 1, 1, 0, GDB_RT.GLOB)
|
||||
EgtModifyCurveExtrusion( nShadowContourId, vvtN[i], GDB_RT.GLOB)
|
||||
local nShadowSurfFlatId
|
||||
-- se non troppo ortogonale (almeno 0.5deg di delta)
|
||||
local dResV = vvtN[i] * vvtN[j]
|
||||
if abs( dResV) > 0.087 then
|
||||
EgtOffsetCurve( nShadowContourId, EgtIf( dResV > GEO.EPS_SMALL, - 50, 50) * GEO.EPS_SMALL)
|
||||
local nShadowSurfFlatId = EgtSurfFlatRegion( nAddGrpId, nShadowContourId)
|
||||
local bShadowSurfIsExternal = EgtSurfFrTestExternal( nMasterSurfFlatId, nShadowSurfFlatId)
|
||||
if not bShadowSurfIsExternal then
|
||||
bUcut = true
|
||||
end
|
||||
EgtErase( nShadowSurfFlatId)
|
||||
end
|
||||
EgtErase( nMasterSurfFlatId)
|
||||
end
|
||||
EgtErase( { nMasterContourId, nShadowContourId, nShadowFacetId})
|
||||
end
|
||||
end
|
||||
if bUcut then
|
||||
nFacesWithUnderCut = nFacesWithUnderCut + 1
|
||||
end
|
||||
vUcut[i] = bUcut
|
||||
vOrtho[i] = bOrtho
|
||||
end
|
||||
-- se 4 facce tutte con adiacenza 2, allora è un tunnel
|
||||
if nFacCnt == 4 then
|
||||
if vAdj[1] == 2 and vAdj[2] == 2 and vAdj[3] == 2 and vAdj[4] == 2 then
|
||||
-- se tutte le facce sono ortogonali tra loro esco con un flag che ne indica questa propietà
|
||||
if vOrtho[1] == true and vOrtho[2] == true and vOrtho[3] == true and vOrtho[4] == true then
|
||||
return -1, GEO.INFINITO, true
|
||||
else
|
||||
return -1, GEO.INFINITO
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se 3 facce con una che ha 2 adiacenze e le altre hanno 1 adiacenza, allora è una semi-fessura
|
||||
if bCompare3Fc and nFacCnt == 3 then
|
||||
local nCount2Adc = 0
|
||||
local nCount1Adc = 0
|
||||
-- ottengo il numero di facce con due adiacenze e il numero di facce con una adiacenza
|
||||
for i = 1, #vAdj do
|
||||
if vAdj[i] == 2 then
|
||||
nCount2Adc = nCount2Adc + 1
|
||||
elseif vAdj[i] == 1 then
|
||||
nCount1Adc = nCount1Adc + 1
|
||||
end
|
||||
end
|
||||
-- se il numero di adiacenze corrisponde
|
||||
if nCount2Adc == 1 and nCount1Adc == 2 then
|
||||
if vOrtho[1] == true and vOrtho[2] == true and vOrtho[3] == true then
|
||||
return -1, GEO.INFINITO, true
|
||||
else
|
||||
return -1, GEO.INFINITO
|
||||
end
|
||||
local bEveryFaceHasUndercut = ( nFacesWithUnderCut == nFacCnt)
|
||||
-- tunnel o assimilabile
|
||||
if Proc.Topology == 'Tunnel' or ( bCompare3Fc and Proc.Topology == 'Groove' and Proc.IsThrough) or ( Proc.Topology == 'Strip' and bEveryFaceHasUndercut) then
|
||||
if Proc.IsParallel or Proc.AllRightAngles then
|
||||
return -1, GEO.INFINITO, true
|
||||
else
|
||||
-- non gestito nella LapJoint
|
||||
return -1, GEO.INFINITO
|
||||
end
|
||||
end
|
||||
-- recupero le facce non in sottosquadra e con il maggior numero di adiacenze
|
||||
@@ -618,7 +623,7 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
local dMinElev, dMinElev2 = GEO.INFINITO, GEO.INFINITO
|
||||
local dtElev = {}
|
||||
for i = 1, #nFacInd do
|
||||
local dElev = BeamLib.GetFaceElevation( nSurfId, nFacInd[i], nPartId)
|
||||
local dElev = BeamLib.GetFaceElevation( Proc, nFacInd[i], b3Solid)
|
||||
table.insert( dtElev, dElev)
|
||||
if dElev < dMinElev then
|
||||
if dMinElev < dMinElev2 then
|
||||
@@ -637,7 +642,7 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
-- premio quella che non è sottosquadra e che ha la X minore
|
||||
local bDiffSmall = true
|
||||
for i = 1, #dtElev do
|
||||
if dtElev[i] > dMinElev + 5 or dtElev[i] > 80 then
|
||||
if ( dtElev[i] > dMinElev + 5 or dtElev[i] > 80) and dMinElev < 0.85 * dtElev[i] then
|
||||
bDiffSmall = false
|
||||
end
|
||||
end
|
||||
@@ -673,6 +678,13 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
--- ritorna il riferimento di tipo OCS della faccia *nFacet* della trimesh *nSurfId* e le dimensioni orizzontale e verticale, eventualmente limitate dal grezzo *b3Raw*
|
||||
---@param nSurfId integer Id della trimesh
|
||||
---@param nFacet integer Indice 0-based della faccia della trimesh di cui restituire le informazioni
|
||||
---@param b3Raw? BBox3d Eventuale box del grezzo per limitare le dimensioni
|
||||
---@return Frame3d frHv riferimento faccia OCS
|
||||
---@return number dDimH dimensione orizzontale OCS
|
||||
---@return number dDmiV dimensione verticale OCS
|
||||
function BeamLib.GetFaceHvRefDim( nSurfId, nFacet, b3Raw)
|
||||
-- recupero centro e normale della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
@@ -722,7 +734,9 @@ end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
||||
if BD.C_SIMM then
|
||||
if BD.GetNzLimDownUp then
|
||||
return BD.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
||||
elseif BD.C_SIMM then
|
||||
return -0.484
|
||||
elseif BD.TURN then
|
||||
return -2
|
||||
@@ -751,13 +765,20 @@ function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
||||
else
|
||||
return -0.383
|
||||
end
|
||||
elseif b3Raw:getDimZ() < BD.MIN_DIM_HBEAM then
|
||||
elseif b3Raw:getDimZ() < 300 then
|
||||
-- N_HorAng < 10°
|
||||
if vtN and ( abs( vtN:getY()) < 0.174) then
|
||||
return -0.5
|
||||
else
|
||||
return -0.259
|
||||
end
|
||||
elseif b3Raw:getDimZ() < BD.MIN_DIM_HBEAM then
|
||||
-- N_HorAng < 10°
|
||||
if vtN and ( abs( vtN:getY()) < 0.174) then
|
||||
return -0.342
|
||||
else
|
||||
return -0.259
|
||||
end
|
||||
else
|
||||
-- N_HorAng < 10°
|
||||
if vtN and ( abs( vtN:getY()) < 0.174) then
|
||||
@@ -795,28 +816,16 @@ function BeamLib.GetDistanceToNextPart( nRawId, nPhase)
|
||||
-- se segue una parte rimanente riutilizzabile, modifico opportunamente questa distanza
|
||||
if not BeamLib.IsSplittedPartPhase( nPhase) then
|
||||
local nNextRawId = EgtGetNextRawPart( nRawId)
|
||||
if nNextRawId and
|
||||
EgtGetPartInRawPartCount( nNextRawId) <= 0 and
|
||||
EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw then
|
||||
if nNextRawId and
|
||||
EgtGetPartInRawPartCount( nNextRawId) <= 0 and
|
||||
EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw then
|
||||
|
||||
dDistToNextPiece = BD.OVM_MID
|
||||
end
|
||||
end
|
||||
return dDistToNextPiece
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetChainSawBlockedAxis( nInd)
|
||||
if BD.GetChainSawBlockedAxis then
|
||||
return BD.GetChainSawBlockedAxis( nInd)
|
||||
else
|
||||
if nInd == 1 then
|
||||
return EgtIf( BD.C_SIMM, 'A=90', 'A=90')
|
||||
else
|
||||
return EgtIf( BD.C_SIMM, 'A=0', 'A=0')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetChainSawInitAngs( vtN, vtO, nInd)
|
||||
if BD.GetChainSawInitAngs then
|
||||
@@ -834,6 +843,44 @@ function BeamLib.GetChainSawInitAngs( vtN, vtO, nInd)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
---
|
||||
---@param sMachining string nome della lavorazione di cui bloccare l'asse
|
||||
---@param sBlockedAxis string rappresenta lo stato desiderato dell'asse bloccato, parallelo o perpendicolare all'asse rotante da cui dipende (*parallel* o *perpendicular*)
|
||||
---@param b3Raw? BBox3d
|
||||
---@param vtTool? Vector3d
|
||||
---@param vtOut? Vector3d
|
||||
---@return string # testo contenente il valore dell'asse rotante bloccato da scrivere nel parametro *MCH_MP.BLOCKEDAXIS* della lavorazione (es: 'A2=90')
|
||||
function BeamLib.GetBlockedAxis( sMachining, sBlockedAxis, b3Raw, vtTool, vtOut)
|
||||
-- informazioni sull'utensile della lavorazione
|
||||
local nToolType, sHead
|
||||
if EgtMdbSetCurrMachining( sMachining) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
nToolType = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
end
|
||||
end
|
||||
-- se presente funzione specifica nella macchina, la richiamo
|
||||
if BD.GetBlockedAxis then
|
||||
return BD.GetBlockedAxis( sHead, nToolType, sBlockedAxis, b3Raw, vtTool, vtOut) or ''
|
||||
-- sezione mantenuta per retrocompatibilità con GetChainSawBlockedAxis
|
||||
elseif nToolType == MCH_TY.MORTISE_STD then
|
||||
local nInd = EgtIf( sBlockedAxis == 'parallel', 0, 1)
|
||||
if BD.GetChainSawBlockedAxis then
|
||||
return BD.GetChainSawBlockedAxis( nInd)
|
||||
else
|
||||
if nInd == 1 then
|
||||
return EgtIf( BD.C_SIMM, 'A=90', 'A=90')
|
||||
else
|
||||
return EgtIf( BD.C_SIMM, 'A=0', 'A=0')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return ''
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Trova l'Ind (0 based) della faccia meglio orientata come l'asse vtAx. Restituisce anche vtN e ptC della faccia stessa. La faccia di indice (0 based) fctExclude non viene considerata nella ricerca.
|
||||
function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
|
||||
@@ -852,6 +899,27 @@ function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
|
||||
return nFaceIndMax, ptC, vtN
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrtho)
|
||||
local _, EdgesEgt = EgtSurfTmGetFacetOutlineInfo( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
|
||||
local nEdgeIndMax = 0
|
||||
local dMaxComp = - GEO.INFINITO
|
||||
for i = 1, #EdgesEgt do
|
||||
local vtN = EdgesEgt[i].Norm
|
||||
if EdgesEgt[i].Open then
|
||||
vtN = -vtN
|
||||
end
|
||||
local dComp = vtN * vtOrtho
|
||||
if dComp > dMaxComp then
|
||||
nEdgeIndMax = i -1
|
||||
dMaxComp = dComp
|
||||
end
|
||||
end
|
||||
|
||||
return nEdgeIndMax
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetTunnelDimension( Proc, nPartId)
|
||||
-- sono necessarie almeno due facce
|
||||
@@ -1058,5 +1126,280 @@ function BeamLib.CurveWithOnlyStraightLines( nPathInt)
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Funzione per determinare se la faccia ha lati molto corti (trascurabili) ed è quindi approssimabile ad una 3 facce
|
||||
function BeamLib.Is3EdgesApprox( Proc, nFacet, nAddGrpId)
|
||||
nAddGrpId = nAddGrpId or BeamLib.GetAddGroup( Proc.PartId)
|
||||
if not nAddGrpId then
|
||||
local nEdges = #(EgtSurfTmFacetAdjacencies( Proc.Id, nFacet)[1])
|
||||
return ( nEdges == 3)
|
||||
end
|
||||
local bResult = false
|
||||
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
|
||||
if not nContourId then return false end
|
||||
EgtMergeCurvesInCurveCompo( nContourId)
|
||||
-- recupero il numero effettivo di lati
|
||||
local _, nEntityCount = EgtCurveDomain( nContourId)
|
||||
local nEdges = nEntityCount
|
||||
if nEntityCount and nEntityCount == 3 then
|
||||
bResult = true
|
||||
-- rimuovo i lati molto corti dal conteggio totale
|
||||
elseif nEntityCount then
|
||||
for i = 1, nEntityCount do
|
||||
local dLength = EgtCurveCompoLength( nContourId, i - 1)
|
||||
if dLength < 15 then nEdges = nEdges - 1 end
|
||||
end
|
||||
end
|
||||
if nEdges == 3 then bResult = true end
|
||||
-- cancello tutti i contorni appena creati
|
||||
EgtErase( EgtTableFill( nContourId, nContourCnt))
|
||||
return bResult
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return BeamLib
|
||||
-- restituisce le facce della parte interessate dalla feature Proc
|
||||
function BeamLib.GetProcessAffectedFaces( Proc)
|
||||
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
|
||||
local b3Part = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
|
||||
local vtFacesAffected = { Top = false, Bottom = false, Front = false, Back = false, Left = false, Right = false}
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
if Proc.Box:getMax():getZ() > b3Part:getMax():getZ() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Top = true
|
||||
end
|
||||
if Proc.Box:getMin():getZ() < b3Part:getMin():getZ() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Bottom = true
|
||||
end
|
||||
if Proc.Box:getMin():getY() < b3Part:getMin():getY() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Front = true
|
||||
end
|
||||
if Proc.Box:getMax():getY() > b3Part:getMax():getY() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Back = true
|
||||
end
|
||||
if Proc.Box:getMin():getX() < b3Part:getMin():getX() + 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Left = true
|
||||
end
|
||||
if Proc.Box:getMax():getX() > b3Part:getMax():getX() - 500 * GEO.EPS_SMALL then
|
||||
vtFacesAffected.Right = true
|
||||
end
|
||||
end
|
||||
|
||||
return vtFacesAffected
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
|
||||
function BeamLib.IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH)
|
||||
return ( b3Proc:getDimY() > ( dRawW - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( dRawH - 500 * GEO.EPS_SMALL))
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.GetAdjacentFaces( Proc, nFacet)
|
||||
local AdjacentFaces = {}
|
||||
local vFaceAdjacencies = EgtSurfTmFacetAdjacencies( Proc.Id, nFacet)[1]
|
||||
for i = 1, #vFaceAdjacencies do
|
||||
if vFaceAdjacencies[i] > -1 then
|
||||
local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, nFacet, vFaceAdjacencies[i], GDB_ID.ROOT)
|
||||
local dLen = dist( ptP1, ptP2)
|
||||
table.insert( AdjacentFaces, { Id = vFaceAdjacencies[i], LengthOnMainFace = dLen})
|
||||
end
|
||||
end
|
||||
|
||||
return AdjacentFaces
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.GetFacetsInfo( Proc, b3Raw)
|
||||
|
||||
if Proc.Fct > 20 then
|
||||
return nil
|
||||
end
|
||||
|
||||
local Face = {}
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Proc.PartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
local vAdj
|
||||
if Proc.AdjacencyMatrix then
|
||||
vAdj = Proc.AdjacencyMatrix
|
||||
else
|
||||
vAdj = BeamLib.GetAdjacencyMatrix( Proc)
|
||||
end
|
||||
|
||||
for i = 1, Proc.Fct do
|
||||
Face[i] = {}
|
||||
Face[i].Id = i - 1
|
||||
Face[i].PtCenter, Face[i].VtN = EgtSurfTmFacetCenter( Proc.Id, i - 1, GDB_ID.ROOT)
|
||||
if Proc.Fct < 10 then
|
||||
local frHV, dFaceWidthTrimmed, dFaceHeightTrimmed = BeamLib.GetFaceHvRefDim( Proc.Id, i - 1, b3Raw)
|
||||
-- frame OCS faccia
|
||||
Face[i].FrameHV = frHV
|
||||
-- larghezza OCS faccia trimmata con grezzo
|
||||
Face[i].WidthTrimmed = dFaceWidthTrimmed
|
||||
-- altezza OCS faccia trimmata con grezzo
|
||||
Face[i].HeightTrimmed = dFaceHeightTrimmed
|
||||
local _, dFaceWidth, dFaceHeight = BeamLib.GetFaceHvRefDim( Proc.Id, i - 1)
|
||||
-- larghezza OCS faccia
|
||||
Face[i].Width = dFaceWidth
|
||||
-- altezza OCS faccia
|
||||
Face[i].Height = dFaceHeight
|
||||
-- elevazione calcolata rispetto al box della parte
|
||||
Face[i].Elevation = EgtSurfTmFacetElevationInBBox( Proc.Id, i - 1, b3Solid, true, GDB_ID.ROOT)
|
||||
-- area della faccia
|
||||
-- TODO qui sarebbe meglio l'area vera e non quella del rettangolo minimo
|
||||
local _, dLongEdgeDimension, dShortEdgeDimension = EgtSurfTmFacetMinAreaRectangle( Proc.Id, i - 1, GDB_ID.ROOT)
|
||||
Face[i].Area = dShortEdgeDimension * dLongEdgeDimension
|
||||
-- adiacenze della faccia
|
||||
-- TODO chiamarle in modo che si capisca che sono solo gli id e non l'intero oggetto faccia
|
||||
Face[i].Adjacencies = {}
|
||||
for j = 1, Proc.Fct do
|
||||
if vAdj[i][j] and vAdj[i][j] ~= 0 and ( i ~= j) then
|
||||
table.insert( Face[i].Adjacencies, j - 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return Face
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
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)
|
||||
local vAdj = {}
|
||||
-- essendo la matrice simmetrica a diagonale nulla, ne calcolo solo la metà superiore
|
||||
for i = 1, Proc.Fct do
|
||||
vAdj[i] = {}
|
||||
for j = i + 1, Proc.Fct do
|
||||
_, _, _, vAdj[i][j] = EgtSurfTmFacetsContact( Proc.Id, i - 1, j - 1, GDB_ID.ROOT)
|
||||
if not vAdj[i][j] then vAdj[i][j] = 0 end
|
||||
end
|
||||
end
|
||||
-- riempio di conseguenza il resto della matrice
|
||||
for i = 1, Proc.Fct do
|
||||
vAdj[i][i] = 0
|
||||
for j = i + 1, Proc.Fct do
|
||||
vAdj[j][i] = vAdj[i][j]
|
||||
end
|
||||
end
|
||||
return vAdj
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.GetMachiningSteps( dMachiningDepth, dStep)
|
||||
|
||||
local MachiningSteps = {}
|
||||
MachiningSteps.StepLength = 0
|
||||
MachiningSteps.Count = ceil( ( dMachiningDepth - 10 * GEO.EPS_SMALL) / dStep)
|
||||
if MachiningSteps.Count > 1 then
|
||||
MachiningSteps.StepLength = ( dMachiningDepth - dStep) / ( MachiningSteps.Count - 1)
|
||||
end
|
||||
|
||||
return MachiningSteps
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail)
|
||||
if not dOvmTail then
|
||||
dOvmTail = BD.OVM_MID
|
||||
end
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
|
||||
if Proc.Head then
|
||||
-- se coincide con il taglio di separazione precedente, non va fatto
|
||||
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
||||
return false
|
||||
end
|
||||
-- altrimenti taglio di coda
|
||||
else
|
||||
-- se coincide con taglio di separazione, non va fatto
|
||||
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
||||
return false
|
||||
end
|
||||
end
|
||||
-- se coincide con un taglio frontale non va fatto
|
||||
if Proc.CutFront then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamLib.GetToolFromMachining( sMachiningName)
|
||||
local Tool = {}
|
||||
if EgtMdbSetCurrMachining( sMachiningName) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
Tool.Name = EgtTdbGetCurrToolParam( MCH_TP.NAME)
|
||||
Tool.IsCCW = ( EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0)
|
||||
Tool.Type = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||
Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
|
||||
Tool.HeadType = {}
|
||||
Tool.PreferredSide = {}
|
||||
if BD.GetSetupInfo then
|
||||
Tool.HeadType = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).HeadType
|
||||
Tool.PreferredSide = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).PreferredSide
|
||||
end
|
||||
-- lama
|
||||
if Tool.Type == MCH_TY.SAW_STD or Tool.Type == MCH_TY.SAW_FLAT then
|
||||
Tool.Thickness = EgtTdbGetCurrToolParam(MCH_TP.THICK) or 0
|
||||
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
|
||||
Tool.SideStep = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'SIDESTEP', 'd')
|
||||
-- sega a catena
|
||||
elseif Tool.Type == MCH_TY.MORTISE_STD then
|
||||
Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) or 0
|
||||
Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or 0
|
||||
Tool.Width = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
|
||||
Tool.Thickness = EgtTdbGetCurrToolParam( MCH_TP.THICK) or 0
|
||||
Tool.CornerRadius = EgtTdbGetCurrToolParam( MCH_TP.CORNRAD) or 0
|
||||
-- fresa (TODO al momento aggiunte solo le informazioni che servono)
|
||||
elseif Tool.Type == MCH_TY.MILL_STD or MCH_TY.MILL_NOTIP then
|
||||
if BD.GetSetupInfo then
|
||||
Tool.IsOnAggregate = BD.GetSetupInfo( EgtTdbGetCurrToolParam( MCH_TP.HEAD)).bToolOnAggregate
|
||||
else
|
||||
Tool.IsOnAggregate = false
|
||||
end
|
||||
-- altri utensili al momento non previsti
|
||||
else
|
||||
error( 'Wrong tool type')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return Tool
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return BeamLib
|
||||
+9
-6
@@ -1,4 +1,4 @@
|
||||
-- DiceCut.lua by Egaltech s.r.l. 2023/02/05
|
||||
-- DiceCut.lua by Egaltech s.r.l. 2024/01/23
|
||||
-- Gestione dei piano paralleli nei tagli lunghi: equidistanziamento dei piani paralleli
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -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
|
||||
@@ -396,7 +399,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
|
||||
end
|
||||
local dElevP = DistanzaMassima( nParent, ptCPlanes, vtNPlanes, ptCBond, vtNBond, BBoxRawPart, TBoxPoint)
|
||||
local dElevO
|
||||
if ptCBond and vtNBond then
|
||||
if ptCBond and vtNBond and not AreOppositeVectorApprox( vtNBond, vtNPlanes) then
|
||||
dElevO = DistanzaMassima( nParent, ptCBond, vtNBond, ptCPlanes, vtNPlanes, BBoxRawPart, TBoxPoint)
|
||||
end
|
||||
|
||||
@@ -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 = {}
|
||||
@@ -473,7 +476,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
|
||||
if vtNInner:getZ() > -0.0175 or vtNInner:getZ() < dNzLimDwnUp or abs( vtNInner:getY()) > 0.8 then
|
||||
vtO:rotate( vtNInner, 90)
|
||||
-- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente
|
||||
if ( abs( vtO:getY()) > 3 * abs( vtO:getX()) or BBoxRawPart:getDimZ() > 620) and vtNInner:getZ() > dNzLimDwnUp then
|
||||
if ( abs( vtO:getY()) > 4 * abs( vtO:getX()) or BBoxRawPart:getDimZ() > 620) and vtNInner:getZ() > dNzLimDwnUp then
|
||||
vtO:rotate( vtNInner, 90)
|
||||
-- se faccia principale verso il basso (almeno -3deg), lo inverto per iniziare da sopra
|
||||
if vtNInner:getZ() < -0.05 then
|
||||
@@ -563,7 +566,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
|
||||
end
|
||||
end
|
||||
|
||||
return UltimateTable
|
||||
return UltimateTable, OffsetP, OffsetO
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
-- FaceByPocket.lua by Egaltech s.r.l. 2023/04/04
|
||||
-- Gestione svuotatura di feature con una faccia
|
||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FaceByPocket = {}
|
||||
@@ -78,7 +79,7 @@ function FaceByPocket.Make( Proc, nSurfId, nFacet, sPocketing, nPartId, b3Solid,
|
||||
end
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
local dElev = BL.GetFaceElevation( nSurfId, nFacet, nPartId)
|
||||
local dElev = BL.GetFaceElevation( nSurfId, nFacet, b3Solid)
|
||||
-- determino numero e valore degli step di lavorazione
|
||||
local nSurfStep = ceil( dElev / dMaxDepth)
|
||||
local dSurfStep = dElev / nSurfStep
|
||||
|
||||
+704
-382
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,247 @@
|
||||
-- FeatureTopology.lua by Egaltech s.r.l. 2023/09/12
|
||||
-- Libreria per classificazione topologica feature travi
|
||||
-- 2023/09/26 Aggiunte topologie Strip e Cut.
|
||||
-- 2023/09/27 Modificata GetFacesParallelToPart per tunnel, pocket e groove 3 lati
|
||||
-- 2023/10/16 In GetFacesParallelToPart rimossa Pocket e aggiunto Rabbet al check solo direzione principale
|
||||
-- 2023/11/03 In Classify ora si settano le AffectedFaces nella Proc, se non già presenti.
|
||||
-- Aggiunta groove 2 facce, differenziata da rabbet.
|
||||
-- 2024/03/04 Feature senza topologia, calcolato in BeamExec
|
||||
-- 2024/05/06 A topologia Cut aggiunta IsThrough = true
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local FeatureTopology = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
|
||||
-- Carico le librerie
|
||||
local BL = require( 'BeamLib')
|
||||
|
||||
EgtOutLog( ' FeatureTopology started', 1)
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce gli id delle facce di Proc che hanno il numero di adiacenze nAdj
|
||||
function FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, nAdj)
|
||||
if not vAdj then vAdj = BL.GetAdjacencyMatrix( Proc) end
|
||||
local nFct = #( vAdj or {})
|
||||
local vFacesWithGivenAdj = {}
|
||||
for i = 1, nFct do
|
||||
local nAdjCount = 0
|
||||
for j = 1, nFct do
|
||||
if vAdj[i][j] and vAdj[i][j] ~= 0 then
|
||||
nAdjCount = nAdjCount + 1
|
||||
end
|
||||
end
|
||||
if nAdjCount == nAdj then
|
||||
table.insert( vFacesWithGivenAdj, i - 1)
|
||||
end
|
||||
end
|
||||
return vFacesWithGivenAdj
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce true se Proc ha tutti gli angoli concavi (bAllConcave) e, nei casi in cui ha senso, se questi sono esattamente 90 deg (bAllRight)
|
||||
local function AreAllAnglesConcaveOrRight( vAdj)
|
||||
local bAllConcave, bAllRight = true, true
|
||||
local nFct = #( vAdj or {})
|
||||
for i = 1, nFct do
|
||||
for j = 1, nFct do
|
||||
-- se trovo un angolo convesso restituisco falso e esco subito
|
||||
if vAdj[i][j] and vAdj[i][j] > 0 then
|
||||
bAllConcave = false
|
||||
bAllRight = false
|
||||
break
|
||||
elseif vAdj[i][j] and vAdj[i][j] ~= 0 and vAdj[i][j] + 90 > 500 * GEO.EPS_ANG_SMALL then
|
||||
bAllRight = false
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se 1 faccia oppure 2 facce con angolo convesso non ha senso ritornare valori per bAllRight
|
||||
if nFct < 2 or ( nFct == 2 and vAdj[1][2] > 0) then
|
||||
return bAllConcave
|
||||
else
|
||||
return bAllConcave, bAllRight
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce true se almeno una delle dimensioni della feature è maggiore o uguale ad una delle dimensioni principali del pezzo (tolleranza 1 mm)
|
||||
local function IsAnyDimensionLongAsPart( Proc)
|
||||
local bResult = false
|
||||
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
|
||||
local b3Solid = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
|
||||
if Proc.Box:getDimX() > b3Solid:getDimX() - 1000 * GEO.EPS_SMALL or
|
||||
Proc.Box:getDimY() > b3Solid:getDimY() - 1000 * GEO.EPS_SMALL or
|
||||
Proc.Box:getDimZ() > b3Solid:getDimZ() - 1000 * GEO.EPS_SMALL then
|
||||
bResult = true
|
||||
end
|
||||
return bResult
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- retituisce un vettore con gli indici (0 based) delle facce triangolari (o quasi) di Proc
|
||||
local function GetTriangularFaces( Proc)
|
||||
local vTriangularFaces = {}
|
||||
for i = 1, Proc.Fct do
|
||||
if BL.Is3EdgesApprox( Proc, i - 1) then
|
||||
table.insert( vTriangularFaces, i - 1)
|
||||
end
|
||||
end
|
||||
return vTriangularFaces
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce un vettore contenente gli indici delle facce di Proc parallele ad una delle direzioni principali; il check varia in base alla famiglia topologica
|
||||
local function GetFacesParallelToPart( Proc, sFamily)
|
||||
local vFacesParallelToPart = {}
|
||||
for i = 0, Proc.Fct - 1 do
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i, GDB_ID.ROOT)
|
||||
if sFamily == 'Rabbet' or sFamily == 'Bevel' or sFamily == 'DoubleBevel' or sFamily == 'Strip' then
|
||||
local vTriangularFaces = GetTriangularFaces( Proc)
|
||||
local bIsTriangularFace = false
|
||||
-- verifico se la faccia è triangolare
|
||||
for j = 1, #vTriangularFaces do
|
||||
if i == vTriangularFaces[j] then
|
||||
bIsTriangularFace = true
|
||||
end
|
||||
end
|
||||
-- se faccia triangolare deve avere la normale parallela ad una direzione principale
|
||||
if bIsTriangularFace then
|
||||
if AreSameOrOppositeVectorApprox( vtN, X_AX()) or AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
table.insert( vFacesParallelToPart, i)
|
||||
end
|
||||
-- altrimenti deve avere una componente della normale nulla
|
||||
else
|
||||
if abs( vtN:getX()) < 10 * GEO.EPS_SMALL or abs( vtN:getY()) < 10 * GEO.EPS_SMALL or abs( vtN:getZ()) < 10 * GEO.EPS_SMALL then
|
||||
table.insert( vFacesParallelToPart, i)
|
||||
end
|
||||
end
|
||||
else
|
||||
-- la normale deve essere parallela ad una direzione principale
|
||||
if AreSameOrOppositeVectorApprox( vtN, X_AX()) or AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
table.insert( vFacesParallelToPart, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
return vFacesParallelToPart
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- restituisce una stringa con il nome esteso della topologia della feature
|
||||
-- *famiglia-passante-angoli tutti concavi a 90deg-facce tutte parallele alle dimensioni principali-numero di facce*
|
||||
local function GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, nNumberOfFaces)
|
||||
-- feature passante o cieca
|
||||
local sThrough = '_'
|
||||
if bIsThrough ~= nil then sThrough = EgtIf( bIsThrough, 'Through', 'Blind') end
|
||||
-- tutti gli angoli della feature sono retti oppure no
|
||||
local sAllRightAngles = '_'
|
||||
if bAllRightAngles ~= nil then sAllRightAngles = EgtIf( bAllRightAngles, 'RightAngles', 'NotRightAngles') end
|
||||
-- tutte le dimensioni della feature sono parallele agli assi principali del pezzo oppure no
|
||||
local sParallel = '_'
|
||||
if bIsParallel ~= nil then sParallel = EgtIf( bIsParallel, 'Parallel', 'NotParallel') end
|
||||
|
||||
local sLongName = sFamily .. '-' .. sThrough .. '-' .. sAllRightAngles .. '-' .. sParallel .. '-' .. nNumberOfFaces
|
||||
return sLongName
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- riconosce se Proc è una delle topologie standard e, in caso positivo, ne scrive le caratteristiche in campi specifici della Proc stessa restituendo true
|
||||
function FeatureTopology.Classify( Proc, b3Raw)
|
||||
|
||||
-- la feature deve avere geometria
|
||||
if not Proc.Box or Proc.Box:isEmpty() then
|
||||
return false
|
||||
end
|
||||
|
||||
-- se già calcolato, esco
|
||||
if Proc.Topology then
|
||||
return true
|
||||
end
|
||||
|
||||
-- calcoli
|
||||
if not Proc.AffectedFaces then
|
||||
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
|
||||
end
|
||||
if not Proc.Face then
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
end
|
||||
|
||||
local vAdj = Proc.AdjacencyMatrix or BL.GetAdjacencyMatrix( Proc)
|
||||
local bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( vAdj)
|
||||
local vTriangularFaces = GetTriangularFaces( Proc)
|
||||
local bIsAnyDimensionLongAsPart = IsAnyDimensionLongAsPart( Proc)
|
||||
local vFacesWithOneAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 1)
|
||||
local vFacesWithTwoAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 2)
|
||||
local vFacesWithThreeAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 3)
|
||||
local vFacesWithFourAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, 4)
|
||||
local dRawW = b3Raw:getDimY()
|
||||
local dRawH = b3Raw:getDimZ()
|
||||
local bIsFeatureCuttingEntireSection = BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||
|
||||
-- assegnazione tipologia
|
||||
local sFamily
|
||||
local bIsThrough
|
||||
if Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
|
||||
sFamily = 'Cut'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave and #vTriangularFaces == 1 then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right) and ( Proc.AffectedFaces.Front or Proc.AffectedFaces.Back) then
|
||||
sFamily = 'Rabbet'
|
||||
bIsThrough = true
|
||||
-- birdsmouth
|
||||
elseif Proc.Fct == 2 and bAllAnglesConcave then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 2 and not bAllAnglesConcave and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'DoubleBevel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 1 and #vTriangularFaces == 2 then
|
||||
sFamily = 'Bevel'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 1 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 3 then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithThreeAdj == 2 then
|
||||
sFamily = 'Groove'
|
||||
bIsThrough = false
|
||||
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithTwoAdj == 4 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Tunnel'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct >= 4 and #vFacesWithOneAdj == 2 and bIsAnyDimensionLongAsPart then
|
||||
sFamily = 'Strip'
|
||||
bIsThrough = true
|
||||
elseif Proc.Fct == 5 and bAllAnglesConcave and #vFacesWithFourAdj == 1 then
|
||||
sFamily = 'Pocket'
|
||||
bIsThrough = false
|
||||
end
|
||||
|
||||
-- verifico se facce parallele a quelle della trave
|
||||
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily)
|
||||
local bIsParallel = ( #vFacesParallelToPart == Proc.Fct)
|
||||
|
||||
-- assegnazioni
|
||||
if sFamily then
|
||||
Proc.Topology = sFamily
|
||||
Proc.TopologyLongName = GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, Proc.Fct)
|
||||
Proc.IsThrough = bIsThrough
|
||||
Proc.AllRightAngles = bAllRightAngles
|
||||
Proc.IsParallel = bIsParallel
|
||||
Proc.vAdj = vAdj
|
||||
return true
|
||||
else
|
||||
Proc.Topology = 'OTHER'
|
||||
Proc.TopologyLongName = Proc.Topology
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
return FeatureTopology
|
||||
+249
-144
@@ -1,4 +1,4 @@
|
||||
-- MachiningLib.lua by Egaltech s.r.l. 2022/05/07
|
||||
-- MachiningLib.lua by Egaltech s.r.l. 2023/11/06
|
||||
-- Libreria ricerca lavorazioni per Travi
|
||||
-- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste.
|
||||
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
||||
@@ -6,6 +6,14 @@
|
||||
-- 2022/11/25 Per FindMilling implementata la possibilità di escludere la testa H3 dalla ricerca utensile.
|
||||
-- 2022/12/28 Per FindMilling e FindDrilling possibilità di escludere la testa H2 dalla ricerca utensile.
|
||||
-- 2023/01/31 Per FindPocketing implementata la possibilità di escludere le teste H2 o H3 dalla ricerca utensile.
|
||||
-- 2023/07/28 Aggiunta gestione del tipo di foratura "Drill_AT".
|
||||
-- 2023/11/06 Migliorie e correzioni alle forature con AngularTransmission ("_AT").
|
||||
-- 2024/01/18 In FindSawing aggiunto il parametro opzionale dDepth.
|
||||
-- 2024/01/19 In FindSawing aggiunto parametro opzionale bConsiderCSimmEncumberance per considerare l'ingombro dell'asse C nel massimo materiale (default false).
|
||||
-- 2024/01/23 Nella GetMachinings vengono ora raccolti i parametri utensile necessari per i VerifyTool, scritti direttamente nella tabella Machining.Tool.
|
||||
-- Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest) se passato l'apposito parametro SortingCriterion in FindMachining. Al momento implementato solo per FindSawing.
|
||||
-- 2024/03/01 In VerifyPocketing implementato l'ordinamento per dimensioni utensile.
|
||||
-- 2024/03/13 Aggiunta gestione Predrill
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local MachiningLib = {}
|
||||
@@ -17,11 +25,14 @@ EgtOutLog( ' MachiningLib started', 1)
|
||||
|
||||
-- Dati
|
||||
local BD = require( 'BeamData')
|
||||
local Cuttings = require( 'CutData')
|
||||
local Millings = require( 'MillingData')
|
||||
local Pocketings = require( 'PocketingData')
|
||||
local Sawings = require( 'SawingData')
|
||||
local Drillings = require( 'DrillData')
|
||||
-- librerie lavorazioni caricate con pcall perchè potrebbero non esserci
|
||||
local Cuttings, Millings, Pocketings, Sawings, Drillings, Probing
|
||||
if pcall( require, 'CutData') then Cuttings = require( 'CutData') end
|
||||
if pcall( require, 'MillingData') then Millings = require( 'MillingData') end
|
||||
if pcall( require, 'PocketingData') then Pocketings = require( 'PocketingData') end
|
||||
if pcall( require, 'SawingData') then Sawings = require( 'SawingData') end
|
||||
if pcall( require, 'DrillData') then Drillings = require( 'DrillData') end
|
||||
if pcall( require, 'ProbingData') then Probing = require( 'ProbingData') end
|
||||
|
||||
-- tipo di teste macchina
|
||||
local ONE_HEAD = 1 -- una testa (Fast, One, Turn1T)
|
||||
@@ -66,154 +77,247 @@ local function SetCurrMachineHeadType()
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- funzione che conferma e rende attivi testa e utensile ipotizzati
|
||||
-- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa
|
||||
local function ConfirmNextMachining()
|
||||
-- se non definita testa successiva, esco
|
||||
if not nNextMachHead or nNextMachHead < 1 or nNextMachHead > 2 then return end
|
||||
-- altrimenti, la confermo come attiva
|
||||
nActiveHead = nNextMachHead
|
||||
if nNextMachHead == 1 then
|
||||
H1_TOOL = H1_NEXT_TOOL
|
||||
elseif nNextMachHead == 2 then
|
||||
H2_TOOL = H2_NEXT_TOOL
|
||||
-- utensile corrente
|
||||
local sToolUuid = EgtGetMachiningParam( MCH_MP.TUUID)
|
||||
local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '')
|
||||
EgtTdbSetCurrTool( sToolName or '')
|
||||
-- testa dell'utensile corrente
|
||||
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
local nHead = tonumber( sHead:sub( 2, #sHead)) + 0
|
||||
|
||||
if ( nHead < 10 and nHead >= 30) or vFixedHeads[nHead] then
|
||||
-- testa che non richiede ottimizzazione
|
||||
return
|
||||
elseif nHead >= 20 then
|
||||
nHead = 2
|
||||
elseif nHead >= 10 then
|
||||
nHead = 1
|
||||
end
|
||||
|
||||
-- se la testa richiede ottimizzazione, confermo testa attiva
|
||||
nActiveHead = nHead
|
||||
if nActiveHead == 1 then
|
||||
H1_TOOL = sToolName
|
||||
elseif nActiveHead == 2 then
|
||||
H2_TOOL = sToolName
|
||||
end
|
||||
-- reset prossima testa
|
||||
nNextMachHead = 0
|
||||
H1_NEXT_TOOL = ''
|
||||
H2_NEXT_TOOL = ''
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- funzione che traccia testa e utensile ipotizzati
|
||||
local function SetNextMachining( sToolName, nHead, bFixed)
|
||||
if nHead < 1 or nHead > 2 then return end
|
||||
if bFixed then
|
||||
nNextMachHead = 0
|
||||
H1_NEXT_TOOL = ''
|
||||
H2_NEXT_TOOL = ''
|
||||
end
|
||||
nNextMachHead = nHead
|
||||
if nHead == 1 then
|
||||
H1_NEXT_TOOL = sToolName
|
||||
elseif nHead == 2 then
|
||||
H2_NEXT_TOOL = sToolName
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function SetCurrMachiningAndTool( sMachName)
|
||||
if not EgtMdbSetCurrMachining( sMachName) then return false end
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
local sTool = EgtTdbGetToolFromUUID( sTuuid)
|
||||
if not sTool then return false end
|
||||
if not EgtTdbSetCurrTool( sTool) then return false end
|
||||
local bActive = EgtTdbGetCurrToolParam( MCH_TP.ACTIVE)
|
||||
local function SetCurrMachiningAndTool( Machining)
|
||||
EgtMdbSetCurrMachining( Machining.Name)
|
||||
EgtTdbSetCurrTool( Machining.Tool.Name)
|
||||
local bActive = EgtFindToolInCurrSetup( Machining.Tool.Name)
|
||||
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
local nHead = tonumber( sHead:sub( 2, #sHead))
|
||||
local bH2 = ( nHead >= 21 and nHead <= 29)
|
||||
local bH3 = ( nHead >= 31 and nHead <= 39)
|
||||
local bH3 = ( nHead >= 31 and nHead <= 39)
|
||||
local bFixed = ( vFixedHeads[nHead])
|
||||
return bActive, sTool, bH2, bFixed, bH3
|
||||
return bActive, Machining.Tool.Name, bH2, bFixed, bH3
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifyDrill( dDiam, dDepth, bH2)
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
local dMaxToolLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dDiamTh = EgtTdbGetCurrToolThDiam()
|
||||
local dLenTh = 72
|
||||
if EgtTdbGetCurrToolThLength then dLenTh = EgtTdbGetCurrToolThLength() end
|
||||
local dFreeLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) - dLenTh - EgtMdbGetGeneralParam( MCH_GP.MAXDEPTHSAFE)
|
||||
if dTDiam < dDiam + 10 * GEO.EPS_SMALL and
|
||||
dTDiam > dDiam - BD.DRILL_TOL - 10 * GEO.EPS_SMALL and
|
||||
( not dDepth or dTMaxMat > dDepth - GEO.EPS_SMALL) then
|
||||
return true, { TMaxMat = dTMaxMat, MaxToolLength = dMaxToolLength, ToolDiam = dToolDiam, DiamTh = dDiamTh, FreeLen = dFreeLen, H2 = bH2}
|
||||
function VerifyDrill( Machining, dDiam, dDepth, bH2)
|
||||
local dFreeLen = Machining.Tool.Length - Machining.Tool.ToolHolderLength - EgtMdbGetGeneralParam( MCH_GP.MAXDEPTHSAFE)
|
||||
if Machining.Tool.Diameter < dDiam + 10 * GEO.EPS_SMALL and
|
||||
Machining.Tool.Diameter > dDiam - BD.DRILL_TOL - 10 * GEO.EPS_SMALL and
|
||||
( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) then
|
||||
return true, { TMaxMat = Machining.Tool.MaxMat, MaxToolLength = Machining.Tool.TotalLength, ToolDiam = Machining.Tool.Diameter, DiamTh = Machining.Tool.ToolHolderDiameter, FreeLen = dFreeLen, H2 = bH2}
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifyDrillPocket( dDiam, dDepth, bH2)
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth()
|
||||
local dMaxToolLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
local dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dDiamTh = EgtTdbGetCurrToolThDiam()
|
||||
local dFreeLen = dTMaxDepth
|
||||
if dTDiam < dDiam - 10 * GEO.EPS_SMALL and
|
||||
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) then
|
||||
return true, { TMaxDepth = dTMaxDepth, MaxToolLength = dMaxToolLength, ToolDiam = dToolDiam, DiamTh = dDiamTh, FreeLen = dFreeLen, H2 = bH2}
|
||||
function VerifyDrillPocket( Machining, dDiam, dDepth, bH2)
|
||||
if Machining.Tool.Diameter < dDiam - 10 * GEO.EPS_SMALL and
|
||||
( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) then
|
||||
return true, { TMaxDepth = Machining.Tool.MaxMat, MaxToolLength = Machining.Tool.TotalLength, ToolDiam = Machining.Tool.Diameter, DiamTh = Machining.Tool.ToolHolderDiameter, FreeLen = Machining.Tool.MaxMat, H2 = bH2}
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifyMill( dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2)
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth()
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
if ( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
|
||||
( not sTuuidMstr or sTuuidMstr == sTuuid) and
|
||||
( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
|
||||
( not dMaxTotLen or dTTotLen < dMaxTotLen + GEO.EPS_SMALL) then
|
||||
return true, { TMaxDepth = dTMaxDepth, TDiam = dTDiam, H2 = bH2}
|
||||
function VerifyMill( Machining, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2)
|
||||
if ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) and
|
||||
( not sTuuidMstr or sTuuidMstr == Machining.Tool.UUID) and
|
||||
( not dMaxDiam or Machining.Tool.Diameter < dMaxDiam + GEO.EPS_SMALL) and
|
||||
( not dMaxTotLen or Machining.Tool.TotalLength < dMaxTotLen + GEO.EPS_SMALL) then
|
||||
return true, { TMaxDepth = Machining.Tool.MaxMat, TDiam = Machining.Tool.Diameter, H2 = bH2}
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifyPocket( dMaxDiam, dDepth, dMaxTotLen, bH2)
|
||||
local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth()
|
||||
local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
if ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and
|
||||
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and
|
||||
( not dMaxTotLen or dTTotLen < dMaxTotLen + GEO.EPS_SMALL) then
|
||||
return true, { TDiam = dTDiam, TMaxDepth = dTMaxDepth, H2 = bH2}
|
||||
function VerifyPocket( Machining, dMaxDiam, dDepth, dMaxTotLen, bH2)
|
||||
if ( not dMaxDiam or Machining.Tool.Diameter < dMaxDiam + GEO.EPS_SMALL) and
|
||||
( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) and
|
||||
( not dMaxTotLen or Machining.Tool.TotalLength < dMaxTotLen + GEO.EPS_SMALL) then
|
||||
return true, { TDiam = Machining.Tool.Diameter, TMaxDepth = Machining.Tool.MaxMat, H2 = bH2}
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifyTool( MachiningType, sType, Params, bH2)
|
||||
function VerifyChainSaw( Machining, dDepth, CSimmEncumberance, bH2)
|
||||
-- riduco il massimo materiale dell'ingombro asse C. Se non richiesto, arriverà un valore di CSimmEncumberance nullo
|
||||
Machining.Tool.MaxMat = min( Machining.Tool.MaxMat, Machining.Tool.TotalLength - CSimmEncumberance)
|
||||
if not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL then
|
||||
return true, { H2 = bH2}
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifyTool( Machining, MachiningType, Params, bH2)
|
||||
if MachiningType == MCH_MY.DRILLING then
|
||||
if EgtStartsWith( sType, 'Drill') or EgtStartsWith( sType, 'AngleDrill') then
|
||||
return VerifyDrill( Params.Diam, Params.Depth, bH2)
|
||||
elseif EgtStartsWith( sType, 'Pocket') then
|
||||
return VerifyDrillPocket( Params.Diam, Params.Depth, bH2)
|
||||
if Machining.SubType == 'Drill' or Machining.SubType == 'AngleDrill' or Machining.SubType == 'Predrill' then
|
||||
return VerifyDrill( Machining, Params.Diam, Params.Depth, bH2)
|
||||
elseif Machining.SubType == 'DrillPocket' then
|
||||
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( Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2)
|
||||
return VerifyMill( Machining, Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2)
|
||||
elseif MachiningType == MCH_MY.POCKETING then
|
||||
return VerifyPocket( Params.MaxDiam, Params.Depth, Params.MaxTotLen, bH2)
|
||||
return VerifyPocket( Machining, Params.MaxDiam, Params.Depth, Params.MaxTotLen, bH2)
|
||||
elseif MachiningType == MCH_MY.MORTISING then
|
||||
return true, { H2 = bH2}
|
||||
return VerifyChainSaw( Machining, Params.Depth, Params.CSimmEncumberance, bH2)
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetMachinings( MachiningType)
|
||||
function GetMachinings( MachiningType, sType)
|
||||
local Machinings = {}
|
||||
-- leggo le lavorazioni disponibili
|
||||
if MachiningType == MCH_MY.DRILLING then
|
||||
return Drillings
|
||||
if Drillings and type( Drillings) == "table" then
|
||||
Machinings = Drillings
|
||||
end
|
||||
elseif MachiningType == MCH_MY.SAWING then
|
||||
return Cuttings
|
||||
if Cuttings and type( Cuttings) == "table" then
|
||||
Machinings = Cuttings
|
||||
end
|
||||
elseif MachiningType == MCH_MY.MILLING then
|
||||
return Millings
|
||||
if Millings and type( Millings) == "table" then
|
||||
Machinings = Millings
|
||||
end
|
||||
elseif MachiningType == MCH_MY.POCKETING then
|
||||
return Pocketings
|
||||
if Pocketings and type( Pocketings) == "table" then
|
||||
Machinings = Pocketings
|
||||
end
|
||||
elseif MachiningType == MCH_MY.MORTISING then
|
||||
return Sawings
|
||||
if Sawings and type( Sawings) == "table" then
|
||||
Machinings = Sawings
|
||||
end
|
||||
elseif MachiningType == MCH_MY.PROBING then
|
||||
if Probing and type( Probing) == "table" then
|
||||
Machinings = Probing
|
||||
end
|
||||
end
|
||||
-- scrivo i parametri utensile nella lavorazione
|
||||
local validMachinings = {}
|
||||
for i = 1, #Machinings do
|
||||
local Machining = Machinings[i]
|
||||
if EgtMdbSetCurrMachining( Machining.Name) then
|
||||
Machining.Tool = {}
|
||||
Machining.Tool.UUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
Machining.Tool.Name = EgtTdbGetToolFromUUID( Machining.Tool.UUID)
|
||||
if Machining.Tool.Name then
|
||||
if EgtTdbSetCurrTool( Machining.Tool.Name) then
|
||||
table.insert( validMachinings, Machining)
|
||||
-- se non è tastatura, recupero dati utensile
|
||||
if MachiningType ~= MCH_MY.PROBING then
|
||||
if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then
|
||||
Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth()
|
||||
else
|
||||
Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
|
||||
end
|
||||
if MachiningType == MCH_MY.DRILLING then
|
||||
if EgtStartsWith( Machining.Type, 'Drill') then
|
||||
Machining.SubType = 'Drill'
|
||||
elseif EgtStartsWith( Machining.Type, 'AngleDrill') then
|
||||
Machining.SubType = 'AngleDrill'
|
||||
elseif EgtStartsWith( Machining.Type, 'Pocket') then
|
||||
Machining.SubType = 'DrillPocket'
|
||||
elseif EgtStartsWith( Machining.Type, 'Predrill') then
|
||||
Machining.SubType = 'Predrill'
|
||||
end
|
||||
end
|
||||
Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
Machining.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||
Machining.Tool.TotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
Machining.Tool.ToolHolderDiameter = EgtTdbGetCurrToolThDiam()
|
||||
Machining.Tool.ToolHolderLength = EgtTdbGetCurrToolThLength() or 72
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- ritorno la lista delle sole lavorazioni valide
|
||||
return validMachinings
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
---restituisce la lista delle lavorazioni ordinata secondo il criterio *sCriterion*
|
||||
---@param Machinings table lista della lavorazioni da riordinare
|
||||
---@param sCriterion string criterio di ordinamento ('Longest', 'Shortest', 'Biggest', 'Smallest')
|
||||
function ReorderMachinings( Machinings, sCriterion)
|
||||
|
||||
-- funzioni di ordinamento
|
||||
local function SortMachiningsByLongestTool( Machining1, Machining2)
|
||||
if Machining1.Tool.MaxMat > Machining2.Tool.MaxMat + 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
local function SortMachiningsByShortestTool( Machining1, Machining2)
|
||||
if Machining1.Tool.MaxMat < Machining2.Tool.MaxMat - 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
local function SortMachiningsByBiggestTool( Machining1, Machining2)
|
||||
if Machining1.Tool.Diameter > Machining2.Tool.Diameter + 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
local function SortMachiningsBySmallestTool( Machining1, Machining2)
|
||||
if Machining1.Tool.Diameter < Machining2.Tool.Diameter - 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- ordinamento in base al criterio
|
||||
-- ordine di default, ossia quello che arriva dal database
|
||||
if not sCriterion then
|
||||
return
|
||||
-- prima gli utensili più lunghi
|
||||
elseif sCriterion == 'Longest' then
|
||||
table.sort( Machinings, SortMachiningsByLongestTool)
|
||||
-- prima gli utensili più corti
|
||||
elseif sCriterion == 'Shortest' then
|
||||
table.sort( Machinings, SortMachiningsByShortestTool)
|
||||
-- prima gli utensili con diametro più grande
|
||||
elseif sCriterion == 'Biggest' then
|
||||
table.sort( Machinings, SortMachiningsByBiggestTool)
|
||||
-- prima gli utensili con diametro più piccolo
|
||||
elseif sCriterion == 'Smallest' then
|
||||
table.sort( Machinings, SortMachiningsBySmallestTool)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
|
||||
if MachiningType == MCH_MY.DRILLING then
|
||||
local _, sOrigType = EgtEndsWith( sType, '_H2')
|
||||
return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'AngleDrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen
|
||||
return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'Drill_AT' or sOrigType == 'AngleDrill' or sOrigType == 'Predrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen
|
||||
elseif MachiningType == MCH_MY.SAWING then
|
||||
return MachiningName, ToolParams.H2
|
||||
elseif MachiningType == MCH_MY.MILLING then
|
||||
@@ -226,7 +330,8 @@ function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
|
||||
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||
local bOptimizeHeads = ( not sSortingCriterion or sSortingCriterion == '')
|
||||
if bTopHead == nil and bDownHead == nil then
|
||||
bTopHead = true
|
||||
bDownHead = false
|
||||
@@ -253,28 +358,29 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
local sH2Mach = ''
|
||||
local sH2Tool = ''
|
||||
local sH2Param
|
||||
-- ricerca sulle forature, dal diametro maggiore al minore
|
||||
local Machinings = GetMachinings( MachiningType)
|
||||
local Machinings = GetMachinings( MachiningType, sType)
|
||||
ReorderMachinings( Machinings, sSortingCriterion)
|
||||
local ForStart = 1
|
||||
local ForEnd = #Machinings
|
||||
local ForStep = 1
|
||||
if MachiningType == MCH_MY.DRILLING then
|
||||
-- le forature vanno scorse dal diametro maggiore al minore, a meno che non sia stato passato un ordinamento specifico
|
||||
if MachiningType == MCH_MY.DRILLING and ( not sSortingCriterion or sSortingCriterion == '') then
|
||||
ForStart = #Machinings
|
||||
ForEnd = 1
|
||||
ForStep = -1
|
||||
end
|
||||
if ( BEAM and BEAM.BW) or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
|
||||
if bOptimizeHeads or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
|
||||
_, sType = EgtEndsWith( sType, '_H2')
|
||||
elseif ( not BEAM or not BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and bDownHead then
|
||||
elseif not bOptimizeHeads and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then
|
||||
if not EgtEndsWith( sType, '_H2') then
|
||||
sType = sType .. '_H2'
|
||||
end
|
||||
end
|
||||
local MachineHeadUse = MachineHeadType
|
||||
if not BEAM or not BEAM.BW then
|
||||
if not bOptimizeHeads and MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
MachineHeadUse = ONE_HEAD
|
||||
end
|
||||
if BEAM and BEAM.BW and MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
|
||||
if MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
|
||||
-- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
|
||||
MachineHeadUse = TWO_EQUAL_HEADS
|
||||
end
|
||||
@@ -283,27 +389,24 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
for i = ForStart, ForEnd, ForStep do
|
||||
local Machining = Machinings[i]
|
||||
local sMachiningType = Machining.Type
|
||||
if BEAM and BEAM.BW then
|
||||
if bOptimizeHeads or MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
|
||||
end
|
||||
-- recupero dati utensile
|
||||
local bToolActive, sToolName, bH2, bFixed, bH3 = SetCurrMachiningAndTool( Machining.Name)
|
||||
local bToolActive, sToolName, bH2, bFixed, bH3 = SetCurrMachiningAndTool( Machining)
|
||||
if Machining.On and sMachiningType == sType and bToolActive and ( not bH2 or bH2 == not bExcludeH2) and ( not bH3 or bH3 == not bExcludeH3) then
|
||||
local bOk, ToolParams = VerifyTool( MachiningType, sType, Params, bH2)
|
||||
local bOk, ToolParams = VerifyTool( Machining, MachiningType, Params, bH2)
|
||||
if bOk then
|
||||
if MachineHeadUse == ONE_HEAD then
|
||||
SetNextMachining( sToolName, 1, bFixed)
|
||||
return ReturnParams(MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
elseif MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
-- se nessuna testa attiva, prendo la prima lavorazione disponibile
|
||||
if nActiveHead == 0 then
|
||||
SetNextMachining( sToolName, EgtIf( bH2, 2, 1), bFixed)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
-- verifico se posso usare lo stesso utensile della testa attiva
|
||||
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
|
||||
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo
|
||||
if ( not sH1Param or not sH1Param.TDiam or sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam) and ( not sH2Param or not sH2Param.TDiam or sH2Param.TDiam < 1.25 * ToolParams.TDiam) then
|
||||
SetNextMachining( sToolName, nActiveHead, bFixed)
|
||||
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo, a meno che non siano entrambi grandi (truciolatori)
|
||||
if ( not sH1Param or not sH1Param.TDiam or ( sH1Param.TDiam < 75 and ToolParams.TDiam < 75 and sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam)) and ( not sH2Param or not sH2Param.TDiam or ( sH2Param.TDiam < 75 and ToolParams.TDiam < 75 and sH2Param.TDiam < 1.25 * ToolParams.TDiam)) then
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
end
|
||||
end
|
||||
@@ -323,10 +426,8 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
end
|
||||
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
|
||||
if bTopHead and not bH2 then
|
||||
SetNextMachining( sToolName, 1, bFixed)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
elseif bDownHead and bH2 then
|
||||
SetNextMachining( sToolName, 2, bFixed)
|
||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||
end
|
||||
end
|
||||
@@ -334,55 +435,58 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
||||
end
|
||||
end
|
||||
if MachineHeadUse == TWO_EQUAL_HEADS then
|
||||
-- se uno dei due utensili è molto più grande dell'altro scelgo quello senza fare altre analisi
|
||||
-- se entrambi gli utensili sono piccoli (no truciolatori) e uno dei due è molto più grande dell'altro scelgo quello senza fare altre analisi
|
||||
if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then
|
||||
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
|
||||
SetNextMachining( sH1Tool, 1, bFixed)
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
|
||||
SetNextMachining( sH2Tool, 2, bFixed)
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
if sH1Param.TDiam < 75 or sH2Param.TDiam < 75 then
|
||||
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- verifico se cambiare testa o cambiare utensile su quella corrente
|
||||
if nActiveHead == 1 then
|
||||
if sH2Mach ~= "" then
|
||||
SetNextMachining( sH2Tool, 2, bFixed)
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
|
||||
elseif sH1Mach ~= "" then
|
||||
SetNextMachining( sH1Tool, 1, bFixed)
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
|
||||
end
|
||||
elseif nActiveHead == 2 then
|
||||
if sH1Mach ~= "" then
|
||||
SetNextMachining( sH1Tool, 1, bFixed)
|
||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
|
||||
elseif sH2Mach ~= "" then
|
||||
SetNextMachining( sH2Tool, 2, bFixed)
|
||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
|
||||
end
|
||||
end
|
||||
end
|
||||
local bH2, sOrigType = EgtEndsWith( sType, '_H2')
|
||||
if ( not BEAM or not BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and bH2 and bTopHead then
|
||||
if not bOptimizeHeads and MachineHeadType == TWO_UP_DOWN_HEADS and bH2 and bTopHead then
|
||||
return FindMachining( MachiningType, sOrigType, Params, true, false)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function MachiningLib.FindCutting( sType, bTopHead, bDownHead)
|
||||
return FindMachining( MCH_MY.SAWING, sType, nil, bTopHead, bDownHead)
|
||||
function MachiningLib.FindCutting( sType, bTopHead, bDownHead, dDepth, sSortingCriterion)
|
||||
return FindMachining( MCH_MY.SAWING, sType, { Depth = dDepth}, bTopHead, bDownHead, nil, nil, sSortingCriterion)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2)
|
||||
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Drill', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2)
|
||||
if not MachiningName or MachiningName == '' then
|
||||
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'Pocket', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead)
|
||||
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission, bIsPredrill, bExcludeH3, sSortingCriterion)
|
||||
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5, sTypeMach
|
||||
-- se il foro è un predrill, cerco solo punte abilitate al Predrill
|
||||
if bIsPredrill then
|
||||
sTypeMach = 'Predrill'
|
||||
else
|
||||
sTypeMach = EgtIf( bAngleTransmission, 'Drill_AT', 'Drill')
|
||||
end
|
||||
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, sTypeMach, { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||
if ( not MachiningName or MachiningName == '') then
|
||||
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Pocket_AT', 'Pocket'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||
end
|
||||
if MachiningName and MachiningName ~= '' then
|
||||
return MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5
|
||||
@@ -398,18 +502,19 @@ function MachiningLib.FindAngleDrilling( dDiam, dDepth, bTopHead, bDownHead)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
|
||||
return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
|
||||
function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||
return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
|
||||
return FindMachining( MCH_MY.POCKETING, sType, { MaxDiam = dMaxDiam, Depth = dDepth, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3)
|
||||
function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||
return FindMachining( MCH_MY.POCKETING, sType, { MaxDiam = dMaxDiam, Depth = dDepth, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function MachiningLib.FindSawing( sType)
|
||||
return FindMachining( MCH_MY.MORTISING, sType)
|
||||
function MachiningLib.FindSawing( sType, dDepth, bConsiderCSimmEncumberance, sSortingCriterion)
|
||||
if not BD.C_SIMM_ENC then BD.C_SIMM_ENC = EgtIf( BD.C_SIMM, 180, 90) end
|
||||
return FindMachining( MCH_MY.MORTISING, sType, { Depth = dDepth, CSimmEncumberance = EgtIf( bConsiderCSimmEncumberance, BD.C_SIMM_ENC, 0)}, nil, nil, nil, nil, sSortingCriterion)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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
|
||||
|
||||
+198
-79
@@ -1,4 +1,4 @@
|
||||
-- ProcessCut.lua by Egaltech s.r.l. 2023/04/05
|
||||
-- ProcessCut.lua by Egaltech s.r.l. 2023/08/01
|
||||
-- Gestione calcolo singoli tagli di lama per Travi
|
||||
-- 2021/05/18 I due tagli con testa da sotto di un cubetto sono fatti di seguito.
|
||||
-- 2021/06/06 Correzioni per tagli con testa da sotto.
|
||||
@@ -18,6 +18,14 @@
|
||||
-- 2022/08/30 Modificata la condizione che determina l'utilizzo della testa da sotto. Ora controlla se la trave è più grande del doppio della massima larghezza del cubetto.
|
||||
-- 2022/09/23 Corretta la condizione per cui è richiesto l'aggiornamento del grezzo.
|
||||
-- 2023/01/26 Migliorata la direzione di lavoro della lama in alcuni casi in cui il truciolo veniva scaricato dal lato errato.
|
||||
-- 2023/06/19 Aggiunti tagli speciali per evitare il rischio che il cubetto rimanga appoggiato al motore.
|
||||
-- 2023/08/01 Correzione su offset per taglio doppio di lato.
|
||||
-- 2023/08/01 In caso di pezzi alti su macchina tipo PF i tagli doppi di lato non vengono usati, si usa il metodo standard.
|
||||
-- 2023/09/12 In MakeFromTop abbassato a 590 mm il limite per convertire in LongCut.
|
||||
-- 2023/10/27 In MakeFromTop corretto massimo materiale in caso di lavorazione da sotto.
|
||||
-- 2023/12/07 Correzione in Classify in scelta ribaltamento trave quando si è in condizioni downUp.
|
||||
-- 2024/01/18 Gestita superficie limitante opzionale da passare a diceCut.
|
||||
-- 2024/05/10 In MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessCut = {}
|
||||
@@ -38,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
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -62,10 +77,22 @@ function ProcessCut.Classify( Proc, b3Raw)
|
||||
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw)
|
||||
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
|
||||
if bDownCut then
|
||||
-- recupero i dati della lama
|
||||
local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide')
|
||||
local sCutting = ML.FindCutting( sCutType, true, false)
|
||||
local dMaxDepth = 0
|
||||
local dMaxMat = 0
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
end
|
||||
end
|
||||
-- calcolo l'ingombro orizzontale della faccia
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli)
|
||||
if DimH > 2 * BD.MAX_DIM_DICE then
|
||||
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale)
|
||||
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and ( abs( vtN:getY()) > 0.1) and dMaxMat < DimH + BD.CUT_EXTRA) then
|
||||
return true, true
|
||||
end
|
||||
end
|
||||
@@ -172,7 +199,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -195,7 +222,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true, nil
|
||||
@@ -206,7 +233,8 @@ end
|
||||
local function UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
|
||||
-- eventuale segnalazione ingombro di testa o coda (se non chiamata da altre feature)
|
||||
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
|
||||
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then
|
||||
local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
|
||||
if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinZ then
|
||||
if Proc.Head then
|
||||
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
|
||||
if vtN:getZ() > 0.5 then
|
||||
@@ -233,7 +261,8 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione con testa da sopra
|
||||
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes)
|
||||
local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, sLeadInOutType)
|
||||
local sWarn
|
||||
-- ingombro del grezzo
|
||||
b3Raw = b3Raw or EgtGetRawPartBBox( nRawId)
|
||||
-- ingombro del pezzo
|
||||
@@ -244,16 +273,17 @@ 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 = 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
|
||||
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000))
|
||||
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > dMinFeatureLengthForLongCut))
|
||||
-- verifico se da considerare taglio lungo dal lato, solo per macchine tipo PF1250, inclinato non più di 30deg
|
||||
local bLongCutFromSide = ( not bDownCut and ( BD.C_SIMM and BD.DOWN_HEAD and ( abs(vtN:getY()) > 0.865) and
|
||||
Proc.Box:getDimZ() > b3Solid:getDimZ() - 10 * GEO.EPS_SMALL) and
|
||||
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000))
|
||||
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > dMinFeatureLengthForLongCut))
|
||||
-- se taglio lungo e Q04 = 1 allora lancio il processo dell'L10
|
||||
local bNoDicing = EgtGetInfo( Proc.Id, 'Q04', 'i') == 1
|
||||
if bNoDicing then
|
||||
@@ -342,17 +372,29 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- verifico se necessari tagli supplementari
|
||||
-- verifico se necessari tagli supplementari o se presente superficie limitante
|
||||
EgtOutLog( string.format( 'MaxDepth=%.1f MaxVertDepth=%.1f CutH=%.1f CutV=%.1f', dMaxDepth, dMaxVertDepth, dCutH, dCutV), 3)
|
||||
-- se lungo, una faccia e rivolto sul retro verso l'alto si forzano i cubetti per evitare di rovinare il pezzo successivo
|
||||
local bForceDicing = ( Proc.Fct == 1 and Proc.AffectedFaces.Left and bLongCut and vtN:getZ() > 10 * GEO.EPS_SMALL and vtN:getY() < 10 * GEO.EPS_SMALL)
|
||||
local vCuts = {}
|
||||
if not Proc.AdvTail and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
|
||||
local dDicingOffsetP
|
||||
local dDicingOffsetO
|
||||
if ( ( not Proc.AdvTail) or bForceDicing) and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
|
||||
local ptExtra, vtExtra
|
||||
local bAutoCalcSurf = true
|
||||
if Proc.AdvTail then
|
||||
-- do avviso che la lama può sbordare nel pezzo successivo
|
||||
sWarn = 'Warning : Cut machining can damage next piece'
|
||||
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
|
||||
end
|
||||
if bFillAreaPiece or bFillTail then
|
||||
local ptMiddle = ( b3Solid:getMin() + b3Solid:getMax()) / 2
|
||||
ptExtra = Point3d( b3Solid:getMin():getX() + 5*GEO.EPS_SMALL, ptMiddle:getY(), ptMiddle:getZ())
|
||||
vtExtra = X_AX()
|
||||
bAutoCalcSurf = false
|
||||
-- superficie limitante
|
||||
elseif nLimitingSurf then
|
||||
ptExtra, vtExtra = EgtSurfTmFacetCenter( nLimitingSurf, 0, GDB_ID.ROOT)
|
||||
end
|
||||
-- verifico elevazione max del materiale tagliato
|
||||
local dMaxElev
|
||||
@@ -369,9 +411,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
dMaxElev = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
||||
end
|
||||
end
|
||||
-- per macchina TURN aggiusto massima dimensione cubetto
|
||||
-- per macchina TURN (ma non OikosX) aggiusto massima dimensione cubetto
|
||||
local dNewDiceDim
|
||||
if BD.TURN then
|
||||
if BD.TURN and BD.TURN ~= 2 then
|
||||
local dDimRef = GEO.INFINITO
|
||||
if abs( vtN:getZ()) < 0.003 then
|
||||
dDimRef = b3Raw:getDimZ()
|
||||
@@ -383,11 +425,11 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
end
|
||||
end
|
||||
-- se il taglio è più spesso della lama abilito il dicing, altrimenti no
|
||||
if dMaxElev > dSawThick then
|
||||
vCuts = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, dNewDiceDim)
|
||||
if ( dMaxElev > dSawThick) or bForceDicing then
|
||||
vCuts, dDicingOffsetP = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, dNewDiceDim)
|
||||
-- se taglio sborda in coda e non è stato inserito nessun taglio a cubetti, lo rilancio con le dimensioni customizzate
|
||||
if ( bFillTail or bCustDiceCut) and #vCuts == 0 then
|
||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
|
||||
vCuts, dDicingOffsetP = DC.GetDice( nAddGrpId, b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -395,6 +437,19 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
if bCustDiceCut and #vCuts == 0 then
|
||||
return false, -1
|
||||
end
|
||||
|
||||
-- per caso speciale in cui c'è il rischio che il cubetto rimanga appoggiato sul motore, faccio solo i tagli perpendicolari seguiti da due tagli verticali laterali
|
||||
local bDangerousReliefCut = false
|
||||
-- verifico che i tagli perpendicolari siano perpendicolari al lato più vicino a Z
|
||||
local nFirstPerpendicularCut = ( #vCuts > 0 and ( vCuts[1][1] or vCuts[3][1]))
|
||||
if nFirstPerpendicularCut then
|
||||
local frFace = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
local vtTemp = EgtSurfTmFacetNormVersor( nFirstPerpendicularCut, 0, GDB_ID.ROOT) ^ frFace:getVersX()
|
||||
if not ( vtTemp:isSmall()) and not ( bDownCut or bFromBottom) and not bLongCut and ( not BD.C_SIMM or b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL) then
|
||||
bDangerousReliefCut = true
|
||||
end
|
||||
end
|
||||
|
||||
--DC.PrintOrderCut( vCuts)
|
||||
if #vCuts > 0 then
|
||||
-- sistemo posizione nel DB e nome
|
||||
@@ -442,7 +497,15 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
if vtO then
|
||||
vtOrthoO = Vector3d( vtO) * EgtIf( bOrthInv, -1, 1)
|
||||
else
|
||||
if bHorizCut then
|
||||
-- ricalcolo tipo taglio perché "bHorizCut" è calcolato sulla feature, mentre il cubetto potrebbe essere lavorato in un altro modo
|
||||
local _, dLen, dWidth = BL.GetFaceHvRefDim( vCuts[i][1], 0, b3Raw)
|
||||
local bCutDirection = bHorizCut
|
||||
-- se bisogna tagliare di fianco ma la lunghezza faccia è più del massimo materiale, forzo lavorazione da sopra
|
||||
if not bHorizCut and dLen > dMaxDepth then
|
||||
bCutDirection = true
|
||||
end
|
||||
|
||||
if bCutDirection then
|
||||
vtOrthoO = Z_AX()
|
||||
else
|
||||
if vtN:getZ() < dNzLimDwnUp then
|
||||
@@ -453,44 +516,101 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
end
|
||||
end
|
||||
end
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
-- se taglio dal basso
|
||||
if bDownCut then
|
||||
-- se strato pari composto da 1 o 2 elementi
|
||||
if ( i % 2) == 0 and #vCuts[i] <= 2 then
|
||||
-- il primo elemento prende la direzione prevista, il secondo quella opposta
|
||||
local vtNewOrthoO = Vector3d( vtOrthoO)
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if j ~= 1 then
|
||||
vtNewOrthoO = -vtOrthoO
|
||||
if not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then dVzLimDwnUp = -0.708 end
|
||||
local dDiceFaceMaxH = 0
|
||||
local dDiceFaceMinH = GEO.INFINITO
|
||||
if ( i % 2) == 0 and bDangerousReliefCut then
|
||||
for j = 1, #vCuts[i] do
|
||||
local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][j], 0)
|
||||
dDiceFaceMaxH = max( dDiceFaceMaxH, dDiceFaceH)
|
||||
-- calcolo lato orizzontale minore ipotizzando sia un trapezio
|
||||
local dDiceFaceH2 = ( 2 * EgtSurfArea( vCuts[i][j]) ) / dDiceFaceV - dDiceFaceH
|
||||
dDiceFaceMinH = min( dDiceFaceMinH, dDiceFaceH2)
|
||||
end
|
||||
end
|
||||
-- caso speciale con rischio cubetto sul motore
|
||||
if ( i % 2) == 0 and bDangerousReliefCut and ( dMaxDepth > dDiceFaceMaxH - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN) then
|
||||
local bDoubleCut = false
|
||||
local dCutExtra = BD.CUT_EXTRA
|
||||
if dMaxDepth < dDiceFaceMaxH + BD.CUT_EXTRA then
|
||||
bDoubleCut = true
|
||||
dCutExtra = - 0.5 * dDiceFaceMinH + BD.CUT_EXTRA_MIN
|
||||
end
|
||||
local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
|
||||
local nFaceUseCut1, nFaceUseCut2 = MCH_MILL_FU.ORTHO_BACK, MCH_MILL_FU.ORTHO_FRONT
|
||||
if Proc.Tail then
|
||||
nFaceUseCut1, nFaceUseCut2 = nFaceUseCut2, nFaceUseCut1
|
||||
end
|
||||
if bDoubleCut then
|
||||
local bOk, sErr = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut1, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw, true)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
local bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw)
|
||||
if not bOk2 then return false, sErr2 end
|
||||
-- caso standard
|
||||
else
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
-- se taglio dal basso
|
||||
if bDownCut then
|
||||
-- se strato pari composto da 1 o 2 elementi
|
||||
if ( i % 2) == 0 and #vCuts[i] <= 2 then
|
||||
-- il primo elemento prende la direzione prevista, il secondo quella opposta
|
||||
local vtNewOrthoO = Vector3d( vtOrthoO)
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if j ~= 1 then
|
||||
vtNewOrthoO = -vtOrthoO
|
||||
if BD.GetNzLimDownUp then
|
||||
dVzLimDwnUp = BD.GetNzLimDownUp( b3Raw, vtN, V_NULL(), true)
|
||||
elseif not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then
|
||||
dVzLimDwnUp = -0.708
|
||||
end
|
||||
end
|
||||
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw, nil, nil, bSpecialTangentLeadInOut)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
-- tutti gli altri casi vengono saltati
|
||||
-- caso generale
|
||||
else
|
||||
-- in generale sta sollevato di pochissimo
|
||||
local dExtraCut = -0.1
|
||||
-- se tagli paralleli
|
||||
if ( i % 2) == 0 then
|
||||
-- se non ci sono tagli ortogonali devo affondare
|
||||
if bNoPerpCuts then
|
||||
dExtraCut = BD.CUT_EXTRA
|
||||
-- se altrimenti tagli ortogonali invertiti, devo approfondire dello spessore lama
|
||||
elseif bOrthInv then
|
||||
dExtraCut = dSawThick
|
||||
-- se ultimo taglio, devo affondare
|
||||
elseif j == #vCuts[i] then
|
||||
dExtraCut = BD.CUT_EXTRA
|
||||
end
|
||||
end
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if BD.GetNzLimDownUp then
|
||||
dVzLimDwnUp = BD.GetNzLimDownUp( b3Raw, vtN, V_NULL(), true)
|
||||
elseif not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then
|
||||
dVzLimDwnUp = -0.708
|
||||
end
|
||||
local bSpecialTangentLeadInOut = ( i % 2 == 0) and ( Proc.AffectedFaces.Left or Proc.AffectedFaces.Right)
|
||||
local vtOrthoOAlternative
|
||||
if ( i % 2 == 0) and ( Proc.Fct == 1) and bNoPerpCuts then
|
||||
vtOrthoOAlternative = - vtOrthoO
|
||||
end
|
||||
local sLeadInOutTypeFbs = 'Calculated'
|
||||
if ( ( i % 2) ~= 0) then
|
||||
if ( sLeadInOutType == 'Tangent') then
|
||||
sLeadInOutTypeFbs = 'Tangent'
|
||||
elseif ( sLeadInOutType == 'Perpendicular') then
|
||||
sLeadInOutTypeFbs = 'Perpendicular'
|
||||
elseif ( sLeadInOutType == 'PerpendicularOutraw') then
|
||||
sLeadInOutTypeFbs = 'PerpendicularOutraw'
|
||||
end
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw, nil, nil, bSpecialTangentLeadInOut, sLeadInOutTypeFbs, vtOrthoOAlternative, dDicingOffsetP)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
-- tutti gli altri casi vengono saltati
|
||||
-- caso generale
|
||||
else
|
||||
-- in generale sta sollevato di pochissimo
|
||||
local dExtraCut = -0.1
|
||||
-- se tagli paralleli
|
||||
if ( i % 2) == 0 then
|
||||
-- se non ci sono tagli ortogonali devo affondare
|
||||
if bNoPerpCuts then
|
||||
dExtraCut = BD.CUT_EXTRA
|
||||
-- se altrimenti tagli ortogonali invertiti, devo approfondire dello spessore lama
|
||||
elseif bOrthInv then
|
||||
dExtraCut = dSawThick
|
||||
-- se ultimo taglio, devo affondare
|
||||
elseif j == #vCuts[i] then
|
||||
dExtraCut = BD.CUT_EXTRA
|
||||
end
|
||||
end
|
||||
local dVzLimDwnUp = dNzLimDwnUp
|
||||
if not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -505,9 +625,10 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
end
|
||||
-- lavoro la faccia
|
||||
local vtOrthoO
|
||||
if bFromBottom and dCutV < dMaxVertDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
|
||||
if bFromBottom and dCutV < dMaxDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
|
||||
vtOrthoO = -Z_AX()
|
||||
elseif bHorizCut and ( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or ( vtN:getX() > 0 and vtN:getZ() <= 0.708) or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then
|
||||
elseif ( bHorizCut or ( dCutV < dMaxDepth - BD.CUT_EXTRA and not bVertCutOk)) and
|
||||
( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or ( vtN:getX() > 0 and vtN:getZ() <= 0.708) or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then
|
||||
vtOrthoO = Z_AX()
|
||||
elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and
|
||||
vtN:getZ() > -0.174 and abs( vtN:getY()) > abs( vtN:getZ()) and dCutH < dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
@@ -540,7 +661,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
return true
|
||||
return true, sWarn
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -670,14 +791,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
|
||||
@@ -726,7 +849,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng)
|
||||
function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, dOvmTail, bUpdateIng, nLimitingSurf, sLeadInOutType)
|
||||
-- sovramateriale di coda
|
||||
dOvmTail = dOvmTail or BD.OVM_MID
|
||||
-- ingombro del grezzo
|
||||
@@ -742,20 +865,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
-- se taglio di testa
|
||||
if not bForced then
|
||||
if Proc.Head then
|
||||
-- se coincide con il taglio di separazione precedente, non va fatto
|
||||
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
-- altrimenti taglio di coda
|
||||
else
|
||||
-- se coincide con taglio di separazione, non va fatto
|
||||
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
end
|
||||
-- se coincide con un taglio frontale non va fatto
|
||||
if Proc.CutFront then
|
||||
if not BL.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -776,22 +886,31 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
||||
return false, sErr
|
||||
end
|
||||
local bNoDicing = false
|
||||
local sWarn
|
||||
-- se taglio con testa da sopra
|
||||
if not bDownHead and not bDownTurn then
|
||||
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes)
|
||||
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes, nLimitingSurf, sLeadInOutType)
|
||||
bNoDicing = bNoDicing2
|
||||
if not bOk then return false, sErr end
|
||||
if not bOk then
|
||||
return false, sErr
|
||||
else
|
||||
sWarn = sErr
|
||||
end
|
||||
-- altrimenti taglio con testa da sotto
|
||||
else
|
||||
local bOk, sErr = MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut)
|
||||
if not bOk then return false, sErr end
|
||||
local bOk, sErr = MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOk then
|
||||
return false, sErr
|
||||
else
|
||||
sWarn = sErr
|
||||
end
|
||||
end
|
||||
-- Aggiornamento ingombro (se vero taglio o richiesto)
|
||||
-- Se lascio il cordolo (bNoDicing) non aggiorno il grezzo perchè lo scarto rimane attaccato
|
||||
if ( ProcessCut.Identify( Proc) or bUpdateIng) and not bNoDicing then
|
||||
UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
|
||||
end
|
||||
return true
|
||||
return true, sWarn
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
-- Gestione calcolo doppi tagli di lama per Travi
|
||||
-- 2022/08/29 Implementata la fresatura dal lato per tagli problematici per PF1250.
|
||||
-- 2023/03/22 Eliminata SetOpenSide locale, si usa quella di libreria.
|
||||
-- 2023/12/07 Correzione in Classify in scelta ribaltamento trave quando si è in condizioni downUp
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDoubleCut = {}
|
||||
@@ -54,10 +55,22 @@ function ProcessDoubleCut.Classify( Proc, b3Raw)
|
||||
local dNzLimDwnUp = BL.GetNzLimDownUp( b3Raw, vtN)
|
||||
local bDownCut = ( vtN:getZ() <= dNzLimDwnUp)
|
||||
if bDownCut then
|
||||
-- recupero i dati della lama
|
||||
local sCutType = EgtIf( Proc.Head, 'HeadSide', 'TailSide')
|
||||
local sCutting = ML.FindCutting( sCutType, true, false)
|
||||
local dMaxDepth = 0
|
||||
local dMaxMat = 0
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
end
|
||||
end
|
||||
-- calcolo l'ingombro orizzontale della faccia
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, nFac)
|
||||
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli)
|
||||
if DimH > 2 * BD.MAX_DIM_DICE then
|
||||
local _, DimH = BL.GetFaceHvRefDim( Proc.Id, nFac)
|
||||
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale)
|
||||
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and abs( vtN:getY()) > 0.1 and dMaxMat < DimH + BD.CUT_EXTRA) then
|
||||
return true, true
|
||||
end
|
||||
end
|
||||
@@ -161,7 +174,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -184,7 +197,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
@@ -508,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
|
||||
@@ -520,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
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- ProcessDovetail.lua by Egaltech s.r.l. 2021/02/04
|
||||
-- Gestione calcolo giunzione coda di rondine
|
||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
||||
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDovetail = {}
|
||||
@@ -280,7 +281,7 @@ function ProcessDovetail.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
||||
end
|
||||
-- deve avere la normale principale diretta verso la testa
|
||||
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||
@@ -341,7 +342,7 @@ function ProcessDovetail.IsTailFeature( Proc, b3Raw)
|
||||
end
|
||||
end
|
||||
-- deve avere la normale principale diretta verso la coda
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
if vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||
@@ -933,10 +934,10 @@ local function MachSideFaces( Proc, nPartId, b3Raw, nFacetCnt, bForceUseRough,
|
||||
end
|
||||
else
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, sin(dSideAngle))
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, sin(dSideAngle))
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
-- provo eliminando i sottosquadra
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, -2)
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, -2)
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MachSideFaces could not find reference face'
|
||||
EgtOutLog( sErr)
|
||||
@@ -1189,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
|
||||
@@ -1432,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
|
||||
@@ -1683,7 +1685,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3Sol
|
||||
end
|
||||
-- determino il massimo affondamento con l'utensile
|
||||
local sMchFind = 'Long2Cut'
|
||||
sMilling = ML.FindMilling( sMchFind)
|
||||
local sMilling = ML.FindMilling( sMchFind)
|
||||
if not sMilling then
|
||||
local sErr = 'Milling not found in library : Error on Dovetail ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
|
||||
+175
-25
@@ -1,4 +1,4 @@
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2023/05/11
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2023/11/06
|
||||
-- Gestione calcolo forature per Travi
|
||||
-- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile.
|
||||
-- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto.
|
||||
@@ -17,6 +17,13 @@
|
||||
-- 2022/11/23 Aggiunta la gestione dei fori con angolo < 30 gradi, per i quali si usa la testa della macchina per accorciare l'utile di lavoro.
|
||||
-- 2022/12/28 Implementata gestione forature in doppio
|
||||
-- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax.
|
||||
-- 2023/07/28 Aggiunta gestione rinvio 90deg solo per forature da sotto esattamente verticali.
|
||||
-- 2023/09/26 Se errore in applicazione lavorazione si inverte e riprova solo se foratura singola su foro aperto.
|
||||
-- 2023/11/06 Migliorata gestione dei fori con AngularTransmission.
|
||||
-- 2024/03/13 Aggiunta gestione Predrill
|
||||
-- 2024/03/18 Per Predrill corretta direzione estrusione per fori con direzione verso il basso
|
||||
-- 2024/09/04 Gestione dipendenza foro-tasca in caso di fase con pezzo ribaltato
|
||||
-- 2024/09/10 In GetData corretta gestione modifica diametro foro
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDrill = {}
|
||||
@@ -93,20 +100,22 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Recupero dati foro e adattamento se speciale
|
||||
function ProcessDrill.GetData( Proc, b3Raw)
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||
-- verifico se foro da adattare
|
||||
if EgtExistsInfo( Proc.Id, 'DiamUser') then
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||
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
|
||||
-- recupero diametro e lunghezza
|
||||
local dDiam = EgtGetInfo( Proc.Id, 'P12', 'd') or 0
|
||||
local dLen = abs( EgtCurveThickness( Proc.Id + AuxId)) or 0
|
||||
-- recupero faccia di entrata e uscita
|
||||
local nFcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0
|
||||
local nFce = EgtGetInfo( Proc.Id, 'FCE', 'i') or 0
|
||||
return dDiam, nFcs, nFce
|
||||
return dDiam, dLen, nFcs, nFce
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -131,13 +140,84 @@ function ProcessDrill.Split( Proc, b3Raw)
|
||||
-- restituisco se va fatto in doppio (solo fori orizzontali)
|
||||
local bHoriz = ( abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and
|
||||
( abs( vtExtr:getY()) * b3Raw:getDimZ() > abs( vtExtr:getZ()) * b3Raw:getDimY() or Proc.Fce == 5 or Proc.Fce == 6))
|
||||
local bAngTransm = ( BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreSameOrOppositeVectorApprox( vtExtr, Z_AX()))
|
||||
local bSlant = ( abs( vtExtr:getX()) > BD.DRILL_VX_MAX)
|
||||
return ( bOpen and ( bHoriz or BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and not bSlant)
|
||||
return ( bOpen and ( bHoriz or BD.ROT90 or BD.DOWN_HEAD or BD.TURN or bAngTransm) and not bSlant)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Verifica se bisogna aggiungere un preforo
|
||||
function ProcessDrill.IsPredrillNeeded( Proc)
|
||||
local dDepthPredrill = EgtGetInfo( Proc.Id, 'Q03', 'i')
|
||||
-- se non c'è la Q oppure se zero, allora non è da fare
|
||||
if not dDepthPredrill or dDepthPredrill <= 0 then
|
||||
return false
|
||||
-- altrimenti Predrill da fare
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Aggiunge il preforo alla feature passata
|
||||
function ProcessDrill.AddPredrillFromDrillProc( Proc)
|
||||
local dDepthPredrill = EgtGetInfo( Proc.Id, 'Q03', 'i')
|
||||
-- foro più corto del preforo, allora è il foro che diventa il preforo stesso
|
||||
if Proc.Len <= dDepthPredrill then
|
||||
Proc.IsPredrill = true
|
||||
Proc.IsPredrillOf = Proc.Id
|
||||
return false
|
||||
-- altrimenti creo un nuovo process
|
||||
else
|
||||
-- recupero gruppo per geometria aggiuntiva
|
||||
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
|
||||
-- recupero e verifico l'entità foro
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
|
||||
local ptCen = EgtCP( Proc.Id + AuxId, GDB_RT.GLOB)
|
||||
local vtExtr = EgtCurveExtrusion( Proc.Id + AuxId, GDB_RT.GLOB)
|
||||
|
||||
-- copio foro originale
|
||||
local nPreHoleId = EgtCopyGlob( Proc.Id, nAddGrpId)
|
||||
local nPreHoleAux = EgtCopyGlob( Proc.Id + AuxId, nAddGrpId)
|
||||
|
||||
-- se foro invertito sposto geometria dall'altro lato del foro e inverto direzione estrusione
|
||||
if Proc.Flg == -2 then
|
||||
local vsExtr = -vtExtr * Proc.Len
|
||||
EgtMove( nPreHoleAux, vsExtr, GDB_RT.GLOB)
|
||||
EgtModifyCurveExtrusion( nPreHoleAux, -vtExtr, GDB_RT.GLOB)
|
||||
end
|
||||
EgtModifyCurveThickness( nPreHoleAux, -dDepthPredrill)
|
||||
|
||||
local PredrillProc = {}
|
||||
-- definisco dati seconda parte
|
||||
PredrillProc.PartId = Proc.PartId
|
||||
PredrillProc.Id = nPreHoleId
|
||||
PredrillProc.Grp = Proc.Grp
|
||||
PredrillProc.Prc = Proc.Prc
|
||||
PredrillProc.Flg = 1
|
||||
PredrillProc.Box = Proc.Box
|
||||
PredrillProc.Fct = Proc.Fct
|
||||
PredrillProc.Diam = Proc.Diam
|
||||
PredrillProc.Len = dDepthPredrill
|
||||
PredrillProc.Head = Proc.Head
|
||||
PredrillProc.Tail = Proc.Tail
|
||||
PredrillProc.Fcs = Proc.Fcs
|
||||
PredrillProc.Fce = 0 -- il preforo è sempre chiuso, non ha faccia di uscita
|
||||
PredrillProc.CutId = Proc.CutId
|
||||
PredrillProc.TaskId = Proc.TaskId
|
||||
PredrillProc.AdjId = Proc.AdjId
|
||||
PredrillProc.MainId = Proc.MainId
|
||||
PredrillProc.IsPredrill = true
|
||||
PredrillProc.IsPredrillOf = Proc.Id
|
||||
-- recupero l'elenco delle facce della parte interessate dalla feature
|
||||
PredrillProc.AffectedFaces = BL.GetProcessAffectedFaces( PredrillProc)
|
||||
return true, PredrillProc
|
||||
end
|
||||
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
|
||||
@@ -165,13 +245,36 @@ function ProcessDrill.Classify( Proc, b3Raw)
|
||||
return false, false, false
|
||||
end
|
||||
local bOpen = ( Proc.Fce ~= 0)
|
||||
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and ( Proc.Flg == 2 or Proc.Flg == -2))))
|
||||
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and abs( Proc.Flg) == 2)))
|
||||
local bAngTransm = ( BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreSameOrOppositeVectorApprox( vtExtr, Z_AX()))
|
||||
|
||||
-- se ci sono delle dipendenze da altre feature da rispettare
|
||||
if sDownOrSideOrStd then
|
||||
if sDownOrSideOrStd == 'DOWN' then
|
||||
-- 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
|
||||
return true, true, false
|
||||
-- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione
|
||||
if bAngTransm then
|
||||
return true, false, false
|
||||
else
|
||||
return true, true, false
|
||||
end
|
||||
else
|
||||
return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN)
|
||||
return true, not ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN or bAngTransm), ( BD.ROT90 or BD.DOWN_HEAD or BD.TURN)
|
||||
end
|
||||
else
|
||||
return true, false, false
|
||||
@@ -242,8 +345,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
local bOpen = ( Proc.Fcs ~= 0 and Proc.Fce ~= 0)
|
||||
-- verifico possibilità di foratura da sotto
|
||||
local bDownDrill = ( BD.TURN or ( BD.DOWN_HEAD and ML.FindDrilling( dDiam, nil, false, true)))
|
||||
-- se presente rinvio angolare
|
||||
local bDrillAngTrasm = ( BD.ANG_TRASM and ML.FindDrilling( dDiam, nil, nil, nil, nil, true) and AreOppositeVectorApprox( vtExtr, Z_AX()))
|
||||
-- verifico che il foro non sia fattibile solo da sotto
|
||||
local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill)
|
||||
local bToInvert = ( vtExtr:getZ() < BD.DRILL_VZ_MIN and not bDownDrill and not bDrillAngTrasm)
|
||||
if bToInvert and ( not bOpen or Proc.Flg ~= 1) then
|
||||
local sErr = 'Error : drilling from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
@@ -277,15 +382,34 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.421)
|
||||
local bExcludeH2 = false
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
bMillUp = true
|
||||
-- bMillUp = true
|
||||
bDrillDown = false
|
||||
bExcludeH2 = true
|
||||
end
|
||||
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2)
|
||||
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
||||
|
||||
if sDrilling then
|
||||
-- Determino la faccia di inizio del foro e dati correlati
|
||||
local nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
-- Calcolo acciorciamento affondamento utile per evitare collisione portautensile con faccia
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
|
||||
-- Per fori molto inclinati ( < 30 gradi) si usa la testa della macchina per l'accorciamento. Fast esclusa
|
||||
if BD.C_SIMM and CosB > 0.866 then
|
||||
dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116
|
||||
end
|
||||
local dMaxDepthOri = dMaxDepth
|
||||
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
|
||||
-- se utensile scelto non arriva in fondo, cerco il più lungo
|
||||
if dMaxDepth < GEO.EPS_SMALL * 10 then
|
||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill, nil, 'Longest')
|
||||
end
|
||||
end
|
||||
|
||||
if not sDrilling and dCheckDepth then
|
||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2)
|
||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
||||
if sDrilling then dCheckDepth = nil end
|
||||
end
|
||||
if not sDrilling then
|
||||
@@ -378,16 +502,28 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- eventuale inversione foro in base al lato di lavoro e al lato testa dell'utensile scelto
|
||||
-- se non già richiesta inversione e foro quasi orizzontale (15deg) passante
|
||||
if not bToInvert and Proc.Flg == 1 and bOpen and abs( vtExtr:getZ()) < 0.259 and abs( vtExtr:getY()) > 0.966 then
|
||||
local Tool = BL.GetToolFromMachining( sDrilling)
|
||||
-- lato testa e lato di lavoro devono corrispondere
|
||||
if ( ( Tool.PreferredSide.bFront == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL)
|
||||
or ( ( Tool.PreferredSide.bBack == true) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then
|
||||
ptCen = ptCen - vtExtr * dLen
|
||||
vtExtr = - vtExtr
|
||||
bToInvert = true
|
||||
end
|
||||
end
|
||||
-- Determino la faccia di inizio del foro e dati correlati
|
||||
local nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
nFac, CosB, vFaces = GetHoleStartData( ptCen, vtExtr, b3Solid)
|
||||
-- Calcolo acciorciamento affondamento utile per evitare collisione portautensile con faccia
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
local dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
|
||||
TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
dSubL = ( dDiamTh / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA
|
||||
-- Per fori molto inclinati ( < 30 gradi) si usa la testa della macchina per l'accorciamento. Fast esclusa
|
||||
if BD.C_SIMM and CosB > 0.866 then
|
||||
dSubL = ( 190 / 2 + ( Proc.Diam - dToolDiam) / 2 + 4) * TgA - 116
|
||||
end
|
||||
local dMaxDepthOri = dMaxDepth
|
||||
dMaxDepthOri = dMaxDepth
|
||||
dMaxDepth = min( dMaxDepth, max( dToolFreeLen - dSubL, 0))
|
||||
-- Verifico inclinazione foro nei limiti
|
||||
local bTryDrill = EgtIf( dMaxDepth > 0, ( CosB < BD.DRILL_VX_MAX), false)
|
||||
@@ -410,7 +546,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
if bIntersectionOk then
|
||||
local dHoleToCutDistance = vDistance[1]
|
||||
-- se il taglio accorcia realmente il foro
|
||||
if dHoleToCutDistance > 10 * GEO.EPS_SMALL and dHoleToCutDistance < dLen then
|
||||
if ( dHoleToCutDistance > 10 * GEO.EPS_SMALL or Proc.AffectedFaces.Right) and dHoleToCutDistance < dLen then
|
||||
dMaxDepth = dMaxDepthOri
|
||||
dMaxElev = dLen - dHoleToCutDistance
|
||||
bTryDrill = true
|
||||
@@ -442,7 +578,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
dMaxElev = dMaxDepth
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Drill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local sName = EgtIf( EgtStartsWith( sType, 'Predrill'), 'Predrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sName, sDrilling)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
|
||||
@@ -452,14 +588,18 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- eventuale inversione
|
||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'Drill_AT' or sType == 'AngleDrill' or sType == 'Predrill' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bToInvert)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert)
|
||||
end
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
if bDrillAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif BD.TURN == 2 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif not BD.C_SIMM and not BD.TURN then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
if AreSameVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
@@ -498,6 +638,16 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
-- calcolo gli step reali
|
||||
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
|
||||
local nNumStep = ceil( dDepth/dStep)
|
||||
local dRealStep = dDepth / nNumStep
|
||||
-- Se foro passante e nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno
|
||||
if bOpen and ( nNumStep > 1) and ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then
|
||||
dRealStep = ceil( dDepth / (nNumStep - 1))
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dRealStep)
|
||||
sMyWarn ='Warning in drill-double : step changed to ' .. tostring(dRealStep) .. 'mm'
|
||||
end
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
if Proc.Double ~= Proc.PrevDouble then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||
@@ -506,7 +656,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
local bOk = ML.ApplyMachining( true, false)
|
||||
if not bOk and bDownDrill then
|
||||
if not bOk and bDownDrill and bOpen and abs( Proc.Flg) == 1 then
|
||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
|
||||
+158
-19
@@ -20,6 +20,7 @@ local ProcessDtMortise = {}
|
||||
require( 'EgtBase')
|
||||
local BL = require( 'BeamLib')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local Probe = require( 'ProcessProbing')
|
||||
|
||||
EgtOutLog( ' ProcessDtMortise started', 1)
|
||||
|
||||
@@ -103,7 +104,7 @@ function ProcessDtMortise.GetCutPlane( Proc)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
|
||||
local function CalcPathAtHeight( nProcId, AuxId, nAddGrpId, dHeight, dSideAng, b3Solid)
|
||||
-- copio la curva di base
|
||||
local NewAuxId = EgtCopyGlob( AuxId, nAddGrpId)
|
||||
if not NewAuxId then return end
|
||||
@@ -111,16 +112,16 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
|
||||
EgtAddCurveCompoLineTg( NewAuxId, 100, false)
|
||||
EgtAddCurveCompoLineTg( NewAuxId, 100, true)
|
||||
EgtMergeCurvesInCurveCompo( NewAuxId)
|
||||
-- eseguo traslazione e offset per portarla sul top
|
||||
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dAltMort - 10 * GEO.EPS_SMALL)
|
||||
EgtMove( NewAuxId, vtMove, GDB_RT.GLOB)
|
||||
local dOffset = dAltMort * tan( dSideAng)
|
||||
local dOffset = dHeight * tan( dSideAng)
|
||||
if not EgtOffsetCurve( NewAuxId, dOffset) then return end
|
||||
-- la limito entro la trave
|
||||
local refBox = Frame3d( b3Solid:getMin())
|
||||
local vtBoxDiag = b3Solid:getMax() - b3Solid:getMin()
|
||||
local nCount
|
||||
NewAuxId, nCount = EgtTrimFlatCurveWithBox( NewAuxId, refBox, vtBoxDiag, true, true, GDB_RT.GLOB)
|
||||
-- eseguo traslazione e offset per portarla sul top
|
||||
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dHeight - 10 * GEO.EPS_SMALL)
|
||||
EgtMove( NewAuxId, vtMove, GDB_RT.GLOB)
|
||||
-- se divisa in più parti, le unisco congiungendole con segmenti
|
||||
if nCount > 1 then
|
||||
if EgtGetType( NewAuxId) ~= GDB_TY.CRV_COMPO then
|
||||
@@ -136,6 +137,23 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
|
||||
return NewAuxId
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetVerticalSteps( dMachiningDepth, dStep )
|
||||
local MachiningSteps = {}
|
||||
MachiningSteps.StepLength = 0
|
||||
|
||||
if dMachiningDepth <= 0 then
|
||||
MachiningSteps.Count = 0
|
||||
return MachiningSteps
|
||||
end
|
||||
|
||||
MachiningSteps.Count = ceil( (dMachiningDepth - 10 * GEO.EPS_SMALL) / dStep )
|
||||
|
||||
MachiningSteps.StepLength = dMachiningDepth / MachiningSteps.Count
|
||||
|
||||
return MachiningSteps
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- verifica che il box includa il punto in XY
|
||||
function EnclosesPoint( b3Box, ptP)
|
||||
@@ -154,6 +172,7 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
bMakeAntiSplitPath = true
|
||||
-- ingombro del pezzo
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
if not b3Solid then
|
||||
@@ -210,7 +229,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
|
||||
@@ -272,7 +292,9 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local dToolDiam = 100
|
||||
local dMaxMat = 30
|
||||
local dSideAng = 0
|
||||
local sHeadTool = 'H1'
|
||||
local bCW = true
|
||||
local bMillOnAggregate = sMchExt == '_AT'
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
@@ -280,16 +302,66 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
dToolDiam = max( dToolDiam, 10)
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
|
||||
sHeadTool = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
end
|
||||
-- verifico che la profondità non superi il massimo materiale dell'utensile
|
||||
local bMultipleZPasses = false
|
||||
-- se necessario, cerco un utensile più lungo
|
||||
if dAltMort > dMaxMat + 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Error : DtMortise Depth bigger than Tool Cutting edge'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
-- recupero la lavorazione : prima ricerca per sola tipologia
|
||||
sMilling = ML.FindMilling( sMillType..sMchExt, nil, nil, nil, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
|
||||
if not sMilling and bMillUp then
|
||||
sMilling = ML.FindMilling( sMillType, nil, nil, nil, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Milling not found in library : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero la lavorazione : seconda ricerca con tipologia e diametro massimo
|
||||
sMilling = ML.FindMilling( sMillType..sMchExt, nil, nil, 2 * dMinRad, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
|
||||
if not sMilling and bMillUp then
|
||||
sMilling = ML.FindMilling( sMillType, nil, nil, 2 * dMinRad, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
|
||||
sMchExt = ''
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Radius too small : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : DtMortise Depth bigger than Tool Cutting edge'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- riassegno dati utensile
|
||||
dToolDiam = 100
|
||||
dMaxMat = 30
|
||||
dSideAng = 0
|
||||
bCW = true
|
||||
bMillOnAggregate = sMchExt == '_AT'
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
dToolDiam = max( dToolDiam, 10)
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
|
||||
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
end
|
||||
|
||||
bMultipleZPasses = true
|
||||
end
|
||||
|
||||
|
||||
-- tastatura se richiesta
|
||||
local Info = { vtProbe = vtExtr, ptProbe = ptBC, sType = 'DTMortise', sHead = sHeadTool}
|
||||
local bProbeExecuted, sErr = Probe.Make( Proc, nPartId, Info)
|
||||
|
||||
-- se con tasca, la lavoro (mai in doppio)
|
||||
if bPocket then
|
||||
-- recupero il contorno della tasca (seconda curva ausiliaria)
|
||||
@@ -344,11 +416,20 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- eventuale calcolo SCC
|
||||
local nSCC
|
||||
if BD.TURN and not bPocket then
|
||||
if abs( vtAx:getY()) > abs( vtAx:getZ()) then
|
||||
nSCC = EgtIf( vtAx:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||
if BD.TURN then
|
||||
if not bPocket then
|
||||
if abs( vtAx:getY()) > abs( vtAx:getZ()) then
|
||||
nSCC = EgtIf( vtAx:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||
end
|
||||
end
|
||||
-- se aggregato e rivolto verso Z-, si accede da lato aperto
|
||||
elseif bMillOnAggregate and AreSameVectorApprox( vtExtr, -Z_AX()) then
|
||||
if Proc.AffectedFaces.Back then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
elseif Proc.AffectedFaces.Front then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
end
|
||||
-- flag di mirror precedente aggiornabile localmente
|
||||
@@ -363,7 +444,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
end
|
||||
-- calcolo il percorso top mortise
|
||||
local nAuxId1 = CalcTopPath( Proc.Id, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
|
||||
local nAuxId1 = CalcPathAtHeight( Proc.Id, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
|
||||
-- se esiste il percorso
|
||||
if nAuxId1 then
|
||||
-- creo percorso sulla parte alta della mortasa
|
||||
@@ -422,6 +503,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dAltMort)
|
||||
-- setto offset radiale con aggiunto un ulteriore allargamento di 1mm
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dToolRadDelta - 1)
|
||||
-- antischeggia sempre con una passata
|
||||
if bMultipleZPasses then
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
end
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
|
||||
@@ -465,6 +550,23 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local nPass = ceil( dDist / ( 1.9 * dToolDiam))
|
||||
local dStep = 0
|
||||
if nPass > 1 then dStep = max( ( dDist - 2 * dToolDiam) / ( 2 * nPass - 2), 0.25 * dToolDiam) end
|
||||
|
||||
local dVerticalStep = 0
|
||||
if bMultipleZPasses then
|
||||
local dToolVerticalStep = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
dToolVerticalStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP) or 0
|
||||
end
|
||||
if dToolVerticalStep < 10 * GEO.EPS_SMALL then
|
||||
dToolVerticalStep = dMaxMat / 3
|
||||
else
|
||||
dToolVerticalStep = min( dToolVerticalStep, dMaxMat / 3)
|
||||
end
|
||||
local VerticalSteps = GetVerticalSteps( dAltMort, dToolVerticalStep)
|
||||
dVerticalStep = VerticalSteps.StepLength
|
||||
nPass = VerticalSteps.Count
|
||||
end
|
||||
|
||||
for i = nPass, 1, -1 do
|
||||
-- inserisco la lavorazione di contornatura
|
||||
local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)
|
||||
@@ -475,10 +577,39 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
local GeomId = AuxId
|
||||
if ( i > 1) and bMultipleZPasses then
|
||||
local dCurrentHeight = dAltMort - ( ( nPass - i + 1) * dVerticalStep)
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local b3MortiseNoPocket = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
|
||||
GeomId = CalcPathAtHeight( Proc.Id, AuxId, nAddGrpId, dCurrentHeight, dSideAng, b3MortiseNoPocket)
|
||||
if not GeomId then
|
||||
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
EgtSetMachiningGeometry( {{ GeomId, -1}})
|
||||
-- imposto offset
|
||||
local dOffs = ( i - 1) * dStep
|
||||
if bMultipleZPasses then
|
||||
if i > 1 then
|
||||
dOffs = 1
|
||||
else
|
||||
dOffs = 0
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
||||
-- in caso di passate in Z già calcolate lo step deve essere nullo per garantire passate singole
|
||||
if bMultipleZPasses then
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
end
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
|
||||
@@ -511,11 +642,15 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
end
|
||||
-- se necessario, imposto SCC
|
||||
if nSCC then
|
||||
if nSCC then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
end
|
||||
-- dichiaro massima elevazione e assenza sfridi per VMill
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
|
||||
local dMaxElev = dMaxMat
|
||||
if bMultipleZPasses then
|
||||
dMaxElev = dVerticalStep
|
||||
end
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
|
||||
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
|
||||
if bPocket then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3)
|
||||
@@ -528,6 +663,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||
end
|
||||
end
|
||||
-- se c'è stata tastatura, si disattiva sull'ultima lavorazione
|
||||
if bProbeExecuted and i == 1 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'END-PROBE', true)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
|
||||
+35
-12
@@ -5,6 +5,7 @@
|
||||
-- 2023/02/08 Aumentato il range per cui i tenoni vengono lavorati in sottosquadro.
|
||||
-- 2023/03/27 Migliorate condizioni scelta pretaglio con lama o fresa; gestione unificata con ProcessTenon.
|
||||
-- 2023/03/28 Corretta gestione faccia di base quando divisa in più parti per distanza massima da lavorare.
|
||||
-- 2024/02/29 Aumentato numero passaggi CR su tenone. Massimo 8
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessDtTenon = {}
|
||||
@@ -45,9 +46,9 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
|
||||
-- se macchina Fast, pezzo stretto e inclinazione laterale non eccessiva, accetto fino a -27deg
|
||||
elseif ( not BD.C_SIMM) and abs( vtN:getY()) < 0.5 and b3Raw:getDimY() < 150.1 then
|
||||
return ( vtN:getZ() >= -0.454)
|
||||
-- altrimenti accetto fino a -21deg
|
||||
-- altrimenti accetto fino a -23.5deg
|
||||
else
|
||||
return ( vtN:getZ() >= -0.359)
|
||||
return ( vtN:getZ() >= -0.399)
|
||||
end
|
||||
-- se trave medio-bassa
|
||||
elseif b3Raw:getDimZ() < 281 then
|
||||
@@ -69,8 +70,8 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
|
||||
end
|
||||
-- altrimenti
|
||||
else
|
||||
-- accetto fino a -5deg
|
||||
return ( vtN:getZ() >= -0.088)
|
||||
-- accetto fino a -7deg
|
||||
return ( vtN:getZ() >= -0.122)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -206,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
|
||||
@@ -215,7 +217,7 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'DtTenon'
|
||||
local sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
|
||||
local sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
@@ -234,11 +236,32 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
end
|
||||
-- verifico che l'altezza non superi il massimo materiale dell'utensile
|
||||
-- se necessario, cerco un utensile più lungo
|
||||
if dDtTenH > dMaxMat + 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Error : DtTenon Height bigger than Tool Cutting edge'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown, nil, nil, 'Longest')
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : DtTenon Height bigger than Tool Cutting edge'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- riassegno dati utensile
|
||||
dTDiam = 50
|
||||
dMaxMat = 30
|
||||
bCW = true
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0)
|
||||
local dMaxDist
|
||||
@@ -268,8 +291,8 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
dMaxDist = 2 * ( b3DtTen:getRadius() - b3DtAux:getRadius())
|
||||
end
|
||||
EgtOutLog( 'MaxDist=' .. EgtNumToString( dMaxDist, 3), 3)
|
||||
-- Cicli di lavorazione (max 6)
|
||||
local MAX_PASS = 6
|
||||
-- Cicli di lavorazione (max 8)
|
||||
local MAX_PASS = 8
|
||||
local nStep = min( ceil( dMaxDist / ( 0.7 * dTDiam)), MAX_PASS)
|
||||
local dStep = min( dMaxDist, 0.7 * dTDiam * MAX_PASS) / nStep
|
||||
for i = nStep, 1, -1 do
|
||||
|
||||
+176
-45
@@ -7,6 +7,10 @@
|
||||
-- 2022/11/24 In MakeByMill aggiunta la lavorazione sopra/sotto nel caso di testa sotto
|
||||
-- In MakeByMill se BeamData forza lettura codolo da Q questo viene sempre fatto indipendentemente dalle dimensioni della feature
|
||||
-- 2023/03/03 Corretta MakeByMark ( non definiti b3Raw e b3Aux ).
|
||||
-- 2023/06/21 In CalcSpecialAdd modificato l'angolo minimo da 5 a 15 deg.
|
||||
-- 2023/07/28 In MakeByPocket aggiunta Q06 per specificare un eventuale offset radiale del contorno.
|
||||
-- 2024/03/05 In MakebyPocket aggiunta lavorazione di smusso
|
||||
-- In MakeByMill eliminata doppia lavorazione smusso se contorno non passante
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessFreeContour = {}
|
||||
@@ -26,12 +30,17 @@ local Q_DIM_STRIP = 'Q01' -- d
|
||||
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
|
||||
function ProcessFreeContour.Identify( Proc)
|
||||
return ( ( Proc.Grp == 0 or Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 250)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Verifica se feature di testa
|
||||
function ProcessFreeContour.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
||||
@@ -93,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
|
||||
@@ -101,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
|
||||
@@ -206,8 +217,8 @@ local function CalcSpecialAdd( nCrv, bStartVsEnd, dToolDiam)
|
||||
-- tangenti prima e dopo il punto interno
|
||||
local vtPrev = EgtUV( nCrv, nIn, -1)
|
||||
local vtNext = EgtUV( nCrv, nIn, 1)
|
||||
-- se c'è perdita di tangenza (delta angolare oltre i 5 gradi)
|
||||
if vtPrev * vtNext < 0.996 then
|
||||
-- se c'è perdita di tangenza (delta angolare oltre i 15 gradi)
|
||||
if vtPrev * vtNext < 0.966 then
|
||||
-- lunghezza del tratto
|
||||
local ptP0 = EgtUP( nCrv, nOut)
|
||||
local ptP1 = EgtUP( nCrv, nIn)
|
||||
@@ -290,16 +301,18 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local bCross = false
|
||||
if abs( vtExtr:getX()) < 0.707 then
|
||||
if abs( vtExtr:getY()) > abs( vtExtr:getZ()) then
|
||||
-- se è passante
|
||||
if b3Aux:getDimY() > b3Raw:getDimY() - 1.0 then
|
||||
bCross = true
|
||||
dDepth = min( dDepth, b3Raw:getDimY() / abs( vtExtr:getY()))
|
||||
end
|
||||
if bDown then
|
||||
nSide = -1
|
||||
nSide = -1
|
||||
else
|
||||
nSide = 1
|
||||
nSide = 1
|
||||
end
|
||||
else
|
||||
-- se è passante
|
||||
if b3Aux:getDimZ() > b3Raw:getDimZ() - 1.0 then
|
||||
bCross = true
|
||||
dDepth = min( dDepth, b3Raw:getDimZ() / abs( vtExtr:getZ()))
|
||||
@@ -369,28 +382,28 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham and Proc.Prc ~= 70 then
|
||||
local bDoubleCham = false
|
||||
local dExtra = 2
|
||||
local sChamferDown, sChamferUp
|
||||
if nDouble > 1 and bCanDouble then
|
||||
if nSide == 0 then
|
||||
if BD.DOWN_HEAD then
|
||||
-- recupero la lavorazione
|
||||
local nChamferDown
|
||||
nChamferDown, _, sChamferDown = VerifyChamfer( Proc, AuxId, nRawId, true, true)
|
||||
if nChamferDown < 0 then
|
||||
local sChamferDown, sChamferUp
|
||||
if nDouble > 1 and bCanDouble then
|
||||
if nSide == 0 then
|
||||
if BD.DOWN_HEAD then
|
||||
-- recupero la lavorazione
|
||||
local nChamferDown
|
||||
nChamferDown, _, sChamferDown = VerifyChamfer( Proc, AuxId, nRawId, true, true)
|
||||
if nChamferDown < 0 then
|
||||
sWarn = 'Warning : chamfer from bottom not found in library'
|
||||
sChamferDown = nil
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
end
|
||||
local nChamferUp
|
||||
nChamferUp, _, sChamferUp = VerifyChamfer( Proc, AuxId, nRawId, true, false)
|
||||
if nChamferUp < 0 then
|
||||
sWarn = 'Warning : chamfer from bottom not found in library'
|
||||
sChamferDown = nil
|
||||
sChamferUp = nil
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
end
|
||||
local nChamferUp
|
||||
nChamferUp, _, sChamferUp = VerifyChamfer( Proc, AuxId, nRawId, true, false)
|
||||
if nChamferUp < 0 then
|
||||
sWarn = 'Warning : chamfer from bottom not found in library'
|
||||
sChamferUp = nil
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eseguo
|
||||
for i = 1, nStep do
|
||||
-- inserisco la lavorazione
|
||||
@@ -435,9 +448,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
if nSide == 0 then
|
||||
bDoubleCham = EgtIf( sChamferDown and BD.DOWN_HEAD, true, false)
|
||||
bDoubleCham = EgtIf( sChamferDown and BD.DOWN_HEAD, true, false) and bCanDouble
|
||||
else
|
||||
bDoubleCham = true
|
||||
bDoubleCham = bCanDouble
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra)
|
||||
@@ -458,7 +471,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if BD.TURN == 2 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif not BD.C_SIMM then
|
||||
if Proc.Head then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif Proc.Tail then
|
||||
@@ -526,7 +541,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if BD.TURN == 2 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif not BD.C_SIMM then
|
||||
if Proc.Head then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif Proc.Tail then
|
||||
@@ -576,6 +593,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eventuale inversione ultimo segmento
|
||||
local bInvertLastPath = ( ( EgtGetInfo( Proc.Id, Q_INVERT_LAST_PATH, 'd') or 0) == 1)
|
||||
-- eseguo
|
||||
for i = 1, nStep do
|
||||
for j = 1, nDouble do
|
||||
@@ -618,38 +637,71 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- eventuale accorciamento di testa
|
||||
local dStartAddLen, dEndAddLen, dWorkSide, bToolInvert, bInvert
|
||||
if ( j == 1 and i > 1) or ( j == 2 and i < nStep) then
|
||||
local dStartAddLen = EgtIf( j == 1, - ( i - 1) * dStep, - ( nStep - i) * dStep)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||
dStartAddLen = EgtIf( j == 1, - ( i - 1) * dStep, - ( nStep - i) * dStep)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( j == 1, dStartAddSpec, dEndAddSpec))
|
||||
dStartAddLen = EgtIf( j == 1, dStartAddSpec, dEndAddSpec)
|
||||
end
|
||||
-- eventuale accorciamento di coda
|
||||
if ( j == 1 and i < nStep) or ( j == 2 and i > 1) then
|
||||
local dEndAddLen = EgtIf( j == 1, - ( nStep - i) * dStep, - ( i - 1) * dStep)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||
dEndAddLen = EgtIf( j == 1, - ( nStep - i) * dStep, - ( i - 1) * dStep)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( j == 1, dEndAddSpec, dStartAddSpec))
|
||||
dEndAddLen = EgtIf( j == 1, dEndAddSpec, dStartAddSpec)
|
||||
end
|
||||
-- se estrusione da sotto, inverto direzione fresa
|
||||
if ( j == 1 and bToolInv) or ( j == 2 and not bToolInv) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
bToolInvert = true
|
||||
else
|
||||
bToolInvert = false
|
||||
end
|
||||
-- se seconda passata, inverto direzione di lavoro
|
||||
if j == 2 then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bInvert = true
|
||||
else
|
||||
bInvert = false
|
||||
end
|
||||
|
||||
-- assegno lato di lavoro
|
||||
if Proc.Grp == 0 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
|
||||
dWorkSide = MCH_MILL_WS.CENTER
|
||||
elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) or ( Proc.Grp == 1 and bToolInv) or ( Proc.Grp == 2 and bToolInv) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
dWorkSide = MCH_MILL_WS.LEFT
|
||||
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) or ( Proc.Grp == 1 and not bToolInv) or ( Proc.Grp == 2 and not bToolInv) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
dWorkSide = MCH_MILL_WS.RIGHT
|
||||
end
|
||||
|
||||
-- se ultimo step da invertire
|
||||
if i == nStep and bInvertLastPath then
|
||||
-- se profilo orizzontale
|
||||
if abs( vtExtr:getZ()) < 10 * GEO.EPS_SMALL then
|
||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
||||
bInvert = not( bInvert)
|
||||
bToolInvert = not( bToolInvert)
|
||||
else
|
||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
||||
bInvert = not( bInvert)
|
||||
if dWorkSide == MCH_MILL_WS.LEFT then
|
||||
dWorkSide = MCH_MILL_WS.RIGHT
|
||||
elseif dWorkSide == MCH_MILL_WS.RIGHT then
|
||||
dWorkSide = MCH_MILL_WS.LEFT
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- setto i valori
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToolInvert)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, dWorkSide)
|
||||
|
||||
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if BD.TURN == 2 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif not BD.C_SIMM then
|
||||
if Proc.Head then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif Proc.Tail then
|
||||
@@ -704,7 +756,14 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- eventuale segnalazione ingombro di testa o coda
|
||||
local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ())
|
||||
if Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then
|
||||
local dMinZ = max( BD.MIN_HEIGHT, 0.35 * b3Raw:getDimZ())
|
||||
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)
|
||||
@@ -713,6 +772,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
BL.UpdateTCING( nRawId, dOffs)
|
||||
end
|
||||
end
|
||||
|
||||
return true, sWarn
|
||||
end
|
||||
|
||||
@@ -729,8 +789,74 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- recupero i dati della curva e del profilo
|
||||
local dDepth = abs( EgtCurveThickness( AuxId))
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
--local bToolInv = ( vtExtr:getZ() < -0.1)
|
||||
-- recupero la lavorazione
|
||||
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
||||
local bToolInv = ( not bDownHead and vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
|
||||
local dExtra = 2
|
||||
|
||||
-- verifico se servono gli smussi. Se lavorazione principale di svuotatura significa che è solo da un lato
|
||||
-- generalmente sono lavorazioni non molto lunghe, quindi non si gestistono gli step
|
||||
-- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva
|
||||
local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true)
|
||||
-- se devo inserire il chamfer
|
||||
if nChamfer > 0 and Proc.Grp ~= 0 and dDepth > dDepthCham and Proc.Prc ~= 70 then
|
||||
-- inserisco la lavorazione
|
||||
local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sNameCh, sChamfer)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if Proc.Grp == 3 then
|
||||
if not bToolInv then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
end
|
||||
end
|
||||
if Proc.Grp == 4 then
|
||||
if not bToolInv then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if BD.TURN == 2 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif not BD.C_SIMM then
|
||||
if Proc.Head then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif Proc.Tail then
|
||||
nSCC = MCH_SCC.ADIR_XM
|
||||
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
elseif vtExtr:getY() > -0.01 then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
|
||||
-- recupero la lavorazione di svuotatura
|
||||
local sPocketing = ML.FindPocketing( 'Pocket', nil, dDepth)
|
||||
if not sPocketing then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library'
|
||||
@@ -772,6 +898,11 @@ local function MakeByPocket( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- imposto elevazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';')
|
||||
-- imposto eventuale offset radiale, se impostato dall'utente
|
||||
local dRadialOffset = EgtGetInfo( Proc.Id, Q_RADIAL_OFFSET, 'd') or 0
|
||||
if abs( dRadialOffset) > 10 * GEO.EPS_SMALL then
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, -dRadialOffset)
|
||||
end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
+294
-116
@@ -7,6 +7,10 @@
|
||||
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
||||
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
||||
-- 2023/04/20 Per travi alte aggiunti tagli orizzontali per ridurre le dimensioni degli scarti
|
||||
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo
|
||||
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
|
||||
-- 2024/01/18 Gestiti tagli verticali aggiuntivi per travi larghe.
|
||||
-- 2024/01/22 Nei tagli verticali aggiuntivi si usa ora BD.MAX_LEN_DICE come dimensione (era BD.MAX_DIM_DICE).
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessHeadCut = {}
|
||||
@@ -17,6 +21,8 @@ local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local Pocket = require( 'FaceByPocket')
|
||||
local Topology = require( 'FeatureTopology')
|
||||
local Split = require( 'ProcessSplit')
|
||||
|
||||
EgtOutLog( ' ProcessHeadCut started', 1)
|
||||
|
||||
@@ -24,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)
|
||||
@@ -149,6 +159,198 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
return true, nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- tagli verticali aggiuntivi
|
||||
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, dOffsetBetweenCuts)
|
||||
local nVerticalCuts = ceil( Proc.Face[1].WidthTrimmed / ( BD.MAX_LEN_DICE)) - 1
|
||||
local dVerticalSliceHeight = Proc.Face[1].WidthTrimmed / ( nVerticalCuts + 1)
|
||||
-- recupero il diametro dell'utensile
|
||||
local dSawDiam = 400
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
end
|
||||
end
|
||||
local bOk, sErr
|
||||
-- tagli orizzontali
|
||||
for j = nVerticalCuts, 1, -1 do
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
|
||||
local dVerticalCutOffset = dVerticalSliceHeight * -j
|
||||
local sLeadInOutType = 'PerpendicularOutraw'
|
||||
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, sLeadInOutType, nil, dOffsetBetweenCuts)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
|
||||
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 sLeadInOutType = 'PerpendicularOutraw'
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, sLeadInOutType, nil, dOffsetBetweenCuts)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
-- se necessario taglio verticale doppio, eseguo l'opposto
|
||||
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, dOffsetBetweenCuts)
|
||||
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, dOffsetBetweenCuts)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, Cutting1Data.sCutting, Cutting1Data.dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||
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)
|
||||
@@ -160,8 +362,18 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOkc then return bOkc, sErrC end
|
||||
end
|
||||
-- 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)
|
||||
@@ -191,31 +403,42 @@ 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
|
||||
-- determino se lo spessore del materiale da rimuovere è eccessivo e quindi vanno fatti più tagli con offset
|
||||
local nCuts = max( ceil( dOvmHead / (( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP) + 0.5)), 1)
|
||||
local dOffsL = dOvmHead / nCuts
|
||||
-- caratteristiche taglio
|
||||
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
||||
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
||||
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
||||
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA)
|
||||
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
||||
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) and
|
||||
( b3Raw:getDimY() < 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
-- verifico necessità di tagli aggiuntivi orizzontali o verticali
|
||||
local dMinOvmHeadForAddeddCuts = 10.123
|
||||
local bNeedVerticalAddedCuts = ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL)
|
||||
local bNeedHorizontalAddedCuts = ( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and
|
||||
not bBigSectionCut and ( dOvmHead > dMinOvmHeadForAddeddCuts - 10 * GEO.EPS_SMALL) and
|
||||
dOffsL < BD.MAX_DIM_DICE
|
||||
-- dati lavorazioni sopra e sotto
|
||||
local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth}
|
||||
local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dMaxDepth2, dSawThick = dSawThick2}
|
||||
-- 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
|
||||
if not bNeedHCut and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
-- determino se più tagli con offset
|
||||
local nCuts = max( ceil( dOvmHead / ( BD.MAX_LEN_SCRAP_START or BD.MAX_LEN_SCRAP)), 1)
|
||||
local dOffsL = dOvmHead / nCuts
|
||||
-- se taglio per sezioni alte e larghe
|
||||
if bBigSectionCut then
|
||||
if dOvmHead > 0 then
|
||||
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
||||
-- se finitura con lama
|
||||
if nQ05 == 1 or nQ05 == 0 then
|
||||
if nQ05 < 2 then
|
||||
local dSawThickCheck = dSawThick
|
||||
if dSawThick2 > 0 and bDoubleHorizCut then
|
||||
dSawThickCheck = min( dSawThick, dSawThick2)
|
||||
@@ -226,9 +449,66 @@ 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 = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT)
|
||||
local bOk, sErr
|
||||
-- se trave larga effettuo tagli verticali aggiuntivi
|
||||
if bNeedVerticalAddedCuts then
|
||||
-- ad ogni offset di taglio dovrò fare prima i tagli verticali e poi i cubetti
|
||||
for i = nCuts, 1, -1 do
|
||||
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
|
||||
-- faccia di taglio all'offset corrente
|
||||
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
local AddProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId}
|
||||
Topology.Classify( AddProc, b3Raw)
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local vtMove = Vector3d( dCutOffset, 0, 0)
|
||||
EgtMove( AddId, vtMove, GDB_RT.GLOB)
|
||||
-- eventuale faccia di taglio all'offset precedente, per limitare il dicing e evitare di tagliare i cubetti nel vuoto
|
||||
local nLimitingSurf
|
||||
if nCuts > 1 then
|
||||
nLimitingSurf = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
local dLastCutOffset = i * dOffsL
|
||||
local vtMoveLimitingSurf = Vector3d( dLastCutOffset - 10 * GEO.EPS_SMALL, 0, 0)
|
||||
EgtMove( nLimitingSurf, vtMoveLimitingSurf, GDB_RT.GLOB)
|
||||
local vtNLimitingSurf = EgtSurfTmFacetNormVersor( nLimitingSurf, 0, GDB_ID.ROOT)
|
||||
if AreSameVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
|
||||
end
|
||||
-- tagli verticali
|
||||
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw, dOffsL)
|
||||
if not bOk then return bOk, sErr end
|
||||
-- tagli a cubetti con eventuale superficie limitante
|
||||
local sLeadInOutType = 'PerpendicularOutraw'
|
||||
bOk, sErr = Cut.Make( AddProc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nLimitingSurf, sLeadInOutType)
|
||||
end
|
||||
-- tagli aggiuntivi non necessari
|
||||
else
|
||||
local sLeadInOutType = 'PerpendicularOutraw'
|
||||
bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, nil, nil, nil, sLeadInOutType)
|
||||
end
|
||||
return bOk, sErr
|
||||
end
|
||||
-- se finitura con truciolatore
|
||||
@@ -250,113 +530,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
|
||||
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
|
||||
if BD.C_SIMM then
|
||||
dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||
else
|
||||
dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL)
|
||||
end
|
||||
end
|
||||
|
||||
local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, HeadCutType, Cutting1Data, Cutting2Data, nil, dOvmHead)
|
||||
|
||||
-- per travi alte faccio faccio dei tagli orizzontali aggiuntivi
|
||||
local _, _, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
local dMinOvmHeadForHorizontalCuts = 10.123
|
||||
local bAreHorizontalCutsNeeded = ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dOvmHead > dMinOvmHeadForHorizontalCuts - 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 nForceWorkSide = MCH_MILL_WS.LEFT
|
||||
local bForceInvert = true
|
||||
local nForceSCC = MCH_SCC.ADIR_XP
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, '', b3Raw, bForceInvert, nForceWorkSide, nForceSCC)
|
||||
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
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
|
||||
else
|
||||
-- verifico esistenza della lavorazione con lama da sotto
|
||||
if not sCutting2 then
|
||||
local sErr = 'Error : cutting H2 not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- verifico che le due lame riescano a lavorare la sezione
|
||||
local dDimZ = b3Raw:getDimZ()
|
||||
local dExtra = dMaxVertDepth + dMaxDepth2 - dDimZ
|
||||
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not bBigSectionCut then
|
||||
local sErr = 'Error : section too big for head cut'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- calcolo extra taglio ed accorciamento
|
||||
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||
local dAccStart = 0
|
||||
local dVzLimDwnUp
|
||||
if BD.TURN then dVzLimDwnUp = -2 end
|
||||
-- eseguo i tagli da sotto necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- eseguo i tagli da sopra necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
return bOk, sErr
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
return ProcessHeadCut
|
||||
|
||||
+2236
-355
File diff suppressed because it is too large
Load Diff
+106
-60
@@ -1,4 +1,4 @@
|
||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2023/05/19
|
||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2023/08/01
|
||||
-- Gestione calcolo taglio longitudinale per Travi
|
||||
-- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale.
|
||||
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
||||
@@ -28,6 +28,14 @@
|
||||
-- 2023/04/17 Gestione unificata SCC tramite funzione apposita GetSCC
|
||||
-- 2023/05/03 Corretto SCC in caso di asse utensile allineato con Z.
|
||||
-- 2023/05/19 Migliorato calcolo e verifica affondamento per lavorazione con lama con codolo in mezzo.
|
||||
-- 2023/08/01 Ammesso uso lama da sotto fino a N +3deg in verticale.
|
||||
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||
-- 2023/10/24 Migliorata spezzatura taglio passante con due spezzoni
|
||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||
-- 2024/01/22 Implementata gestione seghe a catena multiple.
|
||||
-- 2024/05/09 In Make, allungamento percorso ingresso per evitare collisioni durante approccio pezzo quando si setta OutRaw=3
|
||||
-- In Make, se non trova fresa per pulizia, da messaggio di warning anziché di errore
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLongCut = {}
|
||||
@@ -287,7 +295,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
-- laterale sul punto medio della linea in comune
|
||||
local frFc = Frame3d( ptPm, vtN) ;
|
||||
local b3BoxLoc = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frFc)
|
||||
dDepth = b3BoxLoc:getDimZ() or 0
|
||||
local dDepth = b3BoxLoc:getDimZ() or 0
|
||||
-- recupero i dati dell'utensile
|
||||
local dSawDiam = 400
|
||||
local dSawThick = 0
|
||||
@@ -436,7 +444,7 @@ end
|
||||
-- Applicazione della lavorazione
|
||||
local function MakeByPocketing( Proc, nPhase, nRawId, nPartId)
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||
-- cerco la svuotatura opportuna
|
||||
local sPocketing = ML.FindPocketing( 'OpenPocket', Proc.Box:getDimX())
|
||||
if not sPocketing then
|
||||
@@ -495,11 +503,16 @@ end
|
||||
-- lavorazione faccia laterale con sega a catena
|
||||
local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal, bShortenStart, bShortenEnd)
|
||||
-- Recupero i dati dell'utensile
|
||||
local sSawing = ML.FindSawing( 'Sawing')
|
||||
local sSawing = ML.FindSawing( 'Sawing', dDepth, true)
|
||||
-- se non trovo alcuna sega a catena lunga a sufficienza, accetto di non arrivare sul fondo
|
||||
if not sSawing then
|
||||
sSawing = ML.FindSawing( 'Sawing', nil, nil, 'Longest')
|
||||
end
|
||||
local dMaxMat = 0
|
||||
local dSawCornerRad = 0
|
||||
local dSawThick = 0
|
||||
local dSawDiameter = 0
|
||||
local sWarn
|
||||
-- se non trova una lavorazione di sawing esco
|
||||
if not sSawing then
|
||||
local sErr = 'Error : Sawing not found in library'
|
||||
@@ -530,7 +543,7 @@ local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal, bShor
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_DOWN
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- imposto angolo 3° asse rot
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1))
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'perpendicular'))
|
||||
local vtN = EgtSurfTmFacetNormVersor( nSurfId, 0, GDB_ID.ROOT)
|
||||
local vtOrtho = BL.GetVersRef( nFaceUse)
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
|
||||
@@ -568,7 +581,7 @@ local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal, bShor
|
||||
return false, sErr
|
||||
end
|
||||
-- impostazione alternativa angolo 3° asse rot
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2))
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'parallel'))
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2))
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -591,6 +604,11 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- recupero l'ingombro del grezzo di appartenenza
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
|
||||
-- recupero lunghezza grezzo totale da info sulla macchinata
|
||||
local dBarLen = EgtGetInfo( EgtGetCurrMachGroup(), 'BARLEN', 'd')
|
||||
local dOvmHead = b3Raw:getMax():getX() - b3Solid:getMax():getX()
|
||||
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
local _, dLen, dWidth = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_ID.ROOT)
|
||||
@@ -647,6 +665,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
-- leggo il parametro Q05 solo se è una vera longcut L010
|
||||
elseif ProcessLongCut.Identify( Proc) then
|
||||
nUseBlade = EgtGetInfo( Proc.Id, 'Q05', 'i') or 0
|
||||
-- funzionamento Q05 --
|
||||
-- 0: fresa; 1: lama solo se feature passante, faccia verso l'alto; 2: lama solo se feature passante, qualunque orientamento faccia; 3: lama con feature sia cieca che passante, faccia verso l'alto, lavorazione non rovina pezzo successivo; 4: lama con feature sia cieca che passante, qualunque orientamento faccia, lavorazione non rovina pezzo successivo
|
||||
end
|
||||
local bForceUseBladeOnNotThruFace
|
||||
if nCustForceUseBladeOnNCF then
|
||||
@@ -694,8 +714,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= -0.5 then
|
||||
bCanUseUnderBlade = true
|
||||
end
|
||||
-- se faccia da sotto o di lato ma con versore Z sotto l'orizzontale abilito la lavorazione con lame mixate
|
||||
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= 0.0175 then
|
||||
-- se faccia da sotto o di lato ma con versore Z sotto l'orizzontale abilito la lavorazione con lame mixate (limite 3 deg verso alto)
|
||||
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= 0.053 then
|
||||
bCanUseUnderBlade = true
|
||||
end
|
||||
-- se faccia da sopra o di lato ma con versore Z negativo verifico che abbia un angolo compatibile (28deg) per non avere extracorsa
|
||||
@@ -949,61 +969,60 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
if bForceUseBladeOnNotThruFace and ( bLimXmin or bLimXmax) then
|
||||
local nCountMilHead = 0
|
||||
-- determino la massima elevazione
|
||||
local dElev = BL.GetFaceElevation( Proc.Id, 0, nPartId)
|
||||
local dElev = BL.GetFaceElevation( Proc, 0, b3Solid)
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'Long2Cut_H2', dElev, nil, nil, nil, not bCanUseUnderBlade, bCanUseUnderBlade)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling Long2Cut (_H2) not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dToolDiam = 0
|
||||
local dMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
if sMilling then
|
||||
-- recupero i dati dell'utensile
|
||||
local dToolDiam = 0
|
||||
local dMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se ho facce di chiusura, per prima cosa faccio antischeggia
|
||||
-- come richiesto da Fabio Squaratti il 03/09/2021
|
||||
if ( bLimXmin and not bForcedLim) or bLimXmax then
|
||||
local bOk, nFacet
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, (( bLimXmin and not bForcedLim) and bLimXmax), vtN, nFacet, 0, sWarn, bCanUseUnderBlade, nil, sCutting)
|
||||
if not bOk then return false, sWarn end
|
||||
end
|
||||
-- eventuale lavorazione della faccia limitante l'inizio
|
||||
if not bStartFixed then
|
||||
local vtIni = -X_AX()
|
||||
for j = 1, Proc.Fct - 1 do
|
||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
||||
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
|
||||
-- se ho facce di chiusura, per prima cosa faccio antischeggia
|
||||
-- come richiesto da Fabio Squaratti il 03/09/2021
|
||||
if ( bLimXmin and not bForcedLim) or bLimXmax then
|
||||
local bMadeASbyBld, bOk, nFacet
|
||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, (( bLimXmin and not bForcedLim) and bLimXmax), vtN, nFacet, 0, sWarn, bCanUseUnderBlade, nil, sCutting)
|
||||
if not bOk then return false, sWarn end
|
||||
end
|
||||
-- eventuale lavorazione della faccia limitante l'inizio
|
||||
if not bStartFixed then
|
||||
local vtIni = -X_AX()
|
||||
for j = 1, Proc.Fct - 1 do
|
||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
||||
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
|
||||
nCountMilHead = nCountMilHead + 1
|
||||
end
|
||||
end
|
||||
if bForcedLim and nCountMilHead < 1 then
|
||||
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
|
||||
nCountMilHead = nCountMilHead + 1
|
||||
end
|
||||
end
|
||||
if bForcedLim and nCountMilHead < 1 then
|
||||
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
|
||||
nCountMilHead = nCountMilHead + 1
|
||||
end
|
||||
end
|
||||
|
||||
-- eventuale lavorazione della faccia limitante la fine
|
||||
if not bEndFixed then
|
||||
local vtFin = X_AX()
|
||||
for j = 1, Proc.Fct - 1 do
|
||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
||||
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade)
|
||||
-- eventuale lavorazione della faccia limitante la fine
|
||||
if not bEndFixed then
|
||||
local vtFin = X_AX()
|
||||
for j = 1, Proc.Fct - 1 do
|
||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
||||
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade)
|
||||
nCountMilHead = nCountMilHead + 1
|
||||
end
|
||||
end
|
||||
if bForcedLim and nCountMilHead < 2 then
|
||||
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade)
|
||||
nCountMilHead = nCountMilHead + 1
|
||||
end
|
||||
end
|
||||
if bForcedLim and nCountMilHead < 2 then
|
||||
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade)
|
||||
nCountMilHead = nCountMilHead + 1
|
||||
end
|
||||
else
|
||||
sWarn = 'Warning: milling Long2Cut (_H2) not found in library'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1167,6 +1186,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
|
||||
-- imposto posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto angolo 3° asse rot
|
||||
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( EgtIf( bIsTopBladeCurrent, sCutting, sCuttingDn), 'perpendicular', b3Raw, vtN, vtOut))
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -1195,11 +1217,10 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
if not bChainSawOk then return false, sErr end
|
||||
end
|
||||
end
|
||||
|
||||
-- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut
|
||||
elseif ( nSide ~= - 1 or BD.DOWN_HEAD) and nUseMillOnSide == 0 then
|
||||
-- determino la massima elevazione
|
||||
local dElev = BL.GetFaceElevation( Proc.Id, 0, nPartId)
|
||||
local dElev = BL.GetFaceElevation( Proc, 0, b3Solid)
|
||||
-- recupero la lavorazione
|
||||
local bDownHead = ( nSide == - 1)
|
||||
sMchType = EgtIf( bDownHead, 'Long2Cut_H2', 'Long2Cut')
|
||||
@@ -1309,8 +1330,18 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
dEndAccDist = min( dEndAccDist, dLen/2)
|
||||
dStartAccDist = dLen - dEndAccDist
|
||||
else
|
||||
dStartAccDist = dLen/2
|
||||
dEndAccDist = dStartAccDist
|
||||
-- se c'è del grezzo aggiuntivo e, considerando il grezzo mi resta abbastanza materiale per pinzare, allora faccio spezzatura asimmetrica
|
||||
if BD.MIN_CLAMPING_LEN and ( dBarLen - dLen) > dOvmHead + 100 * GEO.EPS_SMALL and ( dBarLen - dStartAccDist > BD.MIN_CLAMPING_LEN) then
|
||||
dStartAccDist = dBarLen/2
|
||||
dEndAccDist = dLen - dStartAccDist
|
||||
-- se sono sul fronte, la spezzatura assimmetrica è inversa
|
||||
if Proc.AffectedFaces.Front then
|
||||
dStartAccDist, dEndAccDist = dEndAccDist, dStartAccDist
|
||||
end
|
||||
else
|
||||
dStartAccDist = dLen/2
|
||||
dEndAccDist = dStartAccDist
|
||||
end
|
||||
end
|
||||
else
|
||||
nC = 1
|
||||
@@ -1359,9 +1390,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, 0}})
|
||||
|
||||
-- inverto se utensile antiorario per garantire senso di percorrenza migliore
|
||||
local bInvert = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) > 0
|
||||
-- setto workside e eventuale inversione
|
||||
local bInvert
|
||||
if bInvert then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
@@ -1396,6 +1427,21 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
if k < nO then
|
||||
local sNotes = 'OutRaw=3;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
-- aumento ingresso su spezzoni per evitare collisione durante approccio pezzo
|
||||
if bFront then
|
||||
-- se invertito si allunga ingresso su tutti tranne su ultimo
|
||||
if bInvert and i ~= nC then
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, ( nO - k) * dStep + 10)
|
||||
-- se non invertito si allunga solo il primo
|
||||
elseif not bInvert and i == 1 then
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, ( nO - k) * dStep + 10)
|
||||
end
|
||||
else
|
||||
-- se invertito si allunga ingresso su tutti
|
||||
if bInvert then
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, ( nO - k) * dStep + 10)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
@@ -1533,7 +1579,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
||||
local dDistToEnd = dToolDiam / 2
|
||||
local dDistToEndDn = dToolDiamDn / 2
|
||||
-- calcolo l'elevazione della faccia principale
|
||||
local dFacElev = BL.GetFaceElevation( Proc.Id, 0, nPartId)
|
||||
local dFacElev = BL.GetFaceElevation( Proc, 0, b3Solid)
|
||||
-- se fresa di fianco o da sotto calcolo quanto l'utensile può andare vicino all'estremo con l'elevazione della faccia minore del raggio utensile
|
||||
if ( nUseMillOnSide <= 1 or nSide == -1) and dFacElev < dToolDiam / 2 then
|
||||
dDistToEnd = sqrt( dFacElev * ( dToolDiam - dFacElev))
|
||||
|
||||
@@ -18,6 +18,12 @@
|
||||
-- 2023/03/06 Correzione per i casi con lavorazione limitata.
|
||||
-- 2023/03/23 Correzione per caso con doppia lama da sotto.
|
||||
-- 2023/06/07 Sistemazione SCC per macchina TURN
|
||||
-- 2023/10/24 Migliorata spezzatura taglio passante con due spezzoni
|
||||
-- 2023/10/25 Se effettivamente un taglio longitudinale e lama non taglia completamente, limito la lavorazione. Altrimenti esco.
|
||||
-- 2023/11/24 Aggiunta Q05 per utilizzo lama anche in feature cieche conme per LongCut.
|
||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||
-- 2024/03/21 Corretto parametro passato a funzione BL.GetBlockedAxis. Ora tiene in considerazione anche testa sotto
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessLong2Cut = {}
|
||||
@@ -31,6 +37,7 @@ EgtOutLog( ' ProcessLongDoubleCut started', 1)
|
||||
-- Dati
|
||||
local BD = require( 'BeamData')
|
||||
local ML = require( 'MachiningLib')
|
||||
local Topology = require( 'FeatureTopology')
|
||||
|
||||
local dLimMinPiece = BD.LEN_SHORT_PART or 1000
|
||||
|
||||
@@ -279,9 +286,11 @@ local function CalcBladeUse( bUseBlade, bDown_Head, nSide, vtN1, vtN2, bConvex,
|
||||
end
|
||||
end
|
||||
else
|
||||
if ( vtN1 and vtN1:getZ() >= EgtIf( dCustomAngle, dCustomAngle, -0.5)) and ( not vtN2 or vtN2:getZ() >= -0.5) then
|
||||
bCanUseBlade = true
|
||||
end
|
||||
--if ( vtN1 and vtN1:getZ() >= EgtIf( dCustomAngle, dCustomAngle, -0.5)) and ( not vtN2 or vtN2:getZ() >= -0.5) then
|
||||
-- bCanUseBlade = true
|
||||
--end
|
||||
-- viene abilitata sempre lama da sotto
|
||||
bCanUseBlade = true
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -311,12 +320,20 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster, nUseSideToolMaster)
|
||||
|
||||
-- recupero l'ingombro del grezzo di appartenenza
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
-- carico i dati delle face già inserite nelle opportune tabelle
|
||||
local nFaceLimit, tFaceLong, ptC, vtN = IdentifyFaces( Proc)
|
||||
local dLen = Proc.Box:getDimX()
|
||||
|
||||
-- inizializzazione tabella con eventuali lavorazioni create a posteriori da ritornare al chiamante
|
||||
local AddedIds = {}
|
||||
|
||||
-- recupero lunghezza grezzo totale da info sulla macchinata
|
||||
local dBarLen = EgtGetInfo( EgtGetCurrMachGroup(), 'BARLEN', 'd')
|
||||
local dOvmHead = b3Raw:getMax():getX() - b3Solid:getMax():getX()
|
||||
|
||||
-- verifico posizione (+1=sopra, -1=sotto, 0=sui lati)
|
||||
local nSide = 0
|
||||
if vtN[1]:getZ() > 0.0175 and vtN[2]:getZ() > 0.0175 then
|
||||
@@ -360,11 +377,28 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
----------------------------------------------------------------------------------------------------------------------------------------
|
||||
local bUseBlade
|
||||
local nUseMillOnSide
|
||||
local bForceUseBladeOnNotThruFace
|
||||
-- se presenti utilizzo i parametri dell'eventuale lua "padre"
|
||||
if bForcedBladeMaster ~= nil then
|
||||
bUseBlade = bForcedBladeMaster
|
||||
else
|
||||
bUseBlade = EgtGetInfo( Proc.Id, 'Q01', 'i') == 1
|
||||
local nUseBlade = EgtGetInfo( Proc.Id, 'Q05', 'i')
|
||||
-- funzionamento Q05 --
|
||||
-- 0: fresa; 1: lama solo se feature passante, faccia verso l'alto; 2: lama solo se feature passante, qualunque orientamento faccia; 3: lama con feature sia cieca che passante, faccia verso l'alto, lavorazione non rovina pezzo successivo; 4: lama con feature sia cieca che passante, qualunque orientamento faccia, lavorazione non rovina pezzo successivo
|
||||
-- feature passante
|
||||
if nFaceLimit == 0 then
|
||||
if nUseBlade == 2 or nUseBlade == 4 or
|
||||
( nSide == 1 and ( nUseBlade == 1 or nUseBlade == 3)) then
|
||||
bUseBlade = true
|
||||
end
|
||||
-- feature cieca
|
||||
else
|
||||
if nUseBlade == 4 or
|
||||
( nSide == 1 and ( nUseBlade == 3)) then
|
||||
bUseBlade = true
|
||||
bForceUseBladeOnNotThruFace = true
|
||||
end
|
||||
end
|
||||
end
|
||||
if nUseSideToolMaster ~= nil then
|
||||
nUseMillOnSide = nUseSideToolMaster
|
||||
@@ -391,12 +425,22 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- analisi del taglio
|
||||
local vOrd = {}
|
||||
local vFaceUse = {}
|
||||
local bIsMachDownUp = false
|
||||
if nSide == 1 or ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN)) then
|
||||
vOrd = EgtIf( ptC[1]:getY() < ptRef:getY(), { 1, 2}, { 2, 1})
|
||||
vFaceUse = { BL.GetNearestOrthoOpposite( ptC[1] - ptM), BL.GetNearestOrthoOpposite( ptC[2] - ptM)}
|
||||
elseif nSide == -1 then
|
||||
vOrd = EgtIf( ptC[1]:getY() < ptRef:getY(), { 1, 2}, { 2, 1})
|
||||
vFaceUse = { BL.GetNearestParalOpposite( ptC[1] - ptM), BL.GetNearestParalOpposite( ptC[2] - ptM)}
|
||||
local vtFaceUse1, vtFaceUse2
|
||||
if bCanUseBlade and not BD.DOWN_HEAD then
|
||||
bIsMachDownUp = true
|
||||
vtFaceUse1 = BL.GetOrtupOpposite( BL.GetNearestOrthoOpposite( ptC[1] - ptM))
|
||||
vtFaceUse2 = BL.GetOrtupOpposite( BL.GetNearestOrthoOpposite( ptC[2] - ptM))
|
||||
else
|
||||
vtFaceUse1 = BL.GetNearestParalOpposite( ptC[1] - ptM)
|
||||
vtFaceUse2 = BL.GetNearestParalOpposite( ptC[2] - ptM)
|
||||
end
|
||||
vFaceUse = { vtFaceUse1, vtFaceUse2}
|
||||
else
|
||||
local bFront = ( ( vtN[1]:getY() + vtN[2]:getY()) < 0)
|
||||
if bFront then
|
||||
@@ -410,9 +454,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local vWidth = {}
|
||||
_, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[1])
|
||||
_, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[2])
|
||||
local vElevation = { vWidth[2], vWidth[1]}
|
||||
|
||||
-- Se senza facce limitanti, da sopra o ( da tutte i lati con testa da sotto) e taglio di lama e lunghezza facce maggiore del parametro lunghezza minima
|
||||
if nFaceLimit == 0 and ( bCanUseUnderBlade or bCanUseBlade) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then
|
||||
-- Se da sopra o ( da tutte i lati con testa da sotto) e taglio di lama e lunghezza facce maggiore del parametro lunghezza minima
|
||||
if ( bCanUseUnderBlade or bCanUseBlade) and bUseBlade and Proc.Box:getDimX() > dLimMinPiece - 1 then
|
||||
|
||||
local sCutting
|
||||
local dToolDiam = 0
|
||||
@@ -458,23 +503,36 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se la distanza dal pezzo successivo è inferiore della metà lama, do un warning
|
||||
if ( bCanUseBlade or bCanUseUnderBlade) and ( dDistToNextPiece < dToolDiam/2 or dDistToNextPiece < dToolDiamDn/2) then
|
||||
sWarn = 'Warning : Cut machining can damage next piece'
|
||||
EgtOutLog( sWarn)
|
||||
-- se la fine (a sinistra) non è limitata e ho un pezzo successivo o grezzo riutilizzabile meno distante di metà raggio, setto la fine come limitata
|
||||
if (( bCanUseBlade or bCanUseUnderBlade) and ( dDistToNextPiece < dToolDiam/2 or dDistToNextPiece < dToolDiamDn/2)) and nFaceLimit < 2 then
|
||||
if bForceUseBladeOnNotThruFace then
|
||||
nFaceLimit = nFaceLimit | 2
|
||||
bForcedLim = true
|
||||
else
|
||||
sWarn = 'Warning on saw cut : Cut machining can damage next piece'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
end
|
||||
-- determino gli estremi
|
||||
local dStartAccDist
|
||||
local dEndAccDist
|
||||
local bStartFixed
|
||||
local bEndFixed
|
||||
local dStartDist
|
||||
local dEndDist
|
||||
local dStartDistUp = 0
|
||||
local dEndDistUp = 0
|
||||
local dStartDistDn = 0
|
||||
local dEndDistDn = 0
|
||||
local dStartAccDistUp = BD.LONGCUT_ENDLEN
|
||||
local dEndAccDistUp = BD.LONGCUT_ENDLEN
|
||||
local dStartAccDistDn = BD.LONGCUT_ENDLEN
|
||||
local dEndAccDistDn = BD.LONGCUT_ENDLEN
|
||||
local nC
|
||||
local dC
|
||||
|
||||
local dC
|
||||
local nCUp
|
||||
local dCUp
|
||||
|
||||
-- determino numero di parti
|
||||
if bCanUseBlade then
|
||||
nCUp = ceil( ( dLen - dStartAccDistUp - dEndAccDistUp) / BD.LONGCUT_MAXLEN)
|
||||
@@ -562,7 +620,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local nFaceUse
|
||||
local nFaceUse
|
||||
local nFaceUse2
|
||||
-- se ho solo lama da sotto
|
||||
if bCanUseUnderBlade and not bCanUseBlade then
|
||||
@@ -590,8 +648,47 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
elseif vtN[vOrd[j]]:getZ() < -0.707 then
|
||||
nFaceSide = -1
|
||||
end
|
||||
-- ricavo box della faccia
|
||||
-- ricavo informazioni della faccia
|
||||
local b3Fac = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vOrd[j]-1, GDB_BB.STANDARD)
|
||||
-- determino accorciamenti se lavorazione cieca
|
||||
if bForceUseBladeOnNotThruFace then
|
||||
if bCanUseBlade then
|
||||
bStartFixed = true
|
||||
-- limitato a destra
|
||||
if ( nFaceLimit & 1) ~= 0 then
|
||||
local dRadius = dToolDiam / 2
|
||||
local dCat1 = dRadius - dOffset
|
||||
dStartDistUp = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1))
|
||||
bStartFixed = false
|
||||
end
|
||||
bEndFixed = true
|
||||
-- limitato a sinistra
|
||||
if ( nFaceLimit & 2) ~= 0 then
|
||||
local dRadius = dToolDiam / 2
|
||||
local dCat1 = dRadius - dOffset
|
||||
dEndDistUp = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1))
|
||||
bEndFixed = false
|
||||
end
|
||||
end
|
||||
if bCanUseUnderBlade then
|
||||
bStartFixed = true
|
||||
-- limitato a destra
|
||||
if ( nFaceLimit & 1) ~= 0 then
|
||||
local dRadius = dToolDiamDn / 2
|
||||
local dCat1 = dRadius - dOffset
|
||||
dStartDistDn = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1))
|
||||
bStartFixed = false
|
||||
end
|
||||
bEndFixed = true
|
||||
-- limitato a sinistra
|
||||
if ( nFaceLimit & 2) ~= 0 then
|
||||
local dRadius = dToolDiamDn / 2
|
||||
local dCat1 = dRadius - dOffset
|
||||
dEndDistDn = sqrt( ( dRadius * dRadius) - (dCat1 * dCat1))
|
||||
bEndFixed = false
|
||||
end
|
||||
end
|
||||
end
|
||||
-- ciclo sulle passate
|
||||
for k = 1, 2 do
|
||||
local dLioPerp = ( vWidth[vOrd[j]] - dDimStrip) / 2 + BD.CUT_SIC
|
||||
@@ -608,6 +705,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- setto le variabili delle distanze dagli estremi
|
||||
dEndAccDist = dEndAccDistUp
|
||||
dStartAccDist = dStartAccDistUp
|
||||
dStartDist = dStartDistUp
|
||||
dEndDist = dEndDistUp
|
||||
elseif bCanUseUnderBlade and not bCanUseBlade then
|
||||
sNameF = 'L2CD_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring(j) .. '_' .. tostring( nM)
|
||||
nMchFId = EgtAddMachining( sNameF, sCuttingDn)
|
||||
@@ -615,6 +714,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- setto le variabili delle distanze dagli estremi
|
||||
dEndAccDist = dEndAccDistDn
|
||||
dStartAccDist = dStartAccDistDn
|
||||
dStartDist = dStartDistDn
|
||||
dEndDist = dEndDistDn
|
||||
bMachDown = true
|
||||
-- entrambe le possibilità di lama
|
||||
else
|
||||
@@ -627,6 +728,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- setto le variabili delle distanze dagli estremi
|
||||
dEndAccDist = dEndAccDistDn
|
||||
dStartAccDist = dStartAccDistDn
|
||||
dStartDist = dStartDistDn
|
||||
dEndDist = dEndDistDn
|
||||
bMachDown = true
|
||||
-- se di fronte e prima faccia o dietro e seconda faccia, sta lavorando quella più in basso in Z (posizione)
|
||||
elseif ( ( bFront and j == 1) or ( not bFront and j == 2)) and k == 2 then
|
||||
@@ -636,6 +739,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- setto le variabili delle distanze dagli estremi
|
||||
dEndAccDist = dEndAccDistDn
|
||||
dStartAccDist = dStartAccDistDn
|
||||
dStartDist = dStartDistDn
|
||||
dEndDist = dEndDistDn
|
||||
bMachDown = true
|
||||
-- se di fronte e seconda faccia o dietro e prima faccia, sta lavorando la faccia più in alto in Z (posizione)
|
||||
elseif ( ( bFront and j == 2) or ( not bFront and j == 1)) and k == 1 then
|
||||
@@ -645,6 +750,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- setto le variabili delle distanze dagli estremi
|
||||
dEndAccDist = dEndAccDistUp
|
||||
dStartAccDist = dStartAccDistUp
|
||||
dStartDist = dStartDistUp
|
||||
dEndDist = dEndDistUp
|
||||
-- se di fronte e seconda faccia o dietro e prima faccia, sta lavorando la faccia più in alto in Z (posizione)
|
||||
elseif ( ( bFront and j == 2) or ( not bFront and j == 1)) and k == 2 then
|
||||
sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring(j) .. '_' .. tostring( nM)
|
||||
@@ -653,6 +760,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- setto le variabili delle distanze dagli estremi
|
||||
dEndAccDist = dEndAccDistUp
|
||||
dStartAccDist = dStartAccDistUp
|
||||
dStartDist = dStartDistUp
|
||||
dEndDist = dEndDistUp
|
||||
end
|
||||
end
|
||||
if not nMchFId then
|
||||
@@ -700,8 +809,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
|
||||
-- settaggio di workside, uso faccia e eventuale inversione
|
||||
-- limito opportunamente la lavorazione
|
||||
local dSalInner, dSalOuter = - dEndAccDist - ( i - 2) * dC, 0
|
||||
local dEalInner, dEalOuter = - dStartAccDist - ( nC - i - 1) * dC, 0
|
||||
local dSalInner, dSalOuter = - dEndAccDist - ( i - 2) * dC, -dEndDist
|
||||
local dEalInner, dEalOuter = - dStartAccDist - ( nC - i - 1) * dC, -dStartDist
|
||||
local dSal = EgtIf( i == 1, dSalOuter, dSalInner)
|
||||
local dEal = EgtIf( i == nC, dEalOuter, dEalInner)
|
||||
if ( bFront and k == 1) or ( not bFront and k == 2) then
|
||||
@@ -742,17 +851,19 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
|
||||
-- recupero alcune informazioni utili dalla lavorazione attuale
|
||||
local bIsCurrentBladeCCW
|
||||
local sCuttingNameMach
|
||||
if bIsTopBladeCurrent then
|
||||
EgtMdbSetCurrMachining( sCutting)
|
||||
sCuttingNameMach = sCutting
|
||||
else
|
||||
EgtMdbSetCurrMachining( sCuttingDn)
|
||||
sCuttingNameMach = sCuttingDn
|
||||
end
|
||||
EgtMdbSetCurrMachining( sCuttingNameMach)
|
||||
bIsCurrentBladeCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
|
||||
|
||||
-- imposto la direzione di lavoro per avere scarico del truciolo ottimale
|
||||
local nWorkSide, bInvert
|
||||
if ( not bIsTopBladeCurrent and abs( nSide) ~= 0) or ( bCanUseBlade and bCanUseUnderBlade and nSide == -1) then
|
||||
if bIsCurrentBladeCCW then
|
||||
if bIsCurrentBladeCCW and not bIsMachDownUp then
|
||||
nWorkSide = MCH_MILL_WS.LEFT
|
||||
bInvert = true
|
||||
dSal, dEal = dEal, dSal
|
||||
@@ -761,7 +872,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
bInvert = false
|
||||
end
|
||||
else
|
||||
if bIsCurrentBladeCCW then
|
||||
if bIsCurrentBladeCCW and not bIsMachDownUp then
|
||||
nWorkSide = MCH_MILL_WS.LEFT
|
||||
bInvert = false
|
||||
else
|
||||
@@ -787,6 +898,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
|
||||
-- imposto posizione braccio porta testa per non ingombrare agli estremi
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto angolo 3° asse rot
|
||||
local vtOut = EgtIf( vtN[vOrd[j]]:getX() > 0, X_AX(), -X_AX())
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCuttingNameMach, 'perpendicular', b3Raw, vtN, vtOut))
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -809,6 +923,43 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eventuali puliture impronta lama
|
||||
for j = 1, #vOrd do
|
||||
if bForceUseBladeOnNotThruFace then
|
||||
-- determino la massima elevazione
|
||||
local dElev = 0
|
||||
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[1], b3Solid)
|
||||
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[2], b3Solid)
|
||||
dElev = max( dFacElev1, dFacElev2)
|
||||
-- recupero la lavorazione
|
||||
local sMilling
|
||||
local bDownHead = ( nSide == -1 and BD.DOWN_HEAD)
|
||||
sMilling = ML.FindMilling( 'Long2Cut', dElev, nil, nil, nil, not bDownHead, bDownHead)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Long2Cut not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dToolDiam = 0
|
||||
local dMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
-- eventuale lavorazione della faccia limitante l'inizio (a destra)
|
||||
if not bStartFixed then
|
||||
MakeSideFace( Proc.Id, tFaceLong[vOrd[j]], 1, j, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown)
|
||||
end
|
||||
-- eventuale lavorazione della faccia limitante la fine (a sinistra)
|
||||
if not bEndFixed then
|
||||
MakeSideFace( Proc.Id, tFaceLong[vOrd[j]], -1, j, sMilling, dToolDiam, nSide, bIsAnyFaceUpsideDown)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- altrimenti concavo
|
||||
else
|
||||
-- si percorrono i lati alto e basso della faccia
|
||||
@@ -840,6 +991,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
|
||||
@@ -851,16 +1018,27 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
-- ciclo sulle passate
|
||||
local dOffset
|
||||
local dLioPerp
|
||||
|
||||
if j == 1 then -- il primo taglio lo faccio completo se angolo interno maggiore di 90
|
||||
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0)
|
||||
-- se la faccia è più grande del massimo materiale lama, allora limito lavorazione
|
||||
if dMinOffsBigFace > 0 then
|
||||
dOffset = dMinOffsBigFace
|
||||
-- se angolo interno inferiore di 90° calcolo l'arretramento della lama + un piccolo delta di 0.3
|
||||
if dAng < - ( 90 + 10 * GEO.EPS_SMALL) then
|
||||
elseif dAng < - ( 90 + 10 * GEO.EPS_SMALL) then
|
||||
dOffset = 0.3 + ((dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len()
|
||||
else
|
||||
dOffset = 0
|
||||
end
|
||||
dLioPerp = vWidth[vOrd[j]] + BD.CUT_SIC
|
||||
else -- il secondo ridotto della distanza minima e della componente spessore della lama
|
||||
dOffset = dDimStrip + ((dToolThick* vtN[vOrd[1]]) - (dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len()
|
||||
local dMinOffsBigFace = max( vWidth[vOrd[j]] - dCheckDepth, 0)
|
||||
-- se la faccia è più grande del massimo materiale lama, allora limito lavorazione
|
||||
if dMinOffsBigFace > 0 then
|
||||
dOffset = dMinOffsBigFace
|
||||
else
|
||||
dOffset = dDimStrip + ((dToolThick* vtN[vOrd[1]]) - (dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len()
|
||||
end
|
||||
dLioPerp = vWidth[vOrd[j]] - dOffset + BD.CUT_SIC
|
||||
end
|
||||
local dLioTang = 0
|
||||
@@ -901,6 +1079,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
if nSide == -1 and BD.DOWN_HEAD then
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
|
||||
elseif nSide == -1 and not BD.DOWN_HEAD and bIsMachDownUp then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( EgtGetMachiningParam( MCH_MP.INVERT), false, true))
|
||||
dOffset = 5
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||
@@ -913,9 +1096,27 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, dLioTang)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
|
||||
-- imposto posizione braccio porta testa per non ingombrare agli estremi
|
||||
local ptP1LineToMachine, _, ptP2LineToMachine = EgtSurfTmFacetOppositeSide( Proc.Id, vOrd[j] - 1, BL.GetVersRef( vFaceUse[vOrd[j]]), GDB_ID.ROOT)
|
||||
local vtTg = ptP2LineToMachine - ptP1LineToMachine ; vtTg:normalize()
|
||||
local bIsMachiningInverted = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
if bIsMachiningInverted then
|
||||
vtTg = -vtTg
|
||||
end
|
||||
if BD.C_SIMM then
|
||||
if abs( vtN[vOrd[j]]:getX()) < GEO.EPS_SMALL then
|
||||
nSCC = EgtIf( ( vtTg:getX() > GEO.EPS_SMALL), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
else
|
||||
nSCC = MCH_SCC.NONE
|
||||
end
|
||||
else
|
||||
nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- determino e imposto l'utilizzo della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse[vOrd[j]])
|
||||
-- imposto angolo 3° asse rot
|
||||
local vtOut = EgtIf( vtN[vOrd[j]]:getX() > 0, X_AX(), -X_AX())
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( EgtIf( bCanUseUnderBlade, sCuttingDn, sCutting), 'perpendicular', b3Raw, vtN, vtOut))
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -930,9 +1131,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
elseif ( nSide ~= -1 or BD.DOWN_HEAD or BD.TURN) and nUseMillOnSide == 0 then
|
||||
-- determino la massima elevazione
|
||||
local dElev = 0
|
||||
local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[1], nPartId)
|
||||
local dFacElev2 = BL.GetFaceElevation( Proc.Id, tFaceLong[2], nPartId)
|
||||
-- 03/12/2020
|
||||
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[1], b3Solid)
|
||||
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[2], b3Solid)
|
||||
-- se facce concave e a 90 gradi, prendo l'elevazione minima
|
||||
if bOrtho then
|
||||
dElev = min( dFacElev1, dFacElev2)
|
||||
@@ -1048,8 +1248,14 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
dEndAccDist = min( dEndAccDist, dLen/2)
|
||||
dStartAccDist = dLen - dEndAccDist
|
||||
else
|
||||
dStartAccDist = dLen/2
|
||||
dEndAccDist = dStartAccDist
|
||||
-- se c'è del grezzo aggiuntivo e, considerando il grezzo mi resta abbastanza materiale per pinzare, allora faccio spezzatura asimmetrica
|
||||
if BD.MIN_CLAMPING_LEN and ( dBarLen - dLen) > dOvmHead + 100 * GEO.EPS_SMALL and ( dBarLen - dStartAccDist > BD.MIN_CLAMPING_LEN) then
|
||||
dStartAccDist = dBarLen/2
|
||||
dEndAccDist = dLen - dStartAccDist
|
||||
else
|
||||
dStartAccDist = dLen/2
|
||||
dEndAccDist = dStartAccDist
|
||||
end
|
||||
end
|
||||
else
|
||||
nC = 1
|
||||
@@ -1089,12 +1295,18 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
if Proc.bMoveAfterSplit then
|
||||
nC = 1
|
||||
dStartDist = Proc.Box:getDimX() - ( dToolDiam / 2 + 5)
|
||||
dEndDist = - ( dToolDiam / 2 + 5)
|
||||
end
|
||||
if nIni == 2 then
|
||||
dStartDist, dEndDist = dEndDist, dStartDist
|
||||
dStartAccDist, dEndAccDist = dEndAccDist, dStartAccDist
|
||||
end
|
||||
-- ciclo sulle parti
|
||||
local nM = 0
|
||||
local bInverted = false
|
||||
for j = 1, nC do
|
||||
-- su entrambe le facce
|
||||
for i = nIni, nFin do
|
||||
@@ -1118,6 +1330,9 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
if nSide == 1 or nSide == -1 then
|
||||
local bFromYM = (( vtN[vOrd[i]]:getY() < 0 and bConvex) or ( vtN[vOrd[i]]:getY() > 0 and not bConvex))
|
||||
nSCC = EgtIf( bFromYM, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
||||
if BD.TURN == 2 and not bFromYM then
|
||||
nSCC = EgtIf( nSide == -1, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||
end
|
||||
else
|
||||
local bFromZM = (( vtN[vOrd[i]]:getZ() < 0 and bConvex) or ( vtN[vOrd[i]]:getZ() > 0 and not bConvex))
|
||||
nSCC = EgtIf( bFromZM, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||
@@ -1132,7 +1347,24 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local dStep = 0
|
||||
local dAgg = EgtIf( bConvex, 2 * BD.CUT_EXTRA, BD.CUT_EXTRA)
|
||||
local dLargh = vWidth[vOrd[i]]
|
||||
if not bSide and dLargh > 0.8 * dToolDiam then
|
||||
-- controllo se lavorazione completa
|
||||
local dMachDepth = vElevation[vOrd[i]]
|
||||
if dMachDepth > dMaxDepth - 10 * GEO.EPS_ANG_SMALL then
|
||||
-- verifico se posso lavorare la faccia 2
|
||||
local nOtherFace = EgtIf( i == 1, 2, 1)
|
||||
if j == 1 and vtN[vOrd[nOtherFace]]:getZ() > dLimitAngle and vWidth[vOrd[i]] < dMaxDepth then
|
||||
vOrd[1], vOrd[2] = vOrd[2], vOrd[1]
|
||||
dLargh = vWidth[vOrd[i]]
|
||||
dSal, dEal = dEal, dSal
|
||||
bInverted = true
|
||||
else
|
||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
elseif bInverted then
|
||||
dSal, dEal = dEal, dSal
|
||||
end
|
||||
if not bSide and dLargh > 0.8 * dToolDiam then
|
||||
nO = ceil( dLargh / ( 0.6 * dToolDiam))
|
||||
if nO > 1 then
|
||||
dStep = dLargh / nO
|
||||
@@ -1165,7 +1397,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
--EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, BL.GetParallelOpposite( vFaceUse[vOrd[i]]), vFaceUse[vOrd[i]]))
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, MCH_MILL_FU.PARAL_DOWN, vFaceUse[vOrd[i]]))
|
||||
-- imposto lato di lavoro e inversione
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bIsMachDownUp, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bSide, true, false))
|
||||
-- imposto offset radiale (nullo se concavo o di lato)
|
||||
local dOffsR = EgtIf( k < nO, ( nO - k) * dStep, EgtIf( bConvex, - BD.CUT_EXTRA, 0))
|
||||
@@ -1200,6 +1432,20 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
local AddProc = { Id = AddId, Grp = 0, Prc = 12, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
PartId = Proc.PartId, TaskId = Proc.TaskId, CutId = Proc.CutId, bMoveAfterSplit = true}
|
||||
Topology.Classify( AddProc, b3Raw)
|
||||
table.insert( AddedIds, AddProc)
|
||||
end
|
||||
|
||||
-- altrimenti lavorazione di fianco : Long2CutSide o Long2CutDown
|
||||
else
|
||||
@@ -1296,8 +1542,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
local dDistToEnd = dToolDiam / 2
|
||||
local dDistToEndDn = dToolDiamDn / 2
|
||||
-- calcolo l'elevazione della faccia principale
|
||||
local dFacElev1 = BL.GetFaceElevation( Proc.Id, tFaceLong[vOrd[1]], nPartId)
|
||||
local dFacElev2 = BL.GetFaceElevation( Proc.Id, tFaceLong[vOrd[2]], nPartId)
|
||||
local dFacElev1 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[1]], b3Solid)
|
||||
local dFacElev2 = BL.GetFaceElevation( Proc, tFaceLong[vOrd[2]], b3Solid)
|
||||
-- se fresa di fianco o da sotto calcolo quanto l'utensile può andare vicino al limite se l'elevazione della faccia è minore del raggio utensile
|
||||
if nUseMillOnSide <= 1 or nSide == -1 then
|
||||
local dFacElev = max( dFacElev1, dFacElev2)
|
||||
@@ -1587,7 +1833,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
-- imposto lato di lavoro e inversione
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bIsMachDownUp, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
-- calcolo la componente dNz non in base alla classificazione della feature (sopra, sotto, fianchi) ma alla componente maggiore
|
||||
-- local dNz = EgtIf( nSide == 0, vtN[vOrd[i]]:getY(), vtN[vOrd[i]]:getZ())
|
||||
@@ -1615,7 +1861,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepthDn - dCollSic, 1) .. ')'
|
||||
end
|
||||
dDepth = min( dMaxDepthDn - dCollSic, vWidth[vOrd[i]] + dAgg)
|
||||
dDepth2 = vWidth[vOrd[i]] + dAgg - dDepth
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
|
||||
else
|
||||
dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getZ(), vtN[vOrd[i]]:getY()) / dNz)))
|
||||
@@ -1623,7 +1868,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - dCollSic, 1) .. ')'
|
||||
end
|
||||
dDepth = min( dMaxDepth - dCollSic, vWidth[vOrd[i]] + dAgg)
|
||||
dDepth2 = vWidth[vOrd[i]] + dAgg - dDepth
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
|
||||
end
|
||||
-- eseguo
|
||||
@@ -1644,8 +1888,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
|
||||
return true, sWarn
|
||||
end
|
||||
return true, sWarn, nil, AddedIds
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
return ProcessLong2Cut
|
||||
|
||||
+11
-11
@@ -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
|
||||
|
||||
+195
-25
@@ -1,4 +1,4 @@
|
||||
-- ProcessMortise.lua by Egaltech s.r.l. 2023/05/11
|
||||
-- ProcessMortise.lua by Egaltech s.r.l. 2023/08/10
|
||||
-- Gestione calcolo mortase per Travi
|
||||
-- 2021/07/20 Aggiunta gestione rinvio angolare su FAST.
|
||||
-- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda).
|
||||
@@ -10,6 +10,12 @@
|
||||
-- 2023/01/31 Aggiunta gestione lavorazione in doppio.
|
||||
-- 2023/01/31 Creata la funzione ConvertToClosedCurve (parte della ProcessMortise.Make) e spostata in BeamLib.
|
||||
-- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax.
|
||||
-- 2023/06/27 Esclusa la ricerca lati aperti per le mortase passanti, per le quali il contorno finisce sulla faccia e il riconoscimento sbaglia.
|
||||
-- 2023/07/21 Correzioni per mortise passanti con curva Aux che guarda in basso.
|
||||
-- 2023/08/10 Modificata scelta SCC per tasche in Y+/- in coda o quasi.
|
||||
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||
-- 2024/02/28 Forzata SPIRAL_IN se c'è anche un solo lato aperto
|
||||
-- 2024/03/05 Aggiunta possibilità di inserire lavorazione di smusso
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessMortise = {}
|
||||
@@ -25,6 +31,9 @@ EgtOutLog( ' ProcessMortise started', 1)
|
||||
local BD = require( 'BeamData')
|
||||
local ML = require( 'MachiningLib')
|
||||
|
||||
-- variabili assegnazione parametri Q
|
||||
local Q_DEPTH_CHAMFER = 'Q02' -- d
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
function ProcessMortise.Identify( Proc)
|
||||
@@ -119,11 +128,11 @@ end
|
||||
local nFaceUse = BL.GetNearestParalOpposite( vtN)
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- applico il parametro plunge, che setta la lavorazione per affondare solamente, senza lavorare tutto il contorno; 1: solo lato iniziale, 2: solo lato finale, 3: entrambi
|
||||
sNotes = 'Plunge=3;'
|
||||
local sNotes = 'Plunge=3;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
-- imposto angolo 3° asse rot
|
||||
local vtOrtho = BL.GetVersRef( nFaceUse)
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1))
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sMortising, 'perpendicular'))
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 1))
|
||||
-- calcolo la lavorazione
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
@@ -133,7 +142,7 @@ end
|
||||
return false, sErr
|
||||
end
|
||||
-- impostazione alternativa angolo 3° asse rot
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2))
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sMortising, 'parallel'))
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2))
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -272,7 +281,36 @@ function ProcessMortise.VerifyMortiseOrPocket( Proc, dDiam, dDepth, dMaxTotLen,
|
||||
return sPocketing, dMaxDepth, dToolDiam
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
---------------------------------------------------------------------
|
||||
local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham, bDownHead)
|
||||
local nChamfer = 0
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- verifico che lo smusso sia richiesto
|
||||
local dDepth = EgtGetInfo( Proc.Id, Q_DEPTH_CHAMFER, 'd') or 0
|
||||
if dDepth > 0 then
|
||||
nChamfer = 1
|
||||
end
|
||||
|
||||
-- recupero la lavorazione
|
||||
local sMilling
|
||||
if nChamfer > 0 then
|
||||
if bDownHead then
|
||||
sMilling = ML.FindMilling( 'Mark_H2', nil, nil, nil, nil, false, true)
|
||||
else
|
||||
sMilling = ML.FindMilling( 'Mark')
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : Mark not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return -1, 0, sErr
|
||||
end
|
||||
end
|
||||
|
||||
return nChamfer, dDepth, sMilling
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- ingombro del pezzo
|
||||
@@ -294,13 +332,6 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero versore estrusione della curva supplementare
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_ID.ROOT)
|
||||
-- se curva di contorno aperta la rendo chiusa
|
||||
local _, bModif = BL.ConvertToClosedCurve( Proc, AuxId)
|
||||
if not bModif then
|
||||
BL.SetOpenSide( AuxId, b3Solid)
|
||||
end
|
||||
-- verifico se frontale
|
||||
local bFront = ( Proc.Prc == 51)
|
||||
-- recupero i dati della faccia di fondo
|
||||
@@ -311,8 +342,67 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
ptC = frMor:getOrigin()
|
||||
vtN = frMor:getVersZ()
|
||||
end
|
||||
-- recupero versore estrusione della curva supplementare
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_ID.ROOT)
|
||||
-- Confronto le direzioni dei 2 versori : se diverse la faccia 0 non è il fondo => mortasa passante
|
||||
local bOpenBtm = not AreSameVectorApprox( vtExtr, vtN)
|
||||
-- se curva di contorno aperta la rendo chiusa
|
||||
local _, bModif = BL.ConvertToClosedCurve( Proc, AuxId)
|
||||
-- se la mortasa passante il contorno è sulla faccia della trave e il riconoscimento lati aperti non è corretto
|
||||
if not bModif and not bOpenBtm then
|
||||
BL.SetOpenSide( AuxId, b3Solid)
|
||||
end
|
||||
|
||||
-- caso speciale feature trimmata diversamente in/out: si ricostruisce la curva non trimmata
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- estrazione loop trimesh: se 1 contorno ha il fondo, se due contorni è passante.
|
||||
-- se passante si deve discriminare se i due contorni sono uguali (passante standard, trimmata allo stesso modo in/out) oppure se un contorno è diverso dall'altro (e quindi non è trimmata in egual modo in/out)
|
||||
-- se più di 2 contorni si rimane nel caso standard
|
||||
local idCurve1, nIdCount = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
|
||||
if nIdCount == 2 then
|
||||
local idCurve2 = idCurve1 + 1
|
||||
local dCurveLength1 = EgtCurveLength( idCurve1)
|
||||
local dCurveLength2 = EgtCurveLength( idCurve2)
|
||||
if abs( dCurveLength1 - dCurveLength2) > 100 * GEO.EPS_SMALL then
|
||||
-- riferimento curva ausiliaria
|
||||
local frAuxId = Frame3d( EgtGP( AuxId, GDB_RT.GLOB), vtExtr)
|
||||
-- box dei due contorni nel riferimento della faccia di fondo
|
||||
local b3Curve1 = EgtGetBBoxRef( idCurve1, GDB_BB.STANDARD, frAuxId)
|
||||
local b3Curve2 = EgtGetBBoxRef( idCurve2, GDB_BB.STANDARD, frAuxId)
|
||||
-- per creare la curva non trimmata si creerà un piano di intersezione con la trimesh appena sopra al contorno più vicino a AuxId, ossia a ptOffset
|
||||
local ptOffset = b3Curve1:getMax()
|
||||
if b3Curve1:getMin():getZ() > b3Curve2:getMin():getZ() + 10 * GEO.EPS_SMALL then
|
||||
ptOffset = b3Curve2:getMax()
|
||||
end
|
||||
-- ptOffset si sposta appena sopra per garantire l'intersezione
|
||||
ptOffset = ptOffset + Vector3d( 0, 0, 100 * GEO.EPS_SMALL)
|
||||
local ptOffsetGlob = Point3d( ptOffset)
|
||||
ptOffsetGlob:toGlob( frAuxId)
|
||||
EgtErase( { idCurve1, idCurve2} )
|
||||
-- intersezione piano a ptOffset con la trimesh: si ottiene la curva originale non trimmata
|
||||
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOffsetGlob, frAuxId:getVersZ(), Proc.Id, nAddGrpId, GDB_RT.GLOB)
|
||||
if nPnt == 0 and nCrv == 1 and nSrf == 0 then
|
||||
EgtCloseCurveCompo( nFirstId)
|
||||
local vtMove = -frAuxId:getVersZ() * ptOffset:getZ()
|
||||
EgtMove( nFirstId, vtMove, GDB_RT.GLOB)
|
||||
EgtErase( AuxId)
|
||||
EgtChangeId( nFirstId, AuxId)
|
||||
else
|
||||
if nFirstId then
|
||||
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
|
||||
EgtErase( nId)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if bOpenBtm then
|
||||
-- creo superficie chiusa
|
||||
local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05)
|
||||
@@ -378,7 +468,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
|
||||
@@ -399,6 +490,63 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local bPockUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
|
||||
local bPockDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174)
|
||||
local bPockAngTrasm = ( BD.ANG_TRASM and vtExtr:getZ() < -0.1)
|
||||
|
||||
-- recupero i dati della curva e del profilo
|
||||
local dDepth = dMorH
|
||||
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
||||
local bToolInv = ( not bDownHead and vtExtr:getZ() < -0.1 and Proc.Box:getDimZ() > b3Solid:getDimZ() - 5)
|
||||
local dExtra = 2
|
||||
|
||||
-- verifico se servono gli smussi. Se lavorazione principale di svuotatura significa che è solo da un lato
|
||||
-- generalmente sono lavorazioni non molto lunghe, quindi non si gestistono gli step
|
||||
-- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva
|
||||
local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true)
|
||||
-- se devo inserire il chamfer
|
||||
if nChamfer > 0 and Proc.Grp ~= 0 and dDepth > dDepthCham then
|
||||
-- inserisco la lavorazione
|
||||
local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sNameCh, sChamfer)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
if not bToolInv then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthCham + dExtra - dMorH)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if Proc.Head then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif Proc.Tail then
|
||||
nSCC = MCH_SCC.ADIR_XM
|
||||
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
elseif vtExtr:getY() > -0.01 then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
|
||||
-- recupero la lavorazione
|
||||
local sPockType = 'Mortise'
|
||||
local sMchExt = ''
|
||||
@@ -454,10 +602,17 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- verifico se invertire versore estrusione geometria
|
||||
-- verifico se invertire direzione utensile
|
||||
if bRevertSide then
|
||||
EgtModifyCurveExtrusion( AuxId, -vtExtr, GDB_ID.ROOT)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
end
|
||||
|
||||
-- se ho anche solo un lato aperto, forzo SPIRAL-IN
|
||||
local vOpen = EgtGetInfo( AuxId, 'OPEN', 'vi')
|
||||
if vOpen and #vOpen > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
end
|
||||
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- sistemo la direzione di lavoro
|
||||
@@ -466,11 +621,14 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if bPockAngTrasm then
|
||||
nSCC = MCH_SCC.ADIR_NEAR
|
||||
elseif not BD.C_SIMM then
|
||||
if abs( vtN:getX()) < GEO.EPS_SMALL and abs( vtN:getY()) < GEO.EPS_SMALL then
|
||||
elseif not BD.C_SIMM and not BD.TURN then
|
||||
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtN:getX()) < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif abs( vtN:getX()) < 0.1 then
|
||||
local bNearTail = ( Proc.Box:getMax():getX() < b3Solid:getCenter():getX() and
|
||||
Proc.Box:getMax():getX() - b3Solid:getMin():getX() < 1000)
|
||||
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( EgtGetCurrPhase()) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtN:getY() < GEO.EPS_SMALL then
|
||||
nSCC = EgtIf( bRevertSide, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
@@ -497,9 +655,18 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
dMorH = dMaxDepth
|
||||
EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')')
|
||||
else
|
||||
if bOpenBtm and not bForceOneSide then -- se mortasa passante setto metà profondità
|
||||
-- se passante e lavorabile da due lati
|
||||
if bOpenBtm and not bForceOneSide then
|
||||
-- imposto metà profondità
|
||||
nDepthMin = -dMorH
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, nDepthMin)
|
||||
-- se altrimenti passante ma lavorabile solo da un lato
|
||||
elseif bOpenBtm and bForceOneSide then
|
||||
if bRevertSide then
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, min( dMorH + BD.CUT_EXTRA, dMaxDepth))
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, min( BD.CUT_EXTRA, dMaxDepth - dMorH))
|
||||
end
|
||||
end
|
||||
end
|
||||
-- imposto elevazione
|
||||
@@ -530,7 +697,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
end
|
||||
-- faccio la copia e la metto nel layer dedicato alle geometrie aggiunte
|
||||
local AuxId_oppo = EgtCopyGlob( AuxId, BL.GetAddGroup(nPartId))
|
||||
local AuxId_oppo = EgtCopyGlob( AuxId, BL.GetAddGroup(nPartId))
|
||||
-- inverto la direzione estrusione di questa
|
||||
EgtModifyCurveExtrusion( AuxId_oppo, - vtExtr, GDB_ID.ROOT)
|
||||
-- aggiungo geometria
|
||||
@@ -539,11 +706,14 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM then
|
||||
if abs( vtN:getX()) < GEO.EPS_SMALL and abs( vtN:getY()) < GEO.EPS_SMALL then
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
elseif abs( vtN:getX()) < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif abs( vtN:getX()) < 0.1 then
|
||||
local bNearTail = ( Proc.Box:getMax():getX() < b3Solid:getCenter():getX() and
|
||||
Proc.Box:getMax():getX() - b3Solid:getMin():getX() < 1000)
|
||||
local bVeryShortPart = ( BD.LEN_VERY_SHORT_PART and b3Solid:getDimX() < BD.LEN_VERY_SHORT_PART)
|
||||
nSCC = EgtIf( BL.IsPartFinalPhase( EgtGetCurrPhase()) or ( bNearTail and not bVeryShortPart), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
elseif vtN:getY() < GEO.EPS_SMALL then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
else
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2025/06/20
|
||||
-- Gestione tastatura
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessProbing = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
local BL = require( 'BeamLib')
|
||||
|
||||
-- Dati
|
||||
local ML = require( 'MachiningLib')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetProbingMachining( Machinings, sHead)
|
||||
local sProbeMachining, sHeadTool
|
||||
|
||||
-- TODO questa associazione "testa utensile"-"testa tastatore" dovrebbe essere spostata nella macchina.
|
||||
-- Non è detto che se testa utensile inizia con "H2" allora bisogna prendere lavorazione con "_H2"
|
||||
|
||||
-- se la testa utilizzata dalla lavorazione inizia con H2, dovrebbe essere la seconda testa
|
||||
if EgtStartsWith( sHead, 'H2') then
|
||||
sHeadTool = '_H2'
|
||||
else
|
||||
sHeadTool = '_H1'
|
||||
end
|
||||
|
||||
for i = 1, #Machinings do
|
||||
if EgtEndsWith( Machinings[i].Name, sHeadTool) then
|
||||
sProbeMachining = Machinings[i]
|
||||
return sProbeMachining
|
||||
end
|
||||
end
|
||||
sProbeMachining = Machinings[1]
|
||||
return sProbeMachining
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MoveProbePointToRawFaces( ptProbe, vtProbe, nPartId)
|
||||
local b3BoxPart = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
-- si porta linea di tastatura su grezzo
|
||||
if AreSameVectorApprox( vtProbe, Z_AX()) then
|
||||
ptProbe[3] = b3BoxPart:getMax():getZ()
|
||||
elseif AreSameVectorApprox( vtProbe, -Z_AX()) then
|
||||
ptProbe[3] = b3BoxPart:getMin():getZ()
|
||||
elseif AreSameVectorApprox( vtProbe, Y_AX()) then
|
||||
ptProbe[2] = b3BoxPart:getMax():getY()
|
||||
elseif AreSameVectorApprox( vtProbe, -Y_AX()) then
|
||||
ptProbe[2] = b3BoxPart:getMin():getY()
|
||||
end
|
||||
return ptProbe
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessProbing.Make( Proc, nPartId, Info)
|
||||
local bOk, sErr
|
||||
|
||||
-- per eseguire tastatura servono tutti i dati, altriemnti impossibile
|
||||
if Info.vtProbe and Info.ptProbe and Info.sType then
|
||||
Info.ptProbe = MoveProbePointToRawFaces( Info.ptProbe, Info.vtProbe, nPartId)
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
local nIdLine = EgtLinePVL( nAddGrpId, Info.ptProbe, Info.vtProbe, 10, GDB_RT.GLOB) -- TODO lunghezza da portare fuori come parametro
|
||||
local Machinings = GetMachinings( MCH_MY.PROBING, Info.sType)
|
||||
-- se c'è almeno una lavorazione, allora devo fare tastatura
|
||||
if Machinings and #Machinings > 0 then
|
||||
local sProbing = GetProbingMachining( Machinings, Info.sHead)
|
||||
-- se c'è la linea e la lavorazione, applico
|
||||
if sProbing and nIdLine then
|
||||
local sName = 'DtMtProbe_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sProbing.Name)
|
||||
-- si inverte la direzione della linea, deve essere entrante, oppostaa vettore estrusione
|
||||
EgtInvertCurve( nIdLine)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nIdLine, -1}})
|
||||
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return false, sErr
|
||||
else
|
||||
bOk = true
|
||||
end
|
||||
else
|
||||
bOk = false
|
||||
sErr = 'Error on probing'
|
||||
end
|
||||
-- altrimenti tastatura non richiesta, esco
|
||||
else
|
||||
return true
|
||||
end
|
||||
else
|
||||
bOk = false
|
||||
sErr = 'Error on probing'
|
||||
end
|
||||
|
||||
return bOk, sErr
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
return ProcessProbing
|
||||
+88
-11
@@ -9,6 +9,7 @@
|
||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessProfCamb = {}
|
||||
@@ -205,6 +206,36 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
|
||||
return nChamfer, dDepth, sMilling, sMilling2
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifyOtherMillCanFinish( dDepthProfile, nSide)
|
||||
local dToolMaxDepthFinish
|
||||
-- abilitazione lavorazione da sotto
|
||||
local sMillType = 'Prof_end'
|
||||
local sMillingFinish, _, _, _ = ML.FindMilling( sMillType, nil, nil, nil, nil, true, nil, nil, nil)
|
||||
if not sMillingFinish then
|
||||
return false
|
||||
end
|
||||
-- Recupero i dati dell'utensile
|
||||
if EgtMdbSetCurrMachining( sMillingFinish) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid)) then
|
||||
dToolMaxDepthFinish = EgtTdbGetCurrToolMaxDepth()
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
local bDouble = ( dDepthProfile + BD.CUT_EXTRA > dToolMaxDepthFinish)
|
||||
-- se lavorazione in doppio richiesta, si verifica se richiesta testa sotto
|
||||
if bDouble and nSide == 0 then
|
||||
return false -- TODO macchine con BD.DOWN_HEAD potrebbero lavorare in doppio in questo caso!
|
||||
end
|
||||
|
||||
if not bDouble or ( dDepthProfile + BD.MILL_OVERLAP < dToolMaxDepthFinish * 2) then
|
||||
return true, sMillingFinish, bDouble
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
@@ -243,7 +274,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtN:getZ() > 0.1 then
|
||||
nSide = 1
|
||||
elseif vtN:getZ() < -0.1 then
|
||||
nSide = -1
|
||||
nSide = -1
|
||||
end
|
||||
-- abilitazione lavorazione da sotto
|
||||
local bMillDown = ( BD.DOWN_HEAD and nSide == -1)
|
||||
@@ -285,7 +316,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- aggiungo piano di sgrossatura e lo lavoro
|
||||
local ptStart, vtNP = GetSawCutData( AuxId, vtNF)
|
||||
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
|
||||
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then
|
||||
if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
|
||||
@@ -306,7 +337,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
|
||||
@@ -466,6 +498,11 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- se configurata fresa di finitura
|
||||
local bUseOtherMillOnFinish, sFinishMilling, bDoubleFinishMill = VerifyOtherMillCanFinish( dProfDepth, nSide)
|
||||
|
||||
-- se il chamfer non è esclusivo continuo con le altre lavorazioni
|
||||
if nChamfer < 2 then
|
||||
-- verifico se necessario lavorare in doppio
|
||||
@@ -475,7 +512,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local sMillingDown
|
||||
if bDouble then
|
||||
if nSide == 0 then
|
||||
if BD.DOWN_HEAD then
|
||||
if BD.DOWN_HEAD then
|
||||
-- recupero la lavorazione
|
||||
sMillingDown = ML.FindMilling( 'Prof_H2', nil, nil, nil, nil, false, true)
|
||||
if not sMillingDown then
|
||||
@@ -535,10 +572,6 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, ( dOriOffset + dOffsetPar))
|
||||
bFinish = true
|
||||
end
|
||||
-- se parametro sovramateriale è maggiore di 0 lo aggiungo al sovramateriale precedente
|
||||
if dOffsetPar > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, ( dOriOffset + dOffsetPar))
|
||||
end
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -565,7 +598,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
nMchId = nMch2Id
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
if bFinish and not bUseOtherMillOnFinish then
|
||||
-- inserisco la lavorazione
|
||||
local sNewName = 'ProfB_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
||||
@@ -637,7 +670,13 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
end
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
local nSCC = MCH_SCC.ADIR_NONE
|
||||
if BD.TURN == 2 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
else
|
||||
nSCC = EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- variabili per gestione direzione percorso e per gestione lavorazione di finitura opzionale
|
||||
local ptSP, ptEp
|
||||
local bFinish
|
||||
@@ -674,7 +713,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
nMchId = nMch2Id
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
if bFinish and not bUseOtherMillOnFinish then
|
||||
-- inserisco la lavorazione
|
||||
local sNewName = 'Prof_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
||||
@@ -730,6 +769,44 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
-- se finitura con fresa piccola
|
||||
if bFinish and bUseOtherMillOnFinish then
|
||||
local sDepthFinishMill = EgtIf( bDoubleFinishMill, ( dProfDepth+ BD.MILL_OVERLAP ) / 2, dProfDepth + BD.CUT_EXTRA)
|
||||
local sMachName = 'Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
nMchId = EgtAddMachining( sMachName, sFinishMilling)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sMachName .. '-' .. sFinishMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
|
||||
-- imposto l'affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, sDepthFinishMill)
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
if bDoubleFinishMill then
|
||||
local sNewName = 'FinB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- aggiorno ingombro testa o coda per presa
|
||||
if nSide ~= 1 then -- se feature di fianco o da sotto
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessProfConcave.lua by Egaltech s.r.l. 2023/05/25
|
||||
-- ProcessProfConcave.lua by Egaltech s.r.l. 2023/07/31
|
||||
-- Gestione calcolo profilo concavo per Travi
|
||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
|
||||
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
|
||||
@@ -6,6 +6,8 @@
|
||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||
-- 2023/05/25 Sistemazione SCC per TURN.
|
||||
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
|
||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessProfConcave = {}
|
||||
@@ -89,7 +91,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
bFirstTrim, bLastTrim, dOffsetPar)
|
||||
|
||||
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
||||
@@ -97,6 +99,9 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
local ptEp = EgtGetMachiningEndPoint()
|
||||
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
||||
if nMachMode == 1 and ptSP and ptEp then
|
||||
-- recupero flag inversione direzione di lavorazione
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
-- verifico se da aggiustare
|
||||
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
|
||||
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
|
||||
-- ottengo il lato lavoro e lo inverto
|
||||
@@ -104,9 +109,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if nSideWork > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
end
|
||||
-- ottengo l'inversione e setto il contrario
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
|
||||
-- imposto il contrario dell'inversione trovata
|
||||
bInvertMode = not bInvertMode
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvertMode)
|
||||
end
|
||||
-- se lavorazione invertita rispetto a geometria, scambio dati di inizio e fine
|
||||
if bInvertMode then
|
||||
dLenIni, dLenLst = dLenLst, dLenIni
|
||||
bFirstTrim, bLastTrim = bLastTrim, bFirstTrim
|
||||
end
|
||||
-- modifico attacco e uscita
|
||||
if dLenIni and dLenLst then
|
||||
@@ -120,9 +130,6 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
|
||||
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
||||
end
|
||||
if bFlagInvert then
|
||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||
end
|
||||
@@ -247,8 +254,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- acquisisco informazioni sulle facce estreme
|
||||
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
||||
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
||||
-- flag percorso invertito
|
||||
local bFlagInvert = false
|
||||
-- verifico se in testa o coda
|
||||
local bHead = ( vtN:getX() > 0)
|
||||
EgtOutLog( 'vtN=' .. tostring( vtN), 3)
|
||||
@@ -285,7 +290,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- aggiungo piano di sgrossatura e lo lavoro
|
||||
local ptStart, vtNP = GetSawCutData( AuxId, vtN)
|
||||
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
|
||||
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then
|
||||
if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
|
||||
@@ -306,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
|
||||
@@ -344,7 +350,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
else
|
||||
@@ -353,14 +358,12 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -378,7 +381,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
|
||||
end
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDoubleCham then
|
||||
@@ -393,8 +396,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -402,7 +403,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
else
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -410,7 +410,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -428,7 +427,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -487,14 +486,11 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra e da sotto
|
||||
if ( nSide == 0) then
|
||||
if vtExtr:getZ() > 0.1 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = true
|
||||
end
|
||||
-- altrimenti lavorazione davanti e dietro
|
||||
else
|
||||
@@ -503,7 +499,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = true
|
||||
end
|
||||
end
|
||||
-- imposto l'affondamento
|
||||
@@ -534,7 +529,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -568,8 +563,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
if not bDouble and nSide == -1 then
|
||||
@@ -578,7 +571,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
else
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -586,7 +578,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
@@ -595,14 +586,12 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- se in doppio, imposto l'affondamento
|
||||
@@ -631,7 +620,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -684,7 +673,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
if BD.TURN then
|
||||
local nSCC = GetSccForTurn( vtN)
|
||||
local nSCC = GetSccForTurn( vtN, 'V')
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- modifico attacco e uscita per forzare risalita
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dToolDiam / 2)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessProfConvex.lua by Egaltech s.r.l. 2023/05/25
|
||||
-- ProcessProfConvex.lua by Egaltech s.r.l. 2023/07/31
|
||||
-- Gestione calcolo profilo convesso per Travi
|
||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
|
||||
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
|
||||
@@ -6,6 +6,8 @@
|
||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||
-- 2023/05/25 Sistemazione SCC per TURN.
|
||||
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
|
||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessProfConvex = {}
|
||||
@@ -89,7 +91,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
bFirstTrim, bLastTrim, dOffsetPar)
|
||||
|
||||
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
||||
@@ -97,6 +99,9 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
local ptEp = EgtGetMachiningEndPoint()
|
||||
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
||||
if nMachMode == 1 and ptSP and ptEp then
|
||||
-- recupero flag inversione direzione di lavorazione
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
-- verifico se da aggiustare
|
||||
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
|
||||
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
|
||||
-- ottengo il lato lavoro e lo inverto
|
||||
@@ -104,9 +109,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if nSideWork > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
end
|
||||
-- ottengo l'inversione e setto il contrario
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
|
||||
-- imposto il contrario dell'inversione trovata
|
||||
bInvertMode = not bInvertMode
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvertMode)
|
||||
end
|
||||
-- se lavorazione invertita rispetto a geometria, scambio dati di inizio e fine
|
||||
if bInvertMode then
|
||||
dLenIni, dLenLst = dLenLst, dLenIni
|
||||
bFirstTrim, bLastTrim = bLastTrim, bFirstTrim
|
||||
end
|
||||
-- modifico attacco e uscita
|
||||
if dLenIni and dLenLst then
|
||||
@@ -120,9 +130,6 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
|
||||
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
||||
end
|
||||
if bFlagInvert then
|
||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||
end
|
||||
@@ -247,8 +254,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- acquisisco informazioni sulle facce estreme
|
||||
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
||||
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
||||
-- flag percorso invertito
|
||||
local bFlagInvert = false
|
||||
-- verifico se in testa o coda
|
||||
local bHead = ( vtN:getX() > 0)
|
||||
EgtOutLog( 'vtN=' .. tostring( vtN), 3)
|
||||
@@ -285,7 +290,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- aggiungo piano di sgrossatura e lo lavoro
|
||||
local ptStart, vtNP = GetSawCutData( AuxId, vtN)
|
||||
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
|
||||
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then
|
||||
if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
|
||||
@@ -306,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
|
||||
@@ -344,7 +350,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
else
|
||||
@@ -353,14 +358,12 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -378,7 +381,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
|
||||
end
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDoubleCham then
|
||||
@@ -393,8 +396,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -402,7 +403,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
else
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -410,7 +410,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -428,7 +427,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dExtra)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni, dLenLst, bFirstTrim, bLastTrim, dExtra)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -487,14 +486,11 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra e da sotto
|
||||
if ( nSide == 0) then
|
||||
if vtExtr:getZ() > 0.1 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = true
|
||||
end
|
||||
-- altrimenti lavorazione davanti e dietro
|
||||
else
|
||||
@@ -503,7 +499,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = true
|
||||
end
|
||||
end
|
||||
-- imposto l'affondamento
|
||||
@@ -534,7 +529,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -568,8 +563,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
if not bDouble and nSide == -1 then
|
||||
@@ -578,7 +571,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
else
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -586,7 +578,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
@@ -595,14 +586,12 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- se in doppio, imposto l'affondamento
|
||||
@@ -631,7 +620,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst, bFirstTrim, bLastTrim, dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
-- 2022/02/02 Aggiunta funzione OnlyChamfer.
|
||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessProfFront = {}
|
||||
@@ -236,7 +237,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- aggiungo piano di sgrossatura e lo lavoro
|
||||
local ptStart, vtNP = GetSawCutData( AuxId, vtN)
|
||||
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
|
||||
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then
|
||||
if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
|
||||
@@ -257,7 +258,8 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- altrimenti applico taglio di lama
|
||||
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
|
||||
@@ -465,8 +467,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
@@ -554,8 +555,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
else
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
|
||||
+22
-31
@@ -1,4 +1,4 @@
|
||||
-- ProcessProfHead.lua by Egaltech s.r.l. 2022/05/28
|
||||
-- ProcessProfHead.lua by Egaltech s.r.l. 2023/07/31
|
||||
-- Gestione calcolo profilo di testa per Travi
|
||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa sotto.
|
||||
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
|
||||
@@ -6,6 +6,8 @@
|
||||
-- 2022/02/02 Aggiunta funzione OnlyChamfer.
|
||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||
-- 2023/07/31 Correzione e semplificazione di ModifySideInvertLead per invert.
|
||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessProfHead = {}
|
||||
@@ -81,7 +83,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
bFirstTrim, bLastTrim, bFlagInvert, dOffsetPar)
|
||||
bFirstTrim, bLastTrim, dOffsetPar)
|
||||
|
||||
-- confronto il punto iniziale e finale della lavorazione con il box della feature
|
||||
-- e se è vicino alla parte esterna della trave inverto la lavorazione
|
||||
@@ -89,6 +91,9 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
local ptEp = EgtGetMachiningEndPoint()
|
||||
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
|
||||
if nMachMode == 1 and ptSP and ptEp then
|
||||
-- recupero flag inversione direzione di lavorazione
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
-- verifico se da aggiustare
|
||||
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
|
||||
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
|
||||
-- ottengo il lato lavoro e lo inverto
|
||||
@@ -96,9 +101,14 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if nSideWork > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( nSideWork == MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT))
|
||||
end
|
||||
-- ottengo l'inversione e setto il contrario
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
|
||||
-- imposto il contrario dell'inversione trovata
|
||||
bInvertMode = not bInvertMode
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, bInvertMode)
|
||||
end
|
||||
-- se lavorazione invertita rispetto a geometria, scambio dati di inizio e fine
|
||||
if bInvertMode then
|
||||
dLenIni, dLenLst = dLenLst, dLenIni
|
||||
bFirstTrim, bLastTrim = bLastTrim, bFirstTrim
|
||||
end
|
||||
-- modifico attacco e uscita
|
||||
if dLenIni and dLenLst then
|
||||
@@ -112,9 +122,6 @@ local function ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni, dLenLst,
|
||||
if bLastTrim and dLenLst < dToolDiam / 2 + ( 20 * GEO.EPS_SMALL) then
|
||||
dEndAddLen = dToolDiam / 2 - dLenLst + dOffsetPar + 1
|
||||
end
|
||||
if bFlagInvert then
|
||||
dStartAddLen, dEndAddLen = dEndAddLen, dStartAddLen
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||
end
|
||||
@@ -224,8 +231,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- acquisisco informazioni sulle facce estreme
|
||||
local _, _, dLenIni = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFirstFacet, GDB_ID.ROOT)
|
||||
local _, _, dLenLst = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nLastFacet, GDB_ID.ROOT)
|
||||
-- flag percorso invertito
|
||||
local bFlagInvert = false
|
||||
-- verifico se in testa o coda
|
||||
local bHead = ( vtN:getX() > 0)
|
||||
EgtOutLog( 'vtN=' .. tostring( vtN), 3)
|
||||
@@ -267,7 +272,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- aggiungo piano di sgrossatura e lo lavoro
|
||||
local ptStart, vtNP = GetSawCutData( AuxId, vtN)
|
||||
local AddId = EgtSurfTmPlaneInBBox( nAddGrpId, ptStart, vtNP, b3Solid, GDB_RT.GLOB)
|
||||
if AddId and BL.GetFaceElevation( AddId, 0, nPartId) > 20.0 then
|
||||
if AddId and BL.GetFaceElevation( AddId, 0, b3Solid) > 20.0 then
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
EgtSetInfo( AddId, 'TASKID', Proc.TaskId)
|
||||
-- se macchina PF o ONE e profilo sopra davanti e pezzo alto applico svuotatura
|
||||
@@ -288,7 +293,8 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- altrimenti applico taglio di lama
|
||||
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
|
||||
@@ -326,7 +332,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
else
|
||||
@@ -335,14 +340,12 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -361,7 +364,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni,
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dExtra)
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dExtra)
|
||||
end
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
if bDoubleCham then
|
||||
@@ -376,8 +379,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -385,7 +386,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
else
|
||||
@@ -394,7 +394,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- assegno affondamento e offset radiale
|
||||
@@ -413,7 +412,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
|
||||
-- della feature inverto il punto di inizio della lavorazione
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam + ( 2 * dExtra), dLenIni,
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dExtra)
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dExtra)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -473,8 +472,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra e da sotto
|
||||
if ( nSide == 0) then
|
||||
if vtExtr:getZ() > 0.1 then
|
||||
@@ -517,7 +514,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni,
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dOffsetPar)
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
@@ -551,8 +548,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- resetto il flag inversione percorso
|
||||
bFlagInvert = false
|
||||
-- se lavorazione da sopra o da sotto
|
||||
if nSide ~= 0 then
|
||||
if not bDouble and nSide == -1 then
|
||||
@@ -561,7 +556,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
else
|
||||
-- se lavorazione a destra di fronte o sinistra da dietro, inverto
|
||||
@@ -569,7 +563,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
( not bHead and vtExtr:getY() > 0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- altrimenti lavorazione dal davanti o dal dietro
|
||||
@@ -578,14 +571,12 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if vtExtr:getZ() < 0 then
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
-- se lavorazione a destra da dietro o sinistra di fronte, inverto
|
||||
if ( bHead and vtN:getY() > 0.1) or
|
||||
( not bHead and vtN:getY() < -0.1) then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
bFlagInvert = not bFlagInvert
|
||||
end
|
||||
end
|
||||
-- se in doppio, imposto l'affondamento
|
||||
@@ -613,7 +604,7 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
-- della feature inverto il punto di inizio della lavorazione e modifico i parametri dell'attacco
|
||||
-- e uscita
|
||||
ModifySideInvertLead( Proc, bHead, dToolDiam, dLenIni,
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), bFlagInvert, dOffsetPar)
|
||||
dLenLst, ( #vAngs > 0 and vAngs[1] == 0), ( #vAngs > 0 and vAngs[#vAngs] == (Proc.Fct-2)), dOffsetPar)
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish then
|
||||
|
||||
+37
-13
@@ -1,4 +1,4 @@
|
||||
-- ProcessRidgeLap.lua by Egaltech s.r.l. 2023/05/18
|
||||
-- ProcessRidgeLap.lua by Egaltech s.r.l. 2023/08/10
|
||||
-- Gestione calcolo mezzolegno di testa per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -10,6 +10,7 @@ local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local DC = require( 'DiceCut')
|
||||
local LapJoint = require( 'ProcessLapJoint')
|
||||
|
||||
EgtOutLog( ' ProcessRidgeLap started', 1)
|
||||
|
||||
@@ -48,6 +49,8 @@ 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
|
||||
@@ -132,9 +135,20 @@ 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}
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false)
|
||||
if not bOk then return bOk, sErr end
|
||||
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
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- recupero gruppo per geometria addizionale
|
||||
@@ -159,18 +173,18 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- calcolo riferimenti per facce inclinate
|
||||
local vtRef = Vector3d( vtN[vFaceOrd[3]])
|
||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
||||
local vtRef2 = Vector3d( vtN[vFaceOrd[2]])
|
||||
-- eseguo
|
||||
for i = 1, #vCuts do
|
||||
local nOrthoOpposite
|
||||
local vtOrtho
|
||||
if i % 2 == 1 then
|
||||
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
|
||||
vtOrtho = vtRef
|
||||
else
|
||||
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef2)
|
||||
vtOrtho = vtRef2
|
||||
end
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrtho, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
end
|
||||
@@ -195,20 +209,30 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- aggiornamento ingombro di testa o coda
|
||||
if Proc.Head then
|
||||
local dHCI = 0
|
||||
if abs( vtN[vFaceOrd[3]]:getZ()) > 0.1 then
|
||||
if vtN[vFaceOrd[3]]:getZ() > 0.1 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
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
|
||||
local dTCI = 0
|
||||
if abs( vtN[vFaceOrd[3]]:getZ()) > 0.1 then
|
||||
if vtN[vFaceOrd[3]]:getZ() > 0.1 then
|
||||
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, vFaceOrd[1] - 1, GDB_BB.STANDARD)
|
||||
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessRoundArch.lua by Egaltech s.r.l. 2023/05/18
|
||||
-- ProcessRoundArch.lua by Egaltech s.r.l. 2023/12/07
|
||||
-- Gestione calcolo archi per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -118,10 +118,13 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dMaxDepth = 0
|
||||
local bCW = true
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
end
|
||||
-- ne verifico la lunghezza per eventuale spezzatura e lavorazione in doppio
|
||||
@@ -180,6 +183,10 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se lavorazione in doppio senza codolo, aggiungo sovrapposizione
|
||||
if nDouble == 2 and dDimStrip < 10 * GEO.EPS_SMALL then
|
||||
dDepth = dDepth + BD.MILL_OVERLAP / 2
|
||||
end
|
||||
-- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y-
|
||||
if vtExtr:getY() > 0.707 and nDouble == 1 and bStripOnSide then
|
||||
bToolInv = true
|
||||
@@ -188,7 +195,7 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
for i = 1, nStep do
|
||||
for j = 1, nDouble do
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local sName = 'Arch_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sName, sMilling)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
||||
@@ -212,20 +219,19 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
end
|
||||
-- se seconda passata, inverto direzione di lavoro
|
||||
if j == 2 then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
if ( j == 1 and not bToolInv) or ( j == 2 and bToolInv) then
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
|
||||
end
|
||||
-- assegno affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
||||
-- assegno lato di lavoro
|
||||
if bToolInv then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
end
|
||||
-- assegno lato di lavoro (per avere lavorazione climb)
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
if Proc.Head then
|
||||
nSCC = MCH_SCC.ADIR_XP
|
||||
elseif Proc.Tail then
|
||||
@@ -233,6 +239,8 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
elseif AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = MCH_SCC.ADIR_YP
|
||||
end
|
||||
elseif BD.TURN == 2 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
elseif BD.TURN then
|
||||
if vtN:getZ() > 0.707 then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
-- Gestione calcolo taglio di lama per Travi
|
||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe).
|
||||
-- 2022/12/19 Aggiunta gestione testa da sotto.
|
||||
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessSawCut = {}
|
||||
@@ -229,6 +230,9 @@ function ProcessSawCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTail)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto uso della faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- imposto angolo 3° asse rot
|
||||
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtN, vtOut))
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
|
||||
@@ -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 = {}
|
||||
@@ -101,7 +102,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -124,7 +125,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
@@ -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,74 @@ 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
|
||||
|
||||
-- se non ho intersezione con la faccia tappo posso fare il taglio sul fianco
|
||||
if not nGoodFace1 or nGoodFace1 == 0 then
|
||||
-- controllo per eseguire solo un taglio ottimizzato
|
||||
local bExecJustOneCut = false
|
||||
local dDiceFaceDim = GEO.INFINITO
|
||||
if ( i % 2) == 0 then
|
||||
for cont = 1, #vCuts[i] do
|
||||
local _, dDiceFaceH, dDiceFaceV = BL.GetFaceHvRefDim( vCuts[i][cont], 0)
|
||||
-- se feature verso Z, si ammette anche lavorazione in doppio
|
||||
if AreSameVectorApprox( vtRef, Z_AX()) then
|
||||
if dMaxDepth * 2 > dDiceFaceH + BD.CUT_EXTRA then
|
||||
bExecJustOneCut = true
|
||||
dDiceFaceDim = dDiceFaceH
|
||||
break
|
||||
end
|
||||
elseif AreSameVectorApprox( vtRef, Y_AX()) or AreSameVectorApprox( vtRef, -Y_AX()) then
|
||||
if dMaxDepth > dDiceFaceV + BD.CUT_EXTRA then
|
||||
bExecJustOneCut = true
|
||||
dDiceFaceDim = dDiceFaceV
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
-- se c'è intersezione non ci deve essere ExtraCut
|
||||
else
|
||||
dExtraCut = 0
|
||||
end
|
||||
-- se si può fare, faccio unico taglio parallelo
|
||||
if bExecJustOneCut then
|
||||
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 +269,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 +449,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
if not nGoodFace1 or nGoodFace1 == 0 then
|
||||
-- inserisco la lavorazione
|
||||
local vtRef2 = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, Z_AX(), EgtIf( bHead, Y_AX(), -Y_AX()))
|
||||
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOkd then return bOkd, sErrD end
|
||||
-- lavoro la faccia opposta (definita dal parametro P11)
|
||||
if vFaceOrd[3] ~= 0 then
|
||||
@@ -460,10 +528,20 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
||||
else
|
||||
dDiamMax = EgtIf( abs( frMor:getVersX():getY()) < abs( frMor:getVersY():getY()), dL, dW)
|
||||
end
|
||||
-- determino la distanza tra le due facce inclinate
|
||||
-- determino la distanza tra le due facce inclinate per determinare elevazione
|
||||
local dDistFaces
|
||||
if vFaceOrd[4] ~= 0 then
|
||||
dDistFaces = abs((ptC[vFaceOrd[2]]-ptC[vFaceOrd[4]])*vtN[vFaceOrd[2]])
|
||||
local nElevationFace1 = 0
|
||||
-- controllo estensione faccia 1
|
||||
if vFaceOrd[1] ~= 0 then
|
||||
frMor, dL, dW = EgtSurfTmFacetMinAreaRectangle( Proc.Id, vFaceOrd[1]-1, GDB_ID.ROOT)
|
||||
if abs(vtRef:getY()) > 0.866 then
|
||||
nElevationFace1 = EgtIf( abs( frMor:getVersX():getZ()) < abs( frMor:getVersY():getY()), dL, dW)
|
||||
else
|
||||
nElevationFace1 = EgtIf( abs( frMor:getVersX():getY()) < abs( frMor:getVersY():getY()), dL, dW)
|
||||
end
|
||||
end
|
||||
dDistFaces = max( abs((ptC[vFaceOrd[2]]-ptC[vFaceOrd[4]])*vtN[vFaceOrd[2]]), nElevationFace1)
|
||||
end
|
||||
-- recupero la lavorazione. considerando l dimensione del lato e l'affondamento
|
||||
local sPocketing
|
||||
|
||||
@@ -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 = {}
|
||||
@@ -101,7 +102,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -124,7 +125,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
@@ -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
|
||||
|
||||
+438
-196
@@ -11,6 +11,15 @@
|
||||
-- 2023/04/04 Modifiche per travi con sezioni molto grandi e materiale inferiore allo spessore lama.
|
||||
-- 2023/04/20 Per travi alte aggiunti tagli orizzontali per ridurre le dimensioni degli scarti.
|
||||
-- 2023/05/09 Aggiunta richiesta risalita preliminare a Zmax per tagli da sopra su macchine PF e ONE.
|
||||
-- 2023/06/13 Corrette note Precut e Cut per tagli aggiuntivi orizzontali.
|
||||
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo.
|
||||
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative.
|
||||
-- 2024/01/18 Gestita lama con aggregato con asse bloccato per massimizzare capacità di taglio verticale, se da sotto
|
||||
-- Implementato split per pezzi molto alti con mix sega a catena + lama
|
||||
-- Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||
-- 2024/01/22 Nei tagli verticali aggiuntivi si usa ora BD.MAX_LEN_DICE come dimensione (era BD.MAX_DIM_DICE).
|
||||
-- 2024/01/23 Nello split con sega a catena ora si cerca di preferenza una lavorazione di tipo 'SawingForSplitting'. Se non trovata si cerca il tipo 'Sawing' come in precedenza.
|
||||
-- In split con sega a catena aggiunta estensione start/end del percorso se utensile lungo, per evitare collisioni con il pezzo durante rotazione.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessSplit = {}
|
||||
@@ -21,6 +30,7 @@ local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local Pocket = require( 'FaceByPocket')
|
||||
local Topology = require( 'FeatureTopology')
|
||||
|
||||
EgtOutLog( ' ProcessSplit started', 1)
|
||||
|
||||
@@ -28,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)
|
||||
@@ -53,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
|
||||
@@ -155,9 +169,8 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- lavorazione con sega a catena per sezioni alte e larghe
|
||||
local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
|
||||
local function MakeCutByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes, dRadialOffset, bExtendStartEnd, bInvert)
|
||||
-- Recupero i dati dell'utensile
|
||||
local sSawing = ML.FindSawing( 'Sawing')
|
||||
local dMaxMat = 0
|
||||
local dSawCornerRad = 0
|
||||
local dSawThick = 0
|
||||
@@ -191,18 +204,30 @@ local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
|
||||
-- imposto uso del lato faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
-- imposto angolo 3° asse rot
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 1))
|
||||
local _, vtN = EgtSurfTmFacetCenter( nSurfId, 0, GDB_ID.ROOT)
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'perpendicular'))
|
||||
local vtN = EgtSurfTmFacetNormVersor( nSurfId, 0, GDB_ID.ROOT)
|
||||
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)
|
||||
-- imposto allungamento percorso iniziale e finale a zero
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 0)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 0)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dRadialOffset)
|
||||
-- imposto eventuale allungamento percorso iniziale
|
||||
local dStartAddLen = 0
|
||||
local dEndAddLen = 0
|
||||
if bExtendStartEnd then
|
||||
dStartAddLen = 100
|
||||
dEndAddLen = 100
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
|
||||
-- faccio in modo che l'attacco della lama sia dal lato opposto rispetto al corpo macchina
|
||||
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
|
||||
@@ -221,7 +246,7 @@ local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
|
||||
return false, sErr
|
||||
end
|
||||
-- impostazione alternativa angolo 3° asse rot
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetChainSawBlockedAxis( 2))
|
||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sSawing, 'parallel'))
|
||||
EgtSetMachiningParam( MCH_MP.INITANGS, BL.GetChainSawInitAngs( vtN, vtOrtho, 2))
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
@@ -238,22 +263,325 @@ local function MakeSplitByChainSaw( nSurfId, nFaceUse, dDepth, sNotes, dOffs)
|
||||
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, dOffsetBetweenCuts)
|
||||
local nVerticalCuts = ceil( Proc.Face[1].WidthTrimmed / ( BD.MAX_LEN_DICE)) - 1
|
||||
local dVerticalSliceHeight = Proc.Face[1].WidthTrimmed / ( nVerticalCuts + 1)
|
||||
-- recupero il diametro dell'utensile
|
||||
local dSawDiam = 400
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
end
|
||||
end
|
||||
local bOk, sErr
|
||||
-- tagli verticali
|
||||
for j = nVerticalCuts, 1, -1 do
|
||||
local nFaceUse = MCH_MILL_FU.PARAL_FRONT
|
||||
local dVerticalCutOffset = dVerticalSliceHeight * -j
|
||||
local sLeadInOutType = 'PerpendicularOutraw'
|
||||
bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1 -dCutXOffset, BD.CUT_SIC, dVerticalCutOffset, 0, 0, sNotes, b3Raw, nil, nil, nil, sLeadInOutType, nil, dOffsetBetweenCuts)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
|
||||
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 and b3Raw:getDimZ() > BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL then
|
||||
-- qui arrivano sezioni molto grandi su macchine tipo PF con materiale da asportare inferiore allo spessore lama
|
||||
local dSawRad = Cutting1Data.dSawDiam / 2
|
||||
dCutExtra = - ( b3Raw:getDimY() - dSawRad)
|
||||
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 sLeadInOutType = 'PerpendicularOutraw'
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , Cutting1Data.sCutting, Cutting1Data.dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw, nil, nil, nil, sLeadInOutType, nil, dOffsetBetweenCuts)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- se necessario taglio verticale doppio, eseguo l'opposto
|
||||
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, dOffsetBetweenCuts)
|
||||
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, dOffsetBetweenCuts)
|
||||
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)
|
||||
-- impostazione default a variabili aggiunte
|
||||
if not BD.OVM_CHAIN_HBEAM then BD.OVM_CHAIN_HBEAM = 8 end
|
||||
if not BD.C_SIMM_ENC then BD.C_SIMM_ENC = 180 end
|
||||
if not BD.C_SIMM_ENC then BD.C_SIMM_ENC = EgtIf( BD.C_SIMM, 180, 90) end
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- 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)
|
||||
@@ -261,42 +589,55 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dSawDiam = 400
|
||||
local dMaxDepth = 50
|
||||
local dSawMaxDepth = 50
|
||||
local dSawThick = 2
|
||||
if EgtMdbSetCurrMachining( sCutting) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
dSawMaxDepth = EgtTdbGetCurrToolMaxDepth() or dSawMaxDepth
|
||||
dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick
|
||||
end
|
||||
end
|
||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||
local dMaxVertDepth = dSawMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||
-- recupero la eventuale lavorazione con lama da sotto
|
||||
local sCutting2 = ML.FindCutting( 'TailSide_H2', false, true)
|
||||
-- recupero i dati della eventuale seconda lama
|
||||
local dSawDiam2 = 0
|
||||
local dMaxDepth2 = 0
|
||||
local dSawMaxDepth2 = 0
|
||||
local dSawThick2 = 0
|
||||
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
|
||||
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
||||
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
|
||||
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
||||
dSawMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dSawMaxDepth2
|
||||
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, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
||||
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dSawMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
||||
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
||||
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dSawMaxDepth2) - 2 * BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
||||
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA))
|
||||
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
||||
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL) and
|
||||
( b3Raw:getDimY() < 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||
-- dati geometrici del taglio
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
-- 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))
|
||||
@@ -309,67 +650,51 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
if nNextRawId and EgtVerifyRawPartPhase( nNextRawId, nPhase) then
|
||||
local b3NextRaw = EgtGetRawPartBBox( nNextRawId)
|
||||
dLenEndRaw = ptC:getX() - b3NextRaw:getMin():getX()
|
||||
nCuts = ceil( dLenEndRaw / BD.MAX_LEN_SCRAP)
|
||||
nCuts = ceil( dLenEndRaw / ( EgtIf( bBigSectionCut, BD.MAX_DIM_DICE - 0.1, BD.MAX_LEN_SCRAP + 0.5)))
|
||||
dOffsL = dLenEndRaw / nCuts
|
||||
-- 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 not bBigSectionCut and
|
||||
( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and
|
||||
( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) and
|
||||
dOffsL < BD.MAX_DIM_DICE
|
||||
-- dati lavorazioni sopra e sotto
|
||||
local Cutting1Data = { sCutting = sCutting, dSawDiam = dSawDiam, dMaxDepth = dSawMaxDepth, dSawThick = dSawThick, dMaxVertDepth = dMaxVertDepth}
|
||||
local Cutting2Data = { sCutting = sCutting2, dSawDiam = dSawDiam2, dMaxDepth = dSawMaxDepth2, dSawThick = dSawThick2}
|
||||
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 lunghezza massima di lavoro della sega a catena
|
||||
local sSawing = ML.FindSawing( 'Sawing')
|
||||
local dMaxMat = 0
|
||||
local dTlen = 0
|
||||
if EgtMdbSetCurrMachining( sSawing or '') then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
dTLen = EgtTdbGetCurrToolParam( MCH_TP.LEN) or dTLen
|
||||
end
|
||||
end
|
||||
-- assegno offset in lunghezza
|
||||
local dOffs = 0
|
||||
-- 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
|
||||
-- se pezzo non troppo alto, taglio singolo da sopra
|
||||
if b3Raw:getDimZ() < dMaxMat - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL then
|
||||
local cutDepth = b3Raw:getDimZ() + BD.CUT_EXTRA_MIN
|
||||
sNotesSplit = 'Split;'
|
||||
bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_TOP, cutDepth, sNotesSplit, dOffs)
|
||||
if not bOk then return bOk, sErr, nNewPhase end
|
||||
-- se pezzo non troppo largo, taglio singolo da davanti
|
||||
elseif b3Raw:getDimY() + BD.CUT_EXTRA_MIN < min( dMaxMat, dTLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
|
||||
local cutDepth = b3Raw:getDimY() + BD.CUT_EXTRA_MIN
|
||||
sNotesSplit = 'Split;'
|
||||
bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_FRONT, cutDepth, sNotesSplit, dOffs)
|
||||
if not bOk then return bOk, sErr, nNewPhase end
|
||||
-- altrimenti tagli dai due fianchi (dietro e davanti)
|
||||
else
|
||||
local cutDepth = 0.5 * b3Raw:getDimY() + BD.CUT_EXTRA_MIN
|
||||
-- se la sega a catena non può completare lo split esco
|
||||
if cutDepth >= min( dMaxMat, dTLen - BD.C_SIMM_ENC) + 10 * GEO.EPS_SMALL then
|
||||
sErr = 'Error : section too big for splitting'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr, -1
|
||||
end
|
||||
local sNotesSplit = 'Presplit;'
|
||||
local bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_BACK, cutDepth, sNotesSplit, dOffs)
|
||||
if not bOk then return bOk, sErr, nNewPhase end
|
||||
sNotesSplit = 'Split;'
|
||||
bOk, sErr = MakeSplitByChainSaw( Proc.Id, MCH_MILL_FU.PARAL_FRONT, cutDepth, sNotesSplit, dOffs)
|
||||
if not bOk then return bOk, sErr, nNewPhase end
|
||||
-- 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
|
||||
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET)
|
||||
nNewPhase = EgtGetCurrPhase()
|
||||
nDispId = EgtGetPhaseDisposition( nNewPhase)
|
||||
local nDispId = EgtGetPhaseDisposition( nNewPhase)
|
||||
if sDownOrSideOrStd == 'down' then
|
||||
EgtRotateRawPart( nRawId, X_AX(), 180)
|
||||
EgtSetInfo( nDispId, 'TYPE', 'MID2')
|
||||
@@ -411,11 +736,52 @@ 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 == 1 or nQ05 == 0 or ( not bSplit and dMaxElev > dSawThickCheck) then
|
||||
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 = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT)
|
||||
local bOk, sErr
|
||||
if bNeedVerticalAddedCuts then
|
||||
-- ad ogni offset di taglio dovrò fare prima i tagli verticali e poi i cubetti
|
||||
for i = nCuts, 1, -1 do
|
||||
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
|
||||
-- faccia di taglio all'offset corrente
|
||||
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
local AddProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId}
|
||||
Topology.Classify( AddProc, b3Raw)
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local vtMoveSurf = Vector3d( -dCutOffset, 0, 0)
|
||||
EgtMove( AddId, vtMoveSurf, GDB_RT.GLOB)
|
||||
-- eventuale faccia di taglio all'offset precedente, per limitare il dicing e evitare di tagliare i cubetti nel vuoto
|
||||
local nLimitingSurf
|
||||
if nCuts > 1 then
|
||||
nLimitingSurf = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||
local dLastCutOffset = i * dOffsL
|
||||
local vtMoveLimitingSurf = Vector3d( -dLastCutOffset + 10 * GEO.EPS_SMALL, 0, 0)
|
||||
EgtMove( nLimitingSurf, vtMoveLimitingSurf, GDB_RT.GLOB)
|
||||
local vtNLimitingSurf = EgtSurfTmFacetNormVersor( nLimitingSurf, 0, GDB_ID.ROOT)
|
||||
if AreOppositeVectorApprox( X_AX(), vtNLimitingSurf) then EgtInvertSurf( nLimitingSurf) end
|
||||
end
|
||||
-- tagli verticali
|
||||
bOk, sErr = AddVerticalPreCuts( AddProc, sCutting, 0, b3Raw, sNotes, dOffsL)
|
||||
if not bOk then return bOk, sErr end
|
||||
-- tagli a cubetti con eventuale superficie limitante
|
||||
local sLeadInOutType = 'PerpendicularOutraw'
|
||||
bOk, sErr = Cut.Make( AddProc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nLimitingSurf, sLeadInOutType)
|
||||
end
|
||||
-- tagli aggiuntivi non necessari
|
||||
else
|
||||
local sLeadInOutType = 'PerpendicularOutraw'
|
||||
bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dMaxElev, nil, false, true, b3Raw, sNotes, dCurrOvmT, nil, nil, sLeadInOutType)
|
||||
end
|
||||
if sNotesFinal then
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
||||
end
|
||||
@@ -450,135 +816,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() - dMaxDepth)
|
||||
local dSawRad = dSawDiam / 2
|
||||
local dKL = dSawRad - dMaxDepth + b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN
|
||||
if BD.C_SIMM then
|
||||
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||
else
|
||||
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||
end
|
||||
end
|
||||
|
||||
-- per travi alte faccio faccio dei tagli orizzontali aggiuntivi
|
||||
local _, _, dimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
local dMinTailScrapForHorizontalCuts = 10.123
|
||||
local bAreHorizontalCutsNeeded = ( dimV > BD.MAX_LEN_DICE) and not bBigSectionCut and ( dLenEndRaw > dMinTailScrapForHorizontalCuts - 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 nForceWorkSide = MCH_MILL_WS.LEFT
|
||||
local bForceInvert = true
|
||||
local nForceSCC = MCH_SCC.ADIR_XM
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0 , sCutting, dSawDiam, nFaceUse, nil, -0.1 - dCutXOffset, BD.CUT_SIC, dHorizontalCutOffset, 0, 0, 'Precut;', b3Raw, bForceInvert, nForceWorkSide, nForceSCC)
|
||||
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 bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutXOffset, dAccStart, dAccEnd, 'Cut;', 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
|
||||
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 + dMaxDepth2 - dDimZ
|
||||
if ( dExtra - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL < 0) and not bBigSectionCut then
|
||||
local sErr = 'Error : section too big for tail cut'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- calcolo extra taglio ed accorciamento
|
||||
local dCutExtra = -dMaxDepth2 + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||
local dCutExtra2 = -dMaxVertDepth + dExtra / 2 + BD.CUT_EXTRA_MIN
|
||||
local dAccStart = 0
|
||||
-- limiti da sotto
|
||||
local dVzLimDwnUp
|
||||
if BD.TURN then dVzLimDwnUp = -2 end
|
||||
-- eseguo i tagli da sotto necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, dVzLimDwnUp, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
-- eseguo i tagli da sopra necessari
|
||||
for i = nCuts, 1, -1 do
|
||||
local dCutOffset = ( i - 1) * dOffsL
|
||||
local sNotes
|
||||
if bSplit then
|
||||
sNotes = EgtIf( i == 1, 'Split;', 'Presplit;')
|
||||
else
|
||||
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
|
||||
end
|
||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, dVzLimDwnUp, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
|
||||
if not bOk then return false, sErr end
|
||||
end
|
||||
end
|
||||
return true, nil, nNewPhase
|
||||
end
|
||||
return bOk, sErr, nNewPhase
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
return ProcessSplit
|
||||
|
||||
@@ -111,7 +111,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
@@ -134,7 +134,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
@@ -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
|
||||
@@ -320,10 +322,12 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if bAdj12 then
|
||||
if dAng12 < 0 then
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 2)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
end
|
||||
elseif bAdj20 then
|
||||
if dAng20 < 0 then
|
||||
EgtSurfTmSwapFacets( Proc.Id, 1, 2)
|
||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
||||
end
|
||||
end
|
||||
-- dati delle facce
|
||||
@@ -390,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
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2022/11/03
|
||||
-- Gestione calcolo tacca a gradino per Travi
|
||||
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
||||
-- 2024/06/28 In MakeFourFaces aggiunta copia del parametro PartId sulla nuova Proc
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessStepJointNotch = {}
|
||||
@@ -11,6 +12,8 @@ local BL = require( 'BeamLib')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
local DC = require( 'DiceCut')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local Topology = require( 'FeatureTopology')
|
||||
local LapJoint = require( 'ProcessLapJoint')
|
||||
|
||||
EgtOutLog( ' ProcessStepJointNotch started', 1)
|
||||
|
||||
@@ -47,7 +50,7 @@ function ProcessStepJointNotch.Classify( Proc)
|
||||
-- numero delle facce
|
||||
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
|
||||
-- gestisco solo 2 o 4 facce
|
||||
if nFacetCnt ~= 2 and nFacetCnt ~= 4 and nFacetCnt ~= 6 and nFacetCnt ~= 8 then
|
||||
if nFacetCnt ~= 2 and nFacetCnt ~= 3 and nFacetCnt ~= 4 and nFacetCnt ~= 6 and nFacetCnt ~= 8 then
|
||||
return false, false
|
||||
end
|
||||
-- verifico le normali delle facce
|
||||
@@ -130,7 +133,12 @@ local function MakePocket( Proc, nPartId, ptPs, vtN, nFaceRef, nDiffWidth, sMchF
|
||||
-- calcolo il diametro utensile
|
||||
local dDiamTool
|
||||
if nUseRoughTool == 1 then
|
||||
dDiamTool = max( 80, min( tBHx[nFaceRef][1], tBHx[nFaceRef][2]))
|
||||
-- se feature passante prendo utensile più grande possibile
|
||||
if ( Proc.AffectedFaces.Top and Proc.AffectedFaces.Bottom) or ( Proc.AffectedFaces.Front and Proc.AffectedFaces.Back) then
|
||||
dDiamTool = nil
|
||||
else
|
||||
dDiamTool = max( 80, min( tBHx[nFaceRef][1], tBHx[nFaceRef][2]))
|
||||
end
|
||||
else
|
||||
-- se non uso truciolatore prendo il valore dalle dimensioni minime delle facce
|
||||
dDiamTool = min( tBHx[nFaceRef][1], tBHx[nFaceRef][2])
|
||||
@@ -281,8 +289,8 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN,
|
||||
-- setto a 0 eventuali offset
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, 0)
|
||||
-- applico gli allungamenti o accorciamenti considerando che la lavorazione è invertita
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, dTDiam / 2, - dTDiam / 2))
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, dTDiam / 2, - dTDiam / 2))
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, EgtIf( bOpenStart, dTDiam / 2 + 10, - dTDiam / 2))
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, EgtIf( bOpenEnd, dTDiam / 2 + 10, - dTDiam / 2))
|
||||
-- attacchi e uscite lineari con parte tg nulla
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||
@@ -383,7 +391,9 @@ local function MakeFourFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidt
|
||||
EgtSurfTmSwapFacets( AddId, 1, 3)
|
||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||
-- applico lavorazione
|
||||
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg}
|
||||
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg, PartId = Proc.PartId}
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
Topology.Classify( NewProc, b3Raw)
|
||||
local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
@@ -478,7 +488,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
end
|
||||
-- se diretta verso Z
|
||||
elseif abs( vtExtr:getZ()) > 0.99 then
|
||||
elseif abs( vtExtr:getZ()) > 0.99 and not ( BD.DOWN_HEAD or nTypePos == 0) then
|
||||
-- se diretta verso Z+
|
||||
if vtExtr:getZ() > 0 then
|
||||
-- se sborda verso Z+ abilito solo la lavorazione della parte normale
|
||||
@@ -503,7 +513,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local dExtra = 2
|
||||
-- recupero la lavorazione
|
||||
local sMillType = 'Mark'
|
||||
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
||||
local bDownHead = BD.DOWN_HEAD and vtExtr:getZ() < GEO.EPS_SMALL
|
||||
local sMilling, bH2
|
||||
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||
if not sMilling then
|
||||
@@ -531,11 +541,19 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
if bExeOpposite then
|
||||
bDownHead = BD.DOWN_HEAD and vtExtr:getZ() > - GEO.EPS_SMALL
|
||||
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
bDownHead = ( bDownHead and bH2)
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtAddMachining( sName2, sMilling)
|
||||
@@ -556,7 +574,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch2Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
@@ -566,6 +584,9 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if Proc.Fct == 3 then
|
||||
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- esecuzione eventuale smusso
|
||||
-- ottengo anche il flag che indica che la feature è larga come la trave
|
||||
local bOkc, sErrC, nDiffWidth = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessTenon.lua by Egaltech s.r.l. 2023/03/27
|
||||
-- ProcessTenon.lua by Egaltech s.r.l. 2023/09/26
|
||||
-- Gestione calcolo tenone per Travi
|
||||
-- 2021/10/04 Corretto calcolo HCING per pezzi piccoli.
|
||||
-- 2022/02/15 Aggiornata VerifyOrientation per macchine con testa da sotto.
|
||||
@@ -10,6 +10,7 @@
|
||||
-- 2022/12/20 Aggiunta gestione smusso. Migliorata scelta tra sopra e sotto per il punto di inizio. In VerifyOrientation aggiunta trave medio alta.
|
||||
-- 2023/01/20 Modificata scelta lato di attacco per pezzo piccolo su macchine con pinza speciale (pinza 5).
|
||||
-- 2023/03/27 Migliorate condizioni scelta pretaglio con lama o fresa; gestione unificata con ProcessDtTenon. Migliorato calcolo altezza tenone.
|
||||
-- 2023/09/26 Per macchina TURN si assegna SCC per privilegiare accesso dal lato corto della trave.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessTenon = {}
|
||||
@@ -199,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
|
||||
@@ -240,7 +242,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
@@ -319,13 +321,19 @@ 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
|
||||
if not BD.C_SIMM and not BD.TURN then
|
||||
if BD.TURN then
|
||||
if b3Solid:getDimY() >= b3Solid:getDimZ() then
|
||||
nSCC = MCH_SCC.ADIR_ZP
|
||||
else
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
end
|
||||
elseif not BD.C_SIMM then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
if abs( vtExtr:getY()) > 0.088 then
|
||||
nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- ProcessTyroleanDovetail.lua by Egaltech s.r.l. 2022/03/21
|
||||
-- Gestione calcolo giunzione tirolese
|
||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
||||
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessTyroleanDovetail = {}
|
||||
@@ -231,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
|
||||
@@ -329,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
|
||||
@@ -510,10 +513,10 @@ local function MakeMachByMill( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b
|
||||
dStepmach = dMaxMat * 0.5
|
||||
end
|
||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, sin(dSideAngle))
|
||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, sin(dSideAngle))
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
-- provo eliminando i sottosquadra
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, -2)
|
||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, -2)
|
||||
if not nFacInd or nFacInd < 0 then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MakeMachByMill could not find reference face'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
-- ProcessVariant.lua by Egaltech s.r.l. 2023/11/08
|
||||
-- Gestione calcolo Feature Custom (Variant) per Travi
|
||||
-- 2023/11/08 Creazione modulo.
|
||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local ProcessVariant = {}
|
||||
|
||||
-- Include
|
||||
require( 'EgtBase')
|
||||
local BL = require( 'BeamLib')
|
||||
|
||||
EgtOutLog( ' ProcessVariant started', 1)
|
||||
|
||||
-- Dati
|
||||
local BD = require( 'BeamData')
|
||||
local ML = require( 'MachiningLib')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
function ProcessVariant.Identify( Proc)
|
||||
return (( Proc.Grp == 0 or Proc.Grp == 1 or Proc.Grp == 2 or Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 900)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Classificazione della feature: decide se la feature è in una posizione lavorabile
|
||||
local function ClassifyPocket( Proc, b3Raw)
|
||||
-- recupero gli indici delle facce da lavorare
|
||||
local vFace = EgtGetInfo( Proc.Id, 'Faces', 'vi')
|
||||
if not vFace or #vFace == 0 then
|
||||
local sErr = 'Error : missing Faces for Pocketing'
|
||||
EgtOutLog( sErr)
|
||||
return false
|
||||
end
|
||||
-- recupero le normali di tutte le facce e verifico siano uguali
|
||||
local vtN
|
||||
for i = 1, #vFace do
|
||||
local vtNf = EgtSurfTmFacetNormVersor( Proc.Id, vFace[i], GDB_ID.ROOT)
|
||||
if not vtN then
|
||||
vtN = vtNf
|
||||
else
|
||||
if not AreSameVectorApprox( vtN, vtNf) then
|
||||
local sErr = 'Error : Faces for Pocketing with different orientation'
|
||||
EgtOutLog( sErr)
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
local bDown = ( vtN:getZ() < - 0.5)
|
||||
-- se da sotto e presente rinvio angolare verifico se c'è opportuna lavorazione
|
||||
if bDown and BD.ANG_TRASM then
|
||||
local dMaxDiam = EgtGetInfo( Proc.Id, 'MaxDiam', 'd')
|
||||
if ML.FindPocketing( 'Pocket_AT', dMaxDiam) then
|
||||
bDown = false
|
||||
end
|
||||
end
|
||||
return true, bDown, false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ProcessVariant.Classify( Proc, b3Raw)
|
||||
-- recupero il codice identificativo e il tipo di lavorazione
|
||||
local sCode = EgtGetInfo( Proc.Id, 'DES')
|
||||
local sType = EgtGetInfo( Proc.Id, 'Type')
|
||||
-- gestione in base al tipo
|
||||
if sType == 'Pocket' then
|
||||
return ClassifyPocket( Proc, b3Raw)
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
local function MakePocket( Proc, nRawId, b3Raw, nPartId)
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
-- recupero gli indici delle facce da lavorare
|
||||
local vFace = EgtGetInfo( Proc.Id, 'Faces', 'vi')
|
||||
if not vFace or #vFace == 0 then
|
||||
local sErr = 'Error : missing Faces for Pocketing'
|
||||
EgtOutLog( sErr)
|
||||
return false
|
||||
end
|
||||
-- recupero i dati delle facce (le normali sono identiche)
|
||||
local dTotDepth = 0
|
||||
local vDepth = {}
|
||||
for i = 1, #vFace do
|
||||
vDepth[i] = BL.GetFaceElevation( Proc, vFace[1], b3Solid)
|
||||
dTotDepth = max( dTotDepth, vDepth[i])
|
||||
end
|
||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, vFace[1], GDB_ID.ROOT)
|
||||
-- recupero eventuale massimo diametro impostato
|
||||
local dMaxDiam = EgtGetInfo( Proc.Id, 'MaxDiam', 'd')
|
||||
-- abilitazione lavorazione da sotto
|
||||
local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259)
|
||||
local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.174)
|
||||
local bMillAngTrasm = ( BD.ANG_TRASM and vtN:getZ() < -0.5)
|
||||
-- recupero la lavorazione
|
||||
local sPockType = EgtIf( not bMillAngTrasm, 'Pocket', 'Pocket_AT')
|
||||
local sPocketing = ML.FindPocketing( sPockType, dMaxDiam, dTotDepth)
|
||||
if not sPocketing then
|
||||
sPocketing = ML.FindPocketing( sPockType, dMaxDiam, dTotDepth / 2)
|
||||
if not sPocketing then
|
||||
local sErr = 'Error : pocketing not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dMillDiam = 20
|
||||
local dMaxDepth = 0
|
||||
if EgtMdbSetCurrMachining( sPocketing) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dMillDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
-- se elevazione superiore a massimo affondamento della fresa, segnalo
|
||||
local sWarn
|
||||
if dTotDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||
EgtOutLog( sWarn)
|
||||
end
|
||||
-- lavoro ogni faccia
|
||||
for i = 1, #vFace do
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i)
|
||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, vFace[i]}})
|
||||
-- imposto posizione braccio porta testa
|
||||
if vtN:getY() <= 0 then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, min( 0, dMaxDepth - vDepth[i]))
|
||||
-- imposto elevazione
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';')
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
return true, sWarn
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function ProcessVariant.Make( Proc, nRawId, b3Raw, nPartId)
|
||||
-- recupero il codice identificativo e il tipo di lavorazione
|
||||
local sCode = EgtGetInfo( Proc.Id, 'DES')
|
||||
local sType = EgtGetInfo( Proc.Id, 'Type')
|
||||
-- gestione in base al tipo
|
||||
if sType == 'Pocket' then
|
||||
return MakePocket( Proc, nRawId, b3Raw, nPartId)
|
||||
else
|
||||
return false, 'Variant Type non recognized for machining'
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
return ProcessVariant
|
||||
+1
-1
@@ -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
|
||||
|
||||
+35
-22
@@ -115,23 +115,6 @@ local function MyProcessInputData()
|
||||
end
|
||||
EgtDeselectAll()
|
||||
|
||||
-- Le ordino in senso di lunghezza crescente
|
||||
table.sort( vBeam, function( B1, B2)
|
||||
if abs( B1.Box:getDimX() - B2.Box:getDimX()) < 1 then
|
||||
return B1.Ind < B2.Ind
|
||||
else
|
||||
return B1.Box:getDimX() < B2.Box:getDimX()
|
||||
end
|
||||
end)
|
||||
do
|
||||
local sOut = ''
|
||||
for i = 1, #vBeam do
|
||||
sOut = sOut .. vBeam[i].Name .. ', '
|
||||
end
|
||||
sOut = sOut:sub( 1, -3)
|
||||
EgtOutLog( 'Travi ordinate : ' .. sOut, 1)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -152,12 +135,14 @@ local function MyProcessBeams()
|
||||
local dAddLen = BD.OVM_HEAD + ( #vBeam - 1) * BD.OVM_MID
|
||||
EgtOutLog( 'Ltot : '..EgtNumToString( dTotLen, 1) .. ' Lagg : '..EgtNumToString( dAddLen, 1)..' MinUnloadRaw : '.. EgtNumToString( BD.MinRaw + BD.OVM_MID, 1), 1)
|
||||
|
||||
-- Richiedo lunghezza del grezzo e sovramateriale di testa
|
||||
-- Richiedo lunghezza del grezzo, sovramateriale di testa, forzatura verticale e ordinamento automatico secondo la lunghezza
|
||||
local vsVal = EgtDialogBox( 'Lavora Travi' .. ' (Ltot='..EgtNumToString( dTotLen + dAddLen + 0.5, 0)..
|
||||
', Lmax='..EgtNumToString( BD.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BD.MinRaw + BD.OVM_MID, 0)..')',
|
||||
{'Lunghezza grezzo', EgtNumToString( BD.STD_RAW, 0)},
|
||||
{'Sovramateriale di testa', EgtNumToString( BD.OVM_HEAD, 0)},
|
||||
{'Forza sezione verticale', ' CB:true,*false'})
|
||||
{'Offset intermedio', EgtNumToString( BD.OVM_MID, 0)},
|
||||
{'Forza sezione verticale', ' CB:true,*false'},
|
||||
{'Ordina per lunghezza', ' CB:true,*false'})
|
||||
if not vsVal then
|
||||
EgtDraw()
|
||||
return
|
||||
@@ -180,9 +165,17 @@ local function MyProcessBeams()
|
||||
EgtDraw()
|
||||
return false
|
||||
end
|
||||
|
||||
local dOvmMid = EgtEvalNumExpr( vsVal[3])
|
||||
if not dOvmMid then
|
||||
local sOut = 'Offset intermedio : ' .. vsVal[3]
|
||||
EgtOutLog( sOut)
|
||||
EgtOutBox( sOut, 'Lavora Travi', 'WARNING')
|
||||
EgtDraw()
|
||||
return false
|
||||
end
|
||||
|
||||
-- Sistemo sezione barra con travi
|
||||
local bVert = ( vsVal[3] == 'true')
|
||||
local bVert = ( vsVal[4] == 'true')
|
||||
if bVert then
|
||||
if dRawW > dRawH then dRawW, dRawH = dRawH, dRawW end
|
||||
end
|
||||
@@ -221,8 +214,28 @@ local function MyProcessBeams()
|
||||
return false
|
||||
end
|
||||
|
||||
-- Se richiesto, ordino le travi in senso di lunghezza crescente
|
||||
local bOrd = ( vsVal[5] == 'true')
|
||||
if bOrd then
|
||||
table.sort( vBeam, function( B1, B2)
|
||||
if abs( B1.Box:getDimX() - B2.Box:getDimX()) < 1 then
|
||||
return B1.Ind < B2.Ind
|
||||
else
|
||||
return B1.Box:getDimX() < B2.Box:getDimX()
|
||||
end
|
||||
end)
|
||||
end
|
||||
do
|
||||
local sOut = ''
|
||||
for i = 1, #vBeam do
|
||||
sOut = sOut .. vBeam[i].Name .. ', '
|
||||
end
|
||||
sOut = sOut:sub( 1, -3)
|
||||
EgtOutLog( 'Travi ordinate : ' .. sOut, 1)
|
||||
end
|
||||
|
||||
-- Sistemo le travi nel grezzo
|
||||
local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
|
||||
local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam)
|
||||
if not bOk then
|
||||
EgtOutLog( sErr)
|
||||
EgtOutBox( sErr, 'Lavora Travi', 'ERROR')
|
||||
|
||||
+383
-4
@@ -1,20 +1,399 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 2.7h2 (19/08/2025)
|
||||
- Modif : migliorata ottimizzazione teste
|
||||
- Modif : migliorate forature in doppio
|
||||
- Modif : in LapJoint migliorate lavorazioni lama + sega a catena
|
||||
- Modif : in LapJoint migliorata spezzatura per feature lunghe rispetto al pezzo
|
||||
- Modif : in LapJoint tipo BirdsMouth migliorata lavorazione faccia inclinata
|
||||
- Modif : in StepJointNotch, se 3 facce si riconduce a LapJoint
|
||||
|
||||
Versione 2.7h1 (05/08/2025)
|
||||
- Fixed : in Mortise migliorata la lavorazione in caso di feature trimmata
|
||||
- Modif : in LapJoint, riduzione massimo materiale lama per lavorazioni antischeggia di lama con direzione verticale
|
||||
- Modif : in LapJoint migliorie alla lavorazione tipo BlockHaus
|
||||
- Modif : nei profili si usa il tipo lavorazione Prof_end per la finitura
|
||||
|
||||
Versione 2.7g5 (14/07/2025)
|
||||
- Fixed : in tagli di testa e coda corretti attacchi
|
||||
|
||||
Versione 2.7g4 (11/07/2025)
|
||||
- Fixed : in LapJoint 2 facce correzione nella scelta lama da sotto
|
||||
|
||||
Versione 2.7g3 (11/07/2025)
|
||||
- Fixed : in RidgeLap corretta scelta del lato da lavorare
|
||||
|
||||
Versione 2.7g2 (10/07/2025)
|
||||
- Fixed : in LapJoint correzione per caso in cui la sega a catena lavorava la tasca in modo errato
|
||||
|
||||
Versione 2.7g1 (08/07/2025)
|
||||
- Added : in LapJoint, aggiunti smussi anche se lavorazione con truciolatore
|
||||
- Added : per profilo caudato aggiunta finitura con fresa piccola
|
||||
- Added : gestione tastatura
|
||||
- Modif : nei tagli di testa e coda, compresi quelli di spezzatura, la lama evita di arretrare se non necessario
|
||||
- Modif : in LongDoubleCut migliorie varie
|
||||
- Modif : in RidgeLap migliorie varie
|
||||
- Modif : nelle forature che attraversano un taglio ora si considera la profondità già lavorata
|
||||
- Fixed : in LongDoubleCut corretta lavorazione aggiunta erroneamente dopo separazione
|
||||
|
||||
Versione 2.7f3 (19/06/2025)
|
||||
- Modif : in StepJointNotch corretta distanza attacco in/out
|
||||
|
||||
Versione 2.7f2 (18/06/2025)
|
||||
- Modif : in LongDoubleCut aggiunto messaggio feature non completa se utensile non arriva sul fondo
|
||||
- Modif : in StepJointNotch, se si forza truciolatore, si prende utensile più grande
|
||||
- Fixed : in LapJoint, piccola correzione calcolo sovrapposizione trimesh per svuotatura
|
||||
- Fixed : in LapJoint, per sovrapposizione in spezzatura, corretto caso tipo Tunnel
|
||||
|
||||
Versione 2.7f1 (03/06/2025)
|
||||
- Modif : in tenone coda di rondine modificato angolo limite tenone per lavorazione in sottosquadro
|
||||
- Modif : migliorie per lavorazioni su aggregato
|
||||
|
||||
Versione 2.7e2 (23/05/2025)
|
||||
- Modif : in tagli di lama migliorie alla scelta del lato da lavorare
|
||||
- Modif : in mortasa coda di rondine migliorati i percorsi
|
||||
- Modif : in tenone coda di rondine migliorate le lavorazioni da sotto
|
||||
- Fixed : in Scarf Joint correzione alla scelta faccia da lavorare
|
||||
|
||||
Versione 2.7e1 (05/05/2025)
|
||||
- Modif : in LapJoint se tunnel verticale lavorato solo da sopra e l'utensile non arriva, si restituisce warning
|
||||
- Fixed : in taglio di separazione si riduce percorso di taglio solo se il pezzo è effettivamente alto
|
||||
- Fixed : in foratura corretto caso in cui non si sceglieva l'utensile più lungo disponibile
|
||||
- Fixed : In BatchProcess (Ts7) corretta generazione in caso di progetto senza ricalcolo
|
||||
|
||||
Versione 2.7d3 (22/04/2025)
|
||||
- Fixed : in LapJoint corretta gestione errata Q04
|
||||
|
||||
Versione 2.7d2 (17/04/2025)
|
||||
- Added : in scanalatura aggiunta Q03 per forzare fresa
|
||||
- Modif : in slot con lama + sega a catena abilitata lavorazione da sotto per macchine con testa sopra
|
||||
- Modif : nei tagli modifche in caso di tagli di coda anticipati
|
||||
- Modif : in lavorazioni tipo tacca ma 3 facce migliorata la scelta faccia
|
||||
|
||||
Versione 2.7d1 (04/04/2025)
|
||||
- Fixed : in PreDrill piccola correzione
|
||||
- Fixed : nei tagli varie correzioni
|
||||
- Fixed : in HeadCut e Split corretto calcolo lunghezza extra di taglio
|
||||
|
||||
Versione 2.7c2 (24/03/2025)
|
||||
- Fixed : in BatchProcess (Ts7) riabilitata modifica barra erroneamente rimossa
|
||||
|
||||
Versione 2.7c1 (17/03/2025)
|
||||
- Modif : in HeadCut e Split, per decidere se fare doppio taglio verticale, si controlla anche il massimo possibile e non solo il minimo
|
||||
- Modif : in LapJoint migliorato controllo per decidere se feature di coda
|
||||
- Modif : nei tagli, se taglio rivolto verso il basso e non possibile tagliare di fianco, si fa in fase ribaltata
|
||||
- Fixed : in BatchProcess (Ts7) corretta restituzione stato feature erroneamente segnalata verde
|
||||
- Fixed : corretta restituzione stato feature lavorata in doppio
|
||||
|
||||
Versione 2.7b3 (03/03/2025)
|
||||
- Modif : in forature passanti orizzontali fatte da un solo lato, si inverte il lato di lavoro in base all'utensile scelto
|
||||
- Modif : in LapJoint in lavorazione tipo BH permessa U passante non parallela agli assi principali; attacchi migliorati
|
||||
- Modif : in LapJoint le feature di coda con pezzo lungo vengono spostate sempre dopo separazione
|
||||
- Fixed : in macchine tipo Turn piccoli miglioramenti ai tagli di lama
|
||||
|
||||
Versione 2.7b2 (05/02/2025)
|
||||
- Modif : si consentono DrillPocket in doppio solo se foro non passante
|
||||
|
||||
Versione 2.7b1 (04/02/2025)
|
||||
- Modif : in tagli di testa e coda l'utilizzo delle lame grandi (es: 1000 su 15003TMAX) è limitato ai pezzi più bassi di 300 mm e più larghi di 300 mm
|
||||
|
||||
Versione 2.7a2 (23/01/2025)
|
||||
- Added : in RidgeLap aggiunta Q05 per usare la fresa tipo LapJoint
|
||||
- Fixed : in BatchProcess (Ts7) piccola correzione
|
||||
- Fixed : in ScarfJoint, in caso di taglio dal lato, aggiunta estensione oltre il bordo
|
||||
|
||||
Versione 2.7a1 (21/01/2025)
|
||||
- Added : in FreeContour aggiunta Q09 per inversione ultima lavorazione
|
||||
- Modif : in Cut, si taglia dal basso solo se il pezzo piccolo è già staccato dalla barra
|
||||
- Modif : in BatchProcess (Ts7) aggiunta scrittura id progetto e produzione in Btm
|
||||
|
||||
Versione 2.6l2 (07/01/2025)
|
||||
- Added : in LapJoint abiitata SideMillAsBlade anche da sotto e varie migliorie
|
||||
- Modif : in LapJoint L030 aggiunto Q03=4 per lavorare con fresa evitando tasche aperte testa/coda
|
||||
- Modif : in LapJoint modifiche per gestione fresa a disco su aggregato
|
||||
- Modif : in fresature con lama o simili aggiunta la possibilità di invertire il senso di percorrenza calcolato in automatico
|
||||
- Modif : migliorie all'ordinamento
|
||||
- Fixed : in LapJoint la Q per forzare lavorazione di lato funziona solo se la feature è aperta davnti o dietro
|
||||
|
||||
Versione 2.6l1 (11/12/2024)
|
||||
- Added : aggiunta gestione slot e tagli di lama con lame molto grandi
|
||||
- Modif : in lama + motosega aggiunta gestione slot aperte con lato obliquo
|
||||
- Modif : modificata retrazione per tenoni aperti
|
||||
|
||||
Versione 2.6k2 (28/11/2024)
|
||||
- Modif : nei tagli migliorati i casi in cui si inverte l'SCC per facilitare la caduta del legno
|
||||
- Modif : nei tagli migliorato controllo rimozione del primo cubetto molto piccolo
|
||||
- Modif : nei tagli migliorati i casi con bilinea
|
||||
- Fixed : in lapjoint corretto un caso in cui si sbagliava a calcolare la dimensione della tasca
|
||||
|
||||
Versione 2.6k1 (15/11/2024)
|
||||
- Modif : in macchine tipo Fast lunghezza minima feature per considerare taglio lungo portata a 400 mm
|
||||
- Modif : in tacche si applica svuotatura anche nel caso di elevazione non raggiunta
|
||||
- Modif : in forature in doppio, se necessario, si aumenta lo step per evitare collisione tra le punte durante lavorazione
|
||||
- Fixed : in L010 correzione in utilizzo Q07 (forzatura frese)
|
||||
- Fixed : in coda di rondine corretto bug che causava un blocco anomalo del programma
|
||||
|
||||
Versione 2.6j4 (06/11/2024)
|
||||
- Fixed : corretto caso in cui i fori passanti fatti con due teste finiviano nella rotazione sbagliata, provocando un errore di chariot collision
|
||||
|
||||
Versione 2.6j3 (18/10/2024)
|
||||
- Modif : nei tagli orizzontali si inverte SCC per evitare problemi di cubetti incastrati
|
||||
- Modif : modifiche in ordinamento fori che intersecano tenoni
|
||||
- Fixed : corretto caso con fori sul tenone spostati in coda nella fase errata
|
||||
|
||||
Versione 2.6j2 (17/10/2024)
|
||||
- Fixed : in forature con precedenza corretto caso in cui il foro veniva ripetuto in rotazioni diverse
|
||||
|
||||
Versione 2.6j1 (10/10/2024)
|
||||
- Modif : se la macchina è tipo BlockHaus, i LapJoint vengono fatti prima del taglio di separazione
|
||||
- Modif : se tenone di coda è attraversato da foro allora anche il foro sarà di coda
|
||||
- Modif : migliorato ordinamento per tenoni con foro secante
|
||||
- Modif : in FreeContour migliorato pinzaggio
|
||||
- Modif : in LapJoint miglioramenti vari alla lavorazione delle facce oblique
|
||||
- Modif : In RidgeLap l'ingombro testa coda considera inclinazione feature per pinzaggio
|
||||
- Added : in FreeContour aggiunta Q08 per forzare come pinzabile l'area della feature e Q07 per ignorare possibili problemi di lettura laser
|
||||
- Added : in tagli aggiunta Q07 per forzare uso fresa
|
||||
|
||||
Versione 2.6i3 (08/10/2024)
|
||||
- Modif : In RidgeLap, ingombro testa coda considera inclinazione feature per pinzaggio.
|
||||
|
||||
Versione 2.6i2 (13/09/2024)
|
||||
- Modif : in FacesBySaw si invertono gli accorciamenti solo se l'inversione del percorso non è forzata dall'esterno; adeguati HeadCut e Split
|
||||
- Modif : in nesting correzione in lettura array per cambio dll di lettura
|
||||
- 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
|
||||
|
||||
Versione 2.6g1 (01/07/2024)
|
||||
- Modif : in LongDoubleCut gestita correttamente SCC per lama
|
||||
- Modif : in MachiningLib miglioramenti a scelta testa ottimizzata
|
||||
- Modif : in ProcessDtTenon correzione in scelta testa
|
||||
- Modif : In LapJoint -> VerifySideMillAsSaw modificato criterio ricerca utensile in base a normale della faccia
|
||||
- Fixed : in MakeAntiSplintBySaw se non si trova adiacenza tra le facce si restituisce errore
|
||||
- Fixed : In StepJointNotch, MakeFourFaces corretta copia feature con PartId mancante
|
||||
|
||||
Versione 2.6f2 (17/06/2024)
|
||||
- Modif : correzione a tagli a cubetti (ripristinata versione pre 2.6f1)
|
||||
|
||||
Versione 2.6f1 (06/06/2024)
|
||||
- Added : Q04 (tipo longcut) abilitato anche in RidgeLap (T30), se riconducibile a 2 facce
|
||||
- Modif : migliorie al taglio a cubetti
|
||||
- Modif : in LapJoint -> MakePocket abilitata Q per forzare massima elevazione
|
||||
- Fixed : correzione a SCC per lama da sotto con aggregato
|
||||
- Fixed : correzioni a ottimizzazione teste per macchine con teste sopra/sotto
|
||||
|
||||
Versione 2.6e5 (27/05/2024)
|
||||
- Modif : in LapJoint corretto typo in lavorazione lamello che impediva il funzionamento corretto.
|
||||
|
||||
Versione 2.6e4 (20/05/2024)
|
||||
- Modif : in SawPlusChain le lavorazioni di sega a catena aggiuntive (side) si fermano in mezzeria se tasca passante
|
||||
- Modif : in SawPlusChain il tunnel con sega a catena viene fatto da un solo lato se possibile
|
||||
|
||||
Versione 2.6e3 (14/05/2024)
|
||||
- Modif : in SawPlusChain aggiunta gestione lavorazioni aggiuntive lati aperti e tunnel
|
||||
- Fixed : in Cut -> MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti.
|
||||
|
||||
Versione 2.6e2 (10/05/2024)
|
||||
- Modif : in FeatureTopology aggiunta proprietà IsTrough = true anche a Cut
|
||||
- Modif : LongCut : se non trova fresa per pulizia, da messaggio di warning anziché di errore
|
||||
- Fixed : LongCut : allungamento percorso ingresso per evitare collisioni durante approccio pezzo quando si setta OutRaw.
|
||||
|
||||
Versione 2.6e1 (03/05/2024)
|
||||
- Modif : in LapJoint Groove verso il basso lavorata di preferenza dal lato
|
||||
- Modif : in LapJoint -> SideMillAsSaw gestito anche rabbet passante
|
||||
- Fixed : in BeamExec box della feature aggiornato dopo rotazione
|
||||
- Fixed : in BeamExec GetProcessAffectedFaces e GetFacetsInfo rilanciati dopo rotazione
|
||||
- Fixed : In LapJoint -> MakeMoreLongFaces corretto calcolo divisione in parti per evitare problemi di ceil con interi perfetti
|
||||
|
||||
Versione 2.6d2 (11/04/2024)
|
||||
- Added : in LapJoint aggiunta strategia per fare tasche con lama + sega a catena, attivata da Q11
|
||||
|
||||
Versione 2.6d1 (08/04/2024)
|
||||
- Fixed : in Long2Cut corretto nome passato alla BL.GetBlockedAxis
|
||||
- Fixed : in MakeTwo rimossa gestione calcolo differente su ultima passata in caso di macchina FAST
|
||||
- Fixed : in LapJoint -> ForceSideMill escluso caso 4 facce senza possibilità di ingresso lungo Y.
|
||||
|
||||
Versione 2.6c4 (18/03/2024)
|
||||
- Fixed : correzioni a gestione prefori.
|
||||
|
||||
Versione 2.6c3 (15/03/2024)
|
||||
- Added : Aggiunta gestione prefori
|
||||
- Fixed : in LapJoint correzione a calcolo ingombro per feature basse e lunghe dalla testa.
|
||||
|
||||
Versione 2.6c2 (12/03/2024)
|
||||
- Added : in Mortase Aggiunta possibilità di inserire lavorazione di smusso
|
||||
- Added : in FreeContour aggiunto smusso se lav. di svuotatura
|
||||
- Added : in BeamExec creata funzione calcolo dipendenze tra feature
|
||||
- Added : In BeamExec -> CollectFeatures si scrive ora Width e Height della faccia sia trimmate con il grezzo che intere
|
||||
- Added : implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket
|
||||
- Modif : in LapJoint migliorata ricerca pocket (VerifyPocket)
|
||||
- Modif : implementato attacco esterno se tasca 4 facce sulla coda ma nessun pezzo successivo
|
||||
- Modif : rimossi simboli di debug da compile
|
||||
- Fixed : In FreeContour corretto caso di smusso non passante
|
||||
|
||||
Versione 2.6c1 (29/02/2024)
|
||||
- Modif : in FacesBySaw e LapJoint migliorato calcolo area non pinzabile in testa HCING e coda TCING
|
||||
- Modif : vari miglioramenti all'ordinamento delle lavorazioni
|
||||
- Modif : in Mortise forzata SPIRAL_IN se c'è almeno un lato aperto
|
||||
- Modif : in tenone a coda di rondine aumentato a 8 il numero massimo di passate (era 6)
|
||||
- Modif : in lapjoint a due facce migliorata la scelta della lama da sotto
|
||||
- Fixed : in LapJoint corretto bug che impediva l'esecuzione della lavorazion con antischeggia attivo
|
||||
|
||||
Versione 2.6b1 (14/02/2024)
|
||||
- Fixed : corretto bug in Split in cui si chiamava la EgtSurfTmFacetNormVersor senza riferimento
|
||||
- Fixed : in L20 corretta gestione 2 facce
|
||||
- Modif : modifiche per limiti pinzaggio con pinze con fronte verticale (ONE, PF) anzichè inclinato (FAST) quindi parametro BD.VICE_MINH grande
|
||||
- Modif : nei tagli con sega a catena ora si considera l'ingombro della testa per il calcolo della massima profondità
|
||||
- Modif : in LapJoint ora i rabbet lungo X che guardano in basso sono sempre fatti con fresatura di lato per evitare di ruotare.
|
||||
|
||||
Versione 2.6a1 (24/01/2024)
|
||||
- Added : in HeadCut e Split aggiunti tagli verticali addizionali per travi di larghezza elevata
|
||||
- Added : in Split gestita separazione con sega a catena + lama
|
||||
- Added : in MachiningLib è ora possibile riordinare le lavorazioni in base a lunghezza e dimensione utensile
|
||||
- Added : modifiche per poter impostare offset intermedio anche se lanciato da EgtCam5
|
||||
- Modif : nelle lavorazioni si gestiscono ora seghe a catena multiple
|
||||
- Modif : in split con sega a catena ora si cerca di preferenza una lavorazione di tipo 'SawingForSplitting'. Se non trovata si cerca il tipo 'Sawing' come in precedenza
|
||||
- Modif : in split con sega a catena aggiunta estensione start/end del percorso se utensile lungo, per evitare collisioni con il pezzo durante rotazione
|
||||
- Modif : implementata funzione GetBlockedAxis per gestire l'asse bloccato per sega a catena e lama
|
||||
- Modif : in DiceCut corretto calcolo cubetti con superficie limitante parallela e opposta a quella di base
|
||||
|
||||
Versione 2.5l3 (08/01/2023)
|
||||
- Modif : modifiche per centrare i pezzi in Y sulla tavola (da flag BeamData.CENTER_BEAM)
|
||||
- Modif : resi più veloci i calcoli di FeatureTopology
|
||||
- Modif : migliorato calcolo attacco/uscite lame in FacesBySaw.
|
||||
|
||||
Versione 2.5l2 (20/12/2023)
|
||||
- Modif : in Cut e DoubleCut modifica in scelta ribaltamento trave quando si è in condizioni downUp
|
||||
- Modif : migliorato e esteso il funzionamento di SideMillAsSaw
|
||||
- Modif : in LapJoint con più facce, nelle OpenPocket, ammesso utensile con diametro fino a 3 volte la dimensione della tasca (era 2)
|
||||
- Modif : in RoundArch aggiunta gestione senso di rotazione fresa per lavorare sempre in concordanza
|
||||
- Fixed : correzione a GetFaceWithMostAdj per calcoli con facce che fanno ombra
|
||||
|
||||
Versione 2.5l1 (01/12/2023)
|
||||
- Added : in LongDoubleCut aggiunta Q05 per utilizzo lama anche in feature cieche conme per LongCut
|
||||
- Modif : Migliorato e velocizzato il calcolo elevazione (EgtSurfTmFacetElevationInBBox)
|
||||
- Fixed : in MakeTwo di FacesBySaw raffinamento calcolo vtRef per casi dubbi.
|
||||
|
||||
Versione 2.5k3 (28/11/2023)
|
||||
- Added : in Long2Cut gestite lavorazioni lama con Q05 come in LongCut.
|
||||
|
||||
Versione 2.5k2 (06/11/2023)
|
||||
- Added : in LapJoint, per L020, gestita lavorazione speciale gradino scala con fresatura + lama, attivata con Q09
|
||||
- Fixed : in ProcessSplit si imposta l'ingombro asse C correttamente anche per teste con asse rotante C con un solo braccio.
|
||||
|
||||
Versione 2.5k1 (02/11/2023)
|
||||
- Modif : in LapJoint gestito caso groove due facce >90° con fresa, se forzato da parametro Q
|
||||
- Modif : in LongCut e LongDoubleCut migliorata spezzatura taglio passante con due spezzoni
|
||||
- Modif : nei tagli di lama migliorata gestione con percorso bilinea
|
||||
- Modif : in LapJoint 2 facce longitudinali si usa taglio di lama solo se si taglia completamente, altrimenti fresa.
|
||||
|
||||
Versione 2.5j1 (23/10/2023)
|
||||
- Added : in Process (lancio da EgtCAM5 quindi uso praticamente solo interno) aggiunta possibilità di tenere ordine pezzi in barra come da selezione
|
||||
- Modif : in Topology aggiunti casi al check solo direzione principale
|
||||
- Modif : nella ricerca lavorazione da usare controllo di utensile attivo sostituito con controllo utensile presente nel setup corrente
|
||||
- Fixed : piccola correzione a Classify di FeatureTopology per casi senza geometria
|
||||
- Fixed : in HeadCut e Split corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
|
||||
- Fixed : in Lapjoint -> MakePocket aggiunto messaggio in caso si rovini il pezzo successivo.
|
||||
|
||||
Versione 2.5i2 (27/09/2023)
|
||||
- Added : aggiunto riconoscimento sottosquadro da facce non adiacenti
|
||||
- Modif : in lavorazione tenoni per Turn si assegna SCC per privilegiare accesso dal lato corto della trave.
|
||||
- Fixed : in LapJoint corretto caso tunnel lungo non lavorato correttamente
|
||||
- Fixed : in foratura quando errore in applicazione lavorazione si inverte e riprova solo se singola su foro aperto
|
||||
|
||||
Versione 2.5i1 (12/09/2023)
|
||||
- Modif : in Cut abbassato a 590 mm il limite per convertire in LongCut [Ticket #1448]
|
||||
- Fixed : in LapJoint gestito correttamente il ritorno nil di GetUShapeWidth [Ticket #1354].
|
||||
|
||||
Versione 2.5h2 (11/08/2023)
|
||||
- Modif : in LapJoint e Mortise modificata posizione braccio per FAST quando vicino alla coda della trave
|
||||
- Fixed : corrette forature con aggregato quando lato aperto
|
||||
- Fixed : in RidgeLap corretto ingombro lavorazione in testa e coda quando rivolta verso il basso.
|
||||
|
||||
Versione 2.5h1 (07/08/2023)
|
||||
- Fixed : tagli doppi di lato non effettuati se macchina tipo PF e pezzo alto [Ticket #1400]
|
||||
- Fixed : in split e headcut corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo [Ticket #1227]
|
||||
- Fixed : in lapjoint piccola correzione al calcolo della distanza di sicurezza in base al gambo dell'utensile [Ticket #1227]
|
||||
- Fixed : in Lapjoint corretto incremento della profondità pari al raggio utensile per tunnel con sega a catena [Ticket #1212]
|
||||
|
||||
Versione 2.5g3 (01/08/2023)
|
||||
- Added : aggiunta gestione tasche chiuse ad orientamento verticale con rinvio angolare [Ticket #1333]
|
||||
- Modif : in LongCut ammesso uso lama da sotto fino a Norm +3deg in verticale
|
||||
- Fixed : in Cut correzione calcolo offset per taglio doppio di lato [Ticket #1400].
|
||||
|
||||
Versione 2.5g2 (31/07/2023)
|
||||
- Added : in FreeContour, solo se pocket, aggiunta Q06 per specificare un eventuale offset radiale del contorno [Ticket #1334]
|
||||
- Added : aggiunta gestione forature verticali con rinvio angolare [Ticket #1332]
|
||||
- Fixed : corretta gestione antischeggia con lama su LapJoint [Ticket #1351]
|
||||
- Fixed : in ProfConvex, ProfConcave e ProfHead corretto e semplificato ModifySideInvertLead per invert [Ticket #1330]
|
||||
- Fixed : corretto il funzionamento delle mortase in doppio [Ticket #1404].
|
||||
|
||||
Versione 2.5g1 (05/07/2023)
|
||||
- Modif : in DiceCut modificata scelta tagli ortogonali quando liberi (esteso caso di verticali ammessi)
|
||||
- Modif : in LapJoint estesi casi riconoscimento in coda basato su lunghezza
|
||||
- Fixed : nelle mortase passanti escluso il riconoscimento lati aperti che portava a lavorazioni errate [Ticket #1342]
|
||||
- Fixed : in LapJoint impedito l'uso del truciolatore se la tasca è chiusa [Ticket #1361]
|
||||
- Fixed : migliorato controllo fattibilità taglio di fianco con cubetti.
|
||||
|
||||
Versione 2.5f4 (21/06/2023)
|
||||
- Added : aggiunti tagli speciali per evitare il rischio che il cubetto rimanga appoggiato al motore [Ticket #1004, #1214]
|
||||
- Fixed : corretto attacco speciale in FreeContour [Ticket #1250]
|
||||
|
||||
Versione 2.5f3 (16/06/2023)
|
||||
- Fixed : correzione scelta di approccio lama in casi speciali
|
||||
- Fixed : correzione a tagli aggiuntivi orizzontali negli split.
|
||||
|
||||
Versione 2.5f2 (12/06/2023)
|
||||
- Fixed : in LapJoint corretto il recupero dati utensile che, in alcune funzioni, puntava all'utensile errato
|
||||
- In BeamLib -> ChangeOrOpenStart corretta ricerca segmento più lungo.
|
||||
- Fixed : In BeamLib -> ChangeOrOpenStart corretta ricerca segmento più lungo.
|
||||
|
||||
Versione 2.5f1 (08/05/2023)
|
||||
- Fixed : in LongDoubleCut corretta scelta SCC (orientamento braccio testa) per macchine TURN nel caso di concavi
|
||||
- Modif : in Process (esecuzione manuale da Cam5) ordinamento travi di lunghezza praticamente uguale dipende da ordine di selezione
|
||||
- Modif : in LapJoint limiti su svuotature tasche a L 4 facce come per L 3 facce
|
||||
- Modif : in LapJoint su svuotature aggiunto recupero UserNotes da libreria per MaxOptSize.
|
||||
- Fixed : in LongDoubleCut corretta scelta SCC (orientamento braccio testa) per macchine TURN nel caso di concavi
|
||||
|
||||
Versione 2.5e5 (26/05/2023)
|
||||
- Fixed : correzioni a Profili Concavo e Convesso per TURN
|
||||
- Fixed : correzione a foratura per ignorare fori annegati nel pezzo
|
||||
- Modif : riconoscimento fori da sotto anche dalla faccia di ingresso
|
||||
- Modif : in foratura se TURN aggiunta possibilità di forare da sotto.
|
||||
- Fixed : correzioni a Profili Concavo e Convesso per TURN
|
||||
- Fixed : correzione a foratura per ignorare fori annegati nel pezzo
|
||||
|
||||
Versione 2.5e4 (23/05/2023)
|
||||
- Modif : in LongCut migliorato calcolo e verifica affondamento per lavorazione con lama con codolo in mezzo
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
-- Version.lua by Egaltech s.r.l. 2023/06/08
|
||||
-- Version.lua by Egaltech s.r.l. 2024/01/30
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.5f2'
|
||||
MIN_EXE = '2.5c1'
|
||||
VERSION = '2.7h2'
|
||||
MIN_EXE = '2.7f2'
|
||||
|
||||
Reference in New Issue
Block a user