def aglomerateNonStar(t): nb_cells0 = nb_cells(t) carry_on = 1 i = 0 while (carry_on == 1): print " " print "iter %s" % i t = XOR.agglomerateNonStarCells(t) print "check closure" XOR.checkCellsClosure(t) nb_cells1 = nb_cells(t) if (nb_cells1 == nb_cells0): carry_on = 0 if (carry_on == 0): print "no cell found." if (nb_cells1 != nb_cells0): print "%d cells have been aglomerated" % (nb_cells0 - nb_cells1) #C.convertPyTree2File(t, "nonstar_iter_%s.cgns"%i) nb_cells0 = nb_cells1 i = i + 1 #if (i == 3) : carry_on=0 return t
# - convexify any concave polygon in the mesh (array) - import Intersector.PyTree as XOR import Converter.PyTree as C import KCore.test as test M1 = C.convertFile2PyTree('boolNG_M1.tp') M1 = C.convertArray2NGon(M1) M2 = C.convertFile2PyTree('boolNG_M2.tp') M2 = C.convertArray2NGon(M2) tol = -0.5e-3 m = XOR.booleanMinus(M1, M2, tol, preserve_right=1, solid_right=1, agg_mode=1) #C.convertArrays2File([m], 'i.plt') m = XOR.agglomerateNonStarCells(m) test.testT(m, 1)