grid_generator 0.2.8 → 0.2.9

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
  SHA256:
3
- metadata.gz: daf88e31a5aeab774e0a22adfdb485d9441053359add36bf45e1ac6c21c20fb2
4
- data.tar.gz: bcfed0e6b1f2ace7ca279fd65e5c01882277bb8cfb32af358cae075c72c514e3
3
+ metadata.gz: c33e9c431f4c4150d7c1c5290b62fe5affad86f9bc8bff8270af5ba6afcb0be0
4
+ data.tar.gz: 612becd6432cb6009d7d23aecd834a7b4d7cd0f5bca2623a81ac31bda0d83885
5
5
  SHA512:
6
- metadata.gz: 8fa0e5d1bb6c3113ec548e1d1e2740c5cc0a2e7d873c16b91e42dc49ede201e212a2b275c19fb9c7f8f514abbed40d1e3d82700d38a46b92073eafdd70ae025e
7
- data.tar.gz: 9976ffeff14005e007578b23159b248780c338c09d62e61caec0faa7aa578e84ac582e52d97a7bd5b7f10df879393b258840e256237354c007f6584a42117887
6
+ metadata.gz: bc79e92443cc6d6eb1d7215ea519fdfeb93d12f7532b061e2d5f3fb3ca605d7961546d3e02a8687cbcb1a538036b54ecb42a133875b5a849df38f2f6ff203bc3
7
+ data.tar.gz: cc9b3660c6b3cb0a8043ecae38fcc91982989eddb09a664cb56ae0b980e327444929412bc239acc26d326c6ed2668acc8d69f97ed01589521418da4bb75fce92
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grid_generator (0.2.8)
4
+ grid_generator (0.2.9)
5
5
  matrix (~> 0.4.2)
6
6
 
7
7
  GEM
@@ -76,6 +76,16 @@ module GridGenerator
76
76
  end
77
77
  end
78
78
 
79
+ def top_right_pentagon_points
80
+ @top_right_pentagon_points ||= [
81
+ decagon_points[0],
82
+ decagon_points[1],
83
+ decagon_points[2],
84
+ pentagon_points[1],
85
+ pentagon_points[0]
86
+ ]
87
+ end
88
+
79
89
  # for svg
80
90
  def connecting_lines
81
91
  pentagon_points.each_with_index.map do |p, i|
@@ -90,7 +100,31 @@ module GridGenerator
90
100
  )
91
101
  end
92
102
  end
103
+
104
+ # for svg
105
+ def top_right_face_lines
106
+ (0..4).map do |i|
107
+ a = top_right_pentagon_points[i]
108
+ b = top_right_pentagon_points[(i+1)%5]
109
+ c = top_right_pentagon_points[(i+2)%5]
110
+ d = top_right_pentagon_points[(i+3)%5]
111
+
112
+ ab_intervals = GridGenerator::Helper.intervals(a,b,2)
113
+ cd_intervals = GridGenerator::Helper.intervals(c,d,2)
114
+
115
+ line_start = ab_intervals.last + offset
116
+ line_end = cd_intervals.first + offset
117
+
118
+ GridGenerator::BaseLine.new(
119
+ x1: line_start[0,0],
120
+ y1: line_start[1,0],
121
+ x2: line_end[0,0],
122
+ y2: line_end[1,0]
123
+ )
124
+ end
125
+ end
93
126
 
127
+ # for svg
94
128
  def front_face_lines
95
129
  (0..4).map do |i|
96
130
  a = pentagon_points[i]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GridGenerator
4
- VERSION = "0.2.8"
4
+ VERSION = "0.2.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grid_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Humphreys