From e553197d61aa1b60ef0cc23e2596d8f9b815984a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 23 Jan 2025 16:39:43 +0100 Subject: [PATCH] =?UTF-8?q?-=20in=20Edges=20l'elevazione=20si=20tiene=20se?= =?UTF-8?q?mpre=20positiva=20e=20la=20normale=20guarda=20sempre=20verso=20?= =?UTF-8?q?il=20centro.=20-=20alle=20funzioni=20di=20base=20si=20pu=C3=B2?= =?UTF-8?q?=20passare=20il=20parametro=20opzionale=20bOppositeToolDirectio?= =?UTF-8?q?n=20per=20invertire=20la=20direzione=20di=20lavoro=20dell'utens?= =?UTF-8?q?ile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/FaceData.lua | 16 +++----- Strategies/Standard/HEADCUT/HEADCUT.lua | 10 +---- Strategies/Standard/STR0003/STR0003.lua | 42 ++++++++++--------- Strategies/Standard/STR0004/STR0004.lua | 14 ++++--- Strategies/Standard/STR0005/STR0005.lua | 6 +-- StrategyLibs/FACEBYBLADE.lua | 9 +---- StrategyLibs/SLOTBYBLADE.lua | 41 ++++++++++--------- StrategyLibs/SLOTBYCHAINSAW.lua | 54 +++++++++++++------------ StrategyLibs/SPLITCUT.lua | 10 +---- 9 files changed, 95 insertions(+), 107 deletions(-) diff --git a/LuaLibs/FaceData.lua b/LuaLibs/FaceData.lua index 3fe713b..f78957c 100644 --- a/LuaLibs/FaceData.lua +++ b/LuaLibs/FaceData.lua @@ -112,12 +112,17 @@ local function GetEdgesInfo( Proc, idFace ) nNextEdgeIndex = 1 end + -- l'elevazione si tiene sempre positiva e la normale sempre diretta verso l'interno della faccia + -- per sapere se il lato è aperto c'è la proprietà apposita bIsOpen local CurrentEdge = {} CurrentEdge.idAdjacentFace = EdgesEgt[i].Adj - CurrentEdge.vtN = Vector3d( EdgesEgt[i].Norm) CurrentEdge.dLength = EdgesEgt[i].Len CurrentEdge.dElevation = abs( EdgesEgt[i].Elev) CurrentEdge.bIsOpen = EdgesEgt[i].Open + CurrentEdge.vtN = Vector3d( EdgesEgt[i].Norm) + if CurrentEdge.bIsOpen then + CurrentEdge.vtN = -CurrentEdge.vtN + end CurrentEdge.bIsStartOpen = EdgesEgt[nPreviousEdgeIndex].Open CurrentEdge.bIsEndOpen = EdgesEgt[nNextEdgeIndex].Open CurrentEdge.sType = 'Standard' @@ -302,9 +307,6 @@ local function GetBottomFaces( Proc) CurrentEdge.dLength = BottomFaces[1].Edges[i].dLength 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 @@ -390,9 +392,6 @@ local function GetLongFaces( Proc, MainFaces) CurrentEdge.dLength = LongFaces[i].Edges[j].dLength 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 @@ -479,9 +478,6 @@ local function GetSideFaces( Proc, MainFaces) CurrentEdge.dLength = SideFaces[i].Edges[j].dLength 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/Strategies/Standard/HEADCUT/HEADCUT.lua b/Strategies/Standard/HEADCUT/HEADCUT.lua index 7f2a524..17fd160 100644 --- a/Strategies/Standard/HEADCUT/HEADCUT.lua +++ b/Strategies/Standard/HEADCUT/HEADCUT.lua @@ -45,14 +45,8 @@ local function CalculateLeadInOut( Machining, EdgeToMachine) LeadOut.nType = MCH_MILL_LI.LINEAR LeadIn.dTangentDistance = 0 LeadOut.dTangentDistance = 0 - -- elevazione sempre in negativo - if EdgeToMachine.dElevation < 10 * GEO.EPS_SMALL then - LeadIn.dPerpDistance = BeamData.CUT_SIC - EdgeToMachine.dElevation - LeadOut.dPerpDistance = BeamData.CUT_SIC - EdgeToMachine.dElevation - else - LeadIn.dPerpDistance = BeamData.CUT_SIC - LeadOut.dPerpDistance = BeamData.CUT_SIC - end + LeadIn.dPerpDistance = BeamData.CUT_SIC + EdgeToMachine.dElevation + LeadOut.dPerpDistance = BeamData.CUT_SIC + EdgeToMachine.dElevation LeadIn.dElevation = 0 LeadOut.dElevation = 0 LeadIn.dCompLength = 0 diff --git a/Strategies/Standard/STR0003/STR0003.lua b/Strategies/Standard/STR0003/STR0003.lua index b62e1d2..6a813ca 100644 --- a/Strategies/Standard/STR0003/STR0003.lua +++ b/Strategies/Standard/STR0003/STR0003.lua @@ -289,6 +289,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) local Cutting = {} local OptionalParameters = { bForceLongcutBlade = Strategy.Parameters.bForceLongcutBlade, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} if Proc.Topology.sFamily == 'Tunnel' then + OptionalParameters.bOppositeToolDirection = true Cutting = SlotByBlade.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters) else Cutting = SlotByBlade.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge, OptionalParameters) @@ -296,6 +297,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) Blade.AddResult( Cutting) -- lato opposto del tunnel if Proc.Topology.sFamily == 'Tunnel' then + OptionalParameters.bOppositeToolDirection = true Cutting = SlotByBlade.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[2], OptionalParameters) Blade.AddResult( Cutting) else @@ -303,11 +305,13 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) if Blade.Result.Bottom[1].dResidualDepth > 10 * GEO.EPS_SMALL then -- eventuale lavorazione di lama - lato della tasca da cui inizia la lavorazione if Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsStartOpen then + OptionalParameters.bOppositeToolDirection = true Cutting = SlotByBlade.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters) Blade.AddResult( Cutting) end -- eventuale lavorazione di lama - lato della tasca in cui finisce la lavorazione if Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsEndOpen then + OptionalParameters.bOppositeToolDirection = true Cutting = SlotByBlade.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2], OptionalParameters) Blade.AddResult( Cutting) end @@ -392,10 +396,10 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) -- si lavora solamente l'impronta lama sul fondo if ( #Blade.Result.Side > 0) and Blade.Result.Side[1].dResidualDepth < 10 * GEO.EPS_SMALL then if ( Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsStartOpen and Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1].dLength > 3 * Blade.Result.Side[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) then - local OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters) elseif ( Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsEndOpen and Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2].dLength > 3 * Blade.Result.Side[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) then - local OptionalParameters = { sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2], OptionalParameters) end -- si lavora tutto il lato @@ -407,10 +411,10 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) dBladeResidualDepth = Blade.Result.Bottom[1].dResidualDepth end if Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsStartOpen then - local OptionalParameters = { dMaxElev = dBladeResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { dMaxElev = dBladeResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters) elseif Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsEndOpen then - local OptionalParameters = { dMaxElev = dBladeResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { dMaxElev = dBladeResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2], OptionalParameters) end end @@ -428,16 +432,16 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) if ( Blade.Result.Side[1].dResidualDepth < 10 * GEO.EPS_SMALL and Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1].dLength > 3 * Blade.Result.Side[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) and ( Blade.Result.Side[2].dResidualDepth < 10 * GEO.EPS_SMALL and Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2].dLength > 3 * Blade.Result.Side[2].dBladeMarkLength - 10 * GEO.EPS_SMALL) then - local OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) -- ancora materiale residuo - si lavora da entrambi i lati if Chainsaw.Result.Side[1].dResidualDepth > 10 * GEO.EPS_SMALL then - local OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Side[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) OptionalParameters = {} - OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Side[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Side[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2], OptionalParameters) Chainsaw.AddResult( Mortising) -- lavorando dai due lati non c'è materiale residuo - si può eliminare la lavorazione del fondo @@ -447,17 +451,17 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) end -- si lavora tutto il lato else - local OptionalParameters = { dMaxElev = Blade.Result.Side[1].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { dMaxElev = Blade.Result.Side[1].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) -- ancora materiale residuo - si lavora da entrambi i lati if Chainsaw.Result.Side[1].dResidualDepth > 10 * GEO.EPS_SMALL then Chainsaw.Result.Side[1].bIsApplicable = false - local OptionalParameters = { bStopAtHalfElevation = true, dMaxElev = Blade.Result.Side[1].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { bStopAtHalfElevation = true, dMaxElev = Blade.Result.Side[1].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) OptionalParameters = {} - OptionalParameters = { bStopAtHalfElevation = true, dMaxElev = Blade.Result.Side[2].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + OptionalParameters = { bStopAtHalfElevation = true, dMaxElev = Blade.Result.Side[2].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2], OptionalParameters) Chainsaw.AddResult( Mortising) -- lavorando dai due lati non c'è materiale residuo - si può disabilitare la lavorazione del fondo @@ -473,43 +477,43 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) if ( Blade.Result.Opposite[1].dResidualDepth < 10 * GEO.EPS_SMALL and Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1].dLength > 3 * Blade.Result.Opposite[1].dBladeMarkLength - 10 * GEO.EPS_SMALL) and ( Blade.Result.Opposite[2].dResidualDepth < 10 * GEO.EPS_SMALL and Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[2].dLength > 3 * Blade.Result.Opposite[2].dBladeMarkLength - 10 * GEO.EPS_SMALL) then - local OptionalParameters = { sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) OptionalParameters = {} - OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + OptionalParameters = { sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) if Chainsaw.Result.Opposite[1].dResidualDepth > 10 * GEO.EPS_SMALL or Chainsaw.Result.Opposite[2].dResidualDepth > 10 * GEO.EPS_SMALL then Chainsaw.Result.Opposite[1].bIsApplicable = false Chainsaw.Result.Opposite[2].bIsApplicable = false - local OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) OptionalParameters = {} - OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[1].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) OptionalParameters = {} - OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'Start', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[2], OptionalParameters) Chainsaw.AddResult( Mortising) OptionalParameters = {} - OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + OptionalParameters = { bStopAtHalfElevation = true, sSideToMachine = 'End', dLengthToMachine = Blade.Result.Opposite[2].dBladeMarkLength, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[2], OptionalParameters) Chainsaw.AddResult( Mortising) end else - local OptionalParameters = { dMaxElev = Blade.Result.Opposite[1].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { dMaxElev = Blade.Result.Opposite[1].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) if Chainsaw.Result.Opposite[1].dResidualDepth > 10 * GEO.EPS_SMALL then Chainsaw.Result.Opposite[1].bIsApplicable = false - local OptionalParameters = { bStopAtHalfElevation = true, dMaxElev = Blade.Result.Opposite[1].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { bStopAtHalfElevation = true, dMaxElev = Blade.Result.Opposite[1].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) OptionalParameters = {} - OptionalParameters = { bStopAtHalfElevation = true, dMaxElev = Blade.Result.Opposite[2].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + OptionalParameters = { bStopAtHalfElevation = true, dMaxElev = Blade.Result.Opposite[2].dResidualDepth + BeamData.CUT_EXTRA, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[2], OptionalParameters) Chainsaw.AddResult( Mortising) end diff --git a/Strategies/Standard/STR0004/STR0004.lua b/Strategies/Standard/STR0004/STR0004.lua index 89f34cb..3885da2 100644 --- a/Strategies/Standard/STR0004/STR0004.lua +++ b/Strategies/Standard/STR0004/STR0004.lua @@ -182,8 +182,10 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) -- materiale residuo - se possibile si lavora dal lato if ( Chainsaw.Result.Bottom[#Chainsaw.Result.Bottom].dResidualDepth > 10 * GEO.EPS_SMALL or not Chainsaw.Result.Bottom[#Chainsaw.Result.Bottom].bIsApplicable) and #Proc.MainFaces.SideFaces == 1 then if Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsStartOpen then + OptionalParameters.bOppositeToolDirection = true Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters) elseif Proc.MainFaces.LongFaces[1].MainEdges.BottomEdge.bIsEndOpen then + OptionalParameters.bOppositeToolDirection = true Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2], OptionalParameters) end Chainsaw.AddResult( Mortising) @@ -195,17 +197,17 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) Chainsaw.AddResult( Mortising) -- materiale residuo - si lavorano i lati if ( Chainsaw.Result.Bottom[1].dResidualDepth > 10 * GEO.EPS_SMALL or not Chainsaw.Result.Bottom[#Chainsaw.Result.Bottom].bIsApplicable) then - local OptionalParameters = { dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) -- ancora materiale residuo - si lavora da entrambi i lati if Chainsaw.Result.Side[1].dResidualDepth > 10 * GEO.EPS_SMALL then Chainsaw.Result.Side[1].bIsApplicable = false - local OptionalParameters = { bStopAtHalfElevation = true, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { bStopAtHalfElevation = true, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) OptionalParameters = {} - OptionalParameters = { bStopAtHalfElevation = true, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + OptionalParameters = { bStopAtHalfElevation = true, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.SideEdges[2], OptionalParameters) Chainsaw.AddResult( Mortising) -- lavorando dai due lati non c'è materiale residuo - si può disabilitare la lavorazione del fondo @@ -215,16 +217,16 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) end end elseif Proc.Topology.sName == 'Tunnel-4-Through' then - local OptionalParameters = { dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} Mortising = SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) if Chainsaw.Result.Opposite[1].dResidualDepth > 10 * GEO.EPS_SMALL then Chainsaw.Result.Opposite[1].bIsApplicable = false - local OptionalParameters = { bStopAtHalfElevation = true, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + local OptionalParameters = { bStopAtHalfElevation = true, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[1], OptionalParameters) Chainsaw.AddResult( Mortising) OptionalParameters = {} - OptionalParameters = { bStopAtHalfElevation = true, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight} + OptionalParameters = { bStopAtHalfElevation = true, dExtendAfterTail = dExtendAfterTail, dPocketHeight = dPocketHeight, bOppositeToolDirection = true} SlotByChainSaw.Make( Proc, Part, Proc.MainFaces.LongFaces[1], Proc.MainFaces.LongFaces[1].MainEdges.OppositeEdges[2], OptionalParameters) Chainsaw.AddResult( Mortising) end diff --git a/Strategies/Standard/STR0005/STR0005.lua b/Strategies/Standard/STR0005/STR0005.lua index 6424be7..1123ed4 100644 --- a/Strategies/Standard/STR0005/STR0005.lua +++ b/Strategies/Standard/STR0005/STR0005.lua @@ -114,7 +114,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) end table.sort( EdgesSorted, CompareEdges) - local dDepthToMachine = abs( EdgesSorted[1].dElevation) / 2 - Strategy.Parameters.dStripWidth / 2 + local dDepthToMachine = EdgesSorted[1].dElevation / 2 - Strategy.Parameters.dStripWidth / 2 -- ricerca utensile local ToolSearchParameters = {} @@ -130,12 +130,12 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) Cutting.sMessage = 'Blade not found' Cutting.bIsApplicable = false EgtOutLog( Cutting.sMessage) - return Cutting, abs( EdgesSorted[1].dElevation) + return Cutting, EdgesSorted[1].dElevation end -- parametri per il calcolo della velocità di asportazione MRRParametersBlade = { - dStep = min( TOOLS[Cutting.nToolIndex].dStep, abs( EdgesSorted[1].dElevation)), + dStep = min( TOOLS[Cutting.nToolIndex].dStep, EdgesSorted[1].dElevation), dSideStep = TOOLS[Cutting.nToolIndex].dThickness, dFeed = TOOLS[Cutting.nToolIndex].Feeds.dFeed } diff --git a/StrategyLibs/FACEBYBLADE.lua b/StrategyLibs/FACEBYBLADE.lua index 07dbdca..d1c4e15 100644 --- a/StrategyLibs/FACEBYBLADE.lua +++ b/StrategyLibs/FACEBYBLADE.lua @@ -23,13 +23,8 @@ local function CalculateLeadInOut( EdgeToMachine) LeadIn.dTangentDistance = 0 LeadOut.dTangentDistance = 0 -- elevazione sempre in negativo - if EdgeToMachine.dElevation < 10 * GEO.EPS_SMALL then - LeadIn.dPerpDistance = BeamData.CUT_SIC - EdgeToMachine.dElevation - LeadOut.dPerpDistance = BeamData.CUT_SIC - EdgeToMachine.dElevation - else - LeadIn.dPerpDistance = BeamData.CUT_SIC - LeadOut.dPerpDistance = BeamData.CUT_SIC - end + LeadIn.dPerpDistance = BeamData.CUT_SIC + EdgeToMachine.dElevation + LeadOut.dPerpDistance = BeamData.CUT_SIC + EdgeToMachine.dElevation LeadIn.dElevation = 0 LeadOut.dElevation = 0 LeadIn.dCompLength = 0 diff --git a/StrategyLibs/SLOTBYBLADE.lua b/StrategyLibs/SLOTBYBLADE.lua index d49fb1c..bff4dfa 100644 --- a/StrategyLibs/SLOTBYBLADE.lua +++ b/StrategyLibs/SLOTBYBLADE.lua @@ -31,7 +31,7 @@ local function CalculateLeadInOut( Machining, EdgeToMachine) LeadOut.nType = MCH_MILL_LI.LINEAR LeadIn.dTangentDistance = 0 LeadOut.dTangentDistance = 0 - if EdgeToMachine.dElevation > -10 * GEO.EPS_SMALL then + if AreSameVectorApprox( Machining.vtToolDirection, EdgeToMachine.vtN) then LeadIn.dPerpDistance = EdgeToMachine.dElevation + BeamData.CUT_SIC LeadOut.dPerpDistance = EdgeToMachine.dElevation + BeamData.CUT_SIC else @@ -90,7 +90,7 @@ function SLOTBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar Cutting.dDepthToMachine = 0 Cutting.sMessage = '' Cutting.idProc = Proc.id - Cutting.dResidualDepth = abs( EdgeToMachine.dElevation) + Cutting.dResidualDepth = EdgeToMachine.dElevation Cutting.dBladeMarkLength = 0 Cutting.sEdgeType = EdgeToMachine.sType Cutting.nFeatureSegment = 1 @@ -102,8 +102,9 @@ 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 dDepthToMachine = min( OptionalParameters.dDepthToMachine or EdgeToMachine.dElevation, EdgeToMachine.dElevation) local bIsSplitFeature = OptionalParameters.bIsSplitFeature or false + local bOppositeToolDirection = OptionalParameters.bOppositeToolDirection or false -- lunghezze e punti caratteristici della lavorazione e del lato lavorato Cutting.dLengthToMachine = EdgeToMachine.dLength @@ -113,17 +114,17 @@ function SLOTBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar local b3BoxEdge = BBox3d( Cutting.ptEdge1, Cutting.ptEdge2) Cutting.dLengthOnX = b3BoxEdge:getDimX() -- - Cutting.vtToolDirection = EdgeToMachine.vtN - if EdgeToMachine.bIsOpen then - Cutting.vtEdgeDirection = -EdgeToMachine.vtN ^ FaceToMachine.vtN + if bOppositeToolDirection then + Cutting.vtToolDirection = -EdgeToMachine.vtN else - Cutting.vtEdgeDirection = EdgeToMachine.vtN ^ FaceToMachine.vtN + Cutting.vtToolDirection = EdgeToMachine.vtN end + Cutting.vtEdgeDirection = EdgeToMachine.vtN ^ FaceToMachine.vtN -- ricerca utensile local ToolSearchParameters = {} - ToolSearchParameters.dElevation = abs( EdgeToMachine.dElevation) - ToolSearchParameters.vtToolDirection = EdgeToMachine.vtN + ToolSearchParameters.dElevation = EdgeToMachine.dElevation + ToolSearchParameters.vtToolDirection = Cutting.vtToolDirection ToolSearchParameters.bAllowTopHead = true ToolSearchParameters.bAllowBottomHead = false ToolSearchParameters.bForceLongcutBlade = bForceLongcutBlade @@ -169,7 +170,7 @@ function SLOTBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar Cutting.nWorkside = MCH_MILL_WS.LEFT Cutting.bInvert = false end - if EdgeToMachine.dElevation < -10 * GEO.EPS_SMALL then + if bOppositeToolDirection then Cutting.bInvert = not Cutting.bInvert end -- TODO gestire lama da sotto e lama downUp @@ -184,18 +185,18 @@ function SLOTBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar -- TODO la depth dovrebbe essere quella del machining Cutting.dDepthToMachine = dDepthToMachine Cutting.dResidualDepth = 0 - if EdgeToMachine.dElevation > -10 * GEO.EPS_SMALL then - Cutting.dRadialOffset = EdgeToMachine.dElevation - dDepthToMachine - else + if bOppositeToolDirection then Cutting.dRadialOffset = -dDepthToMachine + else + Cutting.dRadialOffset = EdgeToMachine.dElevation - dDepthToMachine end else Cutting.dDepthToMachine = TOOLS[Cutting.nToolIndex].dMaxDepth - 1 - Cutting.dResidualDepth = abs( EdgeToMachine.dElevation) - Cutting.dDepthToMachine - if EdgeToMachine.dElevation > -10 * GEO.EPS_SMALL then - Cutting.dRadialOffset = EdgeToMachine.dElevation - Cutting.dDepthToMachine - else + Cutting.dResidualDepth = EdgeToMachine.dElevation - Cutting.dDepthToMachine + if bOppositeToolDirection then Cutting.dRadialOffset = -Cutting.dDepthToMachine + else + Cutting.dRadialOffset = EdgeToMachine.dElevation - Cutting.dDepthToMachine end end -- completamento @@ -214,10 +215,10 @@ function SLOTBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar -- overlap Cutting.dOverlap = 0 -- faceuse - if EdgeToMachine.dElevation > - 10 * GEO.EPS_SMALL then - Cutting.nFaceuse = BeamLib.GetNearestOrthoOpposite( EdgeToMachine.vtN) - else + if bOppositeToolDirection then Cutting.nFaceuse = BeamLib.GetNearestOrthoOpposite( -EdgeToMachine.vtN) + else + Cutting.nFaceuse = BeamLib.GetNearestOrthoOpposite( EdgeToMachine.vtN) end -- SCC Cutting.nSCC = GetSCC( EdgeToMachine.vtN) diff --git a/StrategyLibs/SLOTBYCHAINSAW.lua b/StrategyLibs/SLOTBYCHAINSAW.lua index 92608a5..6b931fc 100644 --- a/StrategyLibs/SLOTBYCHAINSAW.lua +++ b/StrategyLibs/SLOTBYCHAINSAW.lua @@ -52,7 +52,7 @@ function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional local Mortising = {} Mortising.bIsApplicable = true Mortising.dDepthToMachine = 0 - Mortising.dResidualDepth = abs( EdgeToMachine.dElevation) + Mortising.dResidualDepth = EdgeToMachine.dElevation Mortising.sMessage = '' Mortising.idProc = Proc.id Mortising.sEdgeType = EdgeToMachine.sType @@ -65,11 +65,12 @@ function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional local bUseZigZagMortising = OptionalParameters.bUseZigZagMortising or false local sSideToMachine = OptionalParameters.sSideToMachine or '' local dLengthToMachine = OptionalParameters.dLengthToMachine or EdgeToMachine.dLength - local dCustomMaxElev = OptionalParameters.dMaxElev or abs( EdgeToMachine.dElevation) + local dCustomMaxElev = OptionalParameters.dMaxElev or EdgeToMachine.dElevation local bStopAtHalfElevation = OptionalParameters.bStopAtHalfElevation or false local dExtendAfterTail = OptionalParameters.dExtendAfterTail or 10000 local dPocketHeight = OptionalParameters.dPocketHeight or 0 local bIsSplitFeature = OptionalParameters.bIsSplitFeature or false + local bOppositeToolDirection = OptionalParameters.bOppositeToolDirection or false -- lunghezze e punti caratteristici della lavorazione e del lato lavorato Mortising.dLengthToMachine = dLengthToMachine @@ -77,12 +78,13 @@ function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional Mortising.dLengthOnX = abs( dLengthToMachine * EdgeToMachine.vtN:getY()) Mortising.dEdgeLength = EdgeToMachine.dLength Mortising.ptEdge1, _, Mortising.ptEdge2 = EgtSurfTmFacetOppositeSide( Proc.id, FaceToMachine.id, -EdgeToMachine.vtN, GDB_ID.ROOT) - Mortising.vtToolDirection = EdgeToMachine.vtN - if EdgeToMachine.bIsOpen then - Mortising.vtEdgeDirection = -EdgeToMachine.vtN ^ FaceToMachine.vtN + + if bOppositeToolDirection then + Mortising.vtToolDirection = -EdgeToMachine.vtN else - Mortising.vtEdgeDirection = EdgeToMachine.vtN ^ FaceToMachine.vtN + Mortising.vtToolDirection = EdgeToMachine.vtN end + Mortising.vtEdgeDirection = EdgeToMachine.vtN ^ FaceToMachine.vtN -- ricerca utensile local bExtendWithCornerRadius = false @@ -91,17 +93,17 @@ function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional ( EdgeToMachine.sType == 'Opposite' and Proc.Topology.sFamily == 'Tunnel') then bExtendWithCornerRadius = true - Mortising.dDepthToMachine = abs( EdgeToMachine.dElevation) + BeamData.CUT_EXTRA + Mortising.dDepthToMachine = EdgeToMachine.dElevation + BeamData.CUT_EXTRA else - Mortising.dDepthToMachine = abs( EdgeToMachine.dElevation) + Mortising.dDepthToMachine = EdgeToMachine.dElevation end else bExtendWithCornerRadius = true - Mortising.dDepthToMachine = abs( EdgeToMachine.dElevation) / 2 + BeamData.CUT_EXTRA_MIN + Mortising.dDepthToMachine = EdgeToMachine.dElevation / 2 + BeamData.CUT_EXTRA_MIN end local ToolSearchParameters = {} local ToolInfo = {} - ToolSearchParameters.vtToolDirection = EdgeToMachine.vtN + ToolSearchParameters.vtToolDirection = Mortising.vtToolDirection ToolSearchParameters.bAllowTopHead = true ToolSearchParameters.bAllowBottomHead = true ToolSearchParameters.dElevation = Mortising.dDepthToMachine @@ -143,12 +145,12 @@ function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional Mortising.bIsEndClosed = not EdgeToMachine.bIsEndOpen -- lato di lavoro e inversioni Mortising.bInvert = false - if EdgeToMachine.dElevation > -10 * GEO.EPS_SMALL then - Mortising.nWorkside = MCH_MILL_WS.RIGHT - Mortising.bToolInvert = false - else + if bOppositeToolDirection then Mortising.nWorkside = MCH_MILL_WS.LEFT Mortising.bToolInvert = true + else + Mortising.nWorkside = MCH_MILL_WS.RIGHT + Mortising.bToolInvert = false end -- profondità e offset longitudinale if bExtendWithCornerRadius then @@ -156,19 +158,19 @@ function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional end if TOOLS[Mortising.nToolIndex].dMaxMaterial > Mortising.dDepthToMachine - 10 * GEO.EPS_SMALL then Mortising.dResidualDepth = 0 - if EdgeToMachine.dElevation > -10 * GEO.EPS_SMALL then - Mortising.dLongitudinalOffset = 0 - else - Mortising.dLongitudinalOffset = abs( EdgeToMachine.dElevation) - Mortising.dDepthToMachine - end - else - Mortising.dDepthToMachine = TOOLS[Mortising.nToolIndex].dMaxMaterial - 1 - Mortising.dResidualDepth = abs( EdgeToMachine.dElevation) - Mortising.dDepthToMachine - if EdgeToMachine.dElevation > -10 * GEO.EPS_SMALL then + if bOppositeToolDirection then Mortising.dLongitudinalOffset = EdgeToMachine.dElevation - Mortising.dDepthToMachine else Mortising.dLongitudinalOffset = 0 end + else + Mortising.dDepthToMachine = TOOLS[Mortising.nToolIndex].dMaxMaterial - 1 + Mortising.dResidualDepth = EdgeToMachine.dElevation - Mortising.dDepthToMachine + if bOppositeToolDirection then + Mortising.dLongitudinalOffset = 0 + else + Mortising.dLongitudinalOffset = EdgeToMachine.dElevation - Mortising.dDepthToMachine + end Mortising.sMessage = 'Feature '.. Proc.idFeature .. ' : chainsaw elevation (' .. EgtNumToString( EdgeToMachine.dElevation, 1) .. ') bigger than max tool depth (' .. EgtNumToString( Mortising.dDepthToMachine, 1) .. ')' EgtOutLog( Mortising.sMessage) end @@ -193,10 +195,10 @@ function SLOTBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional end Mortising.Steps.dStep = TOOLS[Mortising.nToolIndex].dStep -- faceuse - if EdgeToMachine.dElevation > - 10 * GEO.EPS_SMALL then - Mortising.nFaceuse = BeamLib.GetNearestParalOpposite( EdgeToMachine.vtN) - else + if bOppositeToolDirection then Mortising.nFaceuse = BeamLib.GetNearestParalOpposite( -EdgeToMachine.vtN) + else + Mortising.nFaceuse = BeamLib.GetNearestParalOpposite( EdgeToMachine.vtN) end -- SCC Mortising.SCC = MCH_SCC.NONE diff --git a/StrategyLibs/SPLITCUT.lua b/StrategyLibs/SPLITCUT.lua index d56cab5..833f7b5 100644 --- a/StrategyLibs/SPLITCUT.lua +++ b/StrategyLibs/SPLITCUT.lua @@ -203,14 +203,8 @@ function SPLITCUT.CalculateLeadInOut( EdgeToMachine) LeadOut.nType = MCH_MILL_LI.LINEAR LeadIn.dTangentDistance = 0 LeadOut.dTangentDistance = 0 - -- elevazione sempre in negativo - if EdgeToMachine.dElevation < 10 * GEO.EPS_SMALL then - LeadIn.dPerpDistance = BeamData.CUT_SIC - EdgeToMachine.dElevation - LeadOut.dPerpDistance = BeamData.CUT_SIC - EdgeToMachine.dElevation - else - LeadIn.dPerpDistance = BeamData.CUT_SIC - LeadOut.dPerpDistance = BeamData.CUT_SIC - end + LeadIn.dPerpDistance = BeamData.CUT_SIC + EdgeToMachine.dElevation + LeadOut.dPerpDistance = BeamData.CUT_SIC + EdgeToMachine.dElevation LeadIn.dElevation = 0 LeadOut.dElevation = 0 LeadIn.dCompLength = 0