Best Ruby Geometry lib?

I am looking for a basic geometry library with classes like Point, Line,
Rect, etc. And with operations like

Rect.new(Point, Point, Point, Point)

or

Line#angle

or

Line#rotate

or

Line#intersect(line)

and so on. Basic, abstract, dealing with points, lines, and other 2d
constructs. I know it’s everyone’s favorite oo example but is there a
well worked out, tested library so I don’t have to write me another one?

Thanks!

Pitp

Dear Pito,

I am looking for a basic geometry library with classes like Point, Line,
Rect, etc. And with operations like

not exactly a Ruby library, but quite large and fast (written in C++) is
CGAL:

http://www.cgal.org/

It already has Python bindings …

Maybe you can use it also via ffi ?

http://wiki.github.com/ffi/ffi

Best regards,

Axel

Pito S. wrote in post #859299:

I am looking for a basic geometry library with classes like Point, Line,
Rect, etc. And with operations like

Rect.new(Point, Point, Point, Point)

or

Line#angle

or

Line#rotate

or

Line#intersect(line)

and so on. Basic, abstract, dealing with points, lines, and other 2d
constructs. I know it’s everyone’s favorite oo example but is there a
well worked out, tested library so I don’t have to write me another one?

Thanks!

Pitp

Try http://github.com/DanielVartanov/ruby-geometry, or my fork of it, in
which I just added a line class. It doesn’t have Rect’s yet, but you
could easily add 'em

-mason

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs