This commit is contained in:
andrea.villa
2025-06-30 17:53:47 +02:00
2 changed files with 36 additions and 4 deletions
+21
View File
@@ -899,6 +899,27 @@ function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
return nFaceIndMax, ptC, vtN
end
---------------------------------------------------------------------
function BeamLib.GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrtho)
local _, EdgesEgt = EgtSurfTmGetFacetOutlineInfo( nSurfId, nFacet, GDB_ID.ROOT)
local nEdgeIndMax = 0
local dMaxComp = - GEO.INFINITO
for i = 1, #EdgesEgt do
local vtN = EdgesEgt[i].Norm
if EdgesEgt[i].Open then
vtN = -vtN
end
local dComp = vtN * vtOrtho
if dComp > dMaxComp then
nEdgeIndMax = i -1
dMaxComp = dComp
end
end
return nEdgeIndMax
end
---------------------------------------------------------------------
function BeamLib.GetTunnelDimension( Proc, nPartId)
-- sono necessarie almeno due facce
+15 -4
View File
@@ -3224,6 +3224,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
vtRef = -Z_AX()
nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, -Z_AX())
end
else
nFaceZ = nFacInd
end
dDepth = Proc.Face[ nFaceZ + 1].Elevation
end
@@ -3284,12 +3286,21 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
EgtOutLog( sWarn)
end
EgtSetMachiningParam( MCH_MP.DEPTH, dMachiningDepth)
local dStartAddLen = dSawWidth / 2 + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + EgtMdbGetGeneralParam( MCH_GP.SAFEAGGRBOTTZ)
local dEndAddLen = - dSawWidth / 2
if vtRef:getZ() > 10 * GEO.EPS_SMALL then
-- si decidono lato di lavoro, inversione e estensione in base al lato aperto
local nEdgeIndex = BL.GetEdgeToMachineFromVector( Proc.Id, nFacAdj, vtRef)
local EdgesEgt = BL.GetEdgesInfo( Proc, Proc.Face[nFacAdj+1])
local CurrentEdge = EdgesEgt[nEdgeIndex+1]
local dStartAddLen = 0
local dEndAddLen = 0
if CurrentEdge.IsStartOpen then
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.RIGHT)
EgtSetMachiningParam( MCH_MP.INVERT, false)
else
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
end
dStartAddLen = dSawWidth / 2 + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + EgtMdbGetGeneralParam( MCH_GP.SAFEAGGRBOTTZ)
dEndAddLen = - dSawWidth / 2
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen)
end
@@ -3299,7 +3310,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
local dMachiningStep = EgtGetMachiningParam( MCH_MP.STEP) or 0
-- TODO qui sostituire con valore preciso da GetSetupInfo
if BD.C_SIMM then
dMachiningStep = 165
dMachiningStep = 175
if vtRef:getZ() < - 10 * GEO.EPS_SMALL then
dMachiningStep = 250
end