diff --git a/CreateSOLID_FromPartsInPark.lua b/CreateSOLID_FromPartsInPark.lua index 87e6e24..6631043 100644 --- a/CreateSOLID_FromPartsInPark.lua +++ b/CreateSOLID_FromPartsInPark.lua @@ -1,4 +1,7 @@ -- 2023/05/__ + +-- |ultima modifica:| +-- |aggiunta gestione di più loop interni| --ERR == -1 valore di default --ERR == 1 CMP.CurrId non è valido ( == -1) --ERR == 0 eseguito senza problemi @@ -219,35 +222,37 @@ local function GetIdFromLay( myTab, sLay) --IdFP = EgtGetFirstPart() local IdLay = EgtGetFirstNameInGroup( IdFP, sLay) local tbIdLayTemp = {} - -- se voglio tenere l'id del layer non devo fare il while - --while IdLay do - local IdS = EgtGetFirstInGroup( IdLay) - while IdS do - local bInsert = false - if EgtGetType( IdS) == GDB_TY.CRV_LINE or EgtGetType( IdS) == GDB_TY.CRV_ARC then - if sLay ~= 'InLoop' then - table.insert( myTab, IdS) - else - table.insert( tbIdLayTemp, IdS) + -- salvo l'id solo del primo layer con nome sLay + local IdFirstLay = IdLay + -- questo while su IdLay serve se ho più gruppi con questo nome (serve per InLoop) + while IdLay do + local IdS = EgtGetFirstInGroup( IdLay) + while IdS do + local bInsert = false + if EgtGetType( IdS) == GDB_TY.CRV_LINE or EgtGetType( IdS) == GDB_TY.CRV_ARC then + if sLay ~= 'InLoop' then + table.insert( myTab, IdS) + else + table.insert( tbIdLayTemp, IdS) + end + bInsert = true end - bInsert = true + if sLay == 'FiloTop' and not bInsert then + table.insert( myTab, IdS) + end + if sLay == 'OnPath' and not bInsert then + table.insert( myTab, IdS) + end + IdS = EgtGetNext( IdS) end - if sLay == 'FiloTop' and not bInsert then - table.insert( myTab, IdS) + if sLay == 'InLoop' then + table.insert( myTab, tbIdLayTemp) + tbIdLayTemp = {} end - if sLay == 'OnPath' and not bInsert then - table.insert( myTab, IdS) - end - IdS = EgtGetNext( IdS) + + IdLay = EgtGetNextName( IdLay, sLay) end - if sLay == 'InLoop' then - table.insert( myTab, tbIdLayTemp) - tbIdLayTemp = {} - end - - --IdLay = EgtGetNextName( IdLay, sLay) - --end - return IdLay + return IdFirstLay end -- @@ -564,7 +569,8 @@ local function SideAngSolid( tbLoop, bInLoop) EgtCutSurfTmPlane( tbIdR[Ind_Pre][8][1], tbIdR[Ind_Nex][8][2], vn_nH, false) EgtCutSurfTmPlane( tbIdR[Ind_Nex][8][1], tbIdR[Ind_Pre][8][2], vn_pH, false) -- se l'angolo con il prossimo lato è positivo, entrambi hanno un hill e gli Ang sono discordi, allora devo anche tagliare gli hill con i piani di taglio e viceversa - if tbIdR[Ind_Pre][6] > 0 and tbIdR[Ind_Pre][4] * tbIdR[Ind_Nex][4] < 0 then + --if tbIdR[Ind_Pre][6] > 0 and tbIdR[Ind_Pre][4] * tbIdR[Ind_Nex][4] < 0 then + if tbIdR[Ind_Pre][6] > 0 then -- ho tolto la condizione che gli angoli debbano essere discordi!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! EgtCutSurfTmPlane( tbIdR[Ind_Nex][8][1], pt_p, vn_p, false) EgtCutSurfTmPlane( tbIdR[Ind_Pre][8][1], pt_n, vn_n, false) EgtCutSurfTmPlane( tbIdR[Ind_Pre][1], tbIdR[Ind_Nex][8][2], vn_nH, false) @@ -654,7 +660,7 @@ local function ExtractBoundaryAndFaces() local IdFac, Nbr = ExplodSurf( nSurfCopy) local IdS = EgtGetFirstInGroup( IdL_Temp) - + local nCount = 0 while IdS ~= nil do ------------------------ gestione archi -- local tabMergSurf = {} @@ -668,6 +674,11 @@ local function ExtractBoundaryAndFaces() -- EgtErase( tabMergSurf) -- IdS = EgtGetNext( IdS) ------------------------ gestione archi + ----------- gestione archi che non vengono esplosi---------------- + nCount = nCount + 1 + local bExplode = false + + ----------- gestione archi che non vengono esplosi---------------- local nLoop, nLoopCount = EgtExtractSurfTmFacetLoops( IdS, 0, IdL_Bound) local ColorApply = 'BLACK' for l=nLoop, nLoop + (nLoopCount-1), 1 do @@ -760,6 +771,8 @@ local function Draw(bPreview) end -- + +--per uso nell' |omagOFFICE| function CMP.Main() IdFP = CMP.CurrId ClearCurrIdSOLID() @@ -777,8 +790,11 @@ function CMP.Main() EgtDraw() CMP.ERR = 0 end --- +--per uso nell' |omagOFFICE| + + +----per uso nel |CAM5| --ClearCurrIdSOLID() --RTh = 20 --IdFP = EgtGetFirstPart() @@ -794,6 +810,6 @@ end --EgtSaveFile('c:\\EgtData\\OmagOFFICE\\Temp\\Ribasso_0.nge') --EgtDraw() ------CMP.ERR = 0 - +----per uso nel |CAM5| --_G.CMP_Main = CMP_Main