From 6a2a87b91f2c23a415a4b400fa962e03d3efcfc8 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 7 Sep 2023 12:23:27 +0200 Subject: [PATCH] - la Topology tunnel chiuso diventa pocket - piccole correzioni alla raccolta features in doppio in WallExec - correzione in LApJoint per evitare di lavorare groove completamente affondate nel grezzo --- LuaLibs/WFeatureTopology.lua | 2 +- LuaLibs/WProcessLapJoint.lua | 2 +- LuaLibs/WallExec.lua | 26 +++++++++++++------------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/LuaLibs/WFeatureTopology.lua b/LuaLibs/WFeatureTopology.lua index ec07b2f..191c868 100644 --- a/LuaLibs/WFeatureTopology.lua +++ b/LuaLibs/WFeatureTopology.lua @@ -208,7 +208,7 @@ function WFeatureTopology.Classify( Proc) sFamily = 'Tunnel' bIsThrough = true elseif Proc.Fct == 5 and bAllAnglesConcave and #vFacesWithFourAdj == 1 then - sFamily = 'Tunnel' + sFamily = 'Pocket' bIsThrough = false end local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily) diff --git a/LuaLibs/WProcessLapJoint.lua b/LuaLibs/WProcessLapJoint.lua index 5fa38d1..39467ca 100644 --- a/LuaLibs/WProcessLapJoint.lua +++ b/LuaLibs/WProcessLapJoint.lua @@ -1510,7 +1510,7 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d end end -- se profondità ribasso è maggiore della capacità di sottosquadro dell'utensile - if ( not bEnablePreMill and bMachFromDn) and ( dElev > 0.5 * ( dMillDiam - dMillDiamTh) - 10 * GEO.EPS_SMALL) then + if ( not bEnablePreMill and ( bMachFromDn or Proc.Fct > 2)) and ( dElev > 0.5 * ( dMillDiam - dMillDiamTh) - 10 * GEO.EPS_SMALL) then local sErr = 'Error : Side Elevation (' .. dElev .. ') bigger than max tool side depth (' .. ( 0.5 * ( dMillDiam - dMillDiamTh)) ..')' EgtOutLog( sErr) return false, sErr diff --git a/LuaLibs/WallExec.lua b/LuaLibs/WallExec.lua index 6fd50ce..47bd8d1 100644 --- a/LuaLibs/WallExec.lua +++ b/LuaLibs/WallExec.lua @@ -686,15 +686,15 @@ local function SortOperationsForMirror( nOper1, nOper2) local ptMax2 = EgtGetInfo( nClId2, 'MMAX', 'p') local b3Oper2 = BBox3d( ptMin2, ptMax2) -- recupero i centri dei box lungo X e Y - local nOper1X = b3Oper1:getCenter():getX() - local nOper1Y = b3Oper1:getCenter():getY() - local nOper2X = b3Oper2:getCenter():getX() - local nOper2Y = b3Oper2:getCenter():getY() + local dOper1X = b3Oper1:getCenter():getX() + local dOper1Y = b3Oper1:getCenter():getY() + local dOper2X = b3Oper2:getCenter():getX() + local dOper2Y = b3Oper2:getCenter():getY() -- confronto per ordinamento - if nOper1X < nOper2X - TOL then + if dOper1X < dOper2X - TOL then return true - elseif abs( nOper1X - nOper2X) < TOL then - if nOper1Y < nOper2Y - TOL then + elseif abs( dOper1X - dOper2X) < TOL then + if dOper1Y < dOper2Y - TOL then return true end end @@ -720,7 +720,7 @@ local function SetMirroredFeatures( vProc, b3Raw) ( Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' and ( not Proc.AffectedFaces.Bottom and Proc.AffectedFaces.Left and Proc.AffectedFaces.Right)) or ( Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-3') or ( Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4') or - ( Proc.TopologyLongName == 'Tunnel-Blind-RightAngles-Parallel-5' and not Proc.AffectedFaces.Bottom) + ( Proc.TopologyLongName == 'Pocket-Blind-RightAngles-Parallel-5' and not Proc.AffectedFaces.Bottom) ) then table.insert( vPockets, Proc) -- raccolgo i fori verticali e aperti verso Z+ @@ -765,7 +765,7 @@ local function SetMirroredFeatures( vProc, b3Raw) Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' or Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-3' or Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' or - Proc.TopologyLongName == 'Tunnel-Blind-RightAngles-Parallel-5' + Proc.TopologyLongName == 'Pocket-Blind-RightAngles-Parallel-5' ) -- se di fianco, determino se è l'ultima parte prima della fine del grezzo local bIsFeatureOnEdge, bIsMirrorFeatureOnEdge = false, false @@ -794,7 +794,7 @@ local function SetMirroredFeatures( vProc, b3Raw) Proc.TopologyLongName == 'Groove-Through-RightAngles-Parallel-3' and Proc.AffectedFaces.Top and ProcMirror.AffectedFaces.Top or Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' and Proc.AffectedFaces.Top and Proc.AffectedFaces.Left and ProcMirror.AffectedFaces.Top and ProcMirror.AffectedFaces.Left or Proc.TopologyLongName == 'Groove-Blind-RightAngles-Parallel-4' and Proc.AffectedFaces.Top and Proc.AffectedFaces.Right and ProcMirror.AffectedFaces.Top and ProcMirror.AffectedFaces.Right or - Proc.TopologyLongName == 'Tunnel-Blind-RightAngles-Parallel-5' and Proc.AffectedFaces.Top and ProcMirror.AffectedFaces.Top + Proc.TopologyLongName == 'Pocket-Blind-RightAngles-Parallel-5' and Proc.AffectedFaces.Top and ProcMirror.AffectedFaces.Top -- box delle stesse dimensioni local bIsMirrorFeatureSameDimension = abs( b3Proc:getDimX() - b3ProcMirror:getDimX()) < ( WD.DOUBLE_HEAD_POCKET_TOLERANCE or 0.5) and abs( b3Proc:getDimY() - b3ProcMirror:getDimY()) < ( WD.DOUBLE_HEAD_POCKET_TOLERANCE or 0.5) and @@ -913,7 +913,7 @@ local function SetMirroredOperations() EgtSetCurrMachining( nOperId) local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) local bIsDouble = ( EgtGetValInNotes( sUserNotes, 'DOUBLE', 'i') or 0) > 0 - if not bIsDouble and EgtGetOperationType( nOperId) == MCH_OY.MILLING then + if EgtGetOperationMode( nOperId) and not bIsDouble and EgtGetOperationType( nOperId) == MCH_OY.MILLING then table.insert( vMillings, nOperId) end nOperId = EgtGetNextOperation( nOperId) @@ -939,7 +939,7 @@ local function SetMirroredOperations() -- box percorso lavorazione master local b3Operation = BBox3d( ptMin, ptMax) -- lavorazione master adatta alla specchiatura - local bIsMachiningOk = EgtGetOperationMode( nOperIdMaster) and WM.IsMachiningOkForDouble( sMachining) + local bIsMachiningOk = WM.IsMachiningOkForDouble( sMachining) if bIsMachiningOk then -- recupero la distanza tra centro di rotazione e punta dell'utensile per aumentare o ridurre l'interasse minimo local dTipToPivot, dTipToPivotDouble = 999, 999 @@ -981,7 +981,7 @@ local function SetMirroredOperations() local sOriginalMirrorToolName = EgtGetMachiningParam( MCH_MP.TOOL) local bIsOriginalMirrorToolSameSize = WM.IsToolDoubleOk( sToolMasterName, sOriginalMirrorToolName) -- lavorazione mirror adatta alla specchiatura - local bIsMirrorMachiningOk = EgtGetOperationMode( nOperIdMirror) and nOperIdMaster ~= nOperIdMirror + local bIsMirrorMachiningOk = nOperIdMaster ~= nOperIdMirror -- lavorazione master più a sinistra local bIsMirrorSideOk = ( b3OperationMirror:getCenter():getY() - b3Operation:getCenter():getY()) > ( WD.DOUBLE_HEAD_POCKET_TOLERANCE or 0.5) -- box delle stesse dimensioni