Volume Grid Isosurface mesh issue
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C++
- Estrellas
- 2.2k
- Forks
- 242
- Merge medio
- 11 min
- PR fusionados (30 d)
- 1
Descripción
Hi,
I've run into an issue with the isosurface generation for volume grid scalar quantities. The problem appears to be that the change made to fix the frame transformation for #253 wasn't propagated into the grid dimensions passed to the MarchingCube library, resulting in the grid cells being interpreted in the wrong order.
The following shows a volume grid of the Stanford Bunny and its isosurface visualization with the 2.2.1 release:
By swizzling the grid dimensions passed into MarchingCube we get the following (correct) result instead:
The patch for the above fix is:
diff --git a/src/volume_grid_scalar_quantity.cpp b/src/volume_grid_scalar_quantity.cpp
index cde441a..603841f 100644
--- a/src/volume_grid_scalar_quantity.cpp
+++ b/src/volume_grid_scalar_quantity.cpp
@@ -165,8 +165,8 @@ void VolumeGridNodeScalarQuantity::createIsosurfaceProgram() {
// Extract the isosurface from the level set of the scalar field
MC::mcMesh isosurfaceMesh;
- MC::marching_cube(&values.data.front(), isosurfaceLevel.get(), parent.getGridNodeDim().x, parent.getGridNodeDim().y,
- parent.getGridNodeDim().z, isosurfaceMesh);
+ MC::marching_cube(&values.data.front(), isosurfaceLevel.get(), parent.getGridNodeDim().z, parent.getGridNodeDim().y,
+ parent.getGridNodeDim().x, isosurfaceMesh);
// Transform the result to be aligned with our volume's spatial layout
glm::vec3 scale = parent.gridSpacing();
@@ -215,8 +215,8 @@ SurfaceMesh* VolumeGridNodeScalarQuantity::registerIsosurfaceAsMesh(std::string
// extract the mesh
MC::mcMesh isosurfaceMesh;
- MC::marching_cube(&values.data.front(), isosurfaceLevel.get(), parent.getGridNodeDim().x, parent.getGridNodeDim().y,
- parent.getGridNodeDim().z, isosurfaceMesh);
+ MC::marching_cube(&values.data.front(), isosurfaceLevel.get(), parent.getGridNodeDim().z, parent.getGridNodeDim().y,
+ parent.getGridNodeDim().x, isosurfaceMesh);
glm::vec3 scale = parent.gridSpacing();
for (auto& p : isosurfaceMesh.vertices) {
// swizzle to account for change of coordinate/buffer ordering in the MC lib
I'm not sure how you prefer to manage the repo, but if you'd like me to open a PR for the fix I'm happy to. Thanks!
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en src/volume_grid_scalar_quantity.cpp inspeccionando createIsosurfaceProgram() y registerIsosurfaceAsMesh(), donde se muestran las llamadas a MarchingCube y la transformación de coordenadas. Compara el orden de las dimensiones de la cuadrícula en ambas rutas con la disposición del búfer de volumen. Se considera terminado cuando las isosuperficies de volume-grid se rendericen con la orientación y el orden de celdas correctos en ambos usos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp
- Área
- computer-graphics
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 48/100