ProcessCut - Aggiunti tagli verticali anche in caso di tagli inclinati su testa o coda per rendere più piccoli i pezzi che possono cadere sul motore

This commit is contained in:
daniele.nicoli
2026-06-16 08:16:04 +02:00
parent ce2fcf4a42
commit f5a5350e70
2 changed files with 25 additions and 19 deletions
+22 -10
View File
@@ -556,17 +556,19 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
end
local bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw)
if not bOk2 then return false, sErr2 end
-- caso standard
else
if ( i % 2) == 0 and Proc.Fct == 1 and ( AreSameVectorApprox( vtO, Z_AX()) or AreSameVectorApprox( vtO, -Z_AX())) then
if ( i % 2) == 0 and Proc.Fct == 1 and AreSameOrOppositeVectorApprox( vtO, Z_AX()) then
local vtOrthoVert = vtN ^ vtO
if ( vtN:getY() > 0 and vtOrthoVert:getY() > 0) or ( vtN:getY() < 0 and vtOrthoVert:getY() < 0) then
vtOrthoVert = -vtOrthoVert
end
local Frame = Frame3d( ptC, vtN, vtO)
local b3Fac = EgtGetBBoxRef( vCuts[i][1], GDB_BB.STANDARD, Frame)
if abs( b3Fac:getDimY() - BD.MAX_DIM_DICE) > 10 * GEO.EPS_SMALL then
local bTiltedFaceAddVerticalDiceing = EgtGetInfo( Proc.Id, 'Q19', 'i') == 1
local nVerticalCuts = ceil( b3Fac:getDimY() / ( BD.MAX_LEN_DICE)) - 1
local dVerticalSliceHeight = b3Fac:getDimY() / ( nVerticalCuts + 1)
local dVerticalSliceDist = b3Fac:getDimY() / ( nVerticalCuts + 1)
local dSawDiam = 400
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
@@ -574,12 +576,22 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
end
end
-- tagli orizzontali
for k = nVerticalCuts, 1, -1 do
local nFaceUse = BL.GetNearestParalOpposite( vtN)
local dVerticalCutOffset = dVerticalSliceHeight * -k
local sLeadInOutType = 'PerpendicularOutraw'
local bOk, sErr = Fbs.MakeOne( vCuts[i][1], 0, sCutting, dSawDiam, nFaceUse, nil, -0.1, BD.CUT_SIC, dVerticalCutOffset, 0, 0, '', b3Raw, nil, nil, nil, sLeadInOutType, nil, 0, nil, bTiltedFaceAddVerticalDiceing)
-- tagli verticali
for k = 1, nVerticalCuts do
local nFaceUse = BL.GetNearestOrthoOpposite( vtN)
local dVerticalCutOffset = dVerticalSliceDist * k
local sLeadInOutType = 'Perpendicular'
local nMergedParallelSurfId = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
local ptVertCut = EgtSurfTmFacetCenter( nMergedParallelSurfId, 0, GDB_ID.ROOT)
ptVertCut = ptVertCut + ( -b3Fac:getDimY()/2 + dVerticalCutOffset) * vtOrthoVert
local nSurfId = EgtSurfTmPlaneInBBox( nAddGrpId, ptVertCut, vtOrthoVert, b3Raw, GDB_RT.GLOB)
if i ~= 2 then
local nMergedPreviousParallelSurfId = EgtSurfTmBySewing( nAddGrpId, vCuts[i-2], false)
local ptOnPreviousParallelSurf = EgtSurfTmFacetCenter( nMergedPreviousParallelSurfId, 0, GDB_ID.ROOT)
EgtCutSurfTmPlane( nSurfId, ptOnPreviousParallelSurf, vtN, false, GDB_RT.GLOB)
end
EgtCutSurfTmPlane( nSurfId, ptVertCut, -vtN, false, GDB_RT.GLOB)
local bOk, sErr = Fbs.MakeOne( nSurfId, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1, BD.CUT_SIC, 0, 0, 0, '', b3Raw, nil, nil, nil, sLeadInOutType, nil, 0, nil)
if not bOk then return bOk, sErr end
end
end