Compare commits
2 Commits
3.1f2
..
Ticket#2025
| Author | SHA1 | Date | |
|---|---|---|---|
| d2a9e9e189 | |||
| 8925c73639 |
+53
-11
@@ -1004,7 +1004,7 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Lavorazione con fresa
|
||||
---------------------------------------------------------------------
|
||||
local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
||||
local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId, nForcedFacInd, nSideInd)
|
||||
-- recupero l'ingombro del grezzo di appartenenza
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- recupero l'ingombro della trave
|
||||
@@ -1015,13 +1015,16 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
||||
return false, sErr
|
||||
end
|
||||
-- verifico il numero di facce della tacca
|
||||
assert( ( Proc.Fct == 1), 'Error : MakeOneFaceByMill in LapJoint with ' .. tostring( Proc.Fct) .. ' faces')
|
||||
if not nForcedFacInd then
|
||||
assert( ( Proc.Fct == 1), 'Error : MakeOneFaceByMill in LapJoint with ' .. tostring( Proc.Fct) .. ' faces')
|
||||
nForcedFacInd = 0
|
||||
end
|
||||
-- dati della faccia
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nForcedFacInd, GDB_ID.ROOT)
|
||||
-- verifico se orientata verso l'alto
|
||||
local bUp = ( vtN:getZ() >= BD.NZ_MINA)
|
||||
-- scelta faccia da lavorare
|
||||
local nFacInd = 0
|
||||
local nFacInd = nForcedFacInd
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'BirdsMouth')
|
||||
if not sMilling then
|
||||
@@ -1029,6 +1032,16 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local dTDiam = 50
|
||||
local dMaxMat = 0
|
||||
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
|
||||
end
|
||||
end
|
||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||
-- inserisco la lavorazione di fresatura
|
||||
local sName = 'Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
||||
@@ -1039,8 +1052,17 @@ local function MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd}})
|
||||
-- imposto uso faccia e lato correzione
|
||||
if vtN:getX() > 0 then
|
||||
-- imposto uso faccia e lato correzione se forzate da fuori forzo lavorazione della faccia
|
||||
if nSideInd and nForcedFacInd then
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.NONE)
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dTDiam / 2)
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dTDiam / 2)
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'EdgesFaceUse', EgtNumToString( nSideInd))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, dTDiam / 2)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, dTDiam / 2)
|
||||
elseif vtN:getX() > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bUp, MCH_MILL_FU.ORTHO_LEFT, MCH_MILL_FU.PARAL_LEFT))
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bUp, MCH_MILL_FU.ORTHO_RIGHT, MCH_MILL_FU.PARAL_RIGHT))
|
||||
@@ -7511,14 +7533,34 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
end
|
||||
-- provo con contornatura
|
||||
local dDiamTool = 20
|
||||
local nChoosenFacInd = nFacInd2
|
||||
local dChoosenFacElev = dFacElev2
|
||||
if bIsL then
|
||||
local bOk, sErr
|
||||
bOk, sWarn, dDiamTool = MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, dCollSic, true, sMilling, nFacInd2, dFacElev2)
|
||||
if not bOk then return bOk, sWarn end
|
||||
else
|
||||
local sErr = 'Error : Impossible mill special LapJoint'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
-- provo ancora con la pocketing dell'altra faccia
|
||||
local sPocketing = ML.FindPocketing( sMchFind, dDiam, dFacElev + dCollSic)
|
||||
if sPocketing then
|
||||
nChoosenFacInd = nFacInd
|
||||
dChoosenFacElev = dFacElev
|
||||
local Edges = BL.GetEdgesInfo( Proc, Proc.Face[nFacInd+1])
|
||||
local nSideInd
|
||||
for i = 1, #Edges do
|
||||
if Edges[i].AdjacentFaceId == nFacInd2 then
|
||||
nSideInd = i - 1
|
||||
break
|
||||
end
|
||||
end
|
||||
-- se pocketing ok forza facet e spigolo di lavoro
|
||||
bOk, sWarn = MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId, nFacInd2, nSideInd)
|
||||
if not bOk then return bOk, sWarn end
|
||||
else
|
||||
local sErr = 'Error : Impossible mill special LapJoint'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
@@ -7529,7 +7571,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd2}})
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nChoosenFacInd}})
|
||||
-- imposto uso faccia
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
|
||||
-- imposto posizione braccio porta testa
|
||||
@@ -7544,7 +7586,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
end
|
||||
-- imposto elevazione
|
||||
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dFacElev2, 1))
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dChoosenFacElev, 1))
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
|
||||
Reference in New Issue
Block a user