Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e557d57dae | |||
| d377a33420 | |||
| 0d7e9e09b3 | |||
| 198031a3c1 | |||
| 2f312c5cb8 |
@@ -277,6 +277,15 @@ if bToProcess then
|
|||||||
else
|
else
|
||||||
vBeam[i].Box = b3Solid
|
vBeam[i].Box = b3Solid
|
||||||
end
|
end
|
||||||
|
if BD.MAX_LENGTH and BD.MAX_LENGTH > 10 and b3Solid:getDimX() > BD.MAX_LENGTH then
|
||||||
|
local sOut = 'Piece-Length (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
|
||||||
|
'out of machine limits (' .. EgtNumToString( BD.MAX_LENGTH, 2) .. ') '
|
||||||
|
BEAM.ERR = 17
|
||||||
|
BEAM.MSG = sOut
|
||||||
|
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
|
||||||
|
PostErrView( BEAM.ERR, BEAM.MSG)
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- Assegno lunghezza della barra
|
-- Assegno lunghezza della barra
|
||||||
dBarLen = vBeam[1].Box:getDimX() + 10
|
dBarLen = vBeam[1].Box:getDimX() + 10
|
||||||
@@ -330,6 +339,15 @@ if bToProcess then
|
|||||||
else
|
else
|
||||||
vBeam[i].Box = b3Solid
|
vBeam[i].Box = b3Solid
|
||||||
end
|
end
|
||||||
|
if BD.MAX_LENGTH and BD.MAX_LENGTH > 10 and b3Solid:getDimX() > BD.MAX_LENGTH then
|
||||||
|
local sOut = 'Piece-Length (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
|
||||||
|
'out of machine limits (' .. EgtNumToString( BD.MAX_LENGTH, 2) .. ') '
|
||||||
|
BEAM.ERR = 17
|
||||||
|
BEAM.MSG = sOut
|
||||||
|
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
|
||||||
|
PostErrView( BEAM.ERR, BEAM.MSG)
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1641,7 +1641,8 @@ local function SetCutsOnFrontMortises( vProc)
|
|||||||
-- verifico se i piani coincidono
|
-- verifico se i piani coincidono
|
||||||
local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0)
|
local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0)
|
||||||
if bSamePlane then
|
if bSamePlane then
|
||||||
vProc[i].CutFront = vProc[j].Id
|
--vProc[i].CutFront = vProc[j].Id
|
||||||
|
vProc[j].bSkipCut = true
|
||||||
end
|
end
|
||||||
-- log
|
-- log
|
||||||
local sMsg = string.format( 'Cut %d meet Mortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '')
|
local sMsg = string.format( 'Cut %d meet Mortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '')
|
||||||
@@ -1658,7 +1659,8 @@ local function SetCutsOnFrontMortises( vProc)
|
|||||||
-- verifico se i piani coincidono
|
-- verifico se i piani coincidono
|
||||||
local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0)
|
local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0)
|
||||||
if bSamePlane then
|
if bSamePlane then
|
||||||
vProc[i].CutFront = vProc[j].Id
|
--vProc[i].CutFront = vProc[j].Id
|
||||||
|
vProc[j].bSkipCut = true
|
||||||
end
|
end
|
||||||
-- log
|
-- log
|
||||||
local sMsg = string.format( 'Cut %d meet DtMortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '')
|
local sMsg = string.format( 'Cut %d meet DtMortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '')
|
||||||
|
|||||||
@@ -559,16 +559,20 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
|
|
||||||
-- caso standard
|
-- caso standard
|
||||||
else
|
else
|
||||||
|
-- se necessario aggiungo tagli obliqui per cubettare pezzi lunghi che potrebbero cadere sul motore
|
||||||
if ( i % 2) == 0 and Proc.Fct == 1 and AreSameOrOppositeVectorApprox( vtO, Z_AX()) then
|
if ( i % 2) == 0 and Proc.Fct == 1 and AreSameOrOppositeVectorApprox( vtO, Z_AX()) then
|
||||||
local vtOrthoVert = vtN ^ vtO
|
local vtOrthoVert = vtN ^ vtO
|
||||||
|
-- inverte direzione superfici per corretta direzione SCC
|
||||||
if ( vtN:getY() > 0 and vtOrthoVert:getY() > 0) or ( vtN:getY() < 0 and vtOrthoVert:getY() < 0) then
|
if ( vtN:getY() > 0 and vtOrthoVert:getY() > 0) or ( vtN:getY() < 0 and vtOrthoVert:getY() < 0) then
|
||||||
vtOrthoVert = -vtOrthoVert
|
vtOrthoVert = -vtOrthoVert
|
||||||
end
|
end
|
||||||
local Frame = Frame3d( ptC, vtN, vtO)
|
local Frame = Frame3d( ptC, vtN, vtO)
|
||||||
local b3Fac = EgtGetBBoxRef( vCuts[i][1], GDB_BB.STANDARD, Frame)
|
local b3Fac = EgtGetBBoxRef( vCuts[i][1], GDB_BB.STANDARD, Frame)
|
||||||
|
-- se cubetto più grande di MAX_DIM_DICE
|
||||||
if abs( b3Fac:getDimY() - BD.MAX_DIM_DICE) > 10 * GEO.EPS_SMALL then
|
if abs( b3Fac:getDimY() - BD.MAX_DIM_DICE) > 10 * GEO.EPS_SMALL then
|
||||||
local nVerticalCuts = ceil( b3Fac:getDimY() / ( BD.MAX_LEN_DICE)) - 1
|
local nVerticalCuts = ceil( b3Fac:getDimY() / ( BD.MAX_LEN_DICE)) - 1
|
||||||
local dVerticalSliceDist = b3Fac:getDimY() / ( nVerticalCuts + 1)
|
local dVerticalSliceDist = b3Fac:getDimY() / ( nVerticalCuts + 1)
|
||||||
|
-- selezione utensile
|
||||||
local dSawDiam = 400
|
local dSawDiam = 400
|
||||||
if EgtMdbSetCurrMachining( sCutting) then
|
if EgtMdbSetCurrMachining( sCutting) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
@@ -576,7 +580,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- tagli verticali
|
-- crea faccia per tagli verticali e le taglia a dimensione corretta
|
||||||
for k = 1, nVerticalCuts do
|
for k = 1, nVerticalCuts do
|
||||||
local nFaceUse = BL.GetNearestOrthoOpposite( vtN)
|
local nFaceUse = BL.GetNearestOrthoOpposite( vtN)
|
||||||
local dVerticalCutOffset = dVerticalSliceDist * k
|
local dVerticalCutOffset = dVerticalSliceDist * k
|
||||||
@@ -585,6 +589,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
local ptVertCut = EgtSurfTmFacetCenter( nMergedParallelSurfId, 0, GDB_ID.ROOT)
|
local ptVertCut = EgtSurfTmFacetCenter( nMergedParallelSurfId, 0, GDB_ID.ROOT)
|
||||||
ptVertCut = ptVertCut + ( -b3Fac:getDimY()/2 + dVerticalCutOffset) * vtOrthoVert
|
ptVertCut = ptVertCut + ( -b3Fac:getDimY()/2 + dVerticalCutOffset) * vtOrthoVert
|
||||||
local nSurfId = EgtSurfTmPlaneInBBox( nAddGrpId, ptVertCut, vtOrthoVert, b3Raw, GDB_RT.GLOB)
|
local nSurfId = EgtSurfTmPlaneInBBox( nAddGrpId, ptVertCut, vtOrthoVert, b3Raw, GDB_RT.GLOB)
|
||||||
|
-- se non è il primo taglio parallelo taglia anche le superfici con la faccia parallela precedente
|
||||||
if i ~= 2 then
|
if i ~= 2 then
|
||||||
local nMergedPreviousParallelSurfId = EgtSurfTmBySewing( nAddGrpId, vCuts[i-2], false)
|
local nMergedPreviousParallelSurfId = EgtSurfTmBySewing( nAddGrpId, vCuts[i-2], false)
|
||||||
local ptOnPreviousParallelSurf = EgtSurfTmFacetCenter( nMergedPreviousParallelSurfId, 0, GDB_ID.ROOT)
|
local ptOnPreviousParallelSurf = EgtSurfTmFacetCenter( nMergedPreviousParallelSurfId, 0, GDB_ID.ROOT)
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
-- verifico se frontale
|
-- verifico se frontale
|
||||||
local bFront = ( Proc.Prc == 56)
|
local bFront = ( Proc.Prc == 56)
|
||||||
-- se mortasa di fronte, eseguo il taglio della faccia
|
-- se mortasa di fronte, eseguo il taglio della faccia
|
||||||
if bFront then
|
if bFront and not Proc.bSkipCut then
|
||||||
-- verifico esista la faccia di taglio
|
-- verifico esista la faccia di taglio
|
||||||
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
|
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
|
||||||
if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then
|
if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then
|
||||||
|
|||||||
@@ -467,7 +467,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- se mortasa di fronte, eseguo il taglio della faccia
|
-- se mortasa di fronte, eseguo il taglio della faccia
|
||||||
if bFront then
|
if bFront and not Proc.bSkipCut then
|
||||||
-- verifico esista la faccia di taglio
|
-- verifico esista la faccia di taglio
|
||||||
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
|
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
|
||||||
if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then
|
if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then
|
||||||
|
|||||||
@@ -89,6 +89,14 @@ local function MyProcessInputData()
|
|||||||
else
|
else
|
||||||
vBeam[i].Box = b3Solid
|
vBeam[i].Box = b3Solid
|
||||||
end
|
end
|
||||||
|
if BD.MAX_LENGTH and BD.MAX_LENGTH > 10 and b3Solid:getDimX() > BD.MAX_LENGTH then
|
||||||
|
local sOut = 'Lunghezza (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
|
||||||
|
'oltre i limiti della macchina (' .. EgtNumToString( BD.MAX_LENGTH, 2) .. ') '
|
||||||
|
EgtOutLog( sOut)
|
||||||
|
EgtOutBox( sOut, 'Lavora Travi', 'WARNING')
|
||||||
|
EgtDraw()
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
dRawW = vBeam[1].Box:getDimY()
|
dRawW = vBeam[1].Box:getDimY()
|
||||||
dRawH = vBeam[1].Box:getDimZ()
|
dRawH = vBeam[1].Box:getDimZ()
|
||||||
|
|||||||
Reference in New Issue
Block a user