Skip to main content

Python library for computing Average Outward Flux (AOF).

Project description

PyAOF

PyPI Python License Tests

PyAOF is a Python library for computing Average Outward Flux (AOF) on 3D meshes using NVIDIA Warp.


Features

  • Compute Average Outward Flux (AOF) volumes
  • Efficient tiled computation for large volumes
  • Optional 3D visualization with Polyscope and Matplotlib

Installation

Basic Installation

pip install pyaof

Installation with Visualization Support

If you want to run the visualization examples that render 3D meshes and point clouds (requires matplotlib and polyscope):

pip install "pyaof[viz]"

Developer Installation

If you are contributing to the project or want to run the local test suite and coverage tools, install the test dependencies:

pip install "pyaof[test]"

Install Everything

To install all optional dependencies at once:

pip install "pyaof[all]"

Quick Start

import vtk
from pyaof import compute_aof, compute_sdf

# 1. Load mesh
reader = vtk.vtkOBJReader()
reader.SetFileName("data/cuboid.obj")
reader.Update()
mesh = reader.GetOutput()

# 2. Compute Signed Distance Field (SDF)
sdf, normalized_mesh, mesh_vertices, spacing = compute_sdf(
    mesh,
    resolution=1000,
    normalize=True
)

# 3. Compute Average Outward Flux (AOF)
aof_vol = compute_aof(
    sdf,
    tile_size=1024
)

Examples

The examples/ directory contains full usage demonstrations, including:

  • Mesh loading and preprocessing
  • SDF generation
  • AOF computation
  • 3D visualization using Polyscope

Run an example:

python examples/demo_polyscope.py

Cuboid Demo


Requirements

  • Python 3.12+
  • NumPy
  • VTK
  • SciPy

Optional visualization dependencies:

  • Matplotlib
  • Polyscope

License

MIT License


Citation

If you use PyAOF in academic work, please cite the repository and related publications.

Project details


Download files

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

Source Distribution

pyaof-0.1.2.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyaof-0.1.2-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file pyaof-0.1.2.tar.gz.

File metadata

  • Download URL: pyaof-0.1.2.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for pyaof-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4944794d651f61196f1a2ea331ea1737fec49587a01338a42dea89d6ed07f69c
MD5 705198b8e3cae41167b2edffb66fbcdf
BLAKE2b-256 c06e79331625b1144a6248b9e9c93010d655f8fe2d70c4461228a051544f33e5

See more details on using hashes here.

File details

Details for the file pyaof-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pyaof-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for pyaof-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c9c34c9a978d21535d744551a15d0af183625c971068b6b433d634a5b5b1687
MD5 6138e49844d5d25d4ca71d6da38017cf
BLAKE2b-256 49a8d7b6bd6146589fb0b1f80baad85328c16356ed10dfce6d53866b3c42414e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page