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で受け入れることができるでしょう!


スポンサーリンク

関連記事

Subsurface scatteringの動画
ZBrush4新機能ハイライト 3DCG CAMP 2010
Accord.NET Framework:C#で使える機械学習ライブラリ
3分の動画でプログラミングを学習できるサイト『ドットインストール』
天体写真の3D動画
Super Resolution:OpenCVの超解像処理モジュール
Raytracing Wiki
読みやすくて高速なディープラーニングのフレームワーク『Caffe』
ジュラシック・パークの続編『ジュラシック・ワールド』
Live CV:インタラクティブにComputer Visionコーディングができるツール
OpenGVのライブラリ構成
Twitter APIのPythonラッパー『python-twitter』
ドットインストールのWordPress入門レッスン
ラクガキの立体化 3Dプリント注文
MFnMeshクラスのsplit関数
フォトンの放射から格納までを可視化した動画
ZBrushで仮面ライダー3号を造る 仮面編 ZRemesher
スターウォーズ エピソードVIIの予告編
UnityでShaderの入力パラメータとして行列を渡す
無料で使える人体3DCG作成ツール
Open3D:3Dデータ処理ライブラリ
Google Chromecast
Raspberry Pi 2のGPIOピン配置
ブラウザ操作自動化ツール『Selenium』を試す
フィーリングに基づくタマムシの質感表現
ZBrushでアヴァン・ガメラを作ってみる 頭頂部の作り込み・舌の追加
為替レートの読み方 2WAYプライス表示
ブログが1日ダウンしてました
ZBrushで仮面ライダー3号を造る 仮面編 リファレンス画像の表示
立体視を試してみた
Amazon Web ServicesでWordPress
フィクションに登場するUIデザインのまとめサイト
ちょっと凝り過ぎなWebキャンペーン:全日本バーベイタム選手権 (MITSUBISHI KAGAKU...
ZBrushでアヴァン・ガメラを作ってみる 爪とトゲを追加
WordPress on Google App Engineを1週間運用してみて
白組による『シン・ゴジラ』CGメイキング映像が公開された!
AmazonEC2のインスタンスをt1.microからt2.microへ移行する
第1回 3D勉強会@関東『SLAMチュートリアル大会』
ポリ男からMetaHumanを作る
書籍『ゼロから作るDeep Learning』で自分なりに学ぶ
ブログのデザイン変えました
中学3年生が制作した短編映像作品『2045』

コメント