DataBeam :

- corretto calcolo attacchi e uscite per lame su facce
- ora nei tagli di testa e coda si tiene conto dell'effettiva capacità di lavorazione della lama
- completata lavorazione ScarfJoint
- corretta lavorazione SimpleScarf.
This commit is contained in:
Dario Sassi
2020-01-25 08:57:52 +00:00
parent a49ce81cb0
commit ccac4c975a
6 changed files with 339 additions and 147 deletions
+39 -18
View File
@@ -51,7 +51,9 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- verifico che ci siano almeno due facce (altrimenti non è da lavorare)
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
if nFacetCnt < 2 then
return true
local sErr = 'Not executed ' .. tostring( Proc.Id) .. ' number of faces not enough'
EgtOutLog( sErr)
return false, sErr
end
-- dati delle facce
local ptC = {}
@@ -83,7 +85,12 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
-- determino se di testa o di coda
local bHead = ( vtN[vFaceOrd[2]]:getX() > 0)
local bHead
if vtN[vFaceOrd[2]] then
bHead = ( vtN[vFaceOrd[2]]:getX() > 0)
else
bHead = ( vtN[vFaceOrd[1]]:getX() > 0)
end
-- vettore di riferimento per le facce ortogonali all'asse trave
local vtRef = Vector3d( 0, vtN[vFaceOrd[3]]:getY(), vtN[vFaceOrd[3]]:getZ())
vtRef:normalize()
@@ -116,8 +123,8 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- se va fatto, inserisco la lavorazione
if bCut then
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, nil, b3Raw)
local vtOrthoO = Vector3d( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
end
end
@@ -125,6 +132,8 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local vCuts = {}
if vFaceOrd[2] ~= 0 and vFaceOrd[3] ~= 0 then
vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], false, ptC[vFaceOrd[2]], vtN[vFaceOrd[2]])
elseif vFaceOrd[3] ~= 0 then
vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC[vFaceOrd[3]], vtN[vFaceOrd[3]], true)
end
if #vCuts > 0 then
-- recupero gruppo per geometria addizionale
@@ -142,19 +151,32 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
end
end
-- calcolo secondo riferimento per facce inclinate
local vtRef2 = Vector3d( vtN[vFaceOrd[2]])
-- calcolo secondo riferimento per testa o coda
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
-- eseguo
for i = 1, #vCuts do
local nOrthoOpposite
local vtOrthoO
if i % 2 == 1 then
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
vtOrthoO = Vector3d( vtRef)
else
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef2)
if #vCuts[i-1] > 0 then
vtOrthoO = Vector3d( EgtIf( vtRef2, vtRef2, vtRef))
else
local vtO
for j = 1, #vCuts[i-1] do
_, vtO = EgtSurfTmFacetCenter( vCuts[i-1][j], 0, GDB_ID.ROOT)
break
end
if vtO then
vtOrthoO = Vector3d( vtO)
else
vtOrthoO = Y_AX()
end
end
end
-- lavoro la faccia
for j = 1, #vCuts[i] do
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, nil, 0, BD.CUT_SIC, 0, 0, nil, b3Raw)
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -172,18 +194,17 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- taglio sulla faccia intermedia
if vFaceOrd[3] ~= 0 then
-- inserisco la lavorazione
local vtRef2 = vtN[vFaceOrd[2]]
-- calcolo secondo testa o coda
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
-- se non ho il taglio sulla faccia interna
if not bIntCut then
local frHV, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, vFaceOrd[2] - 1)
if DimV <= DimH then
vtRef2 = Vector3d( frHV:getVersY())
else
local frHV, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, vFaceOrd[3] - 1)
if DimV > DimH then
vtRef2 = Vector3d( frHV:getVersX())
end
end
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef2)
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, 0, BD.CUT_SIC, 0, 0, nil, b3Raw)
-- inserisco la lavorazione
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end