- in MachiningLib.GetSplitMachinings corretta lettura LeadIn / Out per split

- in STR0009 si usa InitMachiningParameters per creare la lavorazione; il LeadIn / Out per split si inizializza copiando quelli originali
This commit is contained in:
luca.mazzoleni
2025-04-09 19:07:42 +02:00
parent fed75861be
commit 9888bc7f4e
2 changed files with 16 additions and 11 deletions
+13 -8
View File
@@ -117,8 +117,8 @@ function MachiningLib.GetSplitMachinings( Machinings, SplittingPoints, Part )
dEdgeMaxX = Machinings[i].ptEdge2:getX()
dEdgeMinX = Machinings[i].ptEdge1:getX()
end
local dOriginalStartAddLength = Machinings[i].LeadIn.dStartAddLength
local dOriginalEndAddLength = Machinings[i].LeadOut.dEndAddLength
local OriginalLeadIn = Machinings[i].LeadIn
local OriginalLeadOut = Machinings[i].LeadOut
local sOriginalStage = Machinings[i].sStage
local LeadInForSplit = Machinings[i].LeadInForSplit
local LeadOutForSplit = Machinings[i].LeadOutForSplit
@@ -136,37 +136,42 @@ function MachiningLib.GetSplitMachinings( Machinings, SplittingPoints, Part )
if j > 1 then
nCurrentMachiningIndex = nCurrentMachiningIndex + 1
table.insert( Machinings, nCurrentMachiningIndex, BeamLib.TableCopyDeep( Machinings[i]))
Machinings[nCurrentMachiningIndex].LeadIn = BeamLib.TableCopyDeep( OriginalLeadIn)
Machinings[nCurrentMachiningIndex].LeadOut = BeamLib.TableCopyDeep( OriginalLeadOut)
end
local dStartAddLength = dOriginalStartAddLength
local dEndAddLength = dOriginalEndAddLength
local dStartAddLength = OriginalLeadIn.dStartAddLength
local dEndAddLength = OriginalLeadOut.dEndAddLength
if MachiningLib.StartsLeftSide( Machinings[i]) then
dStartAddLength, dEndAddLength = dEndAddLength, dStartAddLength
end
if j == 1 then
dEndAddLength = - ( SplittingPoints[j]:getX() - dEdgeMinX) + BeamData.MILL_OVERLAP
if LeadOutForSplit then
Machinings[nCurrentMachiningIndex].LeadOut = LeadOutForSplit
Machinings[nCurrentMachiningIndex].LeadOut = BeamLib.TableCopyDeep( LeadOutForSplit)
end
Machinings[nCurrentMachiningIndex].ptCenter = Point3d( SplittingPoints[j]:getX() + ( dEdgeMaxX - SplittingPoints[j]:getX()) / 2, 0, 0)
elseif j == nParts then
dStartAddLength = - ( dEdgeMaxX - SplittingPoints[j - 1]:getX()) + BeamData.MILL_OVERLAP
if LeadInForSplit then
Machinings[nCurrentMachiningIndex].LeadIn = LeadInForSplit
Machinings[nCurrentMachiningIndex].LeadIn = BeamLib.TableCopyDeep( LeadInForSplit)
end
Machinings[nCurrentMachiningIndex].ptCenter = Point3d( dEdgeMinX + ( SplittingPoints[j - 1]:getX() - dEdgeMinX) / 2, 0, 0)
else
dStartAddLength = - ( dEdgeMaxX - SplittingPoints[j - 1]:getX()) + BeamData.MILL_OVERLAP
dEndAddLength = - ( SplittingPoints[j]:getX() - dEdgeMinX) + BeamData.MILL_OVERLAP
if LeadInForSplit then
Machinings[nCurrentMachiningIndex].LeadIn = LeadInForSplit
Machinings[nCurrentMachiningIndex].LeadIn = BeamLib.TableCopyDeep( LeadInForSplit)
end
if LeadOutForSplit then
Machinings[nCurrentMachiningIndex].LeadOut = LeadOutForSplit
Machinings[nCurrentMachiningIndex].LeadOut = BeamLib.TableCopyDeep( LeadOutForSplit)
end
Machinings[nCurrentMachiningIndex].ptCenter = Point3d( SplittingPoints[j]:getX() + ( SplittingPoints[j - 1]:getX() - SplittingPoints[j]:getX()) / 2, 0, 0)
end
if MachiningLib.StartsLeftSide( Machinings[nCurrentMachiningIndex]) then
dStartAddLength, dEndAddLength = dEndAddLength, dStartAddLength
local LeadInCopy = BeamLib.TableCopyDeep( Machinings[nCurrentMachiningIndex].LeadIn)
Machinings[nCurrentMachiningIndex].LeadIn = BeamLib.TableCopyDeep( Machinings[nCurrentMachiningIndex].LeadOut)
Machinings[nCurrentMachiningIndex].LeadOut = BeamLib.TableCopyDeep( LeadInCopy)
end
Machinings[nCurrentMachiningIndex].LeadIn.dStartAddLength = dStartAddLength