- implemento split e relative finiture per travi con sezioni grandi

- split con sega a catena
- distinzione finitura con lama o truciolatore in base al parametro Q05
- finiture evitate in presenza di feature che tagliano tutta la sezione
- gestione sovramateriale grezzo
This commit is contained in:
luca.mazzoleni
2022-06-10 17:50:22 +02:00
parent c9b0f1e90d
commit b29074cbb1
18 changed files with 833 additions and 348 deletions
+32 -27
View File
@@ -254,7 +254,7 @@ local function CalcBladeUse( bUseBlade, bDown_Head, nSide, vtN1, vtN2, bConvex,
end
end
else
if ( vtN1 and vtN1:getZ() >= EgtIf( dCustomAngle, dCustomAngle, -0.5)) or ( vtN2 and vtN2:getZ() >= -0.5) then
if ( vtN1 and vtN1:getZ() >= EgtIf( dCustomAngle, dCustomAngle, -0.5)) and ( not vtN2 or vtN2:getZ() >= -0.5) then
bCanUseBlade = true
end
end
@@ -305,39 +305,21 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local bConvex
local bOrtho
local ptM
local ptRef = ( ptC[1] + ptC[2]) / 2
if bInt then
bConvex = ( dAng >= 0)
bOrtho = ( abs( dAng + 90) < 1)
ptM = ( ptP1 + ptP2) / 2
else
bConvex = true
ptM = ptRef
local vtM1 = ptC[1] - ptM ; vtM1:normalize()
local vtM2 = ptC[2] - ptM ; vtM2:normalize()
bConvex = ( vtM1 * vtN[1] > 0 and vtM2 * vtN[2] > 0)
bOrtho = false
dAng = acos( vtN[1] * vtN[2])
ptM = ( ptC[1] + ptC[2]) / 2
-- se facce contrapposte e quindi concavo, angolo sempre negativo
if not bConvex and dAng > 0 then dAng = -dAng end
end
local ptRef = ( ptC[1] + ptC[2]) / 2
-- analisi del taglio
local vOrd = {}
local vFaceUse = {}
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() < ptM:getY(), { 1, 2}, { 2, 1})
vFaceUse = { BL.GetNearestParalOpposite( ptC[1] - ptM), BL.GetNearestParalOpposite( ptC[2] - ptM)}
else
local bFront = ( vtN[1]:getY() < 0)
if bFront then
vOrd = EgtIf( ptC[1]:getZ() < ptM:getZ(), { 1, 2}, { 2, 1})
vFaceUse = { BL.GetNearestOrthoOpposite( ptC[1] - ptM), BL.GetNearestOrthoOpposite( ptC[2] - ptM)}
else
vOrd = EgtIf( ptC[1]:getZ() < ptM:getZ(), { 2, 1}, { 1, 2})
vFaceUse = { BL.GetNearestOrthoOpposite( ptC[1] - ptM), BL.GetNearestOrthoOpposite( ptC[2] - ptM)}
end
end
local vWidth = {}
_, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[1])
_, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[2])
-- ottengo la distanza tra la fine del pezzo e il pezzo successivo
local dDistToNextPiece = EgtGetInfo( nRawId, 'BDST', 'd') or 5.4
@@ -380,6 +362,29 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
return false, sErr
end
-- analisi del taglio
local vOrd = {}
local vFaceUse = {}
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)}
else
local bFront = ( vtN[1]:getY() < 0)
if bFront then
vOrd = EgtIf( ptC[1]:getZ() < ptRef:getZ(), { 1, 2}, { 2, 1})
vFaceUse = { BL.GetNearestOrthoOpposite( ptC[1] - ptM), BL.GetNearestOrthoOpposite( ptC[2] - ptM)}
else
vOrd = EgtIf( ptC[1]:getZ() < ptRef:getZ(), { 2, 1}, { 1, 2})
vFaceUse = { BL.GetNearestOrthoOpposite( ptC[1] - ptM), BL.GetNearestOrthoOpposite( ptC[2] - ptM)}
end
end
local vWidth = {}
_, _, vWidth[1] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[1])
_, _, vWidth[2] = BL.GetFaceHvRefDim( Proc.Id, tFaceLong[2])
-- 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
@@ -755,7 +760,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- se faccia da sotto e Z centro faccia è minore del centro altra faccia, segno il limite angolare da passare
-- dovrebbe essere il limite angolare della testa 1 in sottosquadra
if nSide == -1 and not BD.DOWN_HEAD then
if ptC[vOrd[j]]:getZ() < ptC[vOrd[OthFace]]:getZ() then
if ptC[vOrd[j]]:getZ() < ptC[vOrd[OthFace]]:getZ() - 1. then
dSinLimit = -0.0157
else
dSinLimit = -0.5