DataWall 2.5j2 :

- in FreeContour conversione automatica di facce non fattibili con lama per limiti di orientamento in facce da fare con fresa.
This commit is contained in:
Dario Sassi
2023-10-12 10:53:11 +02:00
parent 33deb8b5e3
commit 7c2bc2ec5d
2 changed files with 18 additions and 9 deletions
+16 -7
View File
@@ -1259,7 +1259,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), dFreeLen) or dMaxDepth
end
end
-- verifico se la facce hanno alcuni lati molto corti e possono quindi essere approssimate a 3 lati
-- verifico se le facce hanno alcuni lati molto corti e possono quindi essere approssimate a 3 lati
for currentFace = 1, #vFace do
if Is3EdgesApprox( Proc, vFace[currentFace].Fac, nAddGrpId) then
vFace[currentFace].Is3EdgesApprox = true
@@ -1865,7 +1865,8 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_NEAR)
end
-- eseguo
if not EgtApplyMachining( true, false) then
local bApplyOk = EgtApplyMachining( true, false)
if not bApplyOk then
-- provo a invertire direzione, lato di lavoro e attacco/uscita
EgtSetMachiningParam( MCH_MP.INVERT, not bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( not bInvert, MCH_SAW_WS.LEFT, MCH_SAW_WS.RIGHT))
@@ -1874,14 +1875,22 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, EgtIf( nLeadIn == MCH_SAW_LI.STRICT, MCH_SAW_LO.STRICT, MCH_SAW_LO.CENT))
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
-- ri-eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
bApplyOk = EgtApplyMachining( true, false)
if not bApplyOk then
local nErr, sErr = EgtGetLastMachMgrError()
-- se direzione irraggiungibile (solitamente lama su testa fresa 5A e taglio inclinato) si imposta di usare fresa
if nErr == 2215 then
EgtOutLog( ' Warning : sawing impossible due to unreachable direction, try milling')
EgtRemoveOperation( nMchId)
vFace[i].Type = 4
else
EgtSetOperationMode( nMchId, false)
return false, sErr
end
end
end
-- se limite lunghezza di taglio e taglio lo supera
if WD.CUT_MAX_LENGTH and vFace[i].Len > WD.CUT_MAX_LENGTH then
if bApplyOk and WD.CUT_MAX_LENGTH and vFace[i].Len > WD.CUT_MAX_LENGTH then
-- sdoppio la lavorazione
local sSouName = EgtGetName( nMchId)
local nNewMchId = EgtCopyMachining( sSouName..'_B', sSouName)