Skip to main content

Visualize meshes, point clouds, and other geometry in a Jupyter Notebook

Project description


A Python library for visualizing meshes, point clouds, and other geometry in Jupyter notebooks


pip install threevis


Quick Mesh Inspection

import threevis
import openmesh as om

m = om.read_trimesh('examples/models/bunny.obj')


Custom Rendering

import threevis
import openmesh as om
import numpy as np

# Load Mesh
m = om.read_trimesh('mouse.obj')

# Create Context
ctx = threevis.Context(width=640, height=480)

# Get vertices and faces from the mesh
vertices = m.points()
faces = m.face_vertex_indices()

# We don't have normals, calculate them
normals = threevis.calculateFaceNormals(m.points(), m.face_vertex_indices())

# Choose a random color for each face
colors = threevis.FaceAttribute(np.random.rand(len(faces), 3))

# Draw the mesh with flat shading
ctx.draw_faces(vertices, faces, 
               normals = normals,
               colors = colors,
               shading = 'flat')

# Draw edges on top with random colors
ctx.draw_edges(vertices, m.ev_indices(), 
               colors = threevis.FaceAttribute(np.random.rand(len(m.ev_indices()), 3)),

# Calculate data to display normals as edges
normal_vis_verts, normal_vis_edges = threevis.calculateNormalEdges(vertices, faces, normals, length=0.05)

# Draw the normals in
ctx.draw_edges(normal_vis_verts, normal_vis_edges, colors = colors)

# Draw a point for each vertex
ctx.draw_vertices(vertices, point_size=4, colors='red')

# Finally display it

Development Setup

  • Install dependencies
  • Clone the repository
  • pip install -e .



Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
threevis-0.1.0.post25-py2.py3-none-any.whl (11.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3
threevis-0.1.0.post25.tar.gz (506.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page