Git Product home page Git Product logo

cdt-gd's People

Contributors

sheepandshepherd avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cdt-gd's Issues

Better API

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;

`insert_polygon` doesn't work

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.