diff --git a/face3d/mesh/cython/__init__.py b/face3d/mesh/cython/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/face3d/mesh/cython/mesh_core.cpp b/face3d/mesh/cython/mesh_core.cpp index 3f3aec2..aeea4da 100644 --- a/face3d/mesh/cython/mesh_core.cpp +++ b/face3d/mesh/cython/mesh_core.cpp @@ -346,7 +346,7 @@ void _write_obj_with_colors_texture(string filename, string mtl_name, { int i; - ofstream obj_file(filename); + ofstream obj_file(filename.c_str()); // first line of the obj file: the mtl name obj_file << "mtllib " << mtl_name << endl; @@ -372,4 +372,4 @@ void _write_obj_with_colors_texture(string filename, string mtl_name, obj_file << "f " << triangles[3*i + 2] << "/" << triangles[3*i + 2] << " " << triangles[3*i + 1] << "/" << triangles[3*i + 1] << " " << triangles[3*i] << "/" << triangles[3*i] << endl; } -} \ No newline at end of file +} diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..1b6765a --- /dev/null +++ b/setup.py @@ -0,0 +1,23 @@ +from distutils.core import setup +from distutils.extension import Extension + +import numpy +from Cython.Distutils import build_ext + +cmdclass = {'build_ext': build_ext} +ext_modules = [Extension("face3d.mesh.cython.mesh_core_cython", + sources=["face3d/mesh/cython/mesh_core_cython.pyx", "face3d/mesh/cython/mesh_core.cpp"], + language='c++', + include_dirs=[numpy.get_include(), '.'])] + +setup( + name='face3d', + cmdclass=cmdclass, + ext_modules=ext_modules, + version='1.0', + description='Python tools for 3D face: 3DMM, Mesh processing(transform, camera, light, render), ' + '3D face representations.', + author='Yao Feng', + author_email='yaofeng1995@gmail.com', + packages=['face3d', 'face3d.mesh', 'face3d.mesh_numpy', 'face3d.morphable_model', 'face3d.mesh.cython'], +)