- in BeamExec completata la funzione PrepareMachiningsForSorting
- in FaceData la lunghezza rispetto a X è ora in valore assoluto - in MachiningLib -> GetSplitMachinings aggiunta la scrittura del centro della lavorazione - in STR0003, STR0004, SlotByChainSaw e SlotByBLade nSegment diventa nFeatureSegment per distinguerla da nPartSegment
This commit is contained in:
+17
-13
@@ -105,9 +105,9 @@ function MachiningLib.GetMachiningSteps( dMachiningDepth, dStep)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function MachiningLib.GetSplitMachinings( Machinings, vSplittingPoints, Part )
|
||||
function MachiningLib.GetSplitMachinings( Machinings, SplittingPoints, Part )
|
||||
for i = #Machinings, 1, -1 do
|
||||
local nParts = #vSplittingPoints + 1
|
||||
local nParts = #SplittingPoints + 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
|
||||
@@ -122,10 +122,10 @@ function MachiningLib.GetSplitMachinings( Machinings, vSplittingPoints, Part )
|
||||
for j = 1, nParts do
|
||||
-- check ultimo segmento della lavorazione (NON della feature)
|
||||
local bIsLastSegment = ( nParts == 1)
|
||||
or ( ( ( j ~= 1) and vSplittingPoints[j - 1]:getX() > dEdgeMinX + 10 * GEO.EPS_SMALL)
|
||||
and ( j == nParts or vSplittingPoints[j]:getX() < dEdgeMinX + 10 * GEO.EPS_SMALL))
|
||||
or ( ( ( j ~= 1) and SplittingPoints[j - 1]:getX() > dEdgeMinX + 10 * GEO.EPS_SMALL)
|
||||
and ( j == nParts or SplittingPoints[j]:getX() < dEdgeMinX + 10 * GEO.EPS_SMALL))
|
||||
-- se non è l'ultimo segmento della lavorazione, il punto di spezzatura deve essere all'interno del lato che si sta lavorando
|
||||
if ( j ~= nParts and ( vSplittingPoints[j]:getX() > dEdgeMinX + 10 * GEO.EPS_SMALL and vSplittingPoints[j]:getX() < dEdgeMaxX - 10 * GEO.EPS_SMALL))
|
||||
if ( j ~= nParts and ( SplittingPoints[j]:getX() > dEdgeMinX + 10 * GEO.EPS_SMALL and SplittingPoints[j]:getX() < dEdgeMaxX - 10 * GEO.EPS_SMALL))
|
||||
or bIsLastSegment then
|
||||
if j > 1 then
|
||||
nCurrentMachiningIndex = nCurrentMachiningIndex + 1
|
||||
@@ -137,12 +137,15 @@ function MachiningLib.GetSplitMachinings( Machinings, vSplittingPoints, Part )
|
||||
dStartAddLength, dEndAddLength = dEndAddLength, dStartAddLength
|
||||
end
|
||||
if j == 1 then
|
||||
dEndAddLength = - ( vSplittingPoints[j]:getX() - dEdgeMinX) + BeamData.MILL_OVERLAP
|
||||
dEndAddLength = - ( SplittingPoints[j]:getX() - dEdgeMinX) + BeamData.MILL_OVERLAP
|
||||
Machinings[nCurrentMachiningIndex].ptCenter = Point3d( SplittingPoints[j]:getX() + ( dEdgeMaxX - SplittingPoints[j]:getX()) / 2, 0, 0)
|
||||
elseif j == nParts then
|
||||
dStartAddLength = - ( dEdgeMaxX - vSplittingPoints[j - 1]:getX()) + BeamData.MILL_OVERLAP
|
||||
dStartAddLength = - ( dEdgeMaxX - SplittingPoints[j - 1]:getX()) + BeamData.MILL_OVERLAP
|
||||
Machinings[nCurrentMachiningIndex].ptCenter = Point3d( dEdgeMinX + ( SplittingPoints[j - 1]:getX() - dEdgeMinX) / 2, 0, 0)
|
||||
else
|
||||
dStartAddLength = - ( dEdgeMaxX - vSplittingPoints[j - 1]:getX()) + BeamData.MILL_OVERLAP
|
||||
dEndAddLength = - ( vSplittingPoints[j]:getX() - dEdgeMinX) + BeamData.MILL_OVERLAP
|
||||
dStartAddLength = - ( dEdgeMaxX - SplittingPoints[j - 1]:getX()) + BeamData.MILL_OVERLAP
|
||||
dEndAddLength = - ( SplittingPoints[j]:getX() - dEdgeMinX) + BeamData.MILL_OVERLAP
|
||||
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
|
||||
@@ -154,7 +157,7 @@ function MachiningLib.GetSplitMachinings( Machinings, vSplittingPoints, Part )
|
||||
if not bIsLastSegment then
|
||||
Machinings[nCurrentMachiningIndex].sStage = ''
|
||||
end
|
||||
Machinings[nCurrentMachiningIndex].nSegment = j
|
||||
Machinings[nCurrentMachiningIndex].nFeatureSegment = j
|
||||
end
|
||||
-- anche le lavorazioni non splittate necessitano del segmento assegnato
|
||||
else
|
||||
@@ -167,12 +170,13 @@ function MachiningLib.GetSplitMachinings( Machinings, vSplittingPoints, Part )
|
||||
local dNextSplitX = dEdgeMinX
|
||||
local dPreviousSplitX = dEdgeMaxX
|
||||
if j ~= 1 then
|
||||
dPreviousSplitX = vSplittingPoints[j - 1]:getX()
|
||||
dPreviousSplitX = SplittingPoints[j - 1]:getX()
|
||||
elseif j ~= nParts then
|
||||
dNextSplitX = vSplittingPoints[j]:getX()
|
||||
dNextSplitX = SplittingPoints[j]:getX()
|
||||
end
|
||||
if ( dEdgeMinX - dLeftAddLength) > dNextSplitX - 10 * GEO.EPS_SMALL and ( dEdgeMaxX + dRightAddLength) < dPreviousSplitX + 10 * GEO.EPS_SMALL then
|
||||
Machinings[i].nSegment = j
|
||||
Machinings[i].nFeatureSegment = j
|
||||
Machinings[i].ptCenter = Point3d( dNextSplitX + ( dPreviousSplitX - dNextSplitX) / 2, 0, 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user