Skip to main content

threevis # threevis pipeline status

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

Installation

pip install threevis

Examples

Quick Mesh Inspection

import threevis
import openmesh as om

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

threevis.display_openmesh(m)

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)),
               linewidth=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
ctx.display()
mouse

mouse

Development Setup

  • Install dependencies

  • Clone the repository

  • pip install -e .

Dependencies

Optional

Metadata

Release files for threevis 0.1.0.post11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for threevis 0.1.0.post11
File Interpreter ABI Platform
threevis-0.1.0.post11-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / threevis-0.1.0.post11-py2.py3-none-any.whl

Download URL threevis-0.1.0.post11-py2.py3-none-any.whl
Size 11.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8837ed799ecc46ca2e6aa864fde36ddb8fc33257baf2b68b3cf187e92f1af065
BLAKE2b-256 checksum
How to use checksums
03050e87c664bdd69d385111e236ab21a859ab569443b831e921229f7cbdbd6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for threevis 0.1.0.post11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page