From 9b32d12934c7748d59810f676218ce9a2f7b1a84 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 13 Jun 2023 09:14:14 +0200 Subject: [PATCH] DataBeam : - correzione a FacesBySaw.MakeTwo per scelta direzione di approccio lama in casi speciali. --- LuaLibs/FacesBySaw.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index cb94c89..bb15145 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -299,7 +299,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, return false, sErr end local ptM = ( ptT1 + ptT2) / 2 - local vtTg = ptT2 - ptT1 ; + local vtTg = ptT2 - ptT1 ; vtTg:normalize() local bConvex = ( dAngT > 0) -- verifico non siano orientate troppo verso il basso e molto sbandate (oltre 10 deg) local bFaceOk = {} @@ -315,14 +315,14 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, vtRef[1] = vtN[1] ^ vtTg if vtRef[1] * vtN[2] < 0 then vtRef[1] = - vtRef[1] end vtRef[1]:normalize() - if abs( vtRef[1]:getZ()) < 0.577 and abs( abs( vtRef[1]:getX()) - abs( vtRef[1]:getY())) < 0.1 then + if abs( vtTg:getZ()) < 0.708 and abs( vtRef[1]:getZ()) < 0.577 and abs( abs( vtRef[1]:getX()) - abs( vtRef[1]:getY())) < 0.1 then vtRef[1] = ptC[1] - ptM vtRef[1]:normalize() end vtRef[2] = vtN[2] ^ vtTg if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end vtRef[2]:normalize() - if abs( vtRef[2]:getZ()) < 0.577 and abs( abs( vtRef[2]:getX()) - abs( vtRef[2]:getY())) < 0.1 then + if abs( vtTg:getZ()) < 0.708 and abs( vtRef[2]:getZ()) < 0.577 and abs( abs( vtRef[2]:getX()) - abs( vtRef[2]:getY())) < 0.1 then vtRef[2] = ptC[2] - ptM vtRef[2]:normalize() end