If Delaunay is used consecutively, the mesh was already instantiated (because its singleton-pattern static). Thus, deleting its points and edges (calling our own .clear() method) generates a CxC000005 memory issue. This does not happen with Voronoi, as it does not return a static mesh.
Thus, instead of:
Mesh<Triangle> &TriangleDelaunayGenerator::getConformingDelaunayTriangulation() {
if (!this->empty) {
char switches[] = "pzejDQ";
callTriangle(seedPoints, switches);
}
// Dangerous, even if the memory is not cleared, the mesh will not initialize again!
static Mesh<Triangle> mesh = initializeMesh<Triangle>();
return mesh;
}
Hi! I found another issue during triangulation.
If Delaunay is used consecutively, the mesh was already instantiated (because its singleton-pattern static). Thus, deleting its points and edges (calling our own .clear() method) generates a CxC000005 memory issue. This does not happen with Voronoi, as it does not return a static mesh.
Thus, instead of:
The method returns:
Where
this->mesh
andthis->meshInitialized
class parameters, the problem is solved and works fantastic.See https://github.com/IE3-CL/Delynoi for the updated version of this library.