From 40e76a23c9e6b160a0b8f2a08f2819fcb427e2fe Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 21 Jan 2025 15:27:33 +0100 Subject: [PATCH] =?UTF-8?q?-=20in=20FaceData=20Elevation=20=C3=A8=20sempre?= =?UTF-8?q?=20positiva=20nelle=20facce=20standard=20(non=20MainFaces)=20-?= =?UTF-8?q?=20in=20MachiningLib=20in=20GetSplitMachinings=20correzioni=20a?= =?UTF-8?q?lla=20definizione=20dello=20stage=20della=20lavorazione;=20corr?= =?UTF-8?q?ezione=20a=20FindBlade=20-=20in=20SLOTBYBLADE=20e=20SLOTBYCHAIN?= =?UTF-8?q?SAW=20correzioni=20per=20poter=20passare=20la=20profondit=C3=A0?= =?UTF-8?q?=20di=20lavoro=20-=20in=20STR0005=20primo=20implemento=20di=20l?= =?UTF-8?q?avorazione=20con=20codolo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/FaceData.lua | 22 ++++-- LuaLibs/MachiningLib.lua | 5 ++ Strategies/Standard/STR0005/STR0005.lua | 74 +++++++++++++++---- Strategies/Standard/STR0005/STR0005Config.lua | 3 +- StrategyLibs/SLOTBYBLADE.lua | 28 ++++--- StrategyLibs/SLOTBYCHAINSAW.lua | 19 +++-- 6 files changed, 112 insertions(+), 39 deletions(-) diff --git a/LuaLibs/FaceData.lua b/LuaLibs/FaceData.lua index b9c2c72..fa426fa 100644 --- a/LuaLibs/FaceData.lua +++ b/LuaLibs/FaceData.lua @@ -116,11 +116,11 @@ local function GetEdgesInfo( Proc, idFace ) CurrentEdge.idAdjacentFace = EdgesEgt[i].Adj CurrentEdge.vtToolDirection = Vector3d( EdgesEgt[i].Norm) CurrentEdge.dLength = EdgesEgt[i].Len - CurrentEdge.dLengthOnX = abs( CurrentEdge.dLength * CurrentEdge.vtToolDirection:getY()) - CurrentEdge.dElevation = EdgesEgt[i].Elev + CurrentEdge.dElevation = abs( EdgesEgt[i].Elev) CurrentEdge.bIsOpen = EdgesEgt[i].Open CurrentEdge.bIsStartOpen = EdgesEgt[nPreviousEdgeIndex].Open CurrentEdge.bIsEndOpen = EdgesEgt[nNextEdgeIndex].Open + CurrentEdge.sType = 'Standard' table.insert( Edges, CurrentEdge) end @@ -300,9 +300,11 @@ local function GetBottomFaces( Proc) CurrentEdge.idAdjacentFace = BottomFaces[1].Edges[i].idAdjacentFace CurrentEdge.vtToolDirection = BottomFaces[1].Edges[i].vtToolDirection CurrentEdge.dLength = BottomFaces[1].Edges[i].dLength - CurrentEdge.dLengthOnX = BottomFaces[1].Edges[i].dLengthOnX - CurrentEdge.dElevation = BottomFaces[1].Edges[i].dElevation CurrentEdge.bIsOpen = BottomFaces[1].Edges[i].bIsOpen + CurrentEdge.dElevation = BottomFaces[1].Edges[i].dElevation + if CurrentEdge.bIsOpen then + CurrentEdge.dElevation = -CurrentEdge.dElevation + end CurrentEdge.bIsStartOpen = BottomFaces[1].Edges[i].bIsStartOpen CurrentEdge.bIsEndOpen = BottomFaces[1].Edges[i].bIsEndOpen @@ -386,9 +388,11 @@ local function GetLongFaces( Proc, MainFaces) CurrentEdge.idAdjacentFace = LongFaces[i].Edges[j].idAdjacentFace CurrentEdge.vtToolDirection = LongFaces[i].Edges[j].vtToolDirection CurrentEdge.dLength = LongFaces[i].Edges[j].dLength - CurrentEdge.dLengthOnX = LongFaces[i].Edges[j].dLengthOnX - CurrentEdge.dElevation = LongFaces[i].Edges[j].dElevation CurrentEdge.bIsOpen = LongFaces[i].Edges[j].bIsOpen + CurrentEdge.dElevation = LongFaces[i].Edges[j].dElevation + if CurrentEdge.bIsOpen then + CurrentEdge.dElevation = -CurrentEdge.dElevation + end CurrentEdge.bIsStartOpen = LongFaces[i].Edges[j].bIsStartOpen CurrentEdge.bIsEndOpen = LongFaces[i].Edges[j].bIsEndOpen @@ -473,9 +477,11 @@ local function GetSideFaces( Proc, MainFaces) CurrentEdge.idAdjacentFace = SideFaces[i].Edges[j].idAdjacentFace CurrentEdge.vtToolDirection = SideFaces[i].Edges[j].vtToolDirection CurrentEdge.dLength = SideFaces[i].Edges[j].dLength - CurrentEdge.dLengthOnX = SideFaces[i].Edges[j].dLengthOnX - CurrentEdge.dElevation = SideFaces[i].Edges[j].dElevation CurrentEdge.bIsOpen = SideFaces[i].Edges[j].bIsOpen + CurrentEdge.dElevation = SideFaces[i].Edges[j].dElevation + if CurrentEdge.bIsOpen then + CurrentEdge.dElevation = -CurrentEdge.dElevation + end CurrentEdge.bIsStartOpen = SideFaces[i].Edges[j].bIsStartOpen CurrentEdge.bIsEndOpen = SideFaces[i].Edges[j].bIsEndOpen diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 4289fce..33e88af 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -118,6 +118,7 @@ function MachiningLib.GetSplitMachinings( Machinings, SplittingPoints, Part ) end local dOriginalStartAddLength = Machinings[i].LeadIn.dStartAddLength local dOriginalEndAddLength = Machinings[i].LeadOut.dEndAddLength + local sOriginalStage = Machinings[i].sStage if FeatureLib.IsMachiningLong( Machinings[i].dLengthOnX, Part) then local nCurrentMachiningIndex = i -- lo spezzone attivo è quello precedente al punto di spezzatura corrente @@ -158,6 +159,8 @@ function MachiningLib.GetSplitMachinings( Machinings, SplittingPoints, Part ) end if not bIsLastSegment then Machinings[nCurrentMachiningIndex].sStage = '' + else + Machinings[nCurrentMachiningIndex].sStage = sOriginalStage end Machinings[nCurrentMachiningIndex].nFeatureSegment = j end @@ -317,6 +320,8 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters) bIsToolCompatible = TOOLS[i].SetupInfo.bIsTopHead elseif ToolSearchParameters.bAllowBottomHead and not ToolSearchParameters.bAllowTopHead then bIsToolCompatible = TOOLS[i].SetupInfo.bIsBottomHead + else + bIsToolCompatible = true end end diff --git a/Strategies/Standard/STR0005/STR0005.lua b/Strategies/Standard/STR0005/STR0005.lua index 3d4ca22..26e98e4 100644 --- a/Strategies/Standard/STR0005/STR0005.lua +++ b/Strategies/Standard/STR0005/STR0005.lua @@ -10,7 +10,7 @@ local MachiningLib = require( 'MachiningLib') local FeatureLib = require( 'FeatureLib') -- strategie di base local BladeToWaste = require( 'BLADETOWASTE') -local FaceByBlade = require( 'FACEBYBLADE') +local SlotByBlade = require( 'SLOTBYBLADE') -- Tabella per definizione modulo local STR0005 = {} @@ -52,6 +52,31 @@ function Blade.AddResult( Cutting) end +function Blade.AddMachiningAllSteps( Proc, Cutting, AuxiliaryData) + local bMachiningAdded = false + if not AuxiliaryData then + AuxiliaryData = {} + end + AuxiliaryData.Clones = {} + + local dOriginalRadialOffset = Cutting.dRadialOffset + local dOriginalLeadInPerpDistance = Cutting.LeadIn.dPerpDistance + local dOriginalLeadOutPerpDistance = Cutting.LeadOut.dPerpDistance + for i = 1, Cutting.HorizontalSteps.nCount do + AuxiliaryData.Clones[i] = {} + AuxiliaryData.Clones[i].LeadIn = {} + AuxiliaryData.Clones[i].LeadOut = {} + AuxiliaryData.Clones[i].dRadialOffset = dOriginalRadialOffset + Cutting.HorizontalSteps.dStep * ( Cutting.HorizontalSteps.nCount - i) + -- update distanza perpendicolare attacco per contemplare l'offset applicato + AuxiliaryData.Clones[i].LeadIn.dPerpDistance = dOriginalLeadInPerpDistance - Cutting.dRadialOffset + AuxiliaryData.Clones[i].LeadOut.dPerpDistance = dOriginalLeadOutPerpDistance - Cutting.dRadialOffset + end + bMachiningAdded = MachiningLib.AddNewMachining( Proc, Cutting, AuxiliaryData) + + return bMachiningAdded +end + + function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} @@ -63,10 +88,17 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) Strategy.Result.sInfo = '' Blade.Result = {} + local dExtendAfterTail = Strategy.Parameters.dExtendAfterTail or max( Part.dDistanceToNextPiece - BeamData.CUT_EXTRA, 0) + if MachiningLib.CanExtendAfterTail( Strategy.Parameters.sCanDamageNextPiece, Part) then + dExtendAfterTail = 10000 + end + local dFeatureMaxNotClampableLengthHead, dFeatureMaxNotClampableLengthTail = FeatureLib.GetFeatureMaxNotClampableLengths( Proc, Part) local bLeaveWasteAttached = Strategy.Parameters.sCuttingStrategy == 'LEAVE_WASTE_ATTACHED' local bFeatureHindersClamping = FeatureLib.IsMachiningLong( max( dFeatureMaxNotClampableLengthHead, dFeatureMaxNotClampableLengthTail), Part, { dMaxSegmentLength = BeamData.LONGCUT_ENDLEN}) local Cutting = {} + local MRRParametersBlade = {} + if bFeatureHindersClamping or bLeaveWasteAttached then -- TODO Lavorazione con codolo -- La FaceByBlade (o altra??) dovrà accettare opzionalmente di fermarsi prima (basta l'Offset??) e accettare l'utensile forzato. @@ -82,7 +114,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) end table.sort( EdgesSorted, CompareEdges) - local dDepthToMachine = EdgesSorted[1].dElevation / 2 + BeamData.CUT_EXTRA + local dDepthToMachine = abs( EdgesSorted[1].dElevation) / 2 - Strategy.Parameters.dStripWidth / 2 -- ricerca utensile local ToolSearchParameters = {} @@ -98,15 +130,30 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) Cutting.sMessage = 'Blade not found' Cutting.bIsApplicable = false EgtOutLog( Cutting.sMessage) - return Cutting, EdgeToMachine.dElevation + return Cutting, abs( EdgesSorted[1].dElevation) end + -- parametri per il calcolo della velocità di asportazione + MRRParametersBlade = { + dStep = min( TOOLS[Cutting.nToolIndex].dStep, abs( EdgesSorted[1].dElevation)), + dSideStep = TOOLS[Cutting.nToolIndex].dThickness, + dFeed = TOOLS[Cutting.nToolIndex].Feeds.dFeed + } + + -- eventuali punti di spezzatura + local FeatureSplittingPoints = FeatureLib.GetFeatureSplittingPoints( Proc, Part) + local bIsSplitFeature = false + if #FeatureSplittingPoints then + bIsSplitFeature = true + end - - -- si lavora il primo lato - local OptionalParameters = { dRadialOffset = 100} - Cutting = FaceByBlade.Make( Proc, Part, Proc.Faces[1], EdgesSorted[1], OptionalParameters) + -- primo lato + local OptionalParameters = { dDepthToMachine = dDepthToMachine, nToolIndex = Cutting.nToolIndex, bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail} + Cutting = SlotByBlade.Make( Proc, Part, Proc.Faces[1], EdgesSorted[1], OptionalParameters) Blade.AddResult( Cutting) + -- secondo lato + Cutting = SlotByBlade.Make( Proc, Part, Proc.Faces[1], EdgesSorted[2], OptionalParameters) + --Blade.AddResult( Cutting) -- lavorazioni raggruppate in unica lista Blade.Result.Sorted = {} @@ -116,14 +163,13 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) end end - -- TODO ordinamento lavorazioni (se necessario) - -- aggiunta eventuali lavorazioni splittate - local FeatureSplittingPoints = FeatureLib.GetFeatureSplittingPoints( Proc, Part) - if #FeatureSplittingPoints > 0 then - Blade.Result.Sorted = MachiningLib.GetSplitMachinings( Blade.Result, FeatureSplittingPoints, Part) + if bIsSplitFeature then + Blade.Result.Sorted = MachiningLib.GetSplitMachinings( Blade.Result.Sorted, FeatureSplittingPoints, Part) end + -- TODO ordinamento lavorazioni (se necessario) + -- se la lavorazione con codolo fallisce o non è possibile si proseguirà a quella con cubetti end @@ -160,10 +206,6 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) end Strategy.Result.nCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dFinalCompletionPercentage) Strategy.Result.nQuality = FeatureLib.GetFeatureQuality( 'Blade') - local MRRParametersBlade = { - dStep = min( TOOLS[Cutting.nToolIndex].dStep, Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1].dLength), - dSideStep = TOOLS[Cutting.nToolIndex].dThickness, - dFeed = TOOLS[Cutting.nToolIndex].Feeds.dFeed} local dMRRBlade = MachiningLib.GetToolMRR( MRRParametersBlade) Strategy.Result.dMRR = dMRRBlade diff --git a/Strategies/Standard/STR0005/STR0005Config.lua b/Strategies/Standard/STR0005/STR0005Config.lua index 4b9b856..85edf67 100644 --- a/Strategies/Standard/STR0005/STR0005Config.lua +++ b/Strategies/Standard/STR0005/STR0005Config.lua @@ -16,7 +16,8 @@ local STR0005Data = { { sValue = 'DROP_WHOLE_WASTE', sDescriptionShort = '', sDescriptionLong = '', sMessageId = ''}, { sValue = 'LEAVE_WASTE_ATTACHED', sDescriptionShort = '', sDescriptionLong = '', sMessageId = ''}}, { sName = 'dMaxWasteLength', sNameNge = 'MAX_WASTE_LENGTH', sValue = '300', sDescriptionShort = '', sDescriptionLong = '', sType = 'd', sMessageId = '', sMinUserLevel = '1'}, - { sName = 'dMaxWasteVolume', sNameNge = 'MAX_WASTE_VOLUME', sValue = '6000000', sDescriptionShort = '', sDescriptionLong = '', sType = 'd', sMessageId = '', sMinUserLevel = '1'} + { sName = 'dMaxWasteVolume', sNameNge = 'MAX_WASTE_VOLUME', sValue = '6000000', sDescriptionShort = '', sDescriptionLong = '', sType = 'd', sMessageId = '', sMinUserLevel = '1'}, + { sName = 'dStripWidth', sNameNge = 'STRIP_WIDTH', sValue = '5', sDescriptionShort = '', sDescriptionLong = '', sType = 'd', sMessageId = '', sMinUserLevel = '1'} } } diff --git a/StrategyLibs/SLOTBYBLADE.lua b/StrategyLibs/SLOTBYBLADE.lua index 9175bc7..7a7b595 100644 --- a/StrategyLibs/SLOTBYBLADE.lua +++ b/StrategyLibs/SLOTBYBLADE.lua @@ -102,12 +102,17 @@ function SLOTBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar local bForceLongcutBlade = OptionalParameters.bForceLongcutBlade or false local dExtendAfterTail = OptionalParameters.dExtendAfterTail or 10000 local dPocketHeight = OptionalParameters.dPocketHeight or 0 + local dDepthToMachine = min( OptionalParameters.dDepthToMachine or abs( EdgeToMachine.dElevation), abs( EdgeToMachine.dElevation)) + local bIsSplitFeature = OptionalParameters.bIsSplitFeature or false -- lunghezze e punti caratteristici della lavorazione e del lato lavorato Cutting.dLengthToMachine = EdgeToMachine.dLength - Cutting.dLengthOnX = abs( EdgeToMachine.dLength * EdgeToMachine.vtToolDirection:getY()) Cutting.dEdgeLength = EdgeToMachine.dLength + -- TODO conviene spostare questi calcoli nel FaceData? Cutting.ptEdge1, _, Cutting.ptEdge2 = EgtSurfTmFacetOppositeSide( Proc.id, FaceToMachine.id, -EdgeToMachine.vtToolDirection, GDB_ID.ROOT) + local b3BoxEdge = BBox3d( Cutting.ptEdge1, Cutting.ptEdge2) + Cutting.dLengthOnX = b3BoxEdge:getDimX() + -- Cutting.vtToolDirection = EdgeToMachine.vtToolDirection if EdgeToMachine.bIsOpen then Cutting.vtEdgeDirection = -EdgeToMachine.vtToolDirection ^ FaceToMachine.vtN @@ -140,7 +145,7 @@ function SLOTBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar EgtOutLog( Cutting.sMessage) return Cutting, EdgeToMachine.dElevation end - if Proc.MainFaces and #( Proc.MainFaces.SideFaces) > 1 then + if #( Proc.MainFaces) > 0 and #( Proc.MainFaces.SideFaces) > 1 then -- se tasca più stretta della lama la strategia non è applicabile if TOOLS[Cutting.nToolIndex].dDiameter > EdgeToMachine.dLength + 10 * GEO.EPS_SMALL then Cutting.sMessage = 'Pocket too narrow for blade diameter' @@ -175,14 +180,14 @@ function SLOTBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar Cutting.bToolInvert = false end -- profondità da lavorare e offset radiale - if TOOLS[Cutting.nToolIndex].dMaxDepth > abs( EdgeToMachine.dElevation) - 10 * GEO.EPS_SMALL then + if TOOLS[Cutting.nToolIndex].dMaxDepth > dDepthToMachine - 10 * GEO.EPS_SMALL then -- TODO la depth dovrebbe essere quella del machining - Cutting.dDepthToMachine = abs( EdgeToMachine.dElevation) + Cutting.dDepthToMachine = dDepthToMachine Cutting.dResidualDepth = 0 if EdgeToMachine.dElevation > -10 * GEO.EPS_SMALL then - Cutting.dRadialOffset = 0 + Cutting.dRadialOffset = EdgeToMachine.dElevation - dDepthToMachine else - Cutting.dRadialOffset = EdgeToMachine.dElevation + Cutting.dRadialOffset = -dDepthToMachine end else Cutting.dDepthToMachine = TOOLS[Cutting.nToolIndex].dMaxDepth - 1 @@ -243,7 +248,12 @@ function SLOTBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar -- se lavorazione aperta sulla coda, eventuali aggiustamenti -- TODO valutare se fare funzione a parte - if Proc.AffectedFaces.bLeft and ( EdgeToMachine.sType == 'Bottom' or ( EdgeToMachine.vtToolDirection:getX() < 10 * GEO.EPS_SMALL)) then + if Proc.AffectedFaces.bLeft and ( EdgeToMachine.sType == 'Bottom' or ( EdgeToMachine.vtToolDirection:getX() < 0.707)) then + local dLengthOnX = Cutting.dLengthOnX + -- se feature splittata non si considera la lunghezza della feature per il check spostamento dopo separazione + if bIsSplitFeature then + dLengthOnX = 0 + end local bStartLeft = MachiningLib.StartsLeftSide( Cutting) local dAddLengthLeftSide = Cutting.LeadOut.dEndAddLength local dAddLengthToReduce = sqrt( Cutting.dDepthToMachine * TOOLS[Cutting.nToolIndex].dDiameter - Cutting.dDepthToMachine * Cutting.dDepthToMachine) @@ -251,13 +261,13 @@ function SLOTBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar dAddLengthLeftSide = Cutting.LeadIn.dStartAddLength end if not AreSameOrOppositeVectorApprox( EdgeToMachine.vtToolDirection, Y_AX()) then - if MachiningLib.CanMoveAfterSplitcut( Cutting.dLengthOnX, Part) then + if MachiningLib.CanMoveAfterSplitcut( dLengthOnX, Part) then Cutting.sStage = 'AfterTail' else Cutting.bIsApplicable = false end elseif dAddLengthLeftSide + dAddLengthToReduce > dExtendAfterTail then - if MachiningLib.CanMoveAfterSplitcut( Cutting.dLengthOnX, Part) then + if MachiningLib.CanMoveAfterSplitcut( dLengthOnX, Part) then Cutting.sStage = 'AfterTail' else if bStartLeft then diff --git a/StrategyLibs/SLOTBYCHAINSAW.lua b/StrategyLibs/SLOTBYCHAINSAW.lua index 18fe907..1fc8210 100644 --- a/StrategyLibs/SLOTBYCHAINSAW.lua +++ b/StrategyLibs/SLOTBYCHAINSAW.lua @@ -69,12 +69,16 @@ function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional local bStopAtHalfElevation = OptionalParameters.bStopAtHalfElevation or false local dExtendAfterTail = OptionalParameters.dExtendAfterTail or 10000 local dPocketHeight = OptionalParameters.dPocketHeight or 0 + local bIsSplitFeature = OptionalParameters.bIsSplitFeature or false -- lunghezze e punti caratteristici della lavorazione e del lato lavorato Mortising.dLengthToMachine = dLengthToMachine - Mortising.dLengthOnX = abs( dLengthToMachine * EdgeToMachine.vtToolDirection:getY()) Mortising.dEdgeLength = EdgeToMachine.dLength + -- TODO conviene spostare questi calcoli nel FaceData? Mortising.ptEdge1, _, Mortising.ptEdge2 = EgtSurfTmFacetOppositeSide( Proc.id, FaceToMachine.id, -EdgeToMachine.vtToolDirection, GDB_ID.ROOT) + local b3BoxEdge = BBox3d( Mortising.ptEdge1, Mortising.ptEdge2) + Mortising.dLengthOnX = b3BoxEdge:getDimX() + -- TODO conviene spostare questi calcoli nel FaceData? Mortising.vtToolDirection = EdgeToMachine.vtToolDirection if EdgeToMachine.bIsOpen then Mortising.vtEdgeDirection = -EdgeToMachine.vtToolDirection ^ FaceToMachine.vtN @@ -122,7 +126,7 @@ function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional EgtOutLog( Mortising.sMessage) return Mortising end - if Proc.MainFaces and #( Proc.MainFaces.SideFaces) > 1 then + if #( Proc.MainFaces) > 0 and #( Proc.MainFaces.SideFaces) > 1 then -- se tasca più stretta della sega a catena la strategia non è applicabile if TOOLS[Mortising.nToolIndex].dWidth > EdgeToMachine.dLength + 10 * GEO.EPS_SMALL then Mortising.sMessage = 'Pocket too narrow for chainsaw width' @@ -218,20 +222,25 @@ function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional -- se lavorazione aperta sulla coda, eventuali aggiustamenti -- TODO valutare se fare funzione a parte - if Proc.AffectedFaces.bLeft and ( EdgeToMachine.sType == 'Bottom' or ( EdgeToMachine.vtToolDirection:getX() < 10 * GEO.EPS_SMALL)) then + if Proc.AffectedFaces.bLeft and ( EdgeToMachine.sType == 'Bottom' or ( EdgeToMachine.vtToolDirection:getX() < 0.707)) then + local dLengthOnX = Mortising.dLengthOnX + -- se feature splittata non si considera la lunghezza della feature per il check spostamento dopo separazione + if bIsSplitFeature then + dLengthOnX = 0 + end local bStartLeft = MachiningLib.StartsLeftSide( Mortising) local dAddLengthLeftSide = Mortising.LeadOut.dEndAddLength if bStartLeft then dAddLengthLeftSide = Mortising.LeadIn.dStartAddLength end if not AreSameOrOppositeVectorApprox( EdgeToMachine.vtToolDirection, Y_AX()) then - if MachiningLib.CanMoveAfterSplitcut( Mortising.dLengthOnX, Part) then + if MachiningLib.CanMoveAfterSplitcut( dLengthOnX, Part) then Mortising.sStage = 'AfterTail' else Mortising.bIsApplicable = false end elseif dAddLengthLeftSide + TOOLS[Mortising.nToolIndex].dDiameter / 2 > dExtendAfterTail then - if MachiningLib.CanMoveAfterSplitcut( Mortising.dLengthOnX, Part) then + if MachiningLib.CanMoveAfterSplitcut( dLengthOnX, Part) then Mortising.sStage = 'AfterTail' else if bStartLeft then