diff --git a/LuaLibs/FaceData.lua b/LuaLibs/FaceData.lua index 2f91b31..865bf2f 100644 --- a/LuaLibs/FaceData.lua +++ b/LuaLibs/FaceData.lua @@ -216,10 +216,10 @@ function FaceData.GetFacesInfo( Proc, Part, FacesToGet) end ------------------------------------------------------------------------------------------------------------- --- TODO valutare se scrivere in gruppo temporaneo che non richiede di passare ogni volta idPart; passare Face invece dell'id? -function FaceData.IsFaceRectangular( Proc, idFace) +-- TODO valutare se scrivere in gruppo temporaneo che non richiede di passare ogni volta idPart +function FaceData.IsFaceRectangular( Proc, Face) local nAddGrpId = BeamLib.GetAddGroup( Proc.idPart) - local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.id, idFace, nAddGrpId) + local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.id, Face.id, nAddGrpId) if nContourCnt > 1 then error( 'IsFaceRectangular : too many loops') end @@ -235,10 +235,10 @@ function FaceData.IsFaceRectangular( Proc, idFace) end ------------------------------------------------------------------------------------------------------------- --- TODO valutare se scrivere in gruppo temporaneo che non richiede di passare ogni volta idPart; passare Face invece dell'id? -function FaceData.IsFaceRhomboid( Proc, idFace) +-- TODO valutare se scrivere in gruppo temporaneo che non richiede di passare ogni volta idPart +function FaceData.IsFaceRhomboid( Proc, Face) local nAddGrpId = BeamLib.GetAddGroup( Proc.idPart) - local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.id, idFace, nAddGrpId) + local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.id, Face.id, nAddGrpId) if nContourCnt > 1 then error( 'IsFaceRhomboid : too many loops') end @@ -247,8 +247,8 @@ function FaceData.IsFaceRhomboid( Proc, idFace) local bIsRhomboid = false -- un parallelogramma è un trapezoide con i lati paralleli a due a due if bIsTrapezoid - and AreOppositeVectorApprox( Proc.Faces[idFace + 1].Edges[1].vtN, Proc.Faces[idFace + 1].Edges[3].vtN) - and AreOppositeVectorApprox( Proc.Faces[idFace + 1].Edges[2].vtN, Proc.Faces[idFace + 1].Edges[4].vtN) then + and AreOppositeVectorApprox( Face.Edges[1].vtN, Face.Edges[3].vtN) + and AreOppositeVectorApprox( Face.Edges[2].vtN, Face.Edges[4].vtN) then bIsRhomboid = true end diff --git a/StrategyLibs/BLADETOWASTE.lua b/StrategyLibs/BLADETOWASTE.lua index ae36c09..f72d838 100644 --- a/StrategyLibs/BLADETOWASTE.lua +++ b/StrategyLibs/BLADETOWASTE.lua @@ -586,7 +586,7 @@ local function CutWholeWaste( Proc, Part, OptionalParameters) -- se taglio da un lato non ce la fa, si prova da due lati -- TODO valutare se estendere ai non parallelogrammi - elseif FaceData.IsFaceRhomboid( Proc, Proc.Faces[1].id) then + elseif FaceData.IsFaceRhomboid( Proc, Proc.Faces[1]) then local CuttingParametersList CuttingParametersList, EdgeToMachine = GetDualSideCutStrategy( Proc, Part, OptionalParameters) diff --git a/StrategyLibs/FACEBYBLADE.lua b/StrategyLibs/FACEBYBLADE.lua index 00cfb3f..13d73c0 100644 --- a/StrategyLibs/FACEBYBLADE.lua +++ b/StrategyLibs/FACEBYBLADE.lua @@ -16,8 +16,8 @@ local function GetLeadInOutType( Machining) local sLeadInOutType = '' if Machining.bIsStartClosed or Machining.bIsEndClosed - or Machining.sCutType == 'Guillotine' - or Machining.sCutType == 'Reduced' then + or Machining.sEdgeUsage == 'Guillotine' + or Machining.sEdgeUsage == 'Reduced' then sLeadInOutType = 'Perpendicular' else @@ -68,10 +68,10 @@ local function CalculateLeadInOut( Machining, EdgeToMachine, bIsSplitFeature) local dToolMarkLength = sqrt( Machining.dDepthToMachine * TOOLS[Machining.nToolIndex].dDiameter - Machining.dDepthToMachine * Machining.dDepthToMachine) -- allungamento per faccia singola (aperta in tutte le direzioni) local dAddedLengthOpenFace = BeamData.CUT_EXTRA - if Machining.sCutType == 'Guillotine' then + if Machining.sEdgeUsage == 'Guillotine' then local dGuillotineLengthToMachine = 1 dAddedLengthOpenFace = ( - EdgeToMachine.dLength + dGuillotineLengthToMachine) / 2 - elseif Machining.sCutType == 'Reduced' then + elseif Machining.sEdgeUsage == 'Reduced' then dAddedLengthOpenFace = - FACEBYBLADE.GetPathReductionLength( Machining.nToolIndex, Machining.dMaxRadialOffset) end @@ -187,15 +187,15 @@ local function GetSCC( vtMachiningDirection, vtEdgeDirection, vtNFace) end -function FACEBYBLADE.GetCuttingType( FaceToMachine, EdgeToMachine) -local SCuttingType +function FACEBYBLADE.GetBladeEngagement( Face, vtToolDirection, b3Raw, Tool) +local sBladeEngagement - return SCuttingType + return sBladeEngagement end @@ -271,7 +271,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar dLongitudinalOffset = 0 end local dRadialStepSpan = OptionalParameters.dRadialStepSpan - local dMinNzDownUp = OptionalParameters.dMinNzDownUp local sUserNotes = OptionalParameters.sUserNotes or '' -- lunghezze, direzioni e punti caratteristici della lavorazione e del lato lavorato @@ -299,6 +298,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar -- ricerca utensile if nToolIndex then Cutting.nToolIndex = nToolIndex + Cutting.sBladeEngagement = FACEBYBLADE.GetBladeEngagement( FaceToMachine, Cutting.vtToolDirection, Part.b3Raw, TOOLS[nToolIndex]) else local ToolSearchParameters = {} ToolSearchParameters.dElevation = dDepthToMachine @@ -361,7 +361,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar Cutting.bInvert = false end -- se OppositeToolDirectionMode è Optimized, se possibile e necessario, si attiva per garantire taglio concorde e verso l'alto (massima qualità) - if ( OppositeToolDirectionMode == 'Optimized') and ( Proc.nFct == 1) and ( FaceData.IsFaceRhomboid( Proc, FaceToMachine.id)) then + if ( OppositeToolDirectionMode == 'Optimized') and ( Proc.nFct == 1) and ( FaceData.IsFaceRhomboid( Proc, FaceToMachine)) then OppositeToolDirectionMode = 'Disabled' -- la direzione di percorrenza del lato deve essere verso l'alto; bInvert va considerata perchè inverte la direzione di percorrenza. if ( Cutting.bInvert and Cutting.vtEdgeDirection:getZ() > 100 * GEO.EPS_SMALL) @@ -414,7 +414,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar else Cutting.dDepthToMachine = dDepthToMachine Cutting.dResidualDepth = 0 - Cutting.sCutType = 'Standard' + Cutting.sEdgeUsage = 'Standard' if bReduceBladePath and ( Proc.nFct == 1) and FaceData.IsFaceRectangular( Proc, FaceToMachine.id) then @@ -426,11 +426,11 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar -- taglio a ghigliottina if bIsTopBlade and ( Cutting.dRadialOffsetGuillotine < Cutting.dMaxRadialOffset - 10 * GEO.EPS_SMALL) then dDepthToMachine = Cutting.dDepthToMachine + Cutting.dRadialOffsetGuillotine - Cutting.sCutType = 'Guillotine' + Cutting.sEdgeUsage = 'Guillotine' -- taglio ridotto else dDepthToMachine = Cutting.dDepthToMachine + Cutting.dMaxRadialOffset - Cutting.sCutType = 'Reduced' + Cutting.sEdgeUsage = 'Reduced' end end end