Feature/DrillingsOnHeadOrTailCut: in SetDrillingsToMachineAfterHeadOrTailCut (BeamExec) corretto di nuovo check intersezione fori
This commit is contained in:
+18
-4
@@ -1331,23 +1331,37 @@ local function SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachineBeforeInt
|
||||
local vDistHead, vDistTail
|
||||
-- check intersezione con feature di testa
|
||||
if vMachineBeforeIntersectingDrillings.Head.Id then
|
||||
_, _, vDistHead = EgtLineSurfTmInters( ptCen, -vtExtr, vMachineBeforeIntersectingDrillings.Head.Id, GDB_RT.GLOB)
|
||||
-- verifico che ci sia intersezione tra la feature foro e la feature taglio di testa
|
||||
local bIntersectionWithHead =
|
||||
vMachineBeforeIntersectingDrillings.Head.Box and vProc[i].Box:getMin():getX() < vMachineBeforeIntersectingDrillings.Head.Box:getMax():getX() + 100 * GEO.EPS_SMALL and
|
||||
vMachineBeforeIntersectingDrillings.Head.Box:getMin():getX() < vProc[i].Box:getMax():getX() + 100 * GEO.EPS_SMALL
|
||||
-- verifico che ci sia intersezione tra la direzione di estrusione e la faccia della feature taglio di testa
|
||||
if bIntersectionWithHead then
|
||||
_, _, vDistHead = EgtLineSurfTmInters( ptCen, -vtExtr, vMachineBeforeIntersectingDrillings.Head.Id, GDB_RT.GLOB)
|
||||
end
|
||||
end
|
||||
-- check intersezione con feature di coda
|
||||
if vMachineBeforeIntersectingDrillings.Tail.Id then
|
||||
_, _, vDistTail = EgtLineSurfTmInters( ptCen, -vtExtr, vMachineBeforeIntersectingDrillings.Tail.Id, GDB_RT.GLOB)
|
||||
-- verifico che ci sia intersezione tra la feature foro e la feature taglio di coda
|
||||
local bIntersectionWithTail =
|
||||
vMachineBeforeIntersectingDrillings.Tail.Box and vProc[i].Box:getMin():getX() < vMachineBeforeIntersectingDrillings.Tail.Box:getMax():getX() + 100 * GEO.EPS_SMALL and
|
||||
vMachineBeforeIntersectingDrillings.Tail.Box:getMin():getX() < vProc[i].Box:getMax():getX() + 100 * GEO.EPS_SMALL
|
||||
-- verifico che ci sia intersezione tra la direzione di estrusione e la faccia della feature taglio di coda
|
||||
if bIntersectionWithTail then
|
||||
_, _, vDistTail = EgtLineSurfTmInters( ptCen, -vtExtr, vMachineBeforeIntersectingDrillings.Tail.Id, GDB_RT.GLOB)
|
||||
end
|
||||
end
|
||||
-- se esiste intersezione tra il foro e la feature di testa
|
||||
if vDistHead and #vDistHead > 0 then
|
||||
-- verifico che il foro sia di testa
|
||||
if ( bOpen or ( not bOpen and vtExtr:getX() > 0)) then
|
||||
if ( bOpen or ( not bOpen and vtExtr:getX() > 0 and vProc[i].Fcs ~= 0) or ( not bOpen and vtExtr:getX() < 0 and vProc[i].Fce ~= 0)) then
|
||||
vProc[i].MachineAfterHeadCutId = vMachineBeforeIntersectingDrillings.Head.Id
|
||||
vProc[i].Head = true
|
||||
end
|
||||
-- se esiste intersezione tra il foro e la feature di coda
|
||||
elseif vDistTail and #vDistTail > 0 then
|
||||
-- verifico che il foro sia di coda
|
||||
if ( bOpen or ( not bOpen and vtExtr:getX() < 0)) then
|
||||
if ( bOpen or ( not bOpen and vtExtr:getX() < 0 and vProc[i].Fcs ~= 0) or ( not bOpen and vtExtr:getX() > 0 and vProc[i].Fce ~= 0)) then
|
||||
vProc[i].MachineAfterTailCutId = vMachineBeforeIntersectingDrillings.Tail.Id
|
||||
vProc[i].Tail = true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user