首页 > 解决方案 > 3d 网格上描述符的着色函数

问题描述

过程是这样的:

我将 3d 网格表示为图形数据结构(邻接矩阵),并从中提取了一些特征,现在我想在网格上可视化这些特征(着色与之相关的顶点)

我可以访问 XYZ 坐标,

图表是这样的,例如:

[[0 0 0 ... 0 0 1]
 [0 0 0 ... 0 0 1]
 [0 0 0 ... 0 0 1]
 ...
 [0 0 0 ... 0 1 0]
 [0 0 0 ... 1 0 0]
 [1 1 1 ... 0 0 0]]

提取的特征如下:

[0.31830989 0.13789404 0.18738977 0.21210616 0.09979722 0.25386089
0.16402911 0.29690689 0.26002601 0.12894862 0.07586501 0.48601007
0.45855364 0.20280874 0.0126834  0.54532024 0.46835978 0.34243193
0.13314587 0.09234412 0.03764165 0.159134   0.45475221 0.1222509
0.17898168]

或喜欢

 [[ 2.72000000e+03+0.00000000e+00j -3.61459783e+00-2.59278293e+00j
  -2.07518936e+00+5.47244984e+01j ...  4.54069829e+00-1.92151511e+01j
  -2.07518936e+00-5.47244984e+01j -3.61459783e+00+2.59278293e+00j]
 [-3.61459783e+00-2.59278293e+00j  1.58768982e+01+9.65807617e+01j
   5.20680975e+01+3.99595074e+01j ... -4.99445026e+01+7.24088068e+00j
   9.35655863e+01-1.21058601e+02j  2.50985585e+03-2.57571742e-14j]
 [-2.07518936e+00+5.47244984e+01j  5.20680975e+01+3.99595074e+01j
   6.55872731e+01+3.73890215e+01j ...  2.02088720e+02-2.45776099e+02j
   2.02739503e+03-2.13162821e-14j  9.35655863e+01+1.21058601e+02j]
 ...
 [ 4.54069829e+00-1.92151511e+01j -4.99445026e+01+7.24088068e+00j
   2.02088720e+02-2.45776099e+02j ...  8.57571900e+01-4.22466723e+02j
  -1.06818420e+02-3.69249733e+01j  4.09731773e+01-3.35297094e+01j]
 [-2.07518936e+00-5.47244984e+01j  9.35655863e+01-1.21058601e+02j
   2.02739503e+03-3.28626015e-14j ... -1.06818420e+02-3.69249733e+01j
   6.55872731e+01-3.73890215e+01j  5.20680975e+01-3.99595074e+01j]
 [-3.61459783e+00+2.59278293e+00j  2.50985585e+03-3.95239397e-14j
   9.35655863e+01+1.21058601e+02j ...  4.09731773e+01-3.35297094e+01j
   5.20680975e+01-3.99595074e+01j  1.58768982e+01-9.65807617e+01j]]

所以问题又来了:我如何在网格上可视化这些特征,基本上它是坐标、边、面。

标签: pythongraph3dfeature-extraction

解决方案


我最终得到了 Marco Musy 的答案,使用他的图书馆vedo

基本上有无数种基于颜色(显然只是一维)或其他对象(如表示矢量的箭头)或其他简单对象(在本例中称为 Glyphs)来可视化网格属性的方法。

要点(我可能错了或者误解了你!)是你只有网格的一部分点的信息,并且你想将这些信息外推到剩余的点。我在这里的回答中解决了这个问题:

https://github.com/marcomusy/vtkplotter/issues/83#issuecomment-574625775

您可能会发现对可视化有用的其他示例可能是:

https://github.com/marcomusy/vtkplotter-examples/blob/master/vtkplotter_examples/basic/glyphs.py

https://github.com/marcomusy/vtkplotter-examples/blob/master/vtkplotter_examples/basic/glyphs_arrows.py

https://github.com/marcomusy/vtkplotter-examples/blob/master/vtkplotter_examples/advanced/meshquality.py

插值向量:

https://github.com/marcomusy/vtkplotter-examples/blob/master/vtkplotter_examples/advanced/interpolateField.py


推荐阅读