sheepandshepherd / cdt-gd Goto Github PK
View Code? Open in Web Editor NEWGodot binding for CDT, a robust constrained Delaunay triangulation library
License: MIT License
Godot binding for CDT, a robust constrained Delaunay triangulation library
License: MIT License
The current API has redundancy in get_vertex
/get_all_vertices
and get_triangle
/get_all_triangles
. Godot's limited type system can't have the arrays of Vertex/Triangle structs CDT outputs, so some kind of conversion is necessary, but it should be cleaner than this and still mirror the original CDT output.
My main issue with outputting PoolArrays was that converting from std::vector is expensive, but this could be solved by saving them in ConstrainedTriangulation, instead of saving the CDT::Triangulation.
// new ConstrainedTriangulation properties:
PoolVector2Array vertices;
Array vertex_triangles; // the ugly one: jagged array of PoolIntArrays
PoolIntArray triangles; // 3 vertex indices each
PoolIntArray triangle_neighbors; // 3 triangle indices each
// possibly useful additions (not all in CDT output, but would be expensive to calculate in GDScript):
PoolIntArray edges; // 2 vertex indices each
PoolIntArray constrained_edges; // indices into `edges` or also 2 vertex indices?
Array vertex_neighbors;
CDT seems to require inputting all vertices before any edges are added. Since this adds both, it messes up the triangulation by removing existing constraints.
One solution would be to put edges in a queue that's only inserted once at the end, when the user manually calls a triangulate function.
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.