From 1a82df39ad185ccb385c90f3fca28e0fd41f3e83 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 16 May 2024 18:16:22 +0200 Subject: [PATCH] - tutti i campi Id sostituiti con id (minuscolo) - in FaceData aggiunta scrittura Edges (GetFaceInfo) e MainEdges (BottomFace e LongFaces) --- LuaLibs/BeamExec.lua | 24 ++-- LuaLibs/BeamLib.lua | 4 +- LuaLibs/FaceData.lua | 224 ++++++++++++++++++++++----------- LuaLibs/FeatureData.lua | 14 +-- Process.lua | 8 +- Strategies/STR0002/STR0002.lua | 2 +- 6 files changed, 175 insertions(+), 101 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 027045c..06c00c5 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -267,7 +267,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b local dDeltaE = BeamData.OVM_MID for i = 1, #vBeam do -- assegno identificativo pezzo - local idPz = vBeam[i].Id + local idPz = vBeam[i].id -- dati del pezzo local b3Part = EgtGetBBoxGlob( idPz or GDB_ID.NULL, GDB_BB.EXACT) local b3Solid = vBeam[i].b3Box @@ -419,7 +419,7 @@ end ------------------------------------------------------------------------------------------------------------- local function GetFeatureForcedStrategy( Proc) -- cerco nelle note se è stata forzata una strategia specifica - local sStrategyId = EgtGetInfo( Proc.Id, 'STRATEGY', 's') + local sStrategyId = EgtGetInfo( Proc.id, 'STRATEGY', 's') -- se è presente la strategia forzata if sStrategyId then @@ -438,7 +438,7 @@ local function GetFeatureForcedStrategy( Proc) -- cerco e aggiorno i parametri come sono settati nel processing for i = 1, #StrategyData.Parameters do local sParameterToRead = StrategyData.sStrategyId .. '_' .. StrategyData.Parameters[i].sName - ForcedParameterForProc = EgtGetInfo( Proc.Id, sParameterToRead, 's') + ForcedParameterForProc = EgtGetInfo( Proc.id, sParameterToRead, 's') -- se ho trovato il valore, lo sovrascrivo al default if ForcedParameterForProc then StrategyData.Parameters[i].sValue = ForcedParameterForProc @@ -472,9 +472,9 @@ local function CollectFeatures( Part) if nGrp and nPrc and nDo == 1 then local Proc = {} Proc.idPart = Part.idPart - Proc.Id = ProcId + Proc.id = ProcId -- id della feature btl ( se non presente info, si prende id dell'entità geometrica) - Proc.idFeature = EgtGetInfo( Proc.Id, 'PRID', 's') or Proc.Id + Proc.idFeature = EgtGetInfo( Proc.id, 'PRID', 's') or Proc.id Proc.nGrp = nGrp Proc.nPrc = nPrc Proc.nFlg = 1 @@ -527,7 +527,7 @@ local function CollectFeatures( Part) EgtOutLog( ' Feature ' .. tostring( Proc.idFeature) .. ' : NO available strategies') end else - Proc.Flg = 0 + Proc.nFlg = 0 table.insert( vProc, Proc) EgtOutLog( ' Feature ' .. tostring( Proc.idFeature) .. ' is empty (no geometry)') end @@ -541,15 +541,15 @@ end ------------------------------------------------------------------------------------------------------------- local function AreDrillingsMirrored( Proc, ProcMirror, Part) - if Proc.Id == ProcMirror.Id then return false end + if Proc.id == ProcMirror.id then return false end -- geometria ausiliaria foro principale - AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') - if AuxId then AuxId = AuxId + Proc.Id end + AuxId = EgtGetInfo( Proc.id, 'AUXID', 'i') + if AuxId then AuxId = AuxId + Proc.id end if not AuxId or EgtGetType( AuxId ) ~= GDB_TY.CRV_ARC then return false end -- geometria ausiliaria foro specchiato - local AuxIdMirror = EgtGetInfo( ProcMirror.Id, 'AUXID', 'i') - if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.Id end + local AuxIdMirror = EgtGetInfo( ProcMirror.id, 'AUXID', 'i') + if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.id end if not AuxIdMirror or EgtGetType( AuxIdMirror ) ~= GDB_TY.CRV_ARC then return false end -- dati del foro principale local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) @@ -767,7 +767,7 @@ local function PrintFeatures( vProc, Part) for i = 1, #vProc do local Proc = vProc[i] local sOut = string.format( ' Id=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Side=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s TopoName=%s', - Proc.Id, Proc.nGrp, Proc.nPrc, Proc.idTask, Proc.idCut, + Proc.id, Proc.nGrp, Proc.nPrc, Proc.idTask, Proc.idCut, Proc.nFlg, EgtIf( Proc.bDown, 'T', 'F'), EgtIf( Proc.bSide, 'T', 'F'), EgtIf( Proc.bHead, 'T', 'F'), EgtIf( Proc.bTail, 'T', EgtIf( Proc.bAdvTail, 'A', 'F')), Proc.nFcs, Proc.nFce, Proc.dDiam, Proc.nFct, tostring( Proc.b3Box), Proc.Topology.sName or '') diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 22889b5..485aa67 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -180,12 +180,12 @@ end function BeamLib.Is3EdgesApprox( Proc, idFace, nAddGrpId) nAddGrpId = nAddGrpId or BeamLib.GetAddGroup( Proc.idPart) if not nAddGrpId then - local nEdges = #(EgtSurfTmFacetAdjacencies( Proc.Id, idFace)[1]) + local nEdges = #(EgtSurfTmFacetAdjacencies( Proc.id, idFace)[1]) return ( nEdges == 3) end local bResult = false - local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.Id, idFace, nAddGrpId) + local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.id, idFace, nAddGrpId) if not nContourId then return false end diff --git a/LuaLibs/FaceData.lua b/LuaLibs/FaceData.lua index c6297d3..b40d5f4 100644 --- a/LuaLibs/FaceData.lua +++ b/LuaLibs/FaceData.lua @@ -18,7 +18,7 @@ function FaceData.GetAdjacencyMatrix( Proc) for i = 1, Proc.nFct do vAdj[i] = {} for j = i + 1, Proc.nFct do - _, _, _, vAdj[i][j] = EgtSurfTmFacetsContact( Proc.Id, i - 1, j - 1, GDB_ID.ROOT) + _, _, _, vAdj[i][j] = EgtSurfTmFacetsContact( Proc.id, i - 1, j - 1, GDB_ID.ROOT) if not vAdj[i][j] then vAdj[i][j] = 0 end @@ -60,10 +60,10 @@ local function GetNotAdjacentFaces( Proc, idFace) local NotAdjacentFaces = {} for i = 1, Proc.nFct do - if Proc.Faces[i].Id ~= idFace then + if Proc.Faces[i].id ~= idFace then local bIsAdjacent = false for j = 1, #Proc.Faces[idFace + 1].Adjacencies do - if Proc.Faces[i].Id == Proc.Faces[idFace + 1].Adjacencies[j] then + if Proc.Faces[i].id == Proc.Faces[idFace + 1].Adjacencies[j] then bIsAdjacent = true end end @@ -76,20 +76,6 @@ local function GetNotAdjacentFaces( Proc, idFace) return NotAdjacentFaces end ---------------------------------------------------------------------- -local function GetFacesContactLength( Proc, idFace1, idFace2) - local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, idFace1, idFace2, GDB_ID.ROOT) - - local dLength = 0 - if ptP1 and ptP2 then - dLength = dist( ptP1, ptP2) - else - -- TODO se non trova lunghezza serve dare messaggio di errore? - end - - return dLength -end - --------------------------------------------------------------------- -- restituisce una tabella che correla numero di adiacenze e id delle facce con quello stesso numero di adiacenze function FaceData.GetFacesByAdjacencyNumber( Proc) @@ -124,14 +110,14 @@ function FaceData.GetFacesInfo( Proc, Part) end -- reset eventuali visualizzazioni facce a due colori - EgtSurfTmResetTwoColors( Proc.Id) + EgtSurfTmResetTwoColors( Proc.id) for i = 1, Proc.nFct do Faces[i] = {} - Faces[i].Id = i - 1 - Faces[i].ptCenter, Faces[i].vtN = EgtSurfTmFacetCenter( Proc.Id, i - 1, GDB_ID.ROOT) + Faces[i].id = i - 1 + Faces[i].ptCenter, Faces[i].vtN = EgtSurfTmFacetCenter( Proc.id, i - 1, GDB_ID.ROOT) if Proc.nFct < 6 then - local frHV, dFaceWidth, dFaceHeight = BeamLib.GetFaceHvRefDim( Proc.Id, i - 1, Part) + local frHV, dFaceWidth, dFaceHeight = BeamLib.GetFaceHvRefDim( Proc.id, i - 1, Part) -- frame OCS faccia Faces[i].vtFrameHV = frHV -- larghezza OCS faccia @@ -139,16 +125,17 @@ function FaceData.GetFacesInfo( Proc, Part) -- altezza OCS faccia Faces[i].dHeight = dFaceHeight -- elevazione calcolata rispetto al box della parte - Faces[i].dElevation = EgtSurfTmFacetElevationInBBox( Proc.Id, i - 1, b3Solid, true, GDB_ID.ROOT) + Faces[i].dElevation = EgtSurfTmFacetElevationInBBox( Proc.id, i - 1, b3Solid, true, GDB_ID.ROOT) -- TODO qui sarebbe meglio l'area vera e non quella del rettangolo minimo - local _, dLongEdgeDimension, dShortEdgeDimension = EgtSurfTmFacetMinAreaRectangle( Proc.Id, i - 1, GDB_ID.ROOT) + local _, dLongEdgeDimension, dShortEdgeDimension = EgtSurfTmFacetMinAreaRectangle( Proc.id, i - 1, GDB_ID.ROOT) Faces[i].dArea = dShortEdgeDimension * dLongEdgeDimension - -- TODO da scrivere in tabella. Cosa fare se nFaceType > 0? - local nFaceType, vEdges = EgtSurfTmGetFacetOutlineInfo( Proc.Id, i - 1, GDB_ID.ROOT) + local nFaceType, vEdges = EgtSurfTmGetFacetOutlineInfo( Proc.id, i - 1, GDB_ID.ROOT) + Faces[i].IsOkForMachining = nFaceType < 1 + Faces[i].Edges = vEdges -- TODO valutare se fare un output unico alla fine o gestire log in altro modo - EgtOutLog( 'Facet ' .. Faces[i].Id .. ' of ' .. Proc.nFct - 1) + EgtOutLog( 'Facet ' .. Faces[i].id .. ' of ' .. Proc.nFct - 1) EgtOutLog( ' vtN: ' .. tostring( Faces[i].vtN)) -- adiacenze della faccia @@ -188,7 +175,7 @@ local function GetTunnelFaces( Proc) -- centro del tunnel local frTunnel = Frame3d( Proc.Faces[1].ptCenter, vtTunnelDirection) - local b3Tunnel = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frTunnel) + local b3Tunnel = EgtGetBBoxRef( Proc.id, GDB_BB.STANDARD, frTunnel) local ptTunnelCenter = b3Tunnel:getCenter() ptTunnelCenter:toGlob( frTunnel) @@ -202,10 +189,10 @@ local function GetTunnelFaces( Proc) -- faccia centrale, si crea larga come la parte e poi si trimma TunnelAddedFaces.MiddleFaceTm = {} - TunnelAddedFaces.MiddleFaceTm.Id = EgtSurfTmPlaneInBBox( nAddGrpId, ptTunnelCenter, vtTunnelDirection, b3Part, GDB_ID.ROOT) + TunnelAddedFaces.MiddleFaceTm.id = EgtSurfTmPlaneInBBox( nAddGrpId, ptTunnelCenter, vtTunnelDirection, b3Part, GDB_ID.ROOT) -- TODO se non si riesce a costruire la faccia bisogna dare errore o semplicemente non ritornarla?? for i = 1, Proc.nFct do - EgtCutSurfTmPlane( TunnelAddedFaces.MiddleFaceTm.Id, Proc.Faces[i].ptCenter, -Proc.Faces[i].vtN, false, GDB_ID.ROOT) + EgtCutSurfTmPlane( TunnelAddedFaces.MiddleFaceTm.id, Proc.Faces[i].ptCenter, -Proc.Faces[i].vtN, false, GDB_ID.ROOT) end TunnelAddedFaces.MiddleFaceTm.Type = 'Tunnel' @@ -229,17 +216,68 @@ local function GetBottomFace( Proc) if #BottomFaces > 1 then local dMinElevation = GEO.INFINITO for i = 1, #BottomFaces do - if Proc.Faces[BottomFaces[i].Id + 1].dElevation < dMinElevation then - dMinElevation = Proc.Faces[BottomFaces[i].Id + 1].dElevation - BottomFace = Proc.Faces[BottomFaces[i].Id + 1] + if Proc.Faces[BottomFaces[i].id + 1].dElevation < dMinElevation then + dMinElevation = Proc.Faces[BottomFaces[i].id + 1].dElevation + BottomFace = Proc.Faces[BottomFaces[i].id + 1] end end else BottomFace = BottomFaces[1] - BottomFace.Type = 'Bottom' end end + if not BottomFace.IsOkForMachining then + return nil + end + + BottomFace.Type = 'Bottom' + BottomFace.MainEdges = {} + BottomFace.MainEdges.LongEdges = {} + BottomFace.MainEdges.SideEdges = {} + + local EdgesSortedByGreatestLength = {} + for i = 1, #BottomFace.Edges do + EdgesSortedByGreatestLength[i] = {} + EdgesSortedByGreatestLength[i].nIndex = i + EdgesSortedByGreatestLength[i].dLength = BottomFace.Edges[i].Len + end + table.sort( EdgesSortedByGreatestLength, function (a, b) return a.dLength > b.dLength end) + local nFirstLongEdgeIndex = EdgesSortedByGreatestLength[1].nIndex + + for i = 1, #BottomFace.Edges do + local nPreviousEdgeIndex = i - 1 + if i == 1 then + nPreviousEdgeIndex = #BottomFace.Edges + end + local nNextEdgeIndex = i + 1 + if i == #BottomFace.Edges then + nNextEdgeIndex = 1 + end + + local CurrentEdge = {} + CurrentEdge.idAdjacentFace = BottomFace.Edges[i].Adj + CurrentEdge.vtToolDirection = Vector3d( BottomFace.Edges[i].Norm) + CurrentEdge.dLength = BottomFace.Edges[i].Len + CurrentEdge.dElevation = BottomFace.Edges[i].Elev + CurrentEdge.bIsOpen = BottomFace.Edges[i].Open + CurrentEdge.bIsStartOpen = BottomFace.Edges[nPreviousEdgeIndex].Open + CurrentEdge.bIsEndOpen = BottomFace.Edges[nNextEdgeIndex].Open + + if i == nFirstLongEdgeIndex then + BottomFace.MainEdges.LongEdges[1] = CurrentEdge + BottomFace.MainEdges.LongEdges[1].Type = 'Long' + elseif nNextEdgeIndex == nFirstLongEdgeIndex then + BottomFace.MainEdges.SideEdges[1] = CurrentEdge + BottomFace.MainEdges.SideEdges[1].Type = 'Side' + elseif nPreviousEdgeIndex == nFirstLongEdgeIndex then + BottomFace.MainEdges.SideEdges[2] = CurrentEdge + BottomFace.MainEdges.SideEdges[2].Type = 'Side' + else + BottomFace.MainEdges.LongEdges[2] = CurrentEdge + BottomFace.MainEdges.LongEdges[2].Type = 'Long' + end + end + return BottomFace end @@ -251,46 +289,82 @@ local function GetLongFaces( Proc, MainFaces) error( 'GetLongFaces : Topology not implemented') end - local idBottomFace = GDB_ID.NULL - local idTunnelMiddleFace = GDB_ID.NULL - if Proc.Topology.sFamily == 'Tunnel' then - if MainFaces.TunnelAddedFaces then - idTunnelMiddleFace = MainFaces.TunnelAddedFaces.MiddleFaceTm.Id - else - local TunnelAddedFaces = GetTunnelFaces( Proc) - idTunnelMiddleFace = TunnelAddedFaces.MiddleFaceTm.Id or idTunnelMiddleFace + local BottomFace = MainFaces.BottomFace or GetBottomFace( Proc) + + local nFirstLongFaceId = GDB_ID.NULL + local nSecondLongFaceId = GDB_ID.NULL + if not BottomFace then + local FacesSortedByGreatestArea = {} + for i = 1, Proc.nFct do + FacesSortedByGreatestArea[i] = {} + FacesSortedByGreatestArea[i].id = Proc.Faces[i].id + FacesSortedByGreatestArea[i].dArea = Proc.Faces[i].dArea end + table.sort( FacesSortedByGreatestArea, function (a, b) return a.dArea > b.dArea end) + nFirstLongFaceId = FacesSortedByGreatestArea[1].id + local FacesNotAdjacent = GetNotAdjacentFaces( Proc, nFirstLongFaceId) + nSecondLongFaceId = FacesNotAdjacent[1].id else - if MainFaces.BottomFace then - idBottomFace = MainFaces.BottomFace.Id - else - local BottomFace = GetBottomFace( Proc) - idBottomFace = BottomFace.Id or idBottomFace + if not BottomFace.MainEdges.LongEdges[1].bIsOpen then + nFirstLongFaceId = BottomFace.MainEdges.LongEdges[1].idAdjacentFace end + if not BottomFace.MainEdges.LongEdges[2].bIsOpen then + nSecondLongFaceId = BottomFace.MainEdges.LongEdges[2].idAdjacentFace + end + end + if nFirstLongFaceId > -1 then + LongFaces[1] = Proc.Faces[nFirstLongFaceId + 1] + end + if nSecondLongFaceId > -1 then + LongFaces[2] = Proc.Faces[nSecondLongFaceId + 1] end - local FacesToAnalyze = {} - for i = 1, Proc.nFct do - if Proc.Faces[i].Id ~= idBottomFace then - table.insert( FacesToAnalyze, Proc.Faces[i]) - FacesToAnalyze[#FacesToAnalyze].LengthOnMainFace = GetFacesContactLength( Proc, idBottomFace, Proc.Faces[i].Id) - end - end - if Proc.Topology.sFamily == 'Tunnel' then - table.sort( FacesToAnalyze, function( a, b) return a.dArea > b.dArea end) - else - table.sort( FacesToAnalyze, function( a, b) return a.LengthOnMainFace > b.LengthOnMainFace end) - end + for i = 1, #LongFaces do + LongFaces[i].Type = 'Long' + LongFaces[i].MainEdges = {} + LongFaces[i].MainEdges.SideEdges = {} + LongFaces[i].MainEdges.OppositeEdges = {} - -- la prima faccia lunga è sempre la prima della lista - LongFaces[1] = FacesToAnalyze[1] - LongFaces[1].Type = 'Long' - -- si cerca l'eventuale seconda faccia lunga, ossia quella non adiacente alla prima - if Proc.nFct > 3 then - local NotAdjacentFaces = GetNotAdjacentFaces(Proc, LongFaces[1].Id) - if #NotAdjacentFaces > 0 then - LongFaces[2] = NotAdjacentFaces[1] - LongFaces[2].Type = 'Long' + for j = 1, #LongFaces[i].Edges do + local nPreviousEdgeIndex = j - 1 + if j == 1 then + nPreviousEdgeIndex = #LongFaces[1].Edges + end + local nNextEdgeIndex = j + 1 + if j == #LongFaces[i].Edges then + nNextEdgeIndex = 1 + end + + local CurrentEdge = {} + CurrentEdge.idAdjacentFace = LongFaces[i].Edges[j].Adj + CurrentEdge.vtToolDirection = Vector3d( LongFaces[i].Edges[j].Norm) + CurrentEdge.dLength = LongFaces[i].Edges[j].Len + CurrentEdge.dElevation = LongFaces[i].Edges[j].Elev + CurrentEdge.bIsOpen = LongFaces[i].Edges[j].Open + CurrentEdge.bIsStartOpen = LongFaces[i].Edges[nPreviousEdgeIndex].Open + CurrentEdge.bIsEndOpen = LongFaces[i].Edges[nNextEdgeIndex].Open + + if Proc.Topology.sFamily == 'Tunnel' then + if CurrentEdge.idAdjacentFace > -1 then + table.insert( LongFaces[i].MainEdges.SideEdges, CurrentEdge) + else + table.insert( LongFaces[i].MainEdges.OppositeEdges, CurrentEdge) + end + else + if CurrentEdge.idAdjacentFace == BottomFace.id then + LongFaces[i].MainEdges.BottomEdge = CurrentEdge + LongFaces[i].MainEdges.BottomEdge.Type = 'Bottom' + elseif LongFaces[i].Edges[nNextEdgeIndex].Adj == BottomFace.id then + LongFaces[i].MainEdges.SideEdges[1] = CurrentEdge + LongFaces[i].MainEdges.SideEdges[1].Type = 'Side' + elseif LongFaces[i].Edges[nPreviousEdgeIndex].Adj == BottomFace.id then + LongFaces[i].MainEdges.SideEdges[2] = CurrentEdge + LongFaces[i].MainEdges.SideEdges[2].Type = 'Side' + else + table.insert( LongFaces[i].MainEdges.OppositeEdges, CurrentEdge) + LongFaces[i].MainEdges.OppositeEdges[#LongFaces[i].MainEdges.OppositeEdges].Type = 'Opposite' + end + end end end @@ -308,10 +382,10 @@ local function GetSideFaces( Proc, MainFaces) local idBottomFace = GDB_ID.NULL if Proc.Topology.sFamily ~= 'Tunnel' then if MainFaces.BottomFace then - idBottomFace = MainFaces.BottomFace.Id + idBottomFace = MainFaces.BottomFace.id else local BottomFace = GetBottomFace( Proc) - idBottomFace = BottomFace.Id or idBottomFace + idBottomFace = BottomFace.id or idBottomFace end end @@ -327,7 +401,7 @@ local function GetSideFaces( Proc, MainFaces) if not idBottomFace or i ~= ( idBottomFace + 1) then local bIsSideFace = true for j = 1, #LongFaces do - if Proc.Faces[i].Id == LongFaces[j].Id then + if Proc.Faces[i].id == LongFaces[j].id then bIsSideFace = false break end @@ -363,21 +437,21 @@ function FaceData.GetMainFaces( Proc) if EgtGetDebugLevel() >= 3 then if MainFaces.BottomFace then -- colore differente per la faccia di fondo - EgtSurfTmSetFaceColor( Proc.Id, MainFaces.BottomFace.Id, 1) - EgtOutLog( 'Bottom Face : ' .. MainFaces.BottomFace.Id) + EgtSurfTmSetFaceColor( Proc.id, MainFaces.BottomFace.id, 1) + EgtOutLog( 'Bottom Face : ' .. MainFaces.BottomFace.id) end if MainFaces.LongFaces then for i = 1, #MainFaces.LongFaces do - EgtOutLog( 'Long Face : ' .. MainFaces.LongFaces[i].Id) + EgtOutLog( 'Long Face : ' .. MainFaces.LongFaces[i].id) end end if MainFaces.SideFaces then for i = 1, #MainFaces.SideFaces do - EgtOutLog( 'Side Face : ' .. MainFaces.SideFaces[i].Id) + EgtOutLog( 'Side Face : ' .. MainFaces.SideFaces[i].id) end end if MainFaces.TunnelAddedFaces then - EgtOutLog( 'Middle Face (Trimesh): ' .. MainFaces.TunnelAddedFaces.MiddleFaceTm.Id) + EgtOutLog( 'Middle Face (Trimesh): ' .. MainFaces.TunnelAddedFaces.MiddleFaceTm.id) end end else diff --git a/LuaLibs/FeatureData.lua b/LuaLibs/FeatureData.lua index 993eaf2..7156b62 100644 --- a/LuaLibs/FeatureData.lua +++ b/LuaLibs/FeatureData.lua @@ -210,20 +210,20 @@ end ------------------------------------------------------------------------------------------------------------- -- Recupero dati foro e adattamento se speciale function FeatureData.GetDrillingData( Proc) - local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') + local AuxId = EgtGetInfo( Proc.id, 'AUXID', 'i') -- verifico se foro da adattare - if EgtExistsInfo( Proc.Id, 'DiamUser') then - if AuxId then AuxId = AuxId + Proc.Id end + if EgtExistsInfo( Proc.id, 'DiamUser') then + if AuxId then AuxId = AuxId + Proc.id end if AuxId and EgtGetType( AuxId) == GDB_TY.CRV_ARC and BeamData.USER_HOLE_DIAM and BeamData.USER_HOLE_DIAM > 1 then EgtModifyArcRadius( AuxId, BeamData.USER_HOLE_DIAM / 2) end end - local dDiam = EgtGetInfo( Proc.Id, 'P12', 'd') or 0 - local dLen = abs( EgtCurveThickness( Proc.Id + AuxId)) or 0 - local nFcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0 - local nFce = EgtGetInfo( Proc.Id, 'FCE', 'i') or 0 + local dDiam = EgtGetInfo( Proc.id, 'P12', 'd') or 0 + local dLen = abs( EgtCurveThickness( Proc.id + AuxId)) or 0 + local nFcs = EgtGetInfo( Proc.id, 'FCS', 'i') or 0 + local nFce = EgtGetInfo( Proc.id, 'FCE', 'i') or 0 return dDiam, dLen, nFcs, nFce end diff --git a/Process.lua b/Process.lua index ab06601..bdde394 100644 --- a/Process.lua +++ b/Process.lua @@ -80,13 +80,13 @@ local function MyProcessInputData() if nPartId then local bFound = false for i = 1, #vBeam do - if vBeam[i].Id == nPartId then + if vBeam[i].id == nPartId then bFound = true break end end if not bFound then - table.insert( vBeam, { nInd = #vBeam + 1, Id = nPartId, sName = ( EgtGetName( nPartId) or ( 'Id=' .. tonumber( nPartId)))}) + table.insert( vBeam, { nInd = #vBeam + 1, id = nPartId, sName = ( EgtGetName( nPartId) or ( 'Id=' .. tonumber( nPartId)))}) end end nId = EgtGetNextSelectedObj() @@ -105,7 +105,7 @@ local function MyProcessInputData() -- Ne recupero e verifico le dimensioni for i = 1, #vBeam do - local Ls = EgtGetFirstNameInGroup( vBeam[i].Id, 'Box') + local Ls = EgtGetFirstNameInGroup( vBeam[i].id, 'Box') local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) if not b3Solid then EgtOutBox( 'Box non definito per la trave ' .. vBeam[i].sName, 'Lavora Travi', 'ERROR') @@ -129,7 +129,7 @@ local function MyProcessInputData() local sOut = 'Rimosse travi con sezioni diverse dalla prima :\n' for i = #vBeamErr, 1, -1 do sOut = sOut .. vBeam[vBeamErr[i]].sName .. '\n' - EgtDeselectPartObjs( vBeam[vBeamErr[i]].Id) + EgtDeselectPartObjs( vBeam[vBeamErr[i]].id) table.remove( vBeam, vBeamErr[i]) end EgtOutLog( sOut, 1) diff --git a/Strategies/STR0002/STR0002.lua b/Strategies/STR0002/STR0002.lua index 42d4b8f..fd0c8f0 100644 --- a/Strategies/STR0002/STR0002.lua +++ b/Strategies/STR0002/STR0002.lua @@ -85,7 +85,7 @@ function STR0002.Make( AddMachining, Proc, Part, CustomParameters) EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_POCK_LI.ZIGZAG) EgtSetMachiningParam( MCH_MP.LITANG, TOOLS[ToolInfo.idTool].dDiameter/2) EgtSetMachiningParam( MCH_MP.LIELEV, TOOLS[ToolInfo.idTool].dDiameter/2) - EgtSetMachiningGeometry( {{ Proc.Id, Proc.MainFaces.BottomFace.Id}}) + EgtSetMachiningGeometry( {{ Proc.id, Proc.MainFaces.BottomFace.id}}) EgtApplyMachining( true, true) end end