diff --git a/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp b/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp index aea1f39dfa4e68616f7844884d6be6cfde9d1758..bff6a12ff258190ef1d810bc912cfb3d7ae73215 100644 --- a/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp +++ b/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp @@ -44,7 +44,7 @@ DirectConditionGenerator::directToSurfaceNodes(const MeshLib::Mesh& mesh, return _direct_values; } - const MathLib::Vector3 dir(0, 0, -1); + Eigen::Vector3d const dir = -Eigen::Vector3d::UnitZ(); const std::vector<MeshLib::Node*> surface_nodes( MeshLib::MeshSurfaceExtraction::getSurfaceNodes(mesh, dir, 90)); const double no_data(raster->getHeader().no_data); diff --git a/Applications/Utils/MeshGeoTools/computeSurfaceNodeIDsInPolygonalRegion.cpp b/Applications/Utils/MeshGeoTools/computeSurfaceNodeIDsInPolygonalRegion.cpp index b3a5a3d449a5ef5c7ff7128ac87fc24bd566d84a..74dc5bb793455ecd9988da24ec5920f4a0e3ba23 100644 --- a/Applications/Utils/MeshGeoTools/computeSurfaceNodeIDsInPolygonalRegion.cpp +++ b/Applications/Utils/MeshGeoTools/computeSurfaceNodeIDsInPolygonalRegion.cpp @@ -115,9 +115,8 @@ int main (int argc, char* argv[]) }; std::vector<double> areas(computeElementTopSurfaceAreas(*mesh, dir, angle)); - MathLib::Vector3 const mal_dir(dir[0], dir[1], dir[2]); std::vector<MeshLib::Node*> all_sfc_nodes( - MeshLib::MeshSurfaceExtraction::getSurfaceNodes(*mesh, mal_dir, angle) + MeshLib::MeshSurfaceExtraction::getSurfaceNodes(*mesh, dir, angle) ); std::for_each(all_sfc_nodes.begin(), all_sfc_nodes.end(), diff --git a/MeshLib/MeshSurfaceExtraction.cpp b/MeshLib/MeshSurfaceExtraction.cpp index 2c39902520d296f49ddd62a9973fb37354785d9c..9a3dbcbf5920251d92d9bf2be62c24565b6c3994 100644 --- a/MeshLib/MeshSurfaceExtraction.cpp +++ b/MeshLib/MeshSurfaceExtraction.cpp @@ -366,17 +366,16 @@ void MeshSurfaceExtraction::get2DSurfaceElements( } std::vector<MeshLib::Node*> MeshSurfaceExtraction::getSurfaceNodes( - const MeshLib::Mesh& mesh, const MathLib::Vector3& dir, double angle) + const MeshLib::Mesh& mesh, Eigen::Vector3d const& dir, double angle) { INFO("Extracting surface nodes..."); std::vector<MeshLib::Element*> sfc_elements; std::vector<std::size_t> element_to_bulk_element_id_map; std::vector<std::size_t> element_to_bulk_face_id_map; - auto const edir = Eigen::Map<Eigen::Vector3d const>(dir.getCoords()); get2DSurfaceElements( mesh.getElements(), sfc_elements, element_to_bulk_element_id_map, - element_to_bulk_face_id_map, edir, angle, mesh.getDimension()); + element_to_bulk_face_id_map, dir, angle, mesh.getDimension()); std::vector<MeshLib::Node*> surface_nodes; std::tie(surface_nodes, std::ignore) = diff --git a/MeshLib/MeshSurfaceExtraction.h b/MeshLib/MeshSurfaceExtraction.h index 5735d30a4199615ffe8779324039b5b71cd67b69..861ffa90fbc34e19f81424c23e42c80254f53a0f 100644 --- a/MeshLib/MeshSurfaceExtraction.h +++ b/MeshLib/MeshSurfaceExtraction.h @@ -17,7 +17,8 @@ #include <cstddef> #include <vector> -#include "MathLib/Vector3.h" +#include <Eigen/Eigen> + #include "MeshLib/Mesh.h" #include "MeshLib/Properties.h" @@ -41,7 +42,7 @@ public: /// Returns the surface nodes of a mesh. static std::vector<MeshLib::Node*> getSurfaceNodes( - const MeshLib::Mesh& mesh, const MathLib::Vector3& dir, double angle); + const MeshLib::Mesh& mesh, Eigen::Vector3d const& dir, double angle); /** * Returns the 2d-element mesh representing the surface of the given mesh.