Skip to content
Snippets Groups Projects
Commit 9e684df3 authored by Karsten Rink's avatar Karsten Rink
Browse files

use flipping to solve issue with adding bottom layer

parent 5adc7184
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "MeshLib/Elements/Elements.h" #include "MeshLib/Elements/Elements.h"
#include "MeshLib/MeshSurfaceExtraction.h" #include "MeshLib/MeshSurfaceExtraction.h"
#include "MeshLib/MeshEditing/DuplicateMeshComponents.h" #include "MeshLib/MeshEditing/DuplicateMeshComponents.h"
#include "MeshLib/MeshEditing/FlipElements.h"
namespace MeshLib namespace MeshLib
{ {
...@@ -78,10 +79,14 @@ MeshLib::Mesh* addLayerToMesh(MeshLib::Mesh const& mesh, double thickness, ...@@ -78,10 +79,14 @@ MeshLib::Mesh* addLayerToMesh(MeshLib::Mesh const& mesh, double thickness,
int const flag = (on_top) ? -1 : 1; int const flag = (on_top) ? -1 : 1;
const MathLib::Vector3 dir(0, 0, flag); const MathLib::Vector3 dir(0, 0, flag);
double const angle(90); double const angle(90);
std::unique_ptr<MeshLib::Mesh> sfc_mesh = (mesh.getDimension() == 3) ? std::unique_ptr<MeshLib::Mesh> sfc_mesh (nullptr);
std::unique_ptr<MeshLib::Mesh>(
MeshLib::MeshSurfaceExtraction::getMeshSurface(mesh, dir, angle, true)) : if (mesh.getDimension() == 3)
std::unique_ptr<MeshLib::Mesh>(new MeshLib::Mesh(mesh)); sfc_mesh = std::unique_ptr<MeshLib::Mesh>(
MeshLib::MeshSurfaceExtraction::getMeshSurface(mesh, dir, angle, true));
else
sfc_mesh = (on_top) ? std::unique_ptr<MeshLib::Mesh>(new MeshLib::Mesh(mesh)) :
std::unique_ptr<MeshLib::Mesh>(MeshLib::flipMeshElements(mesh));
INFO("done."); INFO("done.");
// *** add new surface nodes // *** add new surface nodes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment