- in funzioni GetMinNzDownUp si passa anche Tool

- in MainFaces correzioni per casi convessi
This commit is contained in:
luca.mazzoleni
2025-05-16 11:22:47 +02:00
parent d46b466f71
commit d9665b4ca9
5 changed files with 15 additions and 16 deletions
+1 -1
View File
@@ -403,7 +403,7 @@ end
-------------------------------------------------------------------------------------------------------------
-- funzione con valore di default in caso la GetSetupInfo della testa della macchina non avesse la funzione definita
function BeamLib.GetMinNzDownUpDefault( b3Raw, vtNFace, vtToolDirection)
function BeamLib.GetMinNzDownUpDefault( b3Raw, vtNFace, vtToolDirection, Tool)
return -2
end
+8 -9
View File
@@ -207,9 +207,9 @@ end
-------------------------------------------------------------------------------------------------------------
local function CompareEdges( EdgeA, EdgeB)
-- prima i lati con facce adiacenti
if EdgeA.idAdjacentFace and not ( EdgeB.idAdjacentFace) then
if ( EdgeA.idAdjacentFace > -1) and ( EdgeB.idAdjacentFace < 0) then
return true
elseif not ( EdgeA.idAdjacentFace) and EdgeB.idAdjacentFace then
elseif ( EdgeA.idAdjacentFace < 0) and ( EdgeB.idAdjacentFace > -1) then
return false
-- se entrambi con facce adiacenti, si sceglie quello convesso (non chiuso)
else
@@ -328,11 +328,10 @@ local function GetBottomFaces( Proc)
local EdgesSorted = {}
for i = 1, #BottomFaces[1].Edges do
if not BottomFaces[1].Edges[i].bIsOpen then
table.insert( EdgesSorted, {})
EdgesSorted[#EdgesSorted].nIndex = i
EdgesSorted[#EdgesSorted].dLength = BottomFaces[1].Edges[i].dLength
end
table.insert( EdgesSorted, {})
EdgesSorted[#EdgesSorted].nIndex = i
EdgesSorted[#EdgesSorted].dLength = BottomFaces[1].Edges[i].dLength
EdgesSorted[#EdgesSorted].idAdjacentFace = BottomFaces[1].Edges[i].idAdjacentFace
end
table.sort( EdgesSorted, CompareEdges)
local nFirstLongEdgeIndex
@@ -409,10 +408,10 @@ local function GetLongFaces( Proc, MainFaces)
local FacesNotAdjacent = GetNotAdjacentFaces( Proc, idFirstLongFace)
idSecondLongFace = FacesNotAdjacent[1].id
else
if not BottomFace.MainEdges.LongEdges[1].bIsOpen then
if BottomFace.MainEdges.LongEdges[1].idAdjacentFace > -1 then
idFirstLongFace = BottomFace.MainEdges.LongEdges[1].idAdjacentFace
end
if not BottomFace.MainEdges.LongEdges[2].bIsOpen then
if BottomFace.MainEdges.LongEdges[2].idAdjacentFace > -1 then
idSecondLongFace = BottomFace.MainEdges.LongEdges[2].idAdjacentFace
end
end
+2 -2
View File
@@ -208,7 +208,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
sChosenBladeType = 'Bottom'
-- se lama sopra va verificato se va usata in DownUp
elseif nChosenToolIndex == nToolIndexTop then
local dMinNzDownUp = TOOLS[nToolIndexTop].SetupInfo.GetMinNzDownUp( Part.b3Raw, Face.vtN)
local dMinNzDownUp = TOOLS[nToolIndexTop].SetupInfo.GetMinNzDownUp( Part.b3Raw, Face.vtN, nil, TOOLS[nToolIndexTop])
local dCurrentResidualDepth = dElevationTopDownUp - TOOLS[nToolIndexTop].dMaxDepth
if Face.vtN:getZ() < dMinNzDownUp then
if ( dCurrentResidualDepth > 10 * GEO.EPS_SMALL) then
@@ -359,7 +359,7 @@ local function CutWithDicing( Proc, Part, OptionalParameters)
end
-- limite per taglio DownUp
local dMinNzDownUp = TOOLS[nToolIndex].SetupInfo.GetMinNzDownUp( Part.b3Raw, Face1.vtN)
local dMinNzDownUp = TOOLS[nToolIndex].SetupInfo.GetMinNzDownUp( Part.b3Raw, Face1.vtN, nil, TOOLS[nToolIndex])
-- calcolo dimensione cubetto e eventuale cubetto ridotto (tagli orizzontali con affondamento verticale)
local dDiceDimension = min( TOOLS[nToolIndex].dMaxMaterial, BeamData.MAX_DIM_DICE)
+2 -2
View File
@@ -223,7 +223,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
-- se si conosce il limite downUp (utensile forzato o downUp forzato) si decide se invertire (ToolInvert)
-- TODO esiste un limite downUp massimo per la lama da sopra??
if nToolIndex and not dMinNzDownUp then
dMinNzDownUp = TOOLS[nToolIndex].SetupInfo.GetMinNzDownUp( Part.b3Raw, FaceToMachine.vtN, Cutting.vtToolDirection)
dMinNzDownUp = TOOLS[nToolIndex].SetupInfo.GetMinNzDownUp( Part.b3Raw, FaceToMachine.vtN, Cutting.vtToolDirection, TOOLS[nToolIndex])
end
if dMinNzDownUp and FaceToMachine.vtN:getZ() < dMinNzDownUp then
Cutting.bToolInvert = true
@@ -249,7 +249,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
local ToolInfo = MachiningLib.FindBlade( Proc, ToolSearchParameters)
-- ora che l'utensile è scelto, se non era definito l'angolo di DownUp lo verifico per decidere se invertire
if ToolInfo.nToolIndex and not dMinNzDownUp then
dMinNzDownUp = TOOLS[ToolInfo.nToolIndex].SetupInfo.GetMinNzDownUp( Part.b3Raw, FaceToMachine.vtN, Cutting.vtToolDirection)
dMinNzDownUp = TOOLS[ToolInfo.nToolIndex].SetupInfo.GetMinNzDownUp( Part.b3Raw, FaceToMachine.vtN, Cutting.vtToolDirection, TOOLS[ToolInfo.nToolIndex])
if FaceToMachine.vtN:getZ() < dMinNzDownUp then
Cutting.bToolInvert = true
end
+2 -2
View File
@@ -210,7 +210,7 @@ function FACEBYMILL.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPara
-- se si conosce il limite downUp (utensile forzato o downUp forzato) si decide se invertire (ToolInvert)
if nToolIndex and not dMinNzDownUp then
dMinNzDownUp = TOOLS[nToolIndex].SetupInfo.GetMinNzDownUp( Part.b3Raw, FaceToMachine.vtN, Milling.vtToolDirection)
dMinNzDownUp = TOOLS[nToolIndex].SetupInfo.GetMinNzDownUp( Part.b3Raw, FaceToMachine.vtN, Milling.vtToolDirection, TOOLS[nToolIndex])
end
if dMinNzDownUp and FaceToMachine.vtN:getZ() < dMinNzDownUp then
Milling.bToolInvert = true
@@ -241,7 +241,7 @@ function FACEBYMILL.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPara
local ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
-- ora che l'utensile è scelto, se non era definito l'angolo di DownUp lo verifico per decidere se invertire
if ToolInfo.nToolIndex and not dMinNzDownUp then
dMinNzDownUp = TOOLS[ToolInfo.nToolIndex].SetupInfo.GetMinNzDownUp( Part.b3Raw, FaceToMachine.vtN, Milling.vtToolDirection)
dMinNzDownUp = TOOLS[ToolInfo.nToolIndex].SetupInfo.GetMinNzDownUp( Part.b3Raw, FaceToMachine.vtN, Milling.vtToolDirection, TOOLS[ToolInfo.nToolIndex])
if FaceToMachine.vtN:getZ() < dMinNzDownUp then
Milling.bToolInvert = true
end