Giter VIP home page Giter VIP logo

octree's Introduction

octree

Codacy Badge PkgGoDev

Imagine, someday, you lose your wallet.
You remember having it until you came back home by driving.
You will therefore search for your wallet around your car, you won't search the whole universe to find your wallet, logic no ?
That's the principle of an Octree data structure.

octree

Installation

go get -u github.com/louis030195/octree

Usage

package main

import (
    octree "github.com/louis030195/octree/pkg"
    "github.com/louis030195/protometry/api/volume"
    "log"
)

func main() {
	o := octree.NewOctree(volume.NewBoxMinMax(1, 1, 1, 4, 4, 4))
	myObj := octree.NewObjectCube(0, 2, 2, 3, 0.5)
	ok := o.Insert(*myObj)
	log.Printf("%v", ok) // true
	colliders := o.GetColliding(*volume.NewBoxMinMax(0, 0, 0, 0.9, 2.9, 0.9))
	log.Printf("%v", colliders)              // some objects
	log.Printf("%v", o.Move(myObj, 2, 2, 3)) // Success
	log.Printf("%v", o.Move(myObj, 2, 2, 8)) // Failure: outside tree !
}

Benchmark

make bench

b1 b2

Roadmap

  • More test coverage
  • Better benchmarks
  • Possible optimisations
    • Linear implementation
    • Looseness
    • Less copies, unnecessary operations
    • Parallelization of a few steps

References

octree's People

Contributors

codacy-badger avatar louis030195 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

octree's Issues

How to make it distributed with load balancing

Strategies if we ever want the octree distributed could be the following:
https://kubernetes.io/
https://github.com/kubernetes/client-go

Simple naïve, without changing the code too much:

  1. Wrap the octree into a service (gRPC for example)
  2. Run a few pods with one octree per pod
  3. Require a sort of reverse proxy to call the appropriate pod on rpc

More complex, more dynamic:

  1. Wrap the octree into a service (gRPC for example)
  2. Run the octree inside a single Kubernetes pod
  3. When a node is splitting, run new pods with its children distributed (inverse when merging ...)
  4. Call appropriate pods when recursion

Is this project still active?

Hello,

I am greatly interested in an Octree for a project that I am working on and am wondering if this project is still active?

Thanks

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.