tiny_obj 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.travis.yml +7 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +25 -0
- data/LICENSE.txt +21 -0
- data/README.md +43 -0
- data/Rakefile +18 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/ext/tiny_obj/extconf.rb +3 -0
- data/ext/tiny_obj/init_tinyobj.c +10 -0
- data/ext/tiny_obj/rb_tinyobj.h +7 -0
- data/ext/tiny_obj/tiny_obj_loader.h +2547 -0
- data/ext/tiny_obj/tinyobj.cpp +235 -0
- data/lib/tiny_obj.rb +1 -0
- data/lib/tiny_obj/version.rb +3 -0
- data/lib/tinyobj.rb +6 -0
- data/tiny_obj.gemspec +39 -0
- metadata +121 -0
@@ -0,0 +1,235 @@
|
|
1
|
+
#define TINYOBJLOADER_IMPLEMENTATION
|
2
|
+
#define TINYOBJLOADER_USE_DOUBLE
|
3
|
+
#include "rb_tinyobj.h"
|
4
|
+
#include <stdlib.h>
|
5
|
+
|
6
|
+
#define NIL_OR_STR(cstr) (strlen(cstr) > 0 ? Qnil : rb_str_new2(cstr))
|
7
|
+
|
8
|
+
VALUE build_rb_texopt(tinyobj::texture_option_t *opt) {
|
9
|
+
VALUE rt = rb_hash_new();
|
10
|
+
if (opt->colorspace.size() > 0)
|
11
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("colorspace")), rb_str_new2(opt->colorspace.c_str()));
|
12
|
+
const char *type_str = NULL;
|
13
|
+
switch(opt->type) {
|
14
|
+
case tinyobj::TEXTURE_TYPE_NONE: type_str = "none"; break;
|
15
|
+
case tinyobj::TEXTURE_TYPE_SPHERE: type_str = "sphere"; break;
|
16
|
+
case tinyobj::TEXTURE_TYPE_CUBE_TOP: type_str = "cube_top"; break;
|
17
|
+
case tinyobj::TEXTURE_TYPE_CUBE_BOTTOM: type_str = "cube_bottom"; break;
|
18
|
+
case tinyobj::TEXTURE_TYPE_CUBE_FRONT: type_str = "cube_front"; break;
|
19
|
+
case tinyobj::TEXTURE_TYPE_CUBE_BACK: type_str = "cube_back"; break;
|
20
|
+
case tinyobj::TEXTURE_TYPE_CUBE_LEFT: type_str = "cube_left"; break;
|
21
|
+
case tinyobj::TEXTURE_TYPE_CUBE_RIGHT: type_str = "cube_right"; break;
|
22
|
+
default: type_str = "unknown";
|
23
|
+
}
|
24
|
+
VALUE rb_origin_offset = rb_ary_new2(3),
|
25
|
+
rb_scale = rb_ary_new2(3),
|
26
|
+
rb_turbulence = rb_ary_new2(3);
|
27
|
+
for (int i = 0; i < 3; i++) {
|
28
|
+
rb_ary_push(rb_origin_offset, DBL2NUM(opt->origin_offset[i]));
|
29
|
+
rb_ary_push(rb_scale, DBL2NUM(opt->scale[i]));
|
30
|
+
rb_ary_push(rb_turbulence, DBL2NUM(opt->turbulence[i]));
|
31
|
+
}
|
32
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("type")), ID2SYM(rb_intern(type_str)));
|
33
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("sharpness")), DBL2NUM(opt->sharpness));
|
34
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("brightness")), DBL2NUM(opt->brightness));
|
35
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("contrast")), DBL2NUM(opt->contrast));
|
36
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("origin_offset")), rb_origin_offset);
|
37
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("scale")), rb_scale);
|
38
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("turbulence")), rb_turbulence);
|
39
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("clamp")), opt->clamp ? Qtrue : Qfalse);
|
40
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("blendu")), opt->blendu ? Qtrue : Qfalse);
|
41
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("blendv")), opt->blendv ? Qtrue : Qfalse);
|
42
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("imfchan")), rb_str_new(&opt->imfchan, 1));
|
43
|
+
rb_hash_aset(rt, ID2SYM(rb_intern("bump_multiplier")), DBL2NUM(opt->bump_multiplier));
|
44
|
+
|
45
|
+
return rt;
|
46
|
+
}
|
47
|
+
|
48
|
+
extern "C" {
|
49
|
+
VALUE rb_tinyobj_load(int argc, VALUE *argv, VALUE self) {
|
50
|
+
VALUE fn, dir;
|
51
|
+
rb_scan_args(argc, argv, "11", &fn, &dir);
|
52
|
+
if (NIL_P(dir)) {
|
53
|
+
dir = rb_funcall(rb_cFile, rb_intern("dirname"), 1, fn);
|
54
|
+
}
|
55
|
+
|
56
|
+
VALUE ret = rb_hash_new();
|
57
|
+
|
58
|
+
tinyobj::attrib_t attrib;
|
59
|
+
std::vector<tinyobj::shape_t> shapes;
|
60
|
+
std::vector<tinyobj::material_t> materials;
|
61
|
+
std::string warn, err;
|
62
|
+
bool result = tinyobj::LoadObj(&attrib, &shapes, &materials, &warn, &err, StringValuePtr(fn), StringValuePtr(dir));
|
63
|
+
|
64
|
+
if (!err.empty())
|
65
|
+
rb_raise(rb_eRuntimeError, "error loading OBJ: %s", err.c_str());
|
66
|
+
|
67
|
+
rb_hash_aset(ret, ID2SYM(rb_intern("success")), result ? Qtrue : Qfalse);
|
68
|
+
|
69
|
+
if (!warn.empty())
|
70
|
+
rb_hash_aset(ret, ID2SYM(rb_intern("warnings")), rb_str_new2(warn.c_str()));
|
71
|
+
|
72
|
+
VALUE rb_materials = rb_ary_new2(materials.size());
|
73
|
+
for (size_t m = 0; m < materials.size(); m++) {
|
74
|
+
VALUE rb_material = rb_hash_new();
|
75
|
+
rb_ary_push(rb_materials, rb_material);
|
76
|
+
VALUE rb_ambient = rb_ary_new2(3),
|
77
|
+
rb_diffuse = rb_ary_new2(3),
|
78
|
+
rb_specular = rb_ary_new2(3),
|
79
|
+
rb_transmittance = rb_ary_new2(3),
|
80
|
+
rb_emission = rb_ary_new2(3);
|
81
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("ambient")), rb_ambient);
|
82
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("diffuse")), rb_diffuse);
|
83
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("specular")), rb_specular);
|
84
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("transmittance")), rb_transmittance);
|
85
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("emission")), rb_emission);
|
86
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("name")), NIL_OR_STR(materials[m].name.c_str()));
|
87
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("shininess")), DBL2NUM(materials[m].shininess));
|
88
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("ior")), DBL2NUM(materials[m].ior));
|
89
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("dissolve")), DBL2NUM(materials[m].dissolve));
|
90
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("illum")), DBL2NUM(materials[m].illum));
|
91
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("ambient_texname")), NIL_OR_STR(materials[m].ambient_texname.c_str()));
|
92
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("diffuse_texname")), NIL_OR_STR(materials[m].diffuse_texname.c_str()));
|
93
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("specular_texname")), NIL_OR_STR(materials[m].specular_texname.c_str()));
|
94
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("specular_highlight_texname")), NIL_OR_STR(materials[m].specular_highlight_texname.c_str()));
|
95
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("bump_texname")), NIL_OR_STR(materials[m].bump_texname.c_str()));
|
96
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("displacement_texname")), NIL_OR_STR(materials[m].displacement_texname.c_str()));
|
97
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("alpha_texname")), NIL_OR_STR(materials[m].alpha_texname.c_str()));
|
98
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("reflection_texname")), NIL_OR_STR(materials[m].reflection_texname.c_str()));
|
99
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("roughness")), DBL2NUM(materials[m].roughness));
|
100
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("metallic")), DBL2NUM(materials[m].metallic));
|
101
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("sheen")), DBL2NUM(materials[m].sheen));
|
102
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("clearcoat_thickness")), DBL2NUM(materials[m].clearcoat_thickness));
|
103
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("clearcoat_roughness")), DBL2NUM(materials[m].clearcoat_roughness));
|
104
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("anisotropy")), DBL2NUM(materials[m].anisotropy));
|
105
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("anisotropy_rotation")), DBL2NUM(materials[m].anisotropy_rotation));
|
106
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("roughness_texname")), NIL_OR_STR(materials[m].roughness_texname.c_str()));
|
107
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("metallic_texname")), NIL_OR_STR(materials[m].metallic_texname.c_str()));
|
108
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("sheen_texname")), NIL_OR_STR(materials[m].sheen_texname.c_str()));
|
109
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("emissive_texname")), NIL_OR_STR(materials[m].emissive_texname.c_str()));
|
110
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("normal_texname")), NIL_OR_STR(materials[m].normal_texname.c_str()));
|
111
|
+
for (int i = 0; i < 3; i++) {
|
112
|
+
rb_ary_push(rb_ambient, DBL2NUM(materials[m].ambient[i]));
|
113
|
+
rb_ary_push(rb_diffuse, DBL2NUM(materials[m].diffuse[i]));
|
114
|
+
rb_ary_push(rb_specular, DBL2NUM(materials[m].specular[i]));
|
115
|
+
rb_ary_push(rb_transmittance, DBL2NUM(materials[m].transmittance[i]));
|
116
|
+
rb_ary_push(rb_emission, DBL2NUM(materials[m].emission[i]));
|
117
|
+
}
|
118
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("ambient_texopt")), build_rb_texopt(&materials[m].ambient_texopt));
|
119
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("diffuse_texopt")), build_rb_texopt(&materials[m].diffuse_texopt));
|
120
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("specular_texopt")), build_rb_texopt(&materials[m].specular_texopt));
|
121
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("specular_highlight_texopt")), build_rb_texopt(&materials[m].specular_highlight_texopt));
|
122
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("bump_texopt")), build_rb_texopt(&materials[m].bump_texopt));
|
123
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("displacement_texopt")), build_rb_texopt(&materials[m].displacement_texopt));
|
124
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("alpha_texopt")), build_rb_texopt(&materials[m].alpha_texopt));
|
125
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("reflection_texopt")), build_rb_texopt(&materials[m].reflection_texopt));
|
126
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("roughness_texopt")), build_rb_texopt(&materials[m].roughness_texopt));
|
127
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("metallic_texopt")), build_rb_texopt(&materials[m].metallic_texopt));
|
128
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("sheen_texopt")), build_rb_texopt(&materials[m].sheen_texopt));
|
129
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("emissive_texopt")), build_rb_texopt(&materials[m].emissive_texopt));
|
130
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("normal_texopt")), build_rb_texopt(&materials[m].normal_texopt));
|
131
|
+
VALUE rb_unknown_parameter = Qnil;
|
132
|
+
typedef std::map<std::string, std::string>::iterator it_type;
|
133
|
+
for (it_type iterator = materials[m].unknown_parameter.begin(); iterator != materials[m].unknown_parameter.end(); iterator++) {
|
134
|
+
if (NIL_P(rb_unknown_parameter)) rb_unknown_parameter = rb_hash_new();
|
135
|
+
rb_hash_aset(rb_unknown_parameter, rb_str_new2(iterator->first.c_str()), rb_str_new2(iterator->second.c_str()));
|
136
|
+
}
|
137
|
+
if (!NIL_P(rb_unknown_parameter))
|
138
|
+
rb_hash_aset(rb_material, ID2SYM(rb_intern("unknown_parameters")), rb_unknown_parameter);
|
139
|
+
}
|
140
|
+
|
141
|
+
VALUE rb_vertices = rb_ary_new2(attrib.vertices.size()),
|
142
|
+
rb_normals = rb_ary_new2(attrib.normals.size()),
|
143
|
+
rb_texcoords = rb_ary_new2(attrib.texcoords.size()),
|
144
|
+
rb_colors = rb_ary_new2(attrib.colors.size());
|
145
|
+
rb_hash_aset(ret, ID2SYM(rb_intern("vertices")), rb_vertices);
|
146
|
+
rb_hash_aset(ret, ID2SYM(rb_intern("normals")), rb_normals);
|
147
|
+
rb_hash_aset(ret, ID2SYM(rb_intern("texcoords")), rb_texcoords);
|
148
|
+
rb_hash_aset(ret, ID2SYM(rb_intern("colors")), rb_colors);
|
149
|
+
for (size_t i = 0; i < attrib.vertices.size(); i++)
|
150
|
+
rb_ary_push(rb_vertices, DBL2NUM(attrib.vertices[i]));
|
151
|
+
for (size_t i = 0; i < attrib.normals.size(); i++)
|
152
|
+
rb_ary_push(rb_normals, DBL2NUM(attrib.normals[i]));
|
153
|
+
for (size_t i = 0; i < attrib.texcoords.size(); i++)
|
154
|
+
rb_ary_push(rb_texcoords, DBL2NUM(attrib.texcoords[i]));
|
155
|
+
for (size_t i = 0; i < attrib.colors.size(); i++)
|
156
|
+
rb_ary_push(rb_colors, DBL2NUM(attrib.colors[i]));
|
157
|
+
|
158
|
+
VALUE rb_shapes = rb_ary_new2(shapes.size());
|
159
|
+
rb_hash_aset(ret, ID2SYM(rb_intern("shapes")), rb_shapes);
|
160
|
+
for (size_t s = 0; s < shapes.size(); s++) {
|
161
|
+
VALUE rb_shape = rb_hash_new();
|
162
|
+
VALUE rb_mesh = rb_hash_new();
|
163
|
+
VALUE rb_path = rb_hash_new();
|
164
|
+
rb_ary_push(rb_shapes, rb_shape);
|
165
|
+
rb_hash_aset(rb_shape, ID2SYM(rb_intern("name")), rb_str_new2(shapes[s].name.c_str()));
|
166
|
+
rb_hash_aset(rb_shape, ID2SYM(rb_intern("mesh")), rb_mesh);
|
167
|
+
rb_hash_aset(rb_shape, ID2SYM(rb_intern("path")), rb_path);
|
168
|
+
|
169
|
+
VALUE rb_path_indices = rb_ary_new2(shapes[s].path.indices.size());
|
170
|
+
rb_hash_aset(rb_shape, ID2SYM(rb_intern("indices")), rb_path_indices);
|
171
|
+
for (size_t i = 0; i < shapes[s].path.indices.size(); i++) {
|
172
|
+
rb_ary_push(rb_path_indices, INT2NUM(shapes[s].path.indices[i]));
|
173
|
+
}
|
174
|
+
|
175
|
+
VALUE rb_mesh_indices = rb_ary_new2(shapes[s].mesh.indices.size());
|
176
|
+
rb_hash_aset(rb_mesh, ID2SYM(rb_intern("indices")), rb_mesh_indices);
|
177
|
+
for (size_t i = 0; i < shapes[s].mesh.indices.size(); i++) {
|
178
|
+
VALUE index = rb_hash_new();
|
179
|
+
if (shapes[s].mesh.indices[i].vertex_index != -1)
|
180
|
+
rb_hash_aset(index, ID2SYM(rb_intern("vertex_index")), INT2NUM(shapes[s].mesh.indices[i].vertex_index));
|
181
|
+
if (shapes[s].mesh.indices[i].normal_index != -1)
|
182
|
+
rb_hash_aset(index, ID2SYM(rb_intern("normal_index")), INT2NUM(shapes[s].mesh.indices[i].normal_index));
|
183
|
+
if (shapes[s].mesh.indices[i].texcoord_index != -1)
|
184
|
+
rb_hash_aset(index, ID2SYM(rb_intern("texcoord_index")), INT2NUM(shapes[s].mesh.indices[i].texcoord_index));
|
185
|
+
rb_ary_push(rb_mesh_indices, index);
|
186
|
+
}
|
187
|
+
|
188
|
+
VALUE rb_mesh_num_face_vertices = rb_ary_new2(shapes[s].mesh.num_face_vertices.size());
|
189
|
+
rb_hash_aset(rb_mesh, ID2SYM(rb_intern("num_face_vertices")), rb_mesh_num_face_vertices);
|
190
|
+
for (size_t i = 0; i < shapes[s].mesh.num_face_vertices.size(); i++) {
|
191
|
+
int v = (int) shapes[s].mesh.num_face_vertices[i];
|
192
|
+
rb_ary_push(rb_mesh_num_face_vertices, INT2NUM(v));
|
193
|
+
}
|
194
|
+
|
195
|
+
VALUE rb_mesh_material_ids = rb_ary_new2(shapes[s].mesh.material_ids.size());
|
196
|
+
rb_hash_aset(rb_mesh, ID2SYM(rb_intern("material_ids")), rb_mesh_material_ids);
|
197
|
+
for (size_t i = 0; i < shapes[s].mesh.material_ids.size(); i++) {
|
198
|
+
int v = (int) shapes[s].mesh.material_ids[i];
|
199
|
+
rb_ary_push(rb_mesh_material_ids, INT2NUM(v));
|
200
|
+
}
|
201
|
+
|
202
|
+
VALUE rb_mesh_smoothing_group_ids = rb_ary_new2(shapes[s].mesh.smoothing_group_ids.size());
|
203
|
+
rb_hash_aset(rb_mesh, ID2SYM(rb_intern("smoothing_group_ids")), rb_mesh_smoothing_group_ids);
|
204
|
+
for (size_t i = 0; i < shapes[s].mesh.smoothing_group_ids.size(); i++) {
|
205
|
+
long v = (long) shapes[s].mesh.smoothing_group_ids[i];
|
206
|
+
rb_ary_push(rb_mesh_smoothing_group_ids, v == 0 ? Qnil : LONG2NUM(v));
|
207
|
+
}
|
208
|
+
|
209
|
+
VALUE rb_mesh_tags = rb_ary_new2(shapes[s].mesh.tags.size());
|
210
|
+
rb_hash_aset(rb_mesh, ID2SYM(rb_intern("tags")), rb_mesh_tags);
|
211
|
+
for (size_t i = 0; i < shapes[s].mesh.tags.size(); i++) {
|
212
|
+
VALUE rb_tag = rb_hash_new();
|
213
|
+
rb_ary_push(rb_mesh_tags, rb_tag);
|
214
|
+
rb_hash_aset(rb_tag, ID2SYM(rb_intern("name")), rb_str_new2(shapes[s].mesh.tags[i].name.c_str()));
|
215
|
+
VALUE rb_int_values = rb_ary_new2(shapes[s].mesh.tags[i].intValues.size());
|
216
|
+
rb_hash_aset(rb_tag, ID2SYM(rb_intern("int_values")), rb_int_values);
|
217
|
+
for (size_t j = 0; j < shapes[s].mesh.tags[i].intValues.size(); j++) {
|
218
|
+
rb_ary_push(rb_int_values, INT2NUM(shapes[s].mesh.tags[i].intValues[j]));
|
219
|
+
}
|
220
|
+
VALUE rb_float_values = rb_ary_new2(shapes[s].mesh.tags[i].floatValues.size());
|
221
|
+
rb_hash_aset(rb_tag, ID2SYM(rb_intern("float_values")), rb_float_values);
|
222
|
+
for (size_t j = 0; j < shapes[s].mesh.tags[i].floatValues.size(); j++) {
|
223
|
+
rb_ary_push(rb_float_values, INT2NUM(shapes[s].mesh.tags[i].floatValues[j]));
|
224
|
+
}
|
225
|
+
VALUE rb_string_values = rb_ary_new2(shapes[s].mesh.tags[i].stringValues.size());
|
226
|
+
rb_hash_aset(rb_tag, ID2SYM(rb_intern("string_values")), rb_string_values);
|
227
|
+
for (size_t j = 0; j < shapes[s].mesh.tags[i].stringValues.size(); j++) {
|
228
|
+
rb_ary_push(rb_string_values, rb_str_new2(shapes[s].mesh.tags[i].stringValues[j].c_str()));
|
229
|
+
}
|
230
|
+
}
|
231
|
+
}
|
232
|
+
|
233
|
+
return ret;
|
234
|
+
}
|
235
|
+
}
|
data/lib/tiny_obj.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'tinyobj'
|
data/lib/tinyobj.rb
ADDED
data/tiny_obj.gemspec
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "tiny_obj/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "tiny_obj"
|
7
|
+
spec.version = TinyOBJ::VERSION
|
8
|
+
spec.authors = ["Colin MacKenzie IV"]
|
9
|
+
spec.email = ["sinisterchipmunk@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Ruby bindings for TinyOBJ}
|
12
|
+
spec.homepage = "https://github.com/sinisterchipmunk/tinyobj-ruby"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
16
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
17
|
+
if spec.respond_to?(:metadata)
|
18
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
19
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
20
|
+
else
|
21
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
22
|
+
"public gem pushes."
|
23
|
+
end
|
24
|
+
|
25
|
+
# Specify which files should be added to the gem when it is released.
|
26
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
28
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
29
|
+
end
|
30
|
+
spec.bindir = "exe"
|
31
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ["lib"]
|
33
|
+
spec.extensions = ["ext/tiny_obj/extconf.rb"]
|
34
|
+
|
35
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
spec.add_development_dependency "rake-compiler"
|
38
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tiny_obj
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Colin MacKenzie IV
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.17'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.17'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake-compiler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.0'
|
69
|
+
description:
|
70
|
+
email:
|
71
|
+
- sinisterchipmunk@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions:
|
74
|
+
- ext/tiny_obj/extconf.rb
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- ".travis.yml"
|
79
|
+
- Gemfile
|
80
|
+
- Gemfile.lock
|
81
|
+
- LICENSE.txt
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- bin/console
|
85
|
+
- bin/setup
|
86
|
+
- ext/tiny_obj/extconf.rb
|
87
|
+
- ext/tiny_obj/init_tinyobj.c
|
88
|
+
- ext/tiny_obj/rb_tinyobj.h
|
89
|
+
- ext/tiny_obj/tiny_obj_loader.h
|
90
|
+
- ext/tiny_obj/tinyobj.cpp
|
91
|
+
- lib/tiny_obj.rb
|
92
|
+
- lib/tiny_obj/version.rb
|
93
|
+
- lib/tinyobj.rb
|
94
|
+
- tiny_obj.gemspec
|
95
|
+
homepage: https://github.com/sinisterchipmunk/tinyobj-ruby
|
96
|
+
licenses:
|
97
|
+
- MIT
|
98
|
+
metadata:
|
99
|
+
allowed_push_host: https://rubygems.org
|
100
|
+
homepage_uri: https://github.com/sinisterchipmunk/tinyobj-ruby
|
101
|
+
post_install_message:
|
102
|
+
rdoc_options: []
|
103
|
+
require_paths:
|
104
|
+
- lib
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
requirements: []
|
116
|
+
rubyforge_project:
|
117
|
+
rubygems_version: 2.7.8
|
118
|
+
signing_key:
|
119
|
+
specification_version: 4
|
120
|
+
summary: Ruby bindings for TinyOBJ
|
121
|
+
test_files: []
|