ProcessCut e FacesBySaw.MakeOne - Modifica non ancora funzionante

This commit is contained in:
daniele.nicoli
2026-06-12 12:09:26 +02:00
parent c9fae12574
commit ce2fcf4a42
2 changed files with 41 additions and 5 deletions
+31 -1
View File
@@ -479,12 +479,16 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
-- determino il modo di tagliare
local vtOrthoO
local bNoPerpCuts = false
local vtO
-- Se tagli ortogonali (indice dispari)
if i % 2 == 1 then
vtOrthoO = Vector3d( vtN)
-- Se tagli perpendicolari (indice pari)
else
local vtO
-- Se elemento precedente contiene tagli ortogonali
if #vCuts[i-1] > 0 then
vtO = EgtSurfTmFacetNormVersor( vCuts[i-1][1], 0, GDB_ID.ROOT)
-- Se elemento successivo contiene tagli ortogonali
elseif vCuts[i+1] and #vCuts[i+1] > 0 then
-- lunghezza faccia nell'eventuale direzione ortogonale
local asseX = EgtSurfTmFacetNormVersor( vCuts[i+1][1], 0, GDB_ID.ROOT)
@@ -552,8 +556,34 @@ 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
local vtOrthoVert = vtN ^ vtO
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 dSawDiam = 400
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
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)
if not bOk then return bOk, sErr end
end
end
end
-- lavoro la faccia
for j = 1, #vCuts[i] do
-- se taglio dal basso