Volume Grid Isosurface mesh issue
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- cpp
调研方向
从 src/volume_grid_scalar_quantity.cpp 开始,检查 createIsosurfaceProgram() 和 registerIsosurfaceAsMesh(),其中展示了 MarchingCube 调用和坐标变换。将两条路径中的网格维度顺序与体积缓冲区布局进行比较。当 volume-grid 等值面在两种用法中都以正确的方向和单元顺序渲染时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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!
- 主要语言
- C++
- 星标
- 2.2k
- 派生
- 242
- 平均合并
- 11 分钟
- 30 天内合并 PR
- 1
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nmwsharp/polyscope 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 48/100
-
难度 5/5 一周以上 新手友好度 30/100
-
Rust Version 未关闭
难度 5/5 一周以上 新手友好度 15/100
-
enhancement
难度 5/5 一周以上 新手友好度 20/100
查看 nmwsharp/polyscope 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
flutter-webrtc/flutter-webrtc#2206 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Component: GLib
难度 2/5 1-3 小时 新手友好度 70/100
-
Mute ydb/tests/functional/dstool/test_canonical_requests.py.Test.test_group_take_snapshot in main 未关闭ai_reviewed
难度 2/5 1-3 小时 新手友好度 70/100
ydb-platform/ydb#53974 · 3 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
google/libultrahdr#485 ·