cemcen / delynoi Goto Github PK
View Code? Open in Web Editor NEWAn object-oriented C++ library for the generation of polygonal meshes
An object-oriented C++ library for the generation of polygonal meshes
Windows 7 x64, Visual C++ 2017, CMake 3.14.0 generate solution.
compile and link success, Run test.exe , there are error in triangle.c line14122.
in transfernodes function
14121 /* Read the vertex coordinates. */
14122 x = vertexloop[0] = pointlist[coordindex++]; <====0xC0000005 error!
14123 y = vertexloop[1] = pointlist[coordindex++];
Hi! I found some critical memory leaks using Valgrind, mainly due to the allocation of:
Mesh<T>::Mesh() {
this->edges = new SegmentMap;
this->pointMap = new PointMap;
}
Also, mesh results should be wiped after computing Delaunay/Voronoi. See https://github.com/IE3-CL/Delynoi for the updated version of this library, which includes full support for linux/macos/windows, as well as a new format of include/namespace. For example, https://github.com/IE3-CL/Delynoi/blob/master/Delynoi/src/voronoi/TriangleVoronoiGenerator.cpp#L22-L25 adds clear() method which should be removed after results were processed.
@aaortizb I'm interested to keep maintaining this project :)
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:
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;
}
The method returns:
Mesh<Triangle> &TriangleDelaunayGenerator::getConformingDelaunayTriangulation() {
if (!this->empty) {
char switches[] = "pzejDQ";
callTriangle(seedPoints, switches);
}
if (this->meshInitialized) return this->mesh;
this->mesh = initializeMesh<Triangle>();
this->meshInitialized = true;
return this->mesh;
}
Where this->mesh
and this->meshInitialized
class parameters, the problem is solved and works fantastic.
See https://github.com/IE3-CL/Delynoi for the updated version of this library.
Your library compiles on Windows with a tiny change.
In triangle.c, before the conditional inclusion
#ifndef NO_TIMER
#include <sys/time.h>
#endif /* not NO_TIMER */
I inserted #define NO_TIMER
to be able to compile on Windows. Maybe this definition can be included from within CMakeLists (I don't really know CMake). If you can solve it, your library will work on another platform as well!
As far as I understood, your library can generate Delaunay triangulations on polygonal regions. I would need a clipped Voronoi diagram on that region. It means that all Voronoi cells are finite and their union gives the region. I would need as an output the list of Voronoi cells described by their vertices. Ideally, I would also need the connectivities of the Voronoi cells and that each segment is between which Voronoi cells. Is it possible?
Hi! We're using Qt alongside Delynoi, but as this library does not use a namespace, there are conflicts regarding class names, such as Polygon, or VOID (in triangle.c).
Thus, a namespace (for example, Delynoi
) solves the issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.