dxf_io 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dxf_io/entity.rb +3 -3
- data/lib/dxf_io/entity/dimension.rb +22 -0
- data/lib/dxf_io/entity/other.rb +1 -1
- data/lib/dxf_io/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c8a0ab7bf7046b03692dddfc2e848c91fc19b99
|
4
|
+
data.tar.gz: 789ff4681c9ac19bbdd0a586e1e76125d7e31193
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b55ff2b036d89b5065a2617112f48ef72525d4a83b5e33f96f24c1c214fffbb7318e087e53d2a1b40e80ac33129d5bdd1815ffa164f95d13d6a8fb89c971731
|
7
|
+
data.tar.gz: e69372d8c0de9591f923a48b11cd9d5ab31506a42b7aecbca8d6249c2341d44b8883a47fd92a594c59fd20b4ffdf1c9e4f06442a1c0f3236df39102ef4f9f8f6
|
data/lib/dxf_io/entity.rb
CHANGED
@@ -2,6 +2,9 @@ module DxfIO
|
|
2
2
|
module Entity
|
3
3
|
extend ActiveSupport::Autoload
|
4
4
|
|
5
|
+
autoload :Support
|
6
|
+
autoload :Other
|
7
|
+
|
5
8
|
autoload :Ellipse
|
6
9
|
autoload :Polyline
|
7
10
|
autoload :Arc
|
@@ -14,8 +17,5 @@ module DxfIO
|
|
14
17
|
autoload :Text
|
15
18
|
autoload :Mtext
|
16
19
|
autoload :Spline
|
17
|
-
|
18
|
-
autoload :Other
|
19
|
-
autoload :Support
|
20
20
|
end
|
21
21
|
end
|
@@ -2,6 +2,12 @@ module DxfIO
|
|
2
2
|
module Entity
|
3
3
|
class Dimension < Other
|
4
4
|
|
5
|
+
ADDITIONAL_X_COORDINATE_GROUP_NUMS = (12..16).to_a.freeze
|
6
|
+
ADDITIONAL_Y_COORDINATE_GROUP_NUMS = (22..26).to_a.freeze
|
7
|
+
ADDITIONAL_Z_COORDINATE_GROUP_NUMS = (32..36).to_a.freeze
|
8
|
+
ADDITIONAL_START_POINT_GROUP_NUMS = (ADDITIONAL_X_COORDINATE_GROUP_NUMS +
|
9
|
+
ADDITIONAL_Y_COORDINATE_GROUP_NUMS).freeze
|
10
|
+
|
5
11
|
protected
|
6
12
|
|
7
13
|
def initialize(groups, representation_hash)
|
@@ -9,6 +15,22 @@ module DxfIO
|
|
9
15
|
super(groups)
|
10
16
|
end
|
11
17
|
|
18
|
+
private
|
19
|
+
|
20
|
+
# checking types of coordinate
|
21
|
+
|
22
|
+
def start_point?(group)
|
23
|
+
ADDITIONAL_START_POINT_GROUP_NUMS.include?(group.keys.first) || super
|
24
|
+
end
|
25
|
+
|
26
|
+
def x_coordinate?(group)
|
27
|
+
ADDITIONAL_X_COORDINATE_GROUP_NUMS.include?(group.keys.first) || super
|
28
|
+
end
|
29
|
+
|
30
|
+
def y_coordinate?(group)
|
31
|
+
ADDITIONAL_Y_COORDINATE_GROUP_NUMS.include?(group.keys.first) || super
|
32
|
+
end
|
33
|
+
|
12
34
|
end
|
13
35
|
end
|
14
36
|
end
|
data/lib/dxf_io/entity/other.rb
CHANGED
@@ -217,7 +217,7 @@ module DxfIO
|
|
217
217
|
|
218
218
|
# reject invalid sequences of coordinate groups
|
219
219
|
def validate_point_groups(groups)
|
220
|
-
groups[1..-1].each.with_index.inject([]) do |result, (group, index)|
|
220
|
+
groups[1..-1].to_a.each.with_index.inject([]) do |result, (group, index)|
|
221
221
|
if y_coordinate?(group)
|
222
222
|
if x_coordinate?(groups[index]) &&
|
223
223
|
( (start_point?(group) && start_point?(groups[index])) ||
|
data/lib/dxf_io/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dxf_io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Zabrovskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|