|
|
|
@@ -53,6 +53,8 @@
|
|
|
|
|
-- 2023/11/08 Aggiunta gestione processi Variant.
|
|
|
|
|
-- 2023/11/30 Migliorato il calcolo elevazione con l'utilizzo della nuova funzione EgtSurfTmFacetElevationInBBox.
|
|
|
|
|
-- 2023/12/26 Modifiche per centrare i pezzi in Y sulla tavola.
|
|
|
|
|
-- 2024/02/26 Migliorata 'CompareFeatures' per ordine lavorazioni
|
|
|
|
|
-- Migliorata 'CompareFeatures' per ordine forature
|
|
|
|
|
|
|
|
|
|
-- Tabella per definizione modulo
|
|
|
|
|
local BeamExec = {}
|
|
|
|
@@ -785,10 +787,18 @@ local function OrderFeatures( vProc, b3Raw)
|
|
|
|
|
if Hcut.Identify( B2) then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
-- se uno di testa e non l'altro, privilegio quello di testa
|
|
|
|
|
if B1.Head ~= B2.Head then
|
|
|
|
|
-- se uno di testa e non l'altro, privilegio quello di testa (a meno che non siano dei fori)
|
|
|
|
|
if B1.Head ~= B2.Head and not Drill.Identify(B1) and not Drill.Identify(B2) then
|
|
|
|
|
return B1.Head
|
|
|
|
|
end
|
|
|
|
|
-- se entrambi di testa e intersecano stesse facce e primo è scasso a due facce e secondo è un profilo caudato, lo scasso è una riduzione e va fatto prima
|
|
|
|
|
if ( ( B1.Head and B2.Head) or ( B1.Tail and B2.Tail)) and ( LapJoint.Identify( B1) and B1.Fct == 2) and ( ProfCamb.Identify( B2)) then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
-- se entrambi di testa e intersecano stesse facce e primo è un profilo caudato e secondo è scasso a due facce, lo scasso è una riduzione e va lasciato dopo
|
|
|
|
|
if ( ( B1.Head and B2.Head) or ( B1.Tail and B2.Tail)) and ( LapJoint.Identify( B2) and B2.Fct == 2) and ( ProfCamb.Identify( B1)) then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
-- se entrambi di testa e primo è scasso o mortasa e secondo no va messo dopo
|
|
|
|
|
if B1.Head and B2.Head and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) and
|
|
|
|
|
not ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) then
|
|
|
|
@@ -807,24 +817,42 @@ local function OrderFeatures( vProc, b3Raw)
|
|
|
|
|
if B2.AdvTail and ( not Split.Identify( B1) or not B1.Tail) then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
|
|
|
|
|
-- se primo è foro e secondo è un ribasso, il foro va sempre prima
|
|
|
|
|
if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2)) and
|
|
|
|
|
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo
|
|
|
|
|
if ( LapJoint.Identify(B1) or Mortise.Identify(B1)) and Drill.Identify(B2) and
|
|
|
|
|
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
-- se primo è feature di coda e l'altro è separazione o non è feature di coda (e non sono dei fori)
|
|
|
|
|
if B1.Tail and ( Split.Identify( B2) or not B2.Tail) then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
-- se secondo è feature di coda e l'altro è separazione o non è feature di coda
|
|
|
|
|
-- se secondo è feature di coda e l'altro è separazione o non è feature di coda (e non sono dei fori)
|
|
|
|
|
if B2.Tail and ( Split.Identify( B1) or not B1.Tail) then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
-- se primo è scasso o mortasa di coda e secondo no, sempre dopo
|
|
|
|
|
if B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) and
|
|
|
|
|
not ( B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2))) then
|
|
|
|
|
not B2.Tail and ( ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2))) then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
-- se secondo è scasso o mortasa di coda e primo no, va lasciato dopo
|
|
|
|
|
if B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) and
|
|
|
|
|
not ( B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1))) then
|
|
|
|
|
not B1.Tail and ( ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1))) then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
-- se entrambi di coda e il primo è una feature taglio di lama e il secondo no, feature taglio lama sempre prima
|
|
|
|
|
if B1.Tail and B2.Tail and ( Cut.Identify( B1) or DoubleCut.Identify( B1)) and ( not Cut.Identify( B2) and not DoubleCut.Identify( B2)) then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
-- se entrambi di coda e il secondo è una feature taglio di lama e il primo no, feature taglio lama sempre prima
|
|
|
|
|
if B1.Tail and B2.Tail and ( Cut.Identify( B2) or DoubleCut.Identify( B2)) and ( not Cut.Identify( B1) and not DoubleCut.Identify( B1)) then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
-- se primo è taglio longitudinale completo o altra lav. lunga, dopo tutte le altre feature non di coda
|
|
|
|
|
if abs( B1.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then
|
|
|
|
|
-- se anche l'altra è lunga, faccio prima quello piccolo in YZ
|
|
|
|
@@ -842,22 +870,12 @@ local function OrderFeatures( vProc, b3Raw)
|
|
|
|
|
if abs( B2.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then
|
|
|
|
|
return not ( B1.Tail or B2.Box:getMin():getX() + 20 > B1.Box:getCenter():getX())
|
|
|
|
|
end
|
|
|
|
|
-- se primo è foro e secondo è un ribasso, il foro va sempre prima
|
|
|
|
|
if Drill.Identify(B1) and ( LapJoint.Identify(B2) or Mortise.Identify(B2)) and
|
|
|
|
|
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo
|
|
|
|
|
if (LapJoint.Identify(B1) or Mortise.Identify(B1)) and Drill.Identify(B2) and
|
|
|
|
|
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
|
|
|
|
return false
|
|
|
|
|
end
|
|
|
|
|
-- se primo è foro e l'altro no, lo penalizzo
|
|
|
|
|
if B1.Prc == 40 and B2.Prc ~= 40 then
|
|
|
|
|
if Drill.Identify(B1) and not Drill.Identify(B2) then
|
|
|
|
|
return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty)
|
|
|
|
|
end
|
|
|
|
|
-- se primo è altro e secondo è foro, lo premio
|
|
|
|
|
if B1.Prc ~= 40 and B2.Prc == 40 then
|
|
|
|
|
if not Drill.Identify(B1) and Drill.Identify(B2) then
|
|
|
|
|
return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX())
|
|
|
|
|
end
|
|
|
|
|
-- se prima è mortasa coda di rondine sul fianco e secondo taglio longitudinale, la coda di rondine va sempre prima
|
|
|
|
|