From efacc96cc8c7282f0334fdf11e4f777a59ddf114 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 10 May 2023 07:03:20 +0000 Subject: automatic import of python-tinymetabobjloader --- python-tinymetabobjloader.spec | 263 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 python-tinymetabobjloader.spec (limited to 'python-tinymetabobjloader.spec') diff --git a/python-tinymetabobjloader.spec b/python-tinymetabobjloader.spec new file mode 100644 index 0000000..20a1725 --- /dev/null +++ b/python-tinymetabobjloader.spec @@ -0,0 +1,263 @@ +%global _empty_manifest_terminate_build 0 +Name: python-tinymetabobjloader +Version: 0.1.1 +Release: 1 +Summary: Experimental fork of tinyobjloader Python module +License: MIT License +URL: https://github.com/metabolize/tinyobjloader +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/7b/93/9511e5a76450092e1b2764dbee6c3100e2d0413ff48258a054e8cd52df6c/tinymetabobjloader-0.1.1.tar.gz + + +%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-tinymetabobjloader +Summary: Experimental fork of tinyobjloader Python module +Provides: python-tinymetabobjloader +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-cffi +BuildRequires: gcc +BuildRequires: gdb +%description -n python3-tinymetabobjloader +# 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 tinymetabobjloader +Provides: python3-tinymetabobjloader-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 tinymetabobjloader-0.1.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-tinymetabobjloader -f filelist.lst +%dir %{python3_sitearch}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 10 2023 Python_Bot - 0.1.1-1 +- Package Spec generated -- cgit v1.2.3