- in FaceData si calcolano i MainEdges solo per le facce che hanno esattamente 4 lati
- in STR0005 corretto calcolo dExtendAfterTail - in FACEBYBLADE si i tagli troncanti in coda sono sempre dichiarati AfterTail; eliminata assegnazione a posteriori in BLADETOWASTE
This commit is contained in:
+26
-6
@@ -386,6 +386,12 @@ local function GetBottomFaces( Proc)
|
||||
end
|
||||
|
||||
BottomFaces[1].sType = 'Bottom'
|
||||
|
||||
-- calcolo MainEdges implementato solo se 4 lati esatti
|
||||
if #BottomFaces[1].Edges ~= 4 then
|
||||
return BottomFaces
|
||||
end
|
||||
|
||||
BottomFaces[1].MainEdges = {}
|
||||
BottomFaces[1].MainEdges.LongEdges = {}
|
||||
BottomFaces[1].MainEdges.SideEdges = {}
|
||||
@@ -471,7 +477,7 @@ local function GetLongFaces( Proc, MainFaces)
|
||||
idFirstLongFace = FacesSortedByGreatestArea[1].id
|
||||
local FacesNotAdjacent = GetNotAdjacentFaces( Proc, idFirstLongFace)
|
||||
idSecondLongFace = FacesNotAdjacent[1].id
|
||||
else
|
||||
elseif BottomFace.MainEdges then
|
||||
if BottomFace.MainEdges.LongEdges[1].idAdjacentFace > -1 then
|
||||
idFirstLongFace = BottomFace.MainEdges.LongEdges[1].idAdjacentFace
|
||||
end
|
||||
@@ -488,6 +494,12 @@ local function GetLongFaces( Proc, MainFaces)
|
||||
|
||||
for i = 1, #LongFaces do
|
||||
LongFaces[i].sType = 'Long'
|
||||
|
||||
-- calcolo MainEdges possibile solo se 4 lati esatti
|
||||
if #LongFaces[i].Edges ~= 4 then
|
||||
break
|
||||
end
|
||||
|
||||
LongFaces[i].MainEdges = {}
|
||||
LongFaces[i].MainEdges.SideEdges = {}
|
||||
LongFaces[i].MainEdges.OppositeEdges = {}
|
||||
@@ -559,11 +571,13 @@ local function GetSideFaces( Proc, MainFaces)
|
||||
|
||||
local idFirstSideFace = GDB_ID.NULL
|
||||
local idSecondSideFace = GDB_ID.NULL
|
||||
if not LongFaces[1].MainEdges.SideEdges[1].bIsOpen then
|
||||
idFirstSideFace = LongFaces[1].MainEdges.SideEdges[1].idAdjacentFace
|
||||
end
|
||||
if not LongFaces[1].MainEdges.SideEdges[2].bIsOpen then
|
||||
idSecondSideFace = LongFaces[1].MainEdges.SideEdges[2].idAdjacentFace
|
||||
if LongFaces[1] and LongFaces[1].MainEdges then
|
||||
if not LongFaces[1].MainEdges.SideEdges[1].bIsOpen then
|
||||
idFirstSideFace = LongFaces[1].MainEdges.SideEdges[1].idAdjacentFace
|
||||
end
|
||||
if not LongFaces[1].MainEdges.SideEdges[2].bIsOpen then
|
||||
idSecondSideFace = LongFaces[1].MainEdges.SideEdges[2].idAdjacentFace
|
||||
end
|
||||
end
|
||||
if idFirstSideFace > -1 and Proc.Faces[idFirstSideFace + 1].bIsOkForMachining then
|
||||
table.insert( SideFaces, Proc.Faces[idFirstSideFace + 1])
|
||||
@@ -576,6 +590,12 @@ local function GetSideFaces( Proc, MainFaces)
|
||||
|
||||
for i = 1, #SideFaces do
|
||||
SideFaces[i].sType = 'Side'
|
||||
|
||||
-- calcolo MainEdges possibile solo se 4 lati esatti
|
||||
if #SideFaces[i].Edges ~= 4 then
|
||||
break
|
||||
end
|
||||
|
||||
SideFaces[i].MainEdges = {}
|
||||
SideFaces[i].MainEdges.LongEdges = {}
|
||||
SideFaces[i].MainEdges.OppositeEdges = {}
|
||||
|
||||
@@ -70,7 +70,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
end
|
||||
|
||||
-- estensione oltre la coda
|
||||
local dExtendAfterTail = Strategy.Parameters.dExtendAfterTail or max( Part.dDistanceToNextPiece - BeamData.CUT_EXTRA, 0)
|
||||
local dExtendAfterTail = Strategy.Parameters.dExtendAfterTail or max( Part.dDistanceToNextPiece, 0)
|
||||
if MachiningLib.CanExtendAfterTail( Strategy.Parameters.sCanDamageNextPiece, Part) then
|
||||
dExtendAfterTail = 10000
|
||||
end
|
||||
|
||||
@@ -611,18 +611,11 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
|
||||
end
|
||||
end
|
||||
|
||||
local bCutToMoveAfterTail = Proc.Topology and Proc.Topology.sName == 'Cut-1-Through' and Proc.AffectedFaces.bLeft
|
||||
if Cutting and Cutting.bIsApplicable then
|
||||
if bCutToMoveAfterTail then
|
||||
Cutting.sStage = 'AfterTail'
|
||||
end
|
||||
table.insert( Machinings, Cutting)
|
||||
dCompletionPercentage = Cutting.dCompletionPercentage or dCompletionPercentage
|
||||
|
||||
if CuttingDouble and CuttingDouble.bIsApplicable then
|
||||
if bCutToMoveAfterTail then
|
||||
CuttingDouble.sStage = 'AfterTail'
|
||||
end
|
||||
table.insert( Machinings, CuttingDouble)
|
||||
dCompletionPercentage = 0.5 * ( Cutting.dCompletionPercentage or dCompletionPercentage) + 0.5 * ( CuttingDouble.dCompletionPercentage or dCompletionPercentage)
|
||||
end
|
||||
|
||||
@@ -499,7 +499,10 @@ function FACEBYBLADE.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 ( Cutting.vtToolDirection:getX() < 0.707)) then
|
||||
local bIsTruncatingCutOnTail = Proc.Topology and Proc.Topology.sName == 'Cut-1-Through' and Proc.AffectedFaces.bLeft
|
||||
if bIsTruncatingCutOnTail then
|
||||
Cutting.sStage = 'AfterTail'
|
||||
elseif Proc.AffectedFaces.bLeft and ( EdgeToMachine.sType == 'Bottom' or ( Cutting.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
|
||||
|
||||
Reference in New Issue
Block a user