From 5646af535b820578545bcfd7b2609447bce98d91 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 17 Nov 2020 11:12:20 +0000 Subject: [PATCH] DataWall : - in lavorazione FreeContour disabilito Tabs se affondo meno del richiesto - in lavorazione FreeContour corretta scelta fresa meno peggio per affondamento massimo - in LapJoint aggiunta gestione tunnel. --- LuaLibs/WProcessFreeContour.lua | 20 ++++++++++++++---- LuaLibs/WProcessLapJoint.lua | 36 ++++++++++++++++++++++++++------- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index 2106868..76ec5bd 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -1,4 +1,4 @@ --- ProcessFreeContour.lua by Egaltech s.r.l. 2020/07/15 +-- ProcessFreeContour.lua by Egaltech s.r.l. 2020/11/17 -- Gestione calcolo profilo libero per Pareti -- Tabella per definizione modulo @@ -114,7 +114,12 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw) if vtNz < 0 then dDepth = dDepth - dMillDiam * abs( vtNz) / sqrt( 1 - vtNz * vtNz) end - dDepth = min( dDepth, dMaxDepth) + -- se affondamento superiore ai limiti della fresa + if dDepth > dMaxDepth then + -- lo limito e tolgo eventuali Tabs + dDepth = dMaxDepth + EgtSetMachiningParam( MCH_MP.LEAVETAB, false) + end -- aggiungo geometria EgtSetMachiningGeometry( {{ Proc.Id, vFace[i].Fac}}) local dSal = 0 @@ -158,7 +163,12 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw) if vtNz < 0 then dDepth = dDepth - dMillDiam * abs( vtNz) / sqrt( 1 - vtNz * vtNz) end - dDepth = min( dDepth, dMaxDepth) + -- se affondamento superiore ai limiti della fresa + if dDepth > dMaxDepth then + -- lo limito e tolgo eventuali Tabs + dDepth = dMaxDepth + EgtSetMachiningParam( MCH_MP.LEAVETAB, false) + end -- aggiungo geometria local vGeom = {{ Proc.Id, vFace[i].Fac}} local dSal = EgtIf( ( vFace[i].Type & 2) ~= 0, vFace[i].Whisk - vFace[i].Len, 0) @@ -512,7 +522,7 @@ local function MakeByCut( Proc, nRawId, b3Raw) -- recupero la lavorazione di fresatura local sMilling, dMillMaxDepth = WM.FindMilling( 'FreeContour', dMaxWidth + WD.CUT_EXTRA) if not sMilling and not sSawing then - local sMilling = WM.FindMilling( 'FreeContour') + sMilling = WM.FindMilling( 'FreeContour') if not sMilling then local sErr = 'Error : milling not found in library' EgtOutLog( sErr) @@ -576,7 +586,9 @@ local function MakeByMill( Proc, nRawId, b3Raw) dDepth = min( dDepth, b3Raw:getDimZ()) + WD.CUT_EXTRA end if dDepth > dMaxDepth then + -- lo limito e tolgo eventuali Tabs dDepth = dMaxDepth + EgtSetMachiningParam( MCH_MP.LEAVETAB, false) end -- inserisco la lavorazione local sName = 'Free_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 6d34f73..bf4a43a 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -1,4 +1,4 @@ --- WProcessLapJoint.lua by Egaltech s.r.l. 2020/09/01 +-- WProcessLapJoint.lua by Egaltech s.r.l. 2020/11/17 -- Gestione calcolo mezzo-legno per Pareti -- Tabella per definizione modulo @@ -7,6 +7,7 @@ local WPL = {} -- Include require( 'EgtBase') local WL = require( 'WallLib') +local FreeContour = require( 'WProcessFreeContour') EgtOutLog( ' WProcessLapJoint started', 1) @@ -46,12 +47,29 @@ function WPL.Classify( Proc, b3Raw) -- se più di 2 facce else local nFacInd, dElev, nFacInd2, dElev2 = WL.GetFaceWithMostAdj( Proc.Id, Proc.PartId) - if nFacInd < 0 then return false end - -- dati della faccia - local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT) - local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) - -- verifico se è lavorabile da sopra o di fianco se con sega a catena - return ( vtN:getZ() >= WD.NZ_MINA or ( dV < 19 and Proc.Fct > 4 and vtN:getZ() > - 0.01)) + -- se trovata faccia di fondo + if nFacInd >= 0 then + -- dati della faccia + local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT) + local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) + -- verifico se è lavorabile da sopra o di fianco se con sega a catena + return ( vtN:getZ() >= WD.NZ_MINA or ( dV < 19 and Proc.Fct > 4 and vtN:getZ() > - 0.01)) + -- se altrimenti tunnel o fessura + elseif nFacInd == -1 then + -- dati delle prime tre facce + local ptC = {} + local vtN = {} + ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) + ptC[2], vtN[2] = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT) + ptC[3], vtN[3] = EgtSurfTmFacetCenter( Proc.Id, 2, GDB_ID.ROOT) + -- verifico se è lavorabile da sopra + local vtAxN = vtN[1] ^ vtN[2] + if vtAxN:isSmall() then vtAxN = vtN[1] ^ vtN[3] end + return abs( vtAxN:getZ()) >= WD.NZ_MINA + -- altrimenti non lavorabile + else + return false + end end end @@ -355,6 +373,10 @@ end local function MakeMoreFaces( Proc, nRawId, b3Raw) -- cerco la faccia con il maggior numero di adiacenze local nFacInd, dElev, nFacInd2 = WL.GetFaceWithMostAdj( Proc.Id, Proc.PartId) + -- se tunnel, applico lavorazione del contorno libero + if nFacInd == - 1 then + return FreeContour.Make( Proc, nRawId, b3Raw) + end local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) local _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) -- se necessaria sega a catena