Closed rob-rb closed 3 years ago
flip_until_delaunay()
may (and does, in this case) create duplicate cells. You can remove them with mesh.remove_duplicate_cells()
after the flip, then it should all work. It's not done automatically because there are cases where duplicates are appropriate.
import meshplex import numpy as np
cells = np.array( [ [4, 5, 2], [5, 6, 2], [8, 7, 6], [6, 7, 2], [4, 2, 1], [1, 2, 0], [2, 7, 3], [0, 2, 3], ] ) points = np.array( [ [4.00540750e00, 8.41882994e00, 1.87847398e-01], [4.15720337e00, 8.14281236e00, 9.12266346e-10], [4.30002833e00, 8.57424769e00, 1.04310192e-02], [4.05235481e00, 8.89348539e00, 2.06854700e-01], [4.25687935e00, 8.41702649e00, -1.80354934e-10], [4.28647665e00, 8.56681008e00, -3.27591539e-10], [4.28974575e00, 8.58639357e00, -1.84739328e-10], [4.36607782e00, 9.03478181e00, 2.94211691e-02], [4.33143378e00, 9.01150991e00, 2.88600116e-10], ] ) meshplex.MeshTri mesh = meshplex.MeshTri(points, cells)
mesh.flip_until_delaunay()
mesh = meshplex.MeshTri(mesh.points, mesh.cells["points"])
mesh.flip_until_delaunay() mesh.create_facets()