- in MachiningLib.AddMachinings gestito attacco non perpendicolare
- in BLADEKEEPWASTE sistemato sorting lavorazioni - in FACEBYBLADE e FACEBYMILL correzioni per lavorazione facce non chiuse sopra
This commit is contained in:
@@ -16,7 +16,7 @@ local FaceByBlade = require('FACEBYBLADE')
|
||||
local FaceByMill = require('FACEBYMILL')
|
||||
|
||||
-- tabella per definizione modulo
|
||||
|
||||
local Machinings = {}
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CompareEdges( EdgeA, EdgeB)
|
||||
-- prima i lati orientati lungo X
|
||||
@@ -57,23 +57,30 @@ local function SortMachiningsBySegment( MachiningA, MachiningB)
|
||||
return false
|
||||
elseif MachiningB.nFeatureSegment > MachiningA.nFeatureSegment then
|
||||
return true
|
||||
-- se segmento uguale, si minimizzano i cambi di lato
|
||||
-- se segmento uguale, si guarda la priorità
|
||||
else
|
||||
local bIsOddSegment = ( MachiningA.nFeatureSegment % 2 ~= 0)
|
||||
if MachiningA.vtToolDirection:getY() < MachiningB.vtToolDirection:getY() - 10 * GEO.EPS_SMALL then
|
||||
if bIsOddSegment then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
elseif MachiningA.vtToolDirection:getY() > MachiningB.vtToolDirection:getY() + 10 * GEO.EPS_SMALL then
|
||||
if bIsOddSegment then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
else
|
||||
if MachiningA.nInternalSortingPriority > MachiningB.nInternalSortingPriority then
|
||||
return false
|
||||
elseif MachiningB.nInternalSortingPriority > MachiningA.nInternalSortingPriority then
|
||||
return true
|
||||
-- se priorità uguale, si minimizzano i cambi di lato
|
||||
else
|
||||
local bIsOddSegment = ( MachiningA.nFeatureSegment % 2 ~= 0)
|
||||
if MachiningA.vtToolDirection:getY() < MachiningB.vtToolDirection:getY() - 10 * GEO.EPS_SMALL then
|
||||
if bIsOddSegment then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
elseif MachiningA.vtToolDirection:getY() > MachiningB.vtToolDirection:getY() + 10 * GEO.EPS_SMALL then
|
||||
if bIsOddSegment then
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -85,8 +92,8 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
||||
-- il FindBlade dovrà restituire di utilizzare sempre la lama sopra se l'angolo lo permette, ma avendo un'altezza massima (da macchina) oltre cui il DownUp non sarà fattibile (evita collisioni tra asse e pezzo)
|
||||
|
||||
local Result = {}
|
||||
local Machining = {}
|
||||
Machining.Result = {}
|
||||
Machinings = {}
|
||||
local CreatedMachinings = {}
|
||||
local Cutting1 = {}
|
||||
local Cutting2 = {}
|
||||
|
||||
@@ -157,36 +164,37 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
||||
-- calcolo lavorazioni
|
||||
-- taglio eventuali facce di chiusura
|
||||
for i = 1, #LongFaces do
|
||||
local CuttingLongFace = {}
|
||||
local Cutting = {}
|
||||
local OptionalParametersFaceByBlade = { bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail, nToolIndex = nToolIndex}
|
||||
CuttingLongFace = FaceByBlade.Make( Proc, Part, Proc.MainFaces.LongFaces[i], Proc.MainFaces.LongFaces[i].MainEdges.BottomEdge, OptionalParametersFaceByBlade)
|
||||
table.insert( Machining.Result, CuttingLongFace)
|
||||
Cutting = FaceByBlade.Make( Proc, Part, Proc.MainFaces.LongFaces[i], Proc.MainFaces.LongFaces[i].MainEdges.BottomEdge, OptionalParametersFaceByBlade)
|
||||
Cutting.nInternalSortingPriority = 1
|
||||
table.insert( CreatedMachinings, Cutting)
|
||||
end
|
||||
-- faccia di fondo
|
||||
-- primo lato
|
||||
local OptionalParametersFaceByBlade = { dDepthToMachine = dDepthToMachine, bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail, nToolIndex = nToolIndex}
|
||||
Cutting1 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade)
|
||||
table.insert( Machining.Result, Cutting1)
|
||||
Cutting1.nInternalSortingPriority = 3
|
||||
table.insert( CreatedMachinings, Cutting1)
|
||||
-- secondo lato
|
||||
OptionalParametersFaceByBlade.bOppositeToolDirection = true
|
||||
Cutting2 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade)
|
||||
table.insert( Machining.Result, Cutting2)
|
||||
Cutting2.nInternalSortingPriority = 3
|
||||
table.insert( CreatedMachinings, Cutting2)
|
||||
-- eventuale pulitura raggio lama
|
||||
if bFinishWithMill then
|
||||
for i = 1, #LongFaces do
|
||||
local OptionalParametersFaceByMill = { bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail,
|
||||
dDepthToMachine = max( Cutting1.dBladeMarkLength, Cutting2.dBladeMarkLength)
|
||||
}
|
||||
local MillingClosedSide = FaceByMill.Make( Proc, Part, BottomFace, BottomFace.MainEdges.LongEdges[i], OptionalParametersFaceByMill)
|
||||
table.insert( Machining.Result, MillingClosedSide)
|
||||
local OptionalParametersFaceByMill = { bIsSplitFeature = bIsSplitFeature, dExtendAfterTail = dExtendAfterTail}
|
||||
local Milling = FaceByMill.Make( Proc, Part, BottomFace, BottomFace.MainEdges.LongEdges[i], OptionalParametersFaceByMill)
|
||||
Milling.nInternalSortingPriority = 2
|
||||
table.insert( CreatedMachinings, Milling)
|
||||
end
|
||||
end
|
||||
|
||||
-- lavorazioni raggruppate in unica lista
|
||||
local Machinings = {}
|
||||
for i = 1, #Machining.Result do
|
||||
if Machining.Result[i].bIsApplicable then
|
||||
table.insert( Machinings, Machining.Result[i])
|
||||
for i = 1, #CreatedMachinings do
|
||||
if CreatedMachinings[i].bIsApplicable then
|
||||
table.insert( Machinings, CreatedMachinings[i])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user