【问题标题】:Generating surface mesh from point cloud using Plotly使用 Plotly 从点云生成表面网格
【发布时间】:2020-08-02 10:31:33
【问题描述】:

我正在尝试从点云 生成表面。我环顾四周,解决方案似乎从浊点生成三角形,然后生成最终网格。但是,我尝试按照here 建议的程序进行操作,但失败并获得了这个:

遗憾的是,我的数学背景不太好,当我开始从其他 awnsers 中阅读 Jonathan Shewchuk 以及从 Plotly 文档中阅读 tessellation 时,我并没有真正理解。

我使用的代码是这样的:

#Assume X_Vir, Y_Vir and Z_Vir are list of points used to create the scatter plot

points2D = np.vstack([X_Vir, Y_Vir]).T
tri = Delaunay(points2D)    
simplices = tri.simplices
fig = ff.create_trisurf(x=X_Vir, y=Y_Vir, z=Z_Vir, simplices=simplices)
fig.show()

有人有想法吗?

谢谢

【问题讨论】:

    标签: python plotly mesh


    【解决方案1】:

    我通过使用 plotly 的 Mesh3d 函数提供点坐标以及相关顶点来解决我的问题:

    fig = pot.Figure(data=[pot.Mesh3d(x=points_coord90[:,1], y=points_coord90[:,0], z=points_coord90[:,2], 
                            i=points_vert[:,0], j=points_vert[:,1], k=points_vert[:,2], 
                            intensity=bi_volt, cmin=0, cmax=2, reversescale=False, colorscale='RdYlBu', opacity=1)])
    
    fig.show()
    

    如果您没有顶点,另一种可能性是使用 plotly 的 alphahull 选项(而不是 Delaunay),但它并没有满足我的需求:

    fig = pot.Figure(data=[pot.Mesh3d(x=points_coord90[:,1], y=points_coord90[:,0], z=points_coord90[:,2], alphahull=0.5, opacity=0.5)])
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-29
      • 1970-01-01
      • 1970-01-01
      • 2012-01-03
      • 1970-01-01
      • 1970-01-01
      • 2014-03-16
      相关资源
      最近更新 更多