Skip to content

Commit

Permalink
Fixed material bug in lsWriteVisualization mesh (#98)
Browse files Browse the repository at this point in the history
* Fixed bug in lsWriteVisualization mesh, where first material does not get correct material id

* Add build dependencies in test workflow
  • Loading branch information
tobre1 authored Nov 10, 2023
1 parent 678c8a2 commit 2e14575
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/linux_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ jobs:
-D CMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-D VIENNALS_BUILD_TESTS=ON
- name: Build Dependencies
run: cmake --build ./build --target buildDependencies

- name: Build Tests
run: cmake --build ./build
run: cmake --build ./build --target buildTests

- name: Run Tests
working-directory: ${{github.workspace}}/build
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/macos_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ jobs:
-D OpenMP_CXX_LIB_NAMES="omp" \
-D OpenMP_omp_LIBRARY="$(brew --prefix libomp)/lib/libomp.a"
- name: Build Dependencies
run: cmake --build ./build --target buildDependencies

- name: Build Tests
run: cmake --build ./build
run: cmake --build ./build --target buildTests

- name: Run Tests
working-directory: ${{github.workspace}}/build
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/windows_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ jobs:
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DVIENNALS_BUILD_TESTS=ON

- name: Build
run: cmake --build ${{github.workspace}}/build
- name: Build Dependencies
run: cmake --build ${{github.workspace}}/build --target buildDependencies

- name: Build Tests
run: cmake --build ${{github.workspace}}/build --target buildTests

- name: Add VTK to PATH
run: echo "${{github.workspace}}\dependencies\Install\vtk_external\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Expand Down
4 changes: 2 additions & 2 deletions include/lsWriteVisualizationMesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,9 @@ template <class T, int D> class lsWriteVisualizationMesh {
}
#endif

const bool useMaterialMap = materialMap != nullptr;
materialMeshes.push_back(clipper->GetOutput());
materialIds.push_back(0);
materialIds.push_back(useMaterialMap ? materialMap->getMaterialId(0) : 0);

#ifdef LS_TO_VISUALIZATION_DEBUG
{
Expand All @@ -526,7 +527,6 @@ template <class T, int D> class lsWriteVisualizationMesh {
#endif

unsigned counter = 1;
const bool useMaterialMap = materialMap != nullptr;

// now cut large volume mesh with all the smaller ones
for (typename LevelSetsType::const_reverse_iterator it =
Expand Down

0 comments on commit 2e14575

Please sign in to comment.