DataBeam :

- correzioni e migliorie varie.
This commit is contained in:
Dario Sassi
2019-07-29 15:01:19 +00:00
parent 7e3c951901
commit 8dee1a0c97
12 changed files with 325 additions and 159 deletions
+19 -2
View File
@@ -368,7 +368,7 @@ local function OrderFeatures( vProc, b3Raw)
return B1.Box:getMax():getX() + 100 > B2.Box:getCenter():getX()
end
-- se sono fori e hanno posizione praticamente uguale ordino secondo diametro e faccia di inizio (Fcs)
if B1.Prc == 40 and B2.Prc == 40 and abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < 400 then
if B1.Prc == 40 and B2.Prc == 40 and abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < 600 then
if abs( B1.Diam - B2.Diam) < 1.0 then
if B1.Fcs == B2.Fcs then
return B1.Box:getCenter():getX() > B2.Box:getCenter():getX()
@@ -388,7 +388,7 @@ local function OrderFeatures( vProc, b3Raw)
if B1.Head ~= B2.Head then
return B1.Head
end
-- confronto standard per feature che non si sovrappongono in X
-- confronto standard
if abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) > 0.5 * ( B1.Box:getDimX() + B2.Box:getDimX()) then
return B1.Box:getCenter():getX() > B2.Box:getCenter():getX()
elseif abs( B1.Box:getCenter():getY() - B2.Box:getCenter():getY()) > 0.5 * ( B1.Box:getDimY() + B2.Box:getDimY()) then
@@ -415,6 +415,23 @@ local function OrderFeatures( vProc, b3Raw)
end
end
end
-- riunisco marcature, testi e decori non troppo lontani
for i = 1, #vProc do
local ProcI = vProc[i]
if ProcI.Prc == 60 or ProcI.Prc == 61 or ProcI.Prc == 959 then
for j = i + 1, #vProc do
local ProcJ = vProc[j]
if ( ProcJ.Prc == 60 or ProcJ.Prc == 61 or ProcJ.Prc == 959) and
ProcJ.Head == ProcI.Head and ProcJ.Tail == ProcI.Tail and
abs( ProcJ.Box:getCenter():getX() - ProcI.Box:getCenter():getX()) < 300.0 then
if j > i + 1 then
table.insert( vProc, i + 1, table.remove( vProc, j))
end
break
end
end
end
end
end
-------------------------------------------------------------------------------------------------------------