aggiunta la gestione delle lavorazioni in coda, per decidere se spostare dopo separazione o accorciarle:
- in MachiningLib aggiunte funzioni StartsLeftSide e CanExtendAfterTail; modificata GetSplitMachinings - Machining.nPart rinominato nSegment - in SLOTBYCHAINSAW.Make aggiunta sezione per gestire lavorazioni di coda - STR0004 adeguata per passare alla strategia di base le informazioni sulle lavorazioni di coda
This commit is contained in:
+45
-12
@@ -60,14 +60,36 @@ local function GetToolEntryAngle( Proc, vtTool)
|
||||
Angle.dTan = dTanAngle
|
||||
|
||||
return Angle
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- TODO da completare
|
||||
function MachiningLib.CanMoveAfterSplitcut( Part)
|
||||
local bMoveAfterSplitcut = false
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function MachiningLib.StartsLeftSide( Machining)
|
||||
local bStartsLeftSide = ( Machining.vtEdgeDirection:getX() > 10 * GEO.EPS_SMALL and not Machining.bInvert)
|
||||
or ( not( Machining.vtEdgeDirection:getX() > 10 * GEO.EPS_SMALL) and Machining.bInvert)
|
||||
|
||||
return bMoveAfterSplitcut
|
||||
return bStartsLeftSide
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- TODO valutare se c'è un modo più preciso di prevedere i casi in cui le lavorazioni dopo separazione sono da saltare
|
||||
function MachiningLib.CanMoveAfterSplitcut( dLengthOnX, Part)
|
||||
local bCanMoveAfterSplitcut = ( dLengthOnX < BeamData.LEN_SHORT_PART - 10 * GEO.EPS_SMALL)
|
||||
or ( dLengthOnX > 0.7 * Part.dLength + 10 * GEO.EPS_SMALL)
|
||||
|
||||
return bCanMoveAfterSplitcut
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function MachiningLib.CanExtendAfterTail( sCanDamageNextPiece, Part)
|
||||
local bCanExtendAfterTail = false
|
||||
|
||||
if sCanDamageNextPiece == 'ALWAYS' then
|
||||
bCanExtendAfterTail = true
|
||||
elseif sCanDamageNextPiece == 'ONLY_IF_RAWPART' then
|
||||
bCanExtendAfterTail = Part.bIsLastPart
|
||||
end
|
||||
|
||||
return bCanExtendAfterTail
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -96,9 +118,15 @@ function MachiningLib.GetSplitMachinings( Machinings, vSplittingPoints, Part )
|
||||
local dOriginalStartAddLength = Machinings[i].LeadIn.dStartAddLength
|
||||
local dOriginalEndAddLength = Machinings[i].LeadOut.dEndAddLength
|
||||
local nCurrentMachiningIndex = i
|
||||
-- lo spezzone attivo è quello precedente al punto di spezzatura corrente
|
||||
for j = 1, nParts do
|
||||
-- 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
|
||||
-- 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))
|
||||
-- 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))
|
||||
or bIsLastSegment then
|
||||
if j > 1 then
|
||||
nCurrentMachiningIndex = nCurrentMachiningIndex + 1
|
||||
table.insert( Machinings, nCurrentMachiningIndex, BeamLib.TableCopyDeep( Machinings[i]))
|
||||
@@ -114,15 +142,17 @@ 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].vtEdgeDirection:getX() > 10 * GEO.EPS_SMALL and not Machinings[nCurrentMachiningIndex].bInvert)
|
||||
or ( not( Machinings[nCurrentMachiningIndex].vtEdgeDirection:getX() > 10 * GEO.EPS_SMALL) and Machinings[nCurrentMachiningIndex].bInvert) then
|
||||
if MachiningLib.StartsLeftSide( Machinings[nCurrentMachiningIndex]) then
|
||||
dStartAddLength, dEndAddLength = dEndAddLength, dStartAddLength
|
||||
end
|
||||
|
||||
Machinings[nCurrentMachiningIndex].LeadIn.dStartAddLength = dStartAddLength
|
||||
Machinings[nCurrentMachiningIndex].LeadOut.dEndAddLength = dEndAddLength
|
||||
end
|
||||
Machinings[nCurrentMachiningIndex].nPart = j
|
||||
if not bIsLastSegment then
|
||||
Machinings[nCurrentMachiningIndex].bMoveAfterSplitcut = false
|
||||
end
|
||||
Machinings[nCurrentMachiningIndex].nSegment = j
|
||||
end
|
||||
-- anche le lavorazioni non splittate necessitano del segmento assegnato
|
||||
else
|
||||
@@ -135,7 +165,7 @@ function MachiningLib.GetSplitMachinings( Machinings, vSplittingPoints, Part )
|
||||
dNextSplitX = vSplittingPoints[j]:getX()
|
||||
end
|
||||
if dEdgeMinX > dNextSplitX - 10 * GEO.EPS_SMALL and dEdgeMaxX < dPreviousSplitX + 10 * GEO.EPS_SMALL then
|
||||
Machinings[i].nPart = j
|
||||
Machinings[i].nSegment = j
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -414,6 +444,7 @@ function MachiningLib.AddNewMachining( ProcToAdd, MachiningToAdd, AuxiliaryDataT
|
||||
Machining.Machining = MachiningToAdd
|
||||
Machining.AuxiliaryData = AuxiliaryDataToAdd or {}
|
||||
table.insert( MACHININGS, Machining)
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -638,12 +669,14 @@ function MachiningLib.AddOperations( vProc, Part, sRotation)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return bAreAllMachiningApplyOk, sErr, bSplitExecuted
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function MachiningLib.ApplyMachining( bRecalc, bApplyPost)
|
||||
local bResult = EgtApplyMachining( bRecalc, bApplyPost)
|
||||
|
||||
return bResult
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user