Commit 403d3afa authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'master' into feature/status-and-features

parents d4a5c6f5 ed217314
Pipeline #20361 failed with stages
in 59 seconds
......@@ -3,24 +3,24 @@ stages:
- test
- deploy
build-3.7-VS2017:
build-3.9-VS2017:
stage:
build
tags:
- VS2017
- python37
- Python39
variables:
BUILD_PLATFORM: "VS2017"
ARCHITECTURE: "x64"
before_script:
- git submodule sync --recursive
- git submodule update --init --recursive
script: "CI\\build-3.7-VS2017.bat"
script: "CI\\build-3.9-VS2017.bat"
artifacts:
paths:
- dist3/
build-3.7-linux:
build-3.9-linux:
stage:
build
tags:
......@@ -28,12 +28,12 @@ build-3.7-linux:
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- virtualenv -p python3.7 .
- virtualenv -p python3.9 .
- source bin/activate
- python setup.py bdist_wheel --dist-dir dist3
artifacts:
paths:
- dist3/
- dist3/
build-3.5-macos:
stage:
......@@ -50,21 +50,22 @@ build-3.5-macos:
artifacts:
paths:
- dist3/
build-2.7-linux:
build-3.9-macos-m1:
stage:
build
tags:
- Linux
- AppleM1
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- virtualenv -p python2.7 .
- export PATH=/opt/local/bin:$PATH
- virtualenv -p python3.9 .
- source bin/activate
- python setup.py bdist_wheel --dist-dir dist2
- python setup.py bdist_wheel --dist-dir dist3
artifacts:
paths:
- dist2/
- dist3/
build-2.7-macos:
stage:
......@@ -82,29 +83,32 @@ build-2.7-macos:
paths:
- dist2/
test-3.7-VS2017:
test-3.9-VS2017:
stage:
test
tags:
- VS2017
- python37
- Python39
dependencies:
- build-3.7-VS2017
script: "CI\\test-3.7-VS2017.bat"
- build-3.9-VS2017
needs: [build-3.9-VS2017]
script: "CI\\test-3.9-VS2017.bat"
test-3.7-linux:
test-3.9-linux:
stage:
test
tags:
- Linux
dependencies:
- build-3.7-linux
- build-3.9-linux
needs: [build-3.9-linux]
script:
- virtualenv -p python3.7 .
- virtualenv -p python3.9 .
- source bin/activate
- pip install dist3/*.whl
- cd tests
- python -m unittest discover
- python -m unittest discover
test-3.5-macos:
stage:
......@@ -113,6 +117,7 @@ test-3.5-macos:
- Apple
dependencies:
- build-3.5-macos
needs: [build-3.5-macos]
script:
- export PATH=/opt/local/bin:$PATH
- virtualenv -p python3.5 .
......@@ -121,20 +126,22 @@ test-3.5-macos:
- cd tests
- python -m unittest discover
test-2.7-linux:
test-3.9-macos-m1:
stage:
test
tags:
- Linux
- AppleM1
dependencies:
- build-2.7-linux
- build-3.9-macos-m1
needs: [build-3.9-macos-m1]
script:
- virtualenv -p python2.7 .
- export PATH=/opt/local/bin:$PATH
- virtualenv -p python3.9 .
- source bin/activate
- pip install dist2/*.whl
- pip install dist3/*.whl
- cd tests
- python -m unittest discover
- python -m unittest discover
test-2.7-macos:
stage:
test
......@@ -142,6 +149,7 @@ test-2.7-macos:
- Apple
dependencies:
- build-2.7-macos
needs: [build-2.7-macos]
script:
- export PATH=/opt/local/bin:$PATH
- virtualenv -p python2.7 .
......@@ -150,32 +158,34 @@ test-2.7-macos:
- cd tests
- python -m unittest discover
deploy-3.7-VS2017:
deploy-3.9-VS2017:
stage:
deploy
tags:
- VS2017
- python37
- Python39
dependencies:
- build-3.7-VS2017
script: "CI\\deploy-3.7-VS2017.bat"
- build-3.9-VS2017
needs: [build-3.9-VS2017]
script: "CI\\deploy-3.9-VS2017.bat"
artifacts:
paths:
- release/*.whl
deploy-3.7-linux:
deploy-3.9-linux:
stage:
deploy
tags:
- Linux
dependencies:
- build-3.7-linux
- build-3.9-linux
needs: [build-3.9-linux]
script:
- mkdir release
- cp dist3/*.whl release
artifacts:
paths:
- release/*.whl
- release/*.whl
deploy-3.5-macos:
stage:
......@@ -184,26 +194,28 @@ deploy-3.5-macos:
- Apple
dependencies:
- build-3.5-macos
needs: [build-3.5-macos]
script:
- mkdir release
- cp dist3/*.whl release
artifacts:
paths:
- release/*.whl
deploy-2.7-linux:
deploy-3.9-macos-m1:
stage:
deploy
tags:
- Linux
- AppleM1
dependencies:
- build-2.7-linux
- build-3.9-macos-m1
needs: [build-3.9-macos-m1]
script:
- mkdir release
- cp dist2/*.whl release
- cp dist3/*.whl release
artifacts:
paths:
- release/*.whl
- release/*.whl
deploy-2.7-macos:
stage:
......@@ -212,6 +224,7 @@ deploy-2.7-macos:
- Apple
dependencies:
- build-2.7-macos
needs: [build-2.7-macos]
script:
- mkdir release
- cp dist2/*.whl release
......@@ -227,7 +240,7 @@ deploy-sdist:
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- virtualenv -p python3.7 .
- virtualenv -p python3.9 .
- source bin/activate
- python setup.py sdist --dist-dir release
artifacts:
......@@ -240,9 +253,10 @@ deploy-documentation:
tags:
- Linux
dependencies:
- build-3.7-linux
- build-3.9-linux
needs: [build-3.9-linux]
script:
- virtualenv -p python3.7 .
- virtualenv -p python3.9 .
- source bin/activate
- pip install dist3/*.whl
- pip install sphinx sphinx_rtd_theme
......
set PATH=C:\Program Files\Python37;C:\Program Files\Python37\Scripts;C:\Program Files\CMake\bin;%PATH%
virtualenv -p "C:\Program Files\Python37\python.exe" .
set PATH=C:\Program Files\Python39;C:\Program Files\Python39\Scripts;C:\Program Files\CMake\bin;%PATH%
virtualenv.exe -p "C:\Program Files\Python39\python.exe" .
call .\Scripts\activate
python setup.py bdist_wheel --dist-dir dist3
set PATH=C:\Program Files\Python37;C:\Program Files\Python37\Scripts;%PATH%
virtualenv -p "C:\Program Files\Python37\python.exe" .
set PATH=C:\Program Files\Python39;C:\Program Files\Python39\Scripts;%PATH%
virtualenv -p "C:\Program Files\Python39\python.exe" .
call .\Scripts\activate
python -m pip install numpy==1.19.3
cd dist3
......
OpenMesh @ c36d8a30
Subproject commit 919abd832608ea2a7d0ba1042f2a7c6e009c56a5
Subproject commit c36d8a304c5ab2457eb7969ad440c4b1ea74407b
......@@ -16,3 +16,15 @@ OpenMesh provides functions that read and write meshes from and to files:
om.write_mesh(trimesh, "bunny.ply")
OpenMesh currently supports five file types: .obj, .off, .ply, .stl and .om
For writing .obj files there is also support for textures. You can pass the path of a texture image and
optionally the suffix for the material file, default is ".mat", but some programs, e.g. Blender expect ".mtl" as suffix
.. code:: python
om.write_mesh(
"out.obj",
trimesh,
texture_file="moon.png",
material_file_extension=".mtl" # default is ".mat", blender needs ".mtl"
)
......@@ -100,6 +100,7 @@ setup(
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.9',
'Topic :: Multimedia :: Graphics',
],
project_urls={
......
......@@ -175,7 +175,9 @@ void def_write_mesh(py::module& m) {
bool _face_color,
bool _color_alpha,
bool _color_float,
bool _status
bool _status,
const std::string& _texture_file = "",
const std::string& _material_file_extension = ".mat"
)
{
OM::IO::Options options;
......@@ -195,6 +197,8 @@ void def_write_mesh(py::module& m) {
if (_color_alpha) options += OM::IO::Options::ColorAlpha;
if (_color_float) options += OM::IO::Options::ColorFloat;
options.texture_file = _texture_file;
options.material_file_extension = _material_file_extension;
if (_status) options += OM::IO::Options::Status;
......@@ -222,6 +226,8 @@ void def_write_mesh(py::module& m) {
py::arg("color_alpha")=false,
py::arg("color_float")=false,
py::arg("status")=false
py::arg("texture_file")="",
py::arg("material_file_extension")=".mat"
);
}
......
......@@ -719,10 +719,21 @@ void expose_mesh(py::module& m, const char *_name) {
_self.status(_h).set_deleted(_val);
})
.def("is_deleted", [](Mesh& _self, OM::HalfedgeHandle _h) {
if (!_self.has_halfedge_status()) return false;
return _self.status(_h).deleted();
})
.def("is_locked", [](Mesh& _self, OM::VertexHandle _h) {
if (!_self.has_vertex_status()) return false;
return _self.status(_h).locked();
})
.def("set_locked", [](Mesh& _self, OM::VertexHandle _h, bool _val) {
if (!_self.has_vertex_status()) _self.request_vertex_status();
_self.status(_h).set_locked(_val);
})
.def("is_deleted", [](Mesh& _self, OM::HalfedgeHandle _h) {
if (!_self.has_halfedge_status()) return false;
return _self.status(_h).deleted();
})
.def("set_deleted", [](Mesh& _self, OM::HalfedgeHandle _h, bool _val) {
if (!_self.has_halfedge_status()) _self.request_halfedge_status();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment