pythonic生物人

Polyscope,一款简洁的三维可视化工具!

本期分享三维可视化工具:Polyscope

Image

  • Polyscope是用于三维数据(如meshes、point clouds)的可视化工具,通过编程或动态GUI完成;

  • Polyscope支持C++和Python编程;

  • Polyscope追求“一行代码”为数据提供有用的可视界面展示。

下面来简单介绍Polyscope使用。


Polyscope效果

Image
Point Clouds
Image
Surface Meshes
Image
Curve Networks
Image
Volume Meshes

Polyscope使用

  • 安装
pip install polyscope
  • 快速上手

一个简单demo介绍Polyscope使用步骤,

import numpy as np
import polyscope as ps

# 初始化polyscope
ps.init()

# 准备顶点位置数据vertices,vertices是一个100x3的numpy数组
vertices = np.random.rand(100, 3)

# 准备索引数据faces ,faces是一个250x3的numpy数组
faces = np.random.randint(0, 100, size=(250, 3))

# 3d可视化
ps_mesh = ps.register_surface_mesh("my mesh", vertices, faces)
ps.show()

运行代码弹出GUI界面,可进一步调节,Image


ref:https://github.com/nmwsharp/polyscope/tree/master


-END-
推荐阅读:

Image

我的学习小圈子👉
加入

Image

赞、在看就是最大的支持Image