- in MachiningLib aggiunta la scrittura dello spezzone nella lavorazione
- in STR0004 aggiunto ordinamento lavorazioni - piccole aggiunte varie
This commit is contained in:
@@ -78,19 +78,18 @@ end
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function MachiningLib.GetSplitMachinings( Machinings, vSplittingPoints, Part )
|
||||
for i = #Machinings, 1, -1 do
|
||||
local nParts = #vSplittingPoints + 1
|
||||
local dEdgeMaxX = Machinings[i].ptEdge1:getX()
|
||||
local dEdgeMinX = Machinings[i].ptEdge2:getX()
|
||||
if Machinings[i].ptEdge1:getX() < Machinings[i].ptEdge2:getX() - 10 * GEO.EPS_SMALL then
|
||||
dEdgeMaxX = Machinings[i].ptEdge2:getX()
|
||||
dEdgeMinX = Machinings[i].ptEdge1:getX()
|
||||
end
|
||||
if FeatureLib.MachiningNeedsSplitting( Machinings[i].dLengthOnX, Part) then
|
||||
local dOriginalStartAddLength = Machinings[i].LeadIn.dStartAddLength
|
||||
local dOriginalEndAddLength = Machinings[i].LeadOut.dEndAddLength
|
||||
local nCurrentMachiningIndex = i
|
||||
local nParts = #vSplittingPoints + 1
|
||||
for j = 1, nParts do
|
||||
local dEdgeMaxX = Machinings[i].ptEdge1:getX()
|
||||
local dEdgeMinX = Machinings[i].ptEdge2:getX()
|
||||
if Machinings[i].ptEdge1:getX() < Machinings[i].ptEdge2:getX() - 10 * GEO.EPS_SMALL then
|
||||
dEdgeMaxX = Machinings[i].ptEdge2:getX()
|
||||
dEdgeMinX = Machinings[i].ptEdge1:getX()
|
||||
end
|
||||
|
||||
-- il punto di spezzatura deve essere all'interno del lato che si sta lavorando
|
||||
if ( j == nParts) or ( vSplittingPoints[j]:getX() > dEdgeMinX + 10 * GEO.EPS_SMALL and vSplittingPoints[j]:getX() < dEdgeMaxX - 10 * GEO.EPS_SMALL) then
|
||||
if j > 1 then
|
||||
@@ -108,13 +107,28 @@ function MachiningLib.GetSplitMachinings( Machinings, vSplittingPoints, Part )
|
||||
dStartAddLength = - ( dEdgeMaxX - vSplittingPoints[j - 1]:getX()) + BeamData.MILL_OVERLAP
|
||||
dEndAddLength = - ( vSplittingPoints[j]:getX() - dEdgeMinX) + BeamData.MILL_OVERLAP
|
||||
end
|
||||
if Machinings[nCurrentMachiningIndex].bInvert then
|
||||
if Machinings[nCurrentMachiningIndex].vtEdgeDirection:getX() > 10 * GEO.EPS_SMALL and not Machinings[nCurrentMachiningIndex].bInvert then
|
||||
dStartAddLength, dEndAddLength = dEndAddLength, dStartAddLength
|
||||
end
|
||||
|
||||
Machinings[nCurrentMachiningIndex].LeadIn.dStartAddLength = dStartAddLength
|
||||
Machinings[nCurrentMachiningIndex].LeadOut.dEndAddLength = dEndAddLength
|
||||
end
|
||||
Machinings[nCurrentMachiningIndex].nPart = j
|
||||
end
|
||||
-- anche le lavorazioni non splittate necessitano del segmento assegnato
|
||||
else
|
||||
for j = 1, nParts do
|
||||
local dNextSplitX = dEdgeMaxX
|
||||
local dPreviousSplitX = dEdgeMinX
|
||||
if j ~= 1 then
|
||||
dPreviousSplitX = vSplittingPoints[j - 1]:getX()
|
||||
elseif j ~= nParts then
|
||||
dNextSplitX = vSplittingPoints[j]:getX()
|
||||
end
|
||||
if dEdgeMinX > dNextSplitX - 10 * GEO.EPS_SMALL and dEdgeMaxX < dPreviousSplitX + 10 * GEO.EPS_SMALL then
|
||||
Machinings[i].nPart = j
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user