obj 0.0.2 → 0.0.3
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/.gitignore +1 -0
- data/Rakefile +2 -1
- data/lib/obj.rb +1 -40
- data/lib/obj/mesh.rb +53 -0
- data/lib/obj/version.rb +1 -1
- data/test/good.simple.obj +695 -695
- data/test/test_mesh_parsing.rb +26 -0
- metadata +3 -2
data/test/test_mesh_parsing.rb
CHANGED
@@ -53,4 +53,30 @@ class TestMeshParsing < Test::Unit::TestCase
|
|
53
53
|
assert_equal true, @mesh.text_coords?
|
54
54
|
assert_equal false, @simple_mesh.text_coords?
|
55
55
|
end
|
56
|
+
|
57
|
+
def test_a_vertex
|
58
|
+
vertex = [-0.939205, 0.343331, -0.00428905]
|
59
|
+
assert_equal vertex, @mesh.vertices[10]
|
60
|
+
assert_equal vertex, @simple_mesh.vertices[10]
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_a_normal
|
64
|
+
normal = [-0.939218, 0.157293, -0.305171]
|
65
|
+
assert_equal normal, @mesh.normals[10]
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_a_text_coord
|
69
|
+
text_coord = [0.0048925, 0.217953]
|
70
|
+
assert_equal text_coord, @mesh.text_coords[10]
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_a_face
|
74
|
+
face = [[249, 247, 248], [247, 235, 246], [279, 229, 277]]
|
75
|
+
assert_equal face, @mesh.faces[10]
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_a_simple_face
|
79
|
+
face = [[249], [247], [279]]
|
80
|
+
assert_equal face, @simple_mesh.faces[10]
|
81
|
+
end
|
56
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: obj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ignacio Contreras Pinilla
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,6 +53,7 @@ files:
|
|
53
53
|
- Rakefile
|
54
54
|
- bin/obj-parse
|
55
55
|
- lib/obj.rb
|
56
|
+
- lib/obj/mesh.rb
|
56
57
|
- lib/obj/version.rb
|
57
58
|
- obj.gemspec
|
58
59
|
- test/good.obj
|