- in WallLib -> GetProcessDistanceToNearestParts piccole correzioni al calcolo del solido della parte

- in LapJoint -> MakeByPocketing migliorata la scelta utensile e la forzatura tasca chiusa nel caso di parti vicine
This commit is contained in:
luca.mazzoleni
2023-08-29 13:12:34 +02:00
parent 924313a0ea
commit afb33aa7c6
2 changed files with 114 additions and 56 deletions
+13 -11
View File
@@ -453,40 +453,42 @@ function WallLib.GetProcessDistanceToNearestParts( Proc)
local nPartId = EgtGetFirstPartInRawPart( nRawId)
while nPartId do
if Proc.PartId ~= nPartId then
local b3Part = EgtGetBBoxGlob( nPartId or GDB_ID.NULL, GDB_BB.STANDARD)
local ptMinPart = b3Part:getMin()
local ptMaxPart = b3Part:getMax()
local nBoxSolidId = EgtGetFirstNameInGroup( nPartId, 'Box')
local b3Solid = EgtGetBBoxGlob( nBoxSolidId or GDB_ID.NULL, GDB_BB.STANDARD)
b3Solid:expand( - 10 * GEO.EPS_SMALL)
local ptMinPart = b3Solid:getMin()
local ptMaxPart = b3Solid:getMax()
if Proc.AffectedFaces.Front then
if OverlapsXY( b3Proc, b3Part) then
if OverlapsXY( b3Proc, b3Solid) then
vtDistances.Front = 0
elseif OverlapsX( b3Proc, b3Part) then
elseif OverlapsX( b3Proc, b3Solid) then
if ptMaxPart:getY() < ptMinProc:getY() + 100 * GEO.EPS_SMALL then
vtDistances.Front = min( vtDistances.Front, max( 0, ptMinProc:getY() - ptMaxPart:getY()))
end
end
end
if Proc.AffectedFaces.Back then
if OverlapsXY( b3Proc, b3Part) then
if OverlapsXY( b3Proc, b3Solid) then
vtDistances.Back = 0
elseif OverlapsX( b3Proc, b3Part) then
elseif OverlapsX( b3Proc, b3Solid) then
if ptMaxProc:getY() < ptMinPart:getY() + 100 * GEO.EPS_SMALL then
vtDistances.Back = min( vtDistances.Back, max( 0, ptMinPart:getY() - ptMaxProc:getY()))
end
end
end
if Proc.AffectedFaces.Left then
if OverlapsXY( b3Proc, b3Part) then
if OverlapsXY( b3Proc, b3Solid) then
vtDistances.Left = 0
elseif OverlapsY( b3Proc, b3Part) then
elseif OverlapsY( b3Proc, b3Solid) then
if ptMaxPart:getX() < ptMinProc:getX() + 100 * GEO.EPS_SMALL then
vtDistances.Left = min( vtDistances.Left, max( 0, ptMinProc:getX() - ptMaxPart:getX()))
end
end
end
if Proc.AffectedFaces.Right then
if OverlapsXY( b3Proc, b3Part) then
if OverlapsXY( b3Proc, b3Solid) then
vtDistances.Right = 0
elseif OverlapsY( b3Proc, b3Part) then
elseif OverlapsY( b3Proc, b3Solid) then
if ptMaxProc:getX() < ptMinPart:getX() + 100 * GEO.EPS_SMALL then
vtDistances.Right = min( vtDistances.Right, max( 0, ptMinPart:getX() - ptMaxProc:getX()))
end