From ebe2f0dd225154b0b4073b537c88213b7e6c8dc1 Mon Sep 17 00:00:00 2001 From: Daniele Bariletti Date: Thu, 27 Feb 2025 14:30:00 +0100 Subject: [PATCH] - aggiunta funzione per pulire l'outloop di un part creato come edge. --- TemplateTool.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/TemplateTool.lua b/TemplateTool.lua index 3883a29..a306839 100644 --- a/TemplateTool.lua +++ b/TemplateTool.lua @@ -130,6 +130,28 @@ local function FindEdges(nLay, tbInfo) return tbId end +function TOOL.ReorganizeEdges() + if not TOOL.nId or TOOL.nId == GDB_ID.NULL then return end + local tbLayer = TOOL.FindLayers(TOOL.nId) + local tbEdges = {} + local nEdgeId = EgtGetFirstInGroup(tbLayer["OutLoop"]) + while nEdgeId and nEdgeId ~= GDB_ID.NULL do + table.insert(tbEdges, nEdgeId) + nEdgeId = EgtGetNext(nEdgeId) + end + local nLoop = EgtCurveCompoByChain(tbLayer["OutLoop"], tbEdges, EgtSP(tbEdges[1], GDB_RT.GLOB), true, GDB_RT.GLOB) + TOOL.ExplodeAndNameEdges(nLoop, false) + + -- se trovo compo nel layer outloop le cancello + nEdgeId = EgtGetFirstInGroup(tbLayer["OutLoop"]) + local nNextEdge = nEdgeId + while nNextEdge and nNextEdge ~= GDB_ID.NULL do + nNextEdge = EgtGetNext(nEdgeId) + if EgtGetType(nEdgeId) == GDB_TY.CRV_COMPO then EgtErase(nEdgeId) end + nEdgeId = nNextEdge + end +end + local function FillInfoTable() if TOOL.nId then TOOL.tbInfo.nId = TOOL.nId end if TOOL.nEdgeId then TOOL.tbInfo.nEdgeId = TOOL.nEdgeId end