Skip to main content

Polyscope: A viewer and user interface for 3D data.

Project description

Polyscope's documentation is hosted at polyscope.run

Polyscope

actions status linux actions status macOS actions status windows PyPI

Polyscope is a C++/Python viewer and user interface for 3D data, like meshes and point clouds. Scientists, engineers, artists, and hackers can use Polyscope to prototype algorithms---it is designed to easily integrate with existing codebases and popular libraries. The lofty objective of Polyscope is to offer a useful visual interface to your data via a single line of code.

Polyscope uses a paradigm of structures and quantities. A structure is a geometric object in the scene, such as a surface mesh or point cloud. A quantity is data associated with a structure, such as a scalar function or a vector field.

When any of these structures and quantities are registered, Polyscope displays them in an interactive 3D scene, handling boilerplate concerns such as toggling visibility, color-mapping data and adjusting maps, "picking" to click in the scene and query numerical quantities, etc.

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 is designed to make your life easier. It is simple to build, and fewer than 10 lines of code should be sufficient to start visualizing. In C++, some template magic means Polyscope can probably accept the data types you're already using!


Author: Nicholas Sharp

If Polyscope contributes to an academic publication, cite it as:

@misc{polyscope,
  title = {Polyscope},
  author = {Nicholas Sharp and others},
  note = {www.polyscope.run},
  year = {2019}
}

Development of this software was funded in part by NSF Award 1717320, an NSF graduate research fellowship, and gifts from Adobe Research and Autodesk, Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for polyscope, version 0.1.6
Filename, size File type Python version Upload date Hashes
Filename, size polyscope-0.1.6-cp27-cp27m-macosx_10_9_x86_64.whl (2.0 MB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size polyscope-0.1.6-cp27-cp27m-manylinux2010_i686.whl (2.1 MB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size polyscope-0.1.6-cp27-cp27m-manylinux2010_x86_64.whl (2.1 MB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size polyscope-0.1.6-cp27-cp27mu-manylinux2010_i686.whl (2.1 MB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size polyscope-0.1.6-cp27-cp27mu-manylinux2010_x86_64.whl (2.1 MB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size polyscope-0.1.6-cp27-cp27m-win32.whl (1.6 MB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size polyscope-0.1.6-cp27-cp27m-win_amd64.whl (1.7 MB) File type Wheel Python version cp27 Upload date Hashes View
Filename, size polyscope-0.1.6-cp35-cp35m-macosx_10_9_x86_64.whl (2.0 MB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size polyscope-0.1.6-cp35-cp35m-manylinux2010_i686.whl (2.1 MB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size polyscope-0.1.6-cp35-cp35m-manylinux2010_x86_64.whl (2.1 MB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size polyscope-0.1.6-cp35-cp35m-win32.whl (1.6 MB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size polyscope-0.1.6-cp35-cp35m-win_amd64.whl (1.7 MB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size polyscope-0.1.6-cp36-cp36m-macosx_10_9_x86_64.whl (2.0 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size polyscope-0.1.6-cp36-cp36m-manylinux2010_i686.whl (2.1 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size polyscope-0.1.6-cp36-cp36m-manylinux2010_x86_64.whl (2.1 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size polyscope-0.1.6-cp36-cp36m-win32.whl (1.6 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size polyscope-0.1.6-cp36-cp36m-win_amd64.whl (1.7 MB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size polyscope-0.1.6-cp37-cp37m-macosx_10_9_x86_64.whl (2.0 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size polyscope-0.1.6-cp37-cp37m-manylinux2010_i686.whl (2.1 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size polyscope-0.1.6-cp37-cp37m-manylinux2010_x86_64.whl (2.1 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size polyscope-0.1.6-cp37-cp37m-win32.whl (1.6 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size polyscope-0.1.6-cp37-cp37m-win_amd64.whl (1.7 MB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size polyscope-0.1.6-cp38-cp38-macosx_10_9_x86_64.whl (2.0 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size polyscope-0.1.6-cp38-cp38-manylinux2010_i686.whl (2.1 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size polyscope-0.1.6-cp38-cp38-manylinux2010_x86_64.whl (2.1 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size polyscope-0.1.6-cp38-cp38-win32.whl (1.6 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size polyscope-0.1.6-cp38-cp38-win_amd64.whl (1.7 MB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size polyscope-0.1.6-cp39-cp39-macosx_10_9_x86_64.whl (2.0 MB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size polyscope-0.1.6-cp39-cp39-manylinux2010_i686.whl (2.1 MB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size polyscope-0.1.6-cp39-cp39-manylinux2010_x86_64.whl (2.1 MB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size polyscope-0.1.6-cp39-cp39-win32.whl (1.6 MB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size polyscope-0.1.6-cp39-cp39-win_amd64.whl (1.7 MB) File type Wheel Python version cp39 Upload date Hashes View
Filename, size polyscope-0.1.6.tar.gz (6.9 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page