- in FACEBYBLADE correzioni a chiamata Cutting.nToolIndex

- in MachiningLib.Check2DBladeCollision ora si controlla correttamente se c'è intersezione
This commit is contained in:
luca.mazzoleni
2025-11-05 18:56:02 +01:00
parent 6d319d17b6
commit 15db75dfad
2 changed files with 19 additions and 11 deletions
+13 -5
View File
@@ -320,6 +320,7 @@ local function Check2DBladeCollision( Edge, vtNFace, vtHead, Part, Tool, dDepthT
ptMaxElev = ptMaxElev + vtNFace * Tool.dThickness
end
-- TODO qui sostituire con il valore reale letto dal SetupInfo
-- per Fast si dovrà aggiungere la lunghezza del massimo utensile utilizzabile con lama
local dHeadDepth = 480
local dHeadWidth = 480
local ptOpposite = ptMaxElev + Edge.vtN * dHeadWidth
@@ -328,12 +329,19 @@ local function Check2DBladeCollision( Edge, vtNFace, vtHead, Part, Tool, dDepthT
-- flat region dal rettangolo
local idHeadSurfFr = EgtSurfFlatRegion( idTempGroup, idHeadRectangle)
-- intersezione
--local idTestSurfFr = EgtCopyGlob( idPartSurfFr, idTempGroup)
-- TODO ritornare correttamente
local bCollisionFound = EgtSurfFrIntersect( idPartSurfFr, idHeadSurfFr)
-- intersezione (se fallisce si inverte la flat region del motore, probabile normale opposta)
local bIntersectSuccess = EgtSurfFrIntersect( idPartSurfFr, idHeadSurfFr)
if not bIntersectSuccess then
EgtInvertSurf( idHeadSurfFr)
bIntersectSuccess = EgtSurfFrIntersect( idPartSurfFr, idHeadSurfFr)
end
if not bIntersectSuccess then
error( 'Check2DBladeCollision : intersect fail')
end
return false
local bCollisionFound = EgtExistsObj( idPartSurfFr)
return bCollisionFound
end
-------------------------------------------------------------------------------------------------------------