From df75f1c760d55185f96758fbaed9eaccdc53c953 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 28 Mar 2023 13:41:44 +0200 Subject: [PATCH] =?UTF-8?q?DataBeam=20:=20-=20in=20DtTenon=20corretto=20ca?= =?UTF-8?q?lcolo=20distanza=20di=20lato=20da=20lavorare=20quando=20faccia?= =?UTF-8?q?=20di=20base=20divisa=20in=20pi=C3=B9=20parti.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaLibs/ProcessDtTenon.lua | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/LuaLibs/ProcessDtTenon.lua b/LuaLibs/ProcessDtTenon.lua index 0d974d3..3d77ec7 100644 --- a/LuaLibs/ProcessDtTenon.lua +++ b/LuaLibs/ProcessDtTenon.lua @@ -1,9 +1,10 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2023/03/09 +-- ProcessTenon.lua by Egaltech s.r.l. 2023/03/28 -- Gestione calcolo tenone a coda di rondine per Travi -- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa. -- 2022/04/14 Aumentati un poco i limiti di orientamento verso il basso per FAST e PF. -- 2023/02/08 Aumentato il range per cui i tenoni vengono lavorati in sottosquadro. -- 2023/03/27 Migliorate condizioni scelta pretaglio con lama o fresa; gestione unificata con ProcessTenon. +-- 2023/03/28 Corretta gestione faccia di base quando divisa in più parti per distanza massima da lavorare. -- Tabella per definizione modulo local ProcessDtTenon = {} @@ -240,22 +241,29 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) return false, sErr end -- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0) - local dMaxDist = 0 - local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( Proc.Id, 0, EgtGetParent( Proc.Id)) - if nLoopId then - local dUmin, dUmax = EgtCurveDomain( nLoopId) - for dU = dUmin, dUmax do - local ptP = EgtUP( nLoopId, dU, GDB_ID.ROOT) - local ptNear = EgtNP( AuxId, ptP, GDB_ID.ROOT) - local dDist = dist( ptP, ptNear) - if dDist > dMaxDist then - dMaxDist = dDist + local dMaxDist + for i = 0, Proc.Fct - 1 do + local ptFC, vtFN = EgtSurfTmFacetCenter( Proc.Id, i, GDB_ID.ROOT) + if not AreSameVectorApprox( vtFN, vtN) or abs( ( ptFC - ptBC) * vtN) > 100 * GEO.EPS_SMALL then + break + end + local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( Proc.Id, i, EgtGetParent( Proc.Id)) + if nLoopId then + local dUmin, dUmax = EgtCurveDomain( nLoopId) + for dU = dUmin, dUmax do + local ptP = EgtUP( nLoopId, dU, GDB_ID.ROOT) + local ptNear = EgtNP( AuxId, ptP, GDB_ID.ROOT) + local dDist = dist( ptP, ptNear) + if not dMaxDist or dDist > dMaxDist then + dMaxDist = dDist + end + end + for j = 1, nLoopCnt do + EgtErase( nLoopId + j - 1) end end - for i = 1, nLoopCnt do - EgtErase( nLoopId + i - 1) - end - else + end + if not dMaxDist then local b3DtAux = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frDtTen) dMaxDist = 2 * ( b3DtTen:getRadius() - b3DtAux:getRadius()) end