Compare commits

...

1 Commits

Author SHA1 Message Date
daniele.nicoli e557d57dae Aggiunti commenti ad ultima modifica 2026-06-16 08:51:14 +02:00
+6 -1
View File
@@ -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)