From 36ba2bca08c6ba36f14142480fcde1e1bd8ea868 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 29 Apr 2018 14:50:41 +0200 Subject: [PATCH] more fixes for flatmesh + fix gcc warning + add conversion function for boost.python + switch build off by default due to travis build failure for Py3 --- CMakeLists.txt | 2 +- .../App/MeshFlatteningBoostPython.cpp | 25 ++++++++++++++++++- .../MeshPart/App/MeshFlatteningLscmRelax.cpp | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04a1005e56..3107cd2685 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -261,7 +261,7 @@ OPTION(BUILD_JTREADER "Build the FreeCAD jt reader module" OFF) OPTION(BUILD_MATERIAL "Build the FreeCAD material module" ON) OPTION(BUILD_MESH "Build the FreeCAD mesh module" ON) OPTION(BUILD_MESH_PART "Build the FreeCAD mesh part module" ON) -OPTION(BUILD_FLAT_MESH "Build the FreeCAD flat mesh module" ON) +OPTION(BUILD_FLAT_MESH "Build the FreeCAD flat mesh module" OFF) OPTION(BUILD_OPENSCAD "Build the FreeCAD openscad module" ON) OPTION(BUILD_PART "Build the FreeCAD part module" ON) OPTION(BUILD_PART_DESIGN "Build the FreeCAD part design module" ON) diff --git a/src/Mod/MeshPart/App/MeshFlatteningBoostPython.cpp b/src/Mod/MeshPart/App/MeshFlatteningBoostPython.cpp index 4ad34352f1..261d13696b 100644 --- a/src/Mod/MeshPart/App/MeshFlatteningBoostPython.cpp +++ b/src/Mod/MeshPart/App/MeshFlatteningBoostPython.cpp @@ -147,6 +147,29 @@ boost::python::list interpolateFlatFacePy(FaceUnwrapper& instance, const py::obj return plist; } +boost::python::list getFlatBoundaryNodesPy(FaceUnwrapper& instance) +{ + std::vector> mat_array = instance.getFlatBoundaryNodes(); + + boost::python::list ary; + for (auto mat : mat_array) { + boost::python::list plist; + auto cols = mat.cols(); + auto rows = mat.rows(); + for (int i=0; i, ColMat>()) .def("findFlatNodes", &FaceUnwrapper::findFlatNodes) .def("interpolateFlatFace", &interpolateFlatFacePy) - .def("getFlatBoundaryNodes", &FaceUnwrapper::getFlatBoundaryNodes) + .def("getFlatBoundaryNodes", &getFlatBoundaryNodesPy) .def_readonly("tris", &FaceUnwrapper::tris) .def_readonly("nodes", &FaceUnwrapper::xyz_nodes) .def_readonly("uv_nodes", &FaceUnwrapper::uv_nodes) diff --git a/src/Mod/MeshPart/App/MeshFlatteningLscmRelax.cpp b/src/Mod/MeshPart/App/MeshFlatteningLscmRelax.cpp index f629c82d0f..6bfd94328d 100644 --- a/src/Mod/MeshPart/App/MeshFlatteningLscmRelax.cpp +++ b/src/Mod/MeshPart/App/MeshFlatteningLscmRelax.cpp @@ -455,7 +455,7 @@ void LscmRelax::lscm() std::vector mat_triplets; for (auto triplet: triple_list) { - if (triplet.col() > static_cast((this->vertices.cols() - this->fixed_pins.size()) * 2 - 1)) + if (triplet.col() > static_cast((this->vertices.cols() - this->fixed_pins.size()) * 2 - 1)) rhs_triplets.push_back(triplet); else mat_triplets.push_back(triplet);