[英]Generating surface mesh from point cloud using Plotly
我正在嘗試從點雲生成表面 . 我環顧四周,解決方案似乎是從雲點生成三角形,然后生成最終網格。 但是,我嘗試按照此處提出的程序進行操作,但失敗並獲得了以下信息:
可悲的是,我的數學背景不太好,當我開始從其他 awnsers 和 Plotly 文檔中的 tessellation 閱讀 Jonathan Shewchuk 時,我並沒有真正理解。
我使用的代碼是這樣的:
#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()
有人有想法嗎?
謝謝
我通過使用Mesh3d
的 Mesh3d function 提供點坐標以及相關頂點來解決我的問題:
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)])
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.