vector_salad 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c19abeb6529dc9c3691a7d08929a8879e705ba82
4
- data.tar.gz: b93177705c7c72d207e88a2926c38d4469ec980b
3
+ metadata.gz: d071854e1ae66458871e4835ff4722769d12c828
4
+ data.tar.gz: df18b372b8c248e804d46c32cd1db9aae11f7920
5
5
  SHA512:
6
- metadata.gz: 26b02e5bccd1ad7c2448be7a03d45af411b55ab2daebc2f0d04a74ef562ef08e65bbed810ee226236f665a1a7666158da0fdd190dad43719ffbaec08a12a38c3
7
- data.tar.gz: 224900caa3d11e831fb2ac4c437ca58be07edd8cb9e0413078ebf68196293a2649d41cde525bc655852fab5423b8663b4ee1d384995f39e250c4991e19b8cbe2
6
+ metadata.gz: 501f23219b15b3f4889a14bda93af31cc03f9c3c4dc7bc7b59a8759c5203c454deec4d5d4d3b2ffc358c35d7b3e8a4ad55fc5b5681bc06201c80107ab405d136
7
+ data.tar.gz: 9bd797ceebdb158c2f0ebd9b8a4ce9e616ce127c6990112370fcc94edfab329f1e7985eb9abff39614b4f86a6b467d83dc1f6195c2037a39c28244a88a25a307
@@ -0,0 +1,31 @@
1
+ require "vector_salad/standard_shapes/polygon"
2
+
3
+ module VectorSalad
4
+ module StandardShapes
5
+ class Heart < BasicShape
6
+ # Create a perfect heart
7
+ Contract Pos, {} => Heart
8
+ def initialize(size, **options)
9
+ r = size / 4 # two circles next to each other
10
+ r2 = Math.sqrt(2 * r**2)
11
+ the_little_bit = r2 - r
12
+ the_long_one = size + 2 * the_little_bit
13
+ l = Math.sqrt(the_long_one**2 / 2) - r
14
+
15
+ @shape = Union.new(**options) do
16
+ circle(r)[-r, 0]
17
+ circle(r)[r, 0]
18
+ difference do
19
+ square(l)[-l/2, -l/2].rotate(45).move(0, r2 / 2)
20
+ square(l * 2)[-l, -l * 2]
21
+ end
22
+ end
23
+ self
24
+ end
25
+
26
+ def to_path
27
+ @shape
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module VectorSalad
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vector_salad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon George
@@ -217,6 +217,7 @@ files:
217
217
  - lib/vector_salad/standard_shapes/difference.rb
218
218
  - lib/vector_salad/standard_shapes/exclusion.rb
219
219
  - lib/vector_salad/standard_shapes/flip.rb
220
+ - lib/vector_salad/standard_shapes/heart.rb
220
221
  - lib/vector_salad/standard_shapes/hexagon.rb
221
222
  - lib/vector_salad/standard_shapes/intersection.rb
222
223
  - lib/vector_salad/standard_shapes/iso_tri.rb