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
-
難度 2/5 1-3 小時 新手友好度 65/100
brave/brave-browser#59300 ·
-
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 則留言 ·