Giter VIP home page Giter VIP logo

godot_voronoi's Introduction

Voronoi Godot integration

Integration of JCash's Voronoi implementation as a Godot V3.1.1 module.

Install

Download the contents of this git repository into Godot's module folder and re-build Godot. The module folder needs to be named voronoi, otherwise Godot won't compile properly.

git clone https://github.com/rakai93/godot_voronoi.git voronoi --recurse-submodules

Example usage

# Create voronoi generator
var generator = Voronoi.new()
generator.set_points(list_of_vector2)
# optional: set boundaries for diagram, otherwise boundaries are computed based on points
generator.set_boundaries(rect2_bounds)
# optional: relax points N times, resulting in more equal sites
generator.relax_points(2)

# Generate diagram
var diagram = generator.generate_diagram()

# Iterate over sites
for site in diagram.sites():
	draw_circle(site.center())

# Iterate over edges
for edge in diagram.edges():
	draw_line(edge.start(), edge.end())

godot_voronoi's People

Contributors

rakai93 avatar kjav avatar xrayez avatar

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.