# - convexify any concave polygon in the mesh (array) - import Intersector.PyTree as XOR import Converter.PyTree as C 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) m = XOR.simplifyCells(m, 1) m = XOR.prepareCellsSplit(m, PH_set=0, split_policy=0, PH_conc_threshold=1. / 3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) m = XOR.splitNonStarCells(m, PH_conc_threshold=1. / 3., PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) C.convertPyTree2File(m, 'out.cgns')
for i in range(5): print " " print " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " print " 2. split. iter %s" % (i) print " 2.1. prepareCellsSplit by convexifying any concave PH..." set = 1 # 0 for concave cells or 1 for non-centroid-star_shaped cells policy = 0 #0 : convexify concave pgs on PH set. 1 : starify concave pgs on PH set. 2 : starify any pgs at concave-chains ends t = XOR.prepareCellsSplit(t, PH_set=set, split_policy=policy, PH_conc_threshold=0.01, PH_cvx_threshold=0.05, PG_cvx_threshold=1.e-8) print " 2.2 splitNonStarCells..." t = XOR.splitNonStarCells(t) print " 2.3 : simplify cells" t = XOR.simplifyCells(t, 0) # do not treat externals C.convertPyTree2File(t, "split%s.cgns" % (i)) print " " print " $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ " print " 3. agglomerate" vratio = VRATIO * VRATIO * VRATIO print " 3.1 : aglomerate cells vr %s" % (vratio) t = aglomerate(t, vr=vratio, vm=VMIN) vratio = VRATIO * VRATIO print " 3.2 : aglomerate cells vr %s" % (vratio) t = aglomerate(t, vr=vratio, vm=VMIN) print " 3.3 : aglomerate cells vr %s" % (VRATIO) t = aglomerate(t, vr=VRATIO, vm=VMIN)