perfect-shape 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -4
- data/VERSION +1 -1
- data/lib/perfect_shape/path.rb +6 -1
- data/perfect-shape.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d98187ae023d5501ed920790105a46340127a38a7a1b83143b9c69d4695dc60e
|
4
|
+
data.tar.gz: 4654765dbb6cf6f091677e95551f632cb65c2e739874d5cbe105c6dcd8a70645
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8b1217796e01a1325934ab73f90ef6edeeb392eeb74c83b21ed468cde9658b2cb0ff1cff42d7c79a62f1c978829584815910b8d5cc31df2a35c06704bd92ff7
|
7
|
+
data.tar.gz: c0a7be7c454bd95cb2a520ec9cd6db231ec51ab1fb7d1b106c1c19526052d37988c8269d96b594c75fa14b523c1222e90d73f237e60627d23c005336368edffa
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Perfect Shape 1.0.
|
1
|
+
# Perfect Shape 1.0.4
|
2
2
|
## Geometric Algorithms
|
3
3
|
[](http://badge.fury.io/rb/perfect-shape)
|
4
4
|
[](https://github.com/AndyObtiva/perfect-shape/actions/workflows/ruby.yml)
|
@@ -7,20 +7,20 @@
|
|
7
7
|
|
8
8
|
Additionally, [`PerfectShape::Math`](#perfectshapemath) contains some purely mathematical algorithms, like [IEEE 754-1985 Remainder](https://en.wikipedia.org/wiki/IEEE_754-1985).
|
9
9
|
|
10
|
-
To ensure
|
10
|
+
To ensure accuracy and preciseness, this library does all its mathematical operations with [`BigDecimal`](https://ruby-doc.org/stdlib-3.0.2/libdoc/bigdecimal/rdoc/BigDecimal.html) numbers.
|
11
11
|
|
12
12
|
## Setup
|
13
13
|
|
14
14
|
Run:
|
15
15
|
|
16
16
|
```
|
17
|
-
gem install perfect-shape -v 1.0.
|
17
|
+
gem install perfect-shape -v 1.0.4
|
18
18
|
```
|
19
19
|
|
20
20
|
Or include in Bundler `Gemfile`:
|
21
21
|
|
22
22
|
```ruby
|
23
|
-
gem 'perfect-shape', '~> 1.0.
|
23
|
+
gem 'perfect-shape', '~> 1.0.4'
|
24
24
|
```
|
25
25
|
|
26
26
|
And, run:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4
|
data/lib/perfect_shape/path.rb
CHANGED
@@ -24,6 +24,11 @@ require 'perfect_shape/point'
|
|
24
24
|
require 'perfect_shape/line'
|
25
25
|
require 'perfect_shape/quadratic_bezier_curve'
|
26
26
|
require 'perfect_shape/cubic_bezier_curve'
|
27
|
+
require 'perfect_shape/arc'
|
28
|
+
require 'perfect_shape/ellipse'
|
29
|
+
require 'perfect_shape/circle'
|
30
|
+
require 'perfect_shape/rectangle'
|
31
|
+
require 'perfect_shape/square'
|
27
32
|
require 'perfect_shape/multi_point'
|
28
33
|
|
29
34
|
module PerfectShape
|
@@ -32,7 +37,7 @@ module PerfectShape
|
|
32
37
|
include Equalizer.new(:shapes, :closed, :winding_rule)
|
33
38
|
|
34
39
|
# Available class types for path shapes
|
35
|
-
SHAPE_TYPES = [Array, PerfectShape::Point, PerfectShape::Line, PerfectShape::QuadraticBezierCurve, PerfectShape::CubicBezierCurve, PerfectShape::Arc, PerfectShape::Ellipse, PerfectShape::Circle]
|
40
|
+
SHAPE_TYPES = [Array, PerfectShape::Point, PerfectShape::Line, PerfectShape::QuadraticBezierCurve, PerfectShape::CubicBezierCurve, PerfectShape::Arc, PerfectShape::Ellipse, PerfectShape::Circle, PerfectShape::Rectangle, PerfectShape::Square]
|
36
41
|
|
37
42
|
# Available winding rules
|
38
43
|
WINDING_RULES = [:wind_even_odd, :wind_non_zero]
|
data/perfect-shape.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: perfect-shape 1.0.
|
5
|
+
# stub: perfect-shape 1.0.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "perfect-shape".freeze
|
9
|
-
s.version = "1.0.
|
9
|
+
s.version = "1.0.4"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Andy Maleh".freeze]
|
14
|
-
s.date = "2022-
|
14
|
+
s.date = "2022-05-15"
|
15
15
|
s.description = "Perfect Shape is a collection of pure Ruby geometric algorithms that are mostly useful for GUI 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\u00E9zier curves, and cubic bezier curves, potentially with affine transforms applied like translation, scale, rotation, shear/skew, and inversion (including both the Ray Casting Algorithm, aka Even-odd Rule, and the Winding Number Algorithm, aka Nonzero Rule). Additionally, it contains some purely mathematical algorithms like IEEEremainder (also known as IEEE-754 remainder).".freeze
|
16
16
|
s.email = "andy.am@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perfect-shape
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equalizer
|