- correzioni per tagli DownUp
This commit is contained in:
+1
-1
@@ -813,7 +813,7 @@ function BeamLib.GetPlaneOrientation( vtN)
|
||||
end
|
||||
|
||||
-- si ordina per incidenza in ogni piano
|
||||
table.sort( Orientation, function (a, b) return a.dRatio > b.dRatio end)
|
||||
table.sort( Orientation, function (a, b) return a.dRelativeMagnitude > b.dRelativeMagnitude end)
|
||||
|
||||
return Orientation
|
||||
end
|
||||
|
||||
+18
-18
@@ -272,11 +272,11 @@ end
|
||||
local function IsFaceZOutOfRange ( vtNFace, Tool)
|
||||
|
||||
-- lama sotto: angolo negativo troppo basso
|
||||
if Tool.SetupInfo.HeadType.Top and vtNFace:getZ() < Tool.SetupInfo.GetMinNz( vtNFace, Tool) - GEO.EPS_ZERO then
|
||||
if Tool.SetupInfo.HeadType.bTop and vtNFace:getZ() < Tool.SetupInfo.GetMinNz( vtNFace, Tool) - GEO.EPS_ZERO then
|
||||
return true
|
||||
end
|
||||
-- lama sopra: angolo positivo troppo elevato
|
||||
if Tool.SetupInfo.HeadType.Bottom and vtNFace:getZ() > Tool.SetupInfo.GetMaxNz( vtNFace, Tool) + GEO.EPS_ZERO then
|
||||
if Tool.SetupInfo.HeadType.bBottom and vtNFace:getZ() > Tool.SetupInfo.GetMaxNz( vtNFace, Tool) + GEO.EPS_ZERO then
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -287,7 +287,7 @@ end
|
||||
local function IsBladeOrientationOkForDownUp( Face, Edge, b3Raw)
|
||||
|
||||
-- se l'utensile lavora perpendicolarmente, l'orientamento è sempre valido per DownUp
|
||||
if AreSameVectorApprox( Face.vtN, Edge) then
|
||||
if AreSameVectorApprox( Face.vtN, Edge.vtN) then
|
||||
|
||||
return true
|
||||
end
|
||||
@@ -518,7 +518,7 @@ end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- funzione per cercare utensile tipo LAMA con certe caratteristiche
|
||||
-- TODO da completare
|
||||
-- TODO da rivedere/completare
|
||||
-- TODO 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)
|
||||
function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
local ToolInfo = {}
|
||||
@@ -562,22 +562,22 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
end
|
||||
|
||||
-- se dati sufficienti, si determina se con questo utensile il taglio è fattibile e il modo di lavorare della lama
|
||||
if FaceToMachine and EdgeToMachine and dElevation then
|
||||
local sBladeEngagement
|
||||
local dDownUpElevation
|
||||
bIsToolCompatible, sBladeEngagement, dDownUpElevation = MachiningLib.GetBladeEngagement( FaceToMachine, EdgeToMachine, b3Raw, TOOLS[i])
|
||||
-- orientamento non raggiungibile o elevazione eccessiva per DownUp: non compatibile
|
||||
if not bIsToolCompatible
|
||||
or ( sBladeEngagement == 'DownUp'
|
||||
and ( dDownUpElevation - ( EdgeToMachine.dElevation - dElevation)) > TOOLS[i].dMaxMaterial - 10 * GEO.EPS_SMALL) then
|
||||
if bIsToolCompatible then
|
||||
if FaceToMachine and EdgeToMachine and dElevation then
|
||||
local bIsBladeOk, sBladeEngagement, dDownUpElevation = MachiningLib.GetBladeEngagement( FaceToMachine, EdgeToMachine, b3Raw, TOOLS[i])
|
||||
-- orientamento non raggiungibile o elevazione eccessiva per DownUp: non compatibile
|
||||
if not bIsBladeOk
|
||||
or ( sBladeEngagement == 'DownUp'
|
||||
and ( dDownUpElevation - ( EdgeToMachine.dElevation - dElevation)) > TOOLS[i].dMaxMaterial - 10 * GEO.EPS_SMALL) then
|
||||
|
||||
bIsToolCompatible = false
|
||||
end
|
||||
bIsToolCompatible = false
|
||||
end
|
||||
|
||||
-- se si ha solo la faccia si può verificare se questa è orientata correttamente
|
||||
elseif FaceToMachine then
|
||||
if IsFaceZOutOfRange( FaceToMachine.vtN, TOOLS[i]) then
|
||||
bIsToolCompatible = false
|
||||
-- se si ha solo la faccia si può verificare se questa è orientata correttamente
|
||||
elseif FaceToMachine then
|
||||
if IsFaceZOutOfRange( FaceToMachine.vtN, TOOLS[i]) then
|
||||
bIsToolCompatible = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user