- in MachiningLib migliorie a FindBlade
- migliorata BLADETOWASTE - in FACEBYBLADE la residualDepth si esprime rispetto alla DephToMachine passata e non rispetto all'elevazione del lato
This commit is contained in:
@@ -319,6 +319,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
ToolSearchParameters.bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false
|
||||
|
||||
local nBestToolIndex
|
||||
local dBestToolResidualDepth = 0
|
||||
for i = 1, #TOOLS do
|
||||
local bIsToolCompatible = false
|
||||
|
||||
@@ -333,19 +334,40 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
end
|
||||
|
||||
if bIsToolCompatible then
|
||||
if not nBestToolIndex then
|
||||
-- TODO gestire accorciamento massimo materiale per inclinazione
|
||||
local dCurrentResidualDepth = ToolSearchParameters.dElevation - TOOLS[i].dMaxDepth
|
||||
if not nBestToolIndex or ( dBestToolResidualDepth > 0 and dCurrentResidualDepth <= 10 * GEO.EPS_SMALL) then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
else
|
||||
-- prediligo utensile per tagli lunghi, se richiesto
|
||||
if ToolSearchParameters.bForceLongcutBlade and not TOOLS[nBestToolIndex].bIsUsedForLongCut and TOOLS[i].bIsUsedForLongCut then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
else
|
||||
-- entrambi completi
|
||||
if dBestToolResidualDepth <= 10 * GEO.EPS_SMALL and dCurrentResidualDepth <= 10 * GEO.EPS_SMALL then
|
||||
-- si sceglie quello con le performance migliori
|
||||
if TOOLS[i].dPerformanceIndex > TOOLS[nBestToolIndex].dPerformanceIndex + 10 * GEO.EPS_SMALL then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
end
|
||||
-- entrambi incompleti
|
||||
elseif dBestToolResidualDepth > 10 * GEO.EPS_SMALL and dCurrentResidualDepth > 10 * GEO.EPS_SMALL then
|
||||
-- si sceglie quello che lavora di più
|
||||
if dCurrentResidualDepth > dBestToolResidualDepth then
|
||||
nBestToolIndex = i
|
||||
dBestToolResidualDepth = dCurrentResidualDepth
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ToolInfo.nToolIndex = nBestToolIndex
|
||||
|
||||
ToolInfo.dResidualDepth = dBestToolResidualDepth
|
||||
|
||||
return ToolInfo
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user