Polyscope:3Dデータ操作用GUIライブラリ

ポリゴンMeshや点群などの3Dデータを扱うビューア、インターフェイスを提供するライブラリ。VTKなんかよりもずっと手軽に導入できそう。MITライセンス。

Polyscope



Polyscopeは、Meshや点群などの3Dデータ用のC++/Pythonビューア・ユーザーインターフェイスです。Polyscopeを使えば、プログラムや動的なGUIを通じてデータを登録でき、即座に情報を美しく可視化できます。Polyscopeは軽量になるよう設計されており、プログラム全体の「所有権を奪う」ことはなく、既存のコードベースや一般的なライブラリと簡単に統合できます。Polyscopeが目指すのは、たった1行のコードを通じてデータへの便利なビジュアルインターフェイスの提供することです。

Polyscopeではstructurequantityのパラダイムを採用しています。structureとは、サーフェスMeshや点群など、シーン内の幾何学的オブジェクトのことです。quantityとは、スカラー関数やベクトル場など、structureに関連付けられたデータのことです。

任意の構造や数量を登録すると、Polyscopeはそれらをインタラクティブな3Dシーンに表示し、可視性の切り替え、データのカラーマッピングとマップの調整、シーン内をクリックして数値を照会する「ピッキング」等、定型的問題を処理できます。

ソースコードはGitHubで配布されている↓
https://github.com/nmwsharp/polyscope



コード例を見ると、3Dデータの可視化GUIをかなりお手軽に実現できるようです↓

Polyscopeでデータを可視化する簡単なワークフローは以下のようになります:

C++:

#include "polyscope/polyscope.h"
#include "polyscope/surface_mesh.h"

// Initialize polyscope
polyscope::init();

// Register a point cloud
// `points` is a Nx3 array-like container of points
polyscope::registerPointCloud("my points", points)

// Register a surface mesh structure
// `meshVerts` is a Vx3 array-like container of vertex positions
// `meshFaces` is a Fx3 array-like container of face indices  
polyscope::registerSurfaceMesh("my mesh", meshVerts, meshFaces);

// Add a scalar and a vector function defined on the mesh
// `scalarQuantity` is a length V array-like container of values
// `vectorQuantity` is an Fx3 array-like container of vectors per face
polyscope::getSurfaceMesh("my mesh")->addVertexScalarQuantity("my_scalar", scalarQuantity);
polyscope::getSurfaceMesh("my mesh")->addFaceVectorQuantity("my_vector", vectorQuantity);

// View the point cloud and mesh we just registered in the 3D UI
polyscope::show();

Python:

import polyscope as ps

# Initialize polyscope
ps.init()

### Register a point cloud
# `my_points` is a Nx3 numpy array
ps.register_point_cloud("my points", my_points)

### Register a mesh
# `verts` is a Nx3 numpy array of vertex positions
# `faces` is a Fx3 array of indices, or a nested list
ps.register_surface_mesh("my mesh", verts, faces, smooth_shade=True)

# Add a scalar function and a vector function defined on the mesh
# vertex_scalar is a length V numpy array of values
# face_vectors is an Fx3 array of vectors per face
ps.get_surface_mesh("my mesh").add_scalar_quantity("my_scalar", 
        vertex_scalar, defined_on='vertices', cmap='blues')
ps.get_surface_mesh("my mesh").add_vector_quantity("my_vector", 
        face_vectors, defined_on='faces', color=(0.2, 0.5, 0.5))

# View the point cloud and mesh we just registered in the 3D UI
ps.show()

Polyscopeは、楽に利用できるよう設計されています。ビルドは簡単で、10行未満のコードで視覚化できます。
C++ではいくつかのテンプレートマジックにより、既に使用しているデータ型をPolyscopeで受け入れることができるでしょう!

関連記事

ポリゴンジオメトリ処理ライブラリ『pmp-library (...

geometry3Sharp:Unity C#で使えるポリゴ...

単純に遊びに行くのはだめなのか?

Netron:機械学習モデルを可視化するツール

ZBrushCoreのTransposeとGizmo 3D

ZBrushでアヴァン・ガメラを作ってみる 頭頂部と首周りを...

Photo Bash:複数の写真を組み合わせて1枚のイラスト...

hloc:SuperGlueで精度を向上させたSfM・Vis...

OpenCVでカメラ画像から自己位置認識 (Visual O...

HTML5・WebGLベースのグラフィックスエンジン『Goo...

COLMAP:オープンソースのSfM・MVSツール

BlenderProc:Blenderで機械学習用の画像デー...

ZBrushでゴジラ2001を作ってみる 姿勢の変更

CycleGAN:ドメイン関係を学習した画像変換

AnacondaとTensorFlowをインストールしてVi...

書籍『データビジュアライゼーションのデザインパターン20』読...

VCG Library:C++のポリゴン操作ライブラリ

ZBrushでアヴァン・ガメラを作ってみる 歯を配置

Composition Rendering:Blenderに...

Math Inspector:科学計算向けビジュアルプログラ...

ZBrushで仮面ライダー3号を造る 仮面編

フリーのUV展開ツール Roadkill UV Tool

3Dモデルを立体視で確認できるVRアプリを作っている

ジュラシック・パークの続編『ジュラシック・ワールド』

ブログの復旧が難航してた話

KelpNet:C#で使える可読性重視のディープラーニングラ...

PyMC:Pythonのベイズ統計ライブラリ

SONY製のニューラルネットワークライブラリ『NNabla』

ZBrushと液晶ペンタブレットでドラゴンをモデリングするチ...

手を動かしながら学ぶデータマイニング

FCN (Fully Convolutional Netwo...

ポリゴン用各種イテレータと関数セット

ZBrushでアヴァン・ガメラを作ってみる 甲羅のバランス調...

ZBrushでアヴァン・ガメラを作ってみる 爪とトゲを追加

pythonの機械学習ライブラリ『scikit-learn』

オープンソースの顔の動作解析ツールキット『OpenFace』

fSpy:1枚の写真からカメラパラメーターを割り出すツール

デザインのリファイン再び

なんかすごいサイト

チャットツール用bot開発フレームワーク『Hubot』

Cartographer:オープンソースのSLAMライブラリ

MB-Lab:Blenderの人体モデリングアドオン

コメント