首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用Plotly从点云生成曲面网格

使用Plotly从点云生成曲面网格
EN

Stack Overflow用户
提问于 2020-07-28 15:58:06
回答 1查看 392关注 0票数 0

我正在尝试从点云生成表面

..。我已经环顾四周,解决方案似乎是从云点生成三角形,然后生成最终的网格。然而,我尝试了here建议的步骤,但我失败了,并获得了以下结果:

可悲的是,我的数学背景不是很好,当我开始从其他awnsers上阅读关于Jonathan Shewchuk的文章和从Plotly文档中了解镶嵌时,我并没有真正理解。

我使用的代码是:

代码语言:javascript
运行
复制
#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()

有谁有主意吗?

谢谢你

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-08-02 10:31:33

我修复了我的问题,通过使用plotly的Mesh3d函数提供点坐标以及关联的顶点:

代码语言:javascript
运行
复制
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),但它不能完全满足我的需求:

代码语言:javascript
运行
复制
fig = pot.Figure(data=[pot.Mesh3d(x=points_coord90[:,1], y=points_coord90[:,0], z=points_coord90[:,2], alphahull=0.5, opacity=0.5)])
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63129494

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档