Skip to content

Commit 6aa103f

Browse files
authored
Merge pull request #920 from wildmeshing/dzint/image_simulation
Dzint/image simulation
2 parents 6756c6f + d4954b6 commit 6aa103f

22 files changed

Lines changed: 236 additions & 2340 deletions

app/pywmtk/pywmtk.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
// components
1212
#include "../components_include.hpp"
1313

14-
// std::map<std::string, std::function<void(nlohmann::json)>> components_map;
15-
//// include auto-generated map
16-
//#include "../components_map.hpp"
17-
1814
namespace py = pybind11;
1915
using namespace pybind11::literals;
2016

@@ -47,16 +43,5 @@ void wmtk_wrapper(const py::dict& obj)
4743
PYBIND11_MODULE(pywmtk, m, py::mod_gil_not_used())
4844
{
4945
m.doc() = "Python bindings for the Wildmeshing-Toolkit"; // optional module docstring
50-
// m.def("get_metrics", &meme::get_metrics, "Get mesh metrics");
51-
// m.def("get_metric_names", &meme::get_metrics_names, "Get names for all mesh metrics");
52-
// m.def("get_metrics_per_tri", &meme::get_metrics_per_tri, "Get mesh metrics per triangle");
53-
// m.def(
54-
// "get_metric_names_per_tri",
55-
// &meme::get_metrics_names_per_tri,
56-
// "Get names for all per-triangle metrics");
57-
// m.def(
58-
// "get_relative_edge_lenghts",
59-
// &meme::get_relative_edge_lengths,
60-
// "Get edge lengths realtive to bbox diagonal");
6146
m.def("wmtk", &wmtk_wrapper, "Wildmeshing-Toolkit application");
6247
}

cmake/recipes/libigl.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CPMAddPackage(
1212
GIT_TAG 3ea7f9480967fcf6bf02ce9b993c0ea6d2fc45f6
1313
OPTIONS
1414
LIBIGL_PREDICATES ON
15-
LIBIGL_COPYLEFT_TETGEN ON
15+
# LIBIGL_COPYLEFT_TETGEN ON
1616
)
1717
# include(eigen)
1818
FetchContent_MakeAvailable(libigl)

cmake/wmtk_data.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ExternalProject_Add(
1616
SOURCE_DIR ${WMTK_DATA_ROOT}
1717

1818
GIT_REPOSITORY https://github.com/wildmeshing/data2.git
19-
GIT_TAG a97b2a974e80cc288624f86c9cc03eae7f050c4f
19+
GIT_TAG f2bd8ed5e8af5a125ee4d92cd0af8f32cec60e02
2020

2121
CONFIGURE_COMMAND ""
2222
BUILD_COMMAND ""

components/image_simulation/wmtk/components/image_simulation/AnnotationsTet.cpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -579,22 +579,31 @@ void ImageSimulationMesh::resolve_intersections(const std::vector<CellTag>& inte
579579
m_envelope.reset();
580580
}
581581

582-
void ImageSimulationMesh::replace_tags(const std::vector<CellTag>& tags_in, const CellTag& tag_out)
582+
void ImageSimulationMesh::replace_tags(
583+
const std::vector<CellTag>& tags_in,
584+
const std::vector<CellTag>& tags_out)
583585
{
584586
for (const Tuple& t : get_tets()) {
585587
CellTag& tags = m_tet_attribute[t.tid(*this)].tags;
586-
bool found_some = false;
587-
for (const CellTag& tag : tags_in) {
588-
if (set_includes(tags, tag)) {
589-
found_some = true;
590-
// remove tag from tags
591-
for (const size_t t : tag) {
592-
tags.erase(t);
588+
std::vector<bool> found_tags(tags_in.size(), false);
589+
for (size_t i = 0; i < tags_in.size(); ++i) {
590+
if (set_includes(tags, tags_in[i])) {
591+
found_tags[i] = true;
592+
}
593+
}
594+
// remove "tags_in" from tags
595+
for (size_t i = 0; i < tags_in.size(); ++i) {
596+
if (found_tags[i]) {
597+
for (const int64_t tt : tags_in[i]) {
598+
tags.erase(tt);
593599
}
594600
}
595601
}
596-
if (found_some) {
597-
tags.insert(tag_out.begin(), tag_out.end());
602+
// add "tags_out" to tags
603+
for (size_t i = 0; i < tags_out.size(); ++i) {
604+
if (found_tags[i]) {
605+
tags.insert(tags_out[i].begin(), tags_out[i].end());
606+
}
598607
}
599608
}
600609

components/image_simulation/wmtk/components/image_simulation/AnnotationsTri.cpp

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -535,22 +535,29 @@ void ImageSimulationMeshTri::resolve_intersections(const std::vector<CellTag>& i
535535

536536
void ImageSimulationMeshTri::replace_tags(
537537
const std::vector<CellTag>& tags_in,
538-
const CellTag& tag_out)
538+
const std::vector<CellTag>& tags_out)
539539
{
540540
for (const Tuple& t : get_faces()) {
541541
CellTag& tags = m_face_attribute[t.fid(*this)].tags;
542-
bool found_some = false;
543-
for (const CellTag& tag : tags_in) {
544-
if (set_includes(tags, tag)) {
545-
found_some = true;
546-
// remove tag from tags
547-
for (const size_t t : tag) {
548-
tags.erase(t);
542+
std::vector<bool> found_tags(tags_in.size(), false);
543+
for (size_t i = 0; i < tags_in.size(); ++i) {
544+
if (set_includes(tags, tags_in[i])) {
545+
found_tags[i] = true;
546+
}
547+
}
548+
// remove "tags_in" from tags
549+
for (size_t i = 0; i < tags_in.size(); ++i) {
550+
if (found_tags[i]) {
551+
for (const int64_t tt : tags_in[i]) {
552+
tags.erase(tt);
549553
}
550554
}
551555
}
552-
if (found_some) {
553-
tags.insert(tag_out.begin(), tag_out.end());
556+
// add "tags_out" to tags
557+
for (size_t i = 0; i < tags_out.size(); ++i) {
558+
if (found_tags[i]) {
559+
tags.insert(tags_out[i].begin(), tags_out[i].end());
560+
}
554561
}
555562
}
556563

components/image_simulation/wmtk/components/image_simulation/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ set(SRC_FILES
1313
ImageSimulationMesh.cpp
1414
ImageSimulationMesh.h
1515

16-
extract_soup.hpp
17-
extract_soup.cpp
18-
1916
EmbedSurface.hpp
2017
EmbedSurface.cpp
2118

@@ -54,7 +51,6 @@ target_link_libraries(wmtk_${COMPONENT_NAME} PUBLIC
5451
wmtk::shortest_edge_collapse
5552
VolumeRemesher::VolumeRemesher
5653
jse::jse
57-
igl_copyleft::tetgen
5854
)
5955

6056
######################

0 commit comments

Comments
 (0)