From f79c141d28aeb741e39c4f0a2ff67e0576931496 Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 21 Feb 2022 17:58:30 +0100 Subject: [PATCH] DataWall : - migliorie a nesting in presenza di tagli inclinati. --- LuaLibs/WProcessFreeContour.lua | 2 +- NestProcess.lua | 37 ++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index df4be6a..aed5e28 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -4,7 +4,7 @@ -- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox. -- 2022/01/13 Aggiunta gestione massimo affondamento in Z anche per pulizia spigoli con fresa 60deg (WD.MAX_CLEAN_CRN60). -- 2022/02/03 Corretto controllo massimo affondamento nella tavola. --- 2022/02/21 Per macchine travi migliorata gestione tagli trasversali. +-- 2022/02/21 Corretti allungamenti/accorciamenti tagli inclinati con fresa. Migliorata gestione tagli trasversali per macchine travi. -- Tabella per definizione modulo local WPF = {} diff --git a/NestProcess.lua b/NestProcess.lua index c3d2cfd..7a4ad5b 100644 --- a/NestProcess.lua +++ b/NestProcess.lua @@ -54,6 +54,8 @@ _G.package.loaded.WProcessDrill = nil local Drill = require( 'WProcessDrill') _G.package.loaded.WProcessDoubleCut = nil local DoubleCut = require( 'WProcessDoubleCut') +_G.package.loaded.WProcessFreeContour = nil +local FreeContour = require( 'WProcessFreeContour') -- Carico i dati globali local WD = require( 'WallData') @@ -369,6 +371,39 @@ local function ComputeToolOutlines( nPartId) if nId ~= GDB_ID.NULL then table.insert(ToolOutlineId, nId) end end end + + -- lati inclinati free contour + if FreeContour.Identify( Proc) then + for nInd = 0, Proc.Fct - 1 do + local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nInd, GDB_ID.ROOT) + -- se inclinato verso il basso + if vtN:getZ() < - GEO.EPS_SMALL then + local bLeftOrRightFace = abs( vtN:getX()) > GEO.EPS_SMALL + local bFrontOrBackFace = abs( vtN:getY()) > GEO.EPS_SMALL + if ( bLeftOrRightFace ~= bFrontOrBackFace) then + local vtMainDir = EgtIf( bLeftOrRightFace, X_AX(), Y_AX()) + local vtOtherDir = EgtIf( bLeftOrRightFace, Y_AX(), X_AX()) + local dCosAlpha = vtN * vtMainDir + local dVal = ( NEST.OFFSET + 0.1) / dCosAlpha + local b3Face = EgtSurfTmGetFacetBBoxGlob( Proc.Id, nInd, GDB_BB.STANDARD) + local dDim = EgtIf( bLeftOrRightFace, b3Face:getDimY(), b3Face:getDimX()) + local ptP1 + if ( dCosAlpha < 0) then + ptP1 = b3Face:getMin() + else + ptP1 = b3Face:getMax() + dDim = -1 * dDim + end + + local ptP2 = ptP1 + dVal * vtMainDir + dDim * vtOtherDir + local nRectId = EgtRectangle2P( nOutlineGrp, Point3d(ptP1:getX(), ptP1:getY(), 0), Point3d( ptP2:getX(), ptP2:getY(), 0)) + EgtSetColor( nRectId, EgtStdColor("AQUA")) + if nRectId ~= GDB_ID.NULL then table.insert( ToolOutlineId, nRectId) end + end + end + end + end + end return ToolOutlineId @@ -1961,7 +1996,7 @@ if bNestingOk then if RawParts[nIndex].PartId[nInd2] == vDoneManually[nInd].SheetId then EgtSetInfo(nMachGroup, "PANELLEN", RawParts[nIndex].Len) EgtSetInfo(nMachGroup, "PANELWIDTH", RawParts[nIndex].Width) - EgtSetInfo(nMachGroup, "MATERIAL", RawParts[nIndex].Material) + EgtSetInfo(nMachGroup, "MATERIAL", NEST.MATERIAL) EgtSetInfo(nMachGroup, "AUTONEST", 1) -- scrivo dati per variabili P di comunicazione con la macchina in gruppo di lavorazione EgtSetInfo( nMachGroup, "PRODID", NEST.PRODID)