Add wrappers for Clipper in love.math

Issue #1073 open
coffeecat
created an issue

Clipper is a "polygon and line clipping and offsetting library" (http://angusj.com/delphi/clipper.php)

  1. Robust
  2. Fast (http://rogue-modron.blogspot.com/2011/04/polygon-clipping-wrapper-benchmark.html)
  3. Easy to integrate: no external library dependencies; only 2 source files; Boost Software License
  4. Seems to be actively maintained (http://sourceforge.net/p/polyclipping/code/commit_browser, http://sourceforge.net/p/polyclipping/discussion/)

Ideally, we should design a geometry API first before choosing a backend library. But I feel Clipper suits LOVE well, so I'd like to mention it.

I know such libraries could be used via FFI, but I would like to see more geometry utilities supported by default.

Comments (4)

  1. Bart van Strien

    I've been going over old issues today, and unfortunately it seems the downloads were eaten by sourceforge, and some quick googling didn't turn up a direct mirror. Secondly, I'm not sure where this would fit in with love? I assume this is either something you could use beforehand, thus without needing it in love, or it's a direct requirement for certain types of games, like ones with terrain destruction. The latter case seems a bit specific. I'm not sure if anyone else sees a use case and/or a place to fit it within the API? Come to think of it, my first though was love.graphics, but maybe you'd use it more with love.physics?

  2. Bart van Strien
    • changed status to open

    SourceForge is hosting it again, from the looks of it. I'm still not quite for including this "just 'cause", but I'll leave it open as it's been mentioned in a few other issues, most notably the lineJoin issue #659.

  3. coffeecat reporter

    Sorry for the late reply.

    I suggest to add it as another utility in love.math, as I said in the original issue title. Theoretically speaking, this library does pretty fundamental stuff in the area of vector graphics, just like love.math.triangulate or love.math.newBezierCurve. The only concern is that, it might have too few practical uses (for a typical present-day game).

    As for love.physics, users should do vector graphics maths by themselves, possibly with assistance from love.math. There could be too many cases if we try to add vector graphics maths directly into love.physics.

  4. Log in to comment