Skip to content
Snippets Groups Projects
Commit 6ed6d45d authored by Bastian Telgen's avatar Bastian Telgen
Browse files

add function for boolean cut operation

parent 43eb0939
No related tags found
No related merge requests found
Pipeline #195236 passed
......@@ -26,6 +26,7 @@ add_library(${PROJECT_NAME}-meshing
cppgmsh/construct_polyhedron.cc
cppgmsh/construct_rectangle.cc
cppgmsh/copy_entities.cc
cppgmsh/cut_entities.cc
cppgmsh/extrude_entities.cc
cppgmsh/extrude_surface.cc
cppgmsh/fuse_entities.cc
......
// © 2023 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#include "ae108/meshing/cppgmsh/cut_entities.h"
#include <gmsh.h>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
std::vector<std::pair<int, int>>
cut_entities(const std::vector<std::pair<int, int>> &object_entities,
const std::vector<std::pair<int, int>> &tool_entities,
const bool remove_object, const bool remove_tool) noexcept {
std::vector<gmsh::vectorpair> temp;
gmsh::vectorpair cut_entities;
gmsh::model::occ::cut(object_entities, tool_entities, cut_entities, temp, -1,
remove_object, remove_tool);
return cut_entities;
}
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
// © 2023 ETH Zurich, Mechanics and Materials Lab
//
// ae108 is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any
// later version.
//
// ae108 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ae108. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <vector>
namespace ae108 {
namespace meshing {
namespace cppgmsh {
/**
* @brief Returns vector of cut entities.
*
* @param object_entities Object entities.
* @param tool_entities Tool entities.
* @param remove_object If true, the object entities will be removed after the
* cut was performed.
* @param remove_tool If true, the tool entities will be removed after the
* cut was performed.
* @note https://gitlab.onelab.info/gmsh/gmsh/-/blob/gmsh_4_8_4/api/gmsh.h#L2632
*/
std::vector<std::pair<int, int>>
cut_entities(const std::vector<std::pair<int, int>> &object_entities,
const std::vector<std::pair<int, int>> &tool_entities,
const bool remove_object = true,
const bool remove_tool = true) noexcept;
} // namespace cppgmsh
} // namespace meshing
} // namespace ae108
\ No newline at end of file
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