diff options
author | CoprDistGit <infra@openeuler.org> | 2023-05-10 10:01:20 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 10:01:20 +0000 |
commit | 2e7b9a4af1076d5fa70dbfe03facd04ef549713b (patch) | |
tree | bbedec715d2f4f9884400de83ed7c47c5d62deef | |
parent | 62d5b8ab140e9d59e4d716c2ab9393c1448cc6f1 (diff) |
automatic import of python-tinyobjloader
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-tinyobjloader.spec | 261 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 263 insertions, 0 deletions
@@ -0,0 +1 @@ +/tinyobjloader-0.1.tar.gz diff --git a/python-tinyobjloader.spec b/python-tinyobjloader.spec new file mode 100644 index 0000000..324787f --- /dev/null +++ b/python-tinyobjloader.spec @@ -0,0 +1,261 @@ +%global _empty_manifest_terminate_build 0 +Name: python-tinyobjloader +Version: 0.1 +Release: 1 +Summary: Python module for tinyobjloader +License: MIT License +URL: https://github.com/syoyo/tinyobjloader +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/c0/ee/f447ed517ff301034b30a1f28fc76365f20bbb70480ca3b7d773803306b1/tinyobjloader-0.1.tar.gz +BuildArch: noarch + + +%description +# tinyobjloader, Wavefront .obj loader + +`tinyobjloader` is a python wrapper for C++ wavefront .obj loader. +`tinyobjloader` is rather fast and feature rich than other pure python version of .obj loader. + +## Quick tutorial + +```py +import sys +import tinyobjloader + +# Create reader. +reader = tinyobjloader.ObjReader() + +filename = "cornellbox.obj" + +# Load .obj(and .mtl) using default configuration +ret = reader.ParseFromFile(filename) + +if ret == False: + print("Warn:", reader.Warning()) + pint("Err:", reader.Error()) + print("Failed to load : ", filename) + + sys.exit(-1) + +if reader.Warning(): + print("Warn:", reader.Warning()) + +attrib = reader.GetAttrib() +print("attrib.vertices = ", len(attrib.vertices)) +print("attrib.normals = ", len(attrib.normals)) +print("attrib.texcoords = ", len(attrib.texcoords)) + +materials = reader.GetMaterials() +print("Num materials: ", len(materials)) +for m in materials: + print(m.name) + print(m.diffuse) + +shapes = reader.GetShapes() +print("Num shapes: ", len(shapes)) +for shape in shapes: + print(shape.name) + print("num_indices = {}".format(len(shape.mesh.indices))) + +``` + +## More detailed usage + +Please take a look at `python/sample.py` file in tinyobjloader git repo. + +https://github.com/syoyo/tinyobjloader/blob/master/python/sample.py + +## License + +MIT license. + +## TODO + * [ ] Writer saver + + + + + +%package -n python3-tinyobjloader +Summary: Python module for tinyobjloader +Provides: python-tinyobjloader +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-tinyobjloader +# tinyobjloader, Wavefront .obj loader + +`tinyobjloader` is a python wrapper for C++ wavefront .obj loader. +`tinyobjloader` is rather fast and feature rich than other pure python version of .obj loader. + +## Quick tutorial + +```py +import sys +import tinyobjloader + +# Create reader. +reader = tinyobjloader.ObjReader() + +filename = "cornellbox.obj" + +# Load .obj(and .mtl) using default configuration +ret = reader.ParseFromFile(filename) + +if ret == False: + print("Warn:", reader.Warning()) + pint("Err:", reader.Error()) + print("Failed to load : ", filename) + + sys.exit(-1) + +if reader.Warning(): + print("Warn:", reader.Warning()) + +attrib = reader.GetAttrib() +print("attrib.vertices = ", len(attrib.vertices)) +print("attrib.normals = ", len(attrib.normals)) +print("attrib.texcoords = ", len(attrib.texcoords)) + +materials = reader.GetMaterials() +print("Num materials: ", len(materials)) +for m in materials: + print(m.name) + print(m.diffuse) + +shapes = reader.GetShapes() +print("Num shapes: ", len(shapes)) +for shape in shapes: + print(shape.name) + print("num_indices = {}".format(len(shape.mesh.indices))) + +``` + +## More detailed usage + +Please take a look at `python/sample.py` file in tinyobjloader git repo. + +https://github.com/syoyo/tinyobjloader/blob/master/python/sample.py + +## License + +MIT license. + +## TODO + * [ ] Writer saver + + + + + +%package help +Summary: Development documents and examples for tinyobjloader +Provides: python3-tinyobjloader-doc +%description help +# tinyobjloader, Wavefront .obj loader + +`tinyobjloader` is a python wrapper for C++ wavefront .obj loader. +`tinyobjloader` is rather fast and feature rich than other pure python version of .obj loader. + +## Quick tutorial + +```py +import sys +import tinyobjloader + +# Create reader. +reader = tinyobjloader.ObjReader() + +filename = "cornellbox.obj" + +# Load .obj(and .mtl) using default configuration +ret = reader.ParseFromFile(filename) + +if ret == False: + print("Warn:", reader.Warning()) + pint("Err:", reader.Error()) + print("Failed to load : ", filename) + + sys.exit(-1) + +if reader.Warning(): + print("Warn:", reader.Warning()) + +attrib = reader.GetAttrib() +print("attrib.vertices = ", len(attrib.vertices)) +print("attrib.normals = ", len(attrib.normals)) +print("attrib.texcoords = ", len(attrib.texcoords)) + +materials = reader.GetMaterials() +print("Num materials: ", len(materials)) +for m in materials: + print(m.name) + print(m.diffuse) + +shapes = reader.GetShapes() +print("Num shapes: ", len(shapes)) +for shape in shapes: + print(shape.name) + print("num_indices = {}".format(len(shape.mesh.indices))) + +``` + +## More detailed usage + +Please take a look at `python/sample.py` file in tinyobjloader git repo. + +https://github.com/syoyo/tinyobjloader/blob/master/python/sample.py + +## License + +MIT license. + +## TODO + * [ ] Writer saver + + + + + +%prep +%autosetup -n tinyobjloader-0.1 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-tinyobjloader -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.1-1 +- Package Spec generated @@ -0,0 +1 @@ +4b7d74bdc61dcea610b6072ea8a8122e tinyobjloader-0.1.tar.gz |