Perfect Shape 1.0.0 was released today, providing the Ruby community with an open-source library of Pure Ruby Geometric Algorithms that are mostly useful for GUI (Graphical User Interface) manipulation like checking viewport rectangle intersection or containment of a mouse click point in popular geometry shapes such as rectangle, square, arc (open, chord, and pie), ellipse, circle, polygon, and paths containing lines, quadratic bézier curves, and cubic bezier curves, potentially with affine transforms applied like translation, scale, rotation, shear/skew, and inversion (including both Ray Casting Algorithm, aka Even-odd Rule, and Winding Number Algorithm, aka Nonzero Rule).
The reason behind creating this library was that before, there were no comprehensive geometric algorithm libraries in Ruby that covered all the geometric shapes mentioned above. Most of them either lacked support for certain shapes like arc or lacked algorithms for checking point containment in every shape, including Cubic Bezier Curves. Thankfully, Perfect Shape addresses that issue completely for the Ruby community.
Another reason why this library was created was to address the need for supporting automated declarative drag and drop features in Glimmer DSL for LibUI coming soon (right now, it supports manually implementing drag and drop with area listeners out of the box).
Below is a summary of the Perfect Shape library directly from its README. Put it to good use!
No comments:
Post a Comment