Skip to main content

PyRXMesh Build wheels PyPI

PyRXMesh brings RXMesh GPU mesh processing to Python. PyRXMesh allows using Python and PyTorch to organize an application, while RXMesh accelerates the mesh processing and automatic differentiation on the GPU.

PyRXMesh provides:

  • triangle meshes built from OBJ files or NumPy arrays
  • vertex, edge, and face attributes on the host and GPU
  • NumPy, SciPy, and PyTorch interoperability
  • dense and sparse matrices and linear solvers
  • small compiled plugins for custom RXMesh CUDA operations
  • differentiable scalar energies that can be interop with PyTorch autograd.

Install

python -m pip install PyRXMesh

PyRXMesh needs an NVIDIA GPU and a driver compatible with the CUDA version in the wheel. PyTorch and SciPy are optional. Install SciPy normally, and choose the CUDA-enabled PyTorch build for your system from the PyTorch installation page.

Visualization is optional and it depends on Polyscope:

python -m pip install "PyRXMesh[viz]"

For a source build, see docs/DEVELOPING.md.

Create a mesh

Initialize RXMesh once, then load a mesh or build one from arrays:

import pyrxmesh as rx

rx.init(0) #0: GPU id

vertices, faces = rx.create_plane(32, 32, dx=0.05)
mesh = rx.RXMeshStatic(vertices, faces)

print(mesh.num_vertices, mesh.num_edges, mesh.num_faces)

velocity = mesh.add_vertex_attribute("velocity", dtype="float32", dim=3)
velocity.reset(0, "device")

RXMeshStatic("mesh.obj") loads an OBJ file. Mesh and attribute arrays use RXMesh linear order by default and maps are available when an application needs input/global order.

See examples/load_and_show.py for mesh inspection and Polyscope visualization, and the tests examples on mesh construction and export and attributes handling.

Automatic differentiation and PyTorch interop

A differentiable plugin defines one or more scalar energy terms as RXMesh CUDA lambdas. We provide a starter plugin/python module which creates an independent project with boilerplate code (pyproject.toml, CMakeLists.txt, etc) needed to compile the CUDA lambda function and build their python bindings:

python -m pyrxmesh.diff_plugin my_energy

The user writes their energy terms in .cu file. Once built, PyRXMesh evaluates its value and gradient on the GPU and exposes the result to PyTorch:

import torch
import my_energy

energy = my_energy.make_energy(mesh, {"weight": 0.5})
x = torch.as_tensor(
    mesh.vertices(), dtype=torch.float32, device="cuda"
).requires_grad_()

loss = energy.torch(x)
loss.backward()

The gradient flows through whatever PyTorch computation produced x. For an optimizer that accepts a value and gradient directly, use energy.value_and_grad() instead of creating an autograd node.

The starter contains the CUDA term, Python package, build files, and run script. See Writing Differentiable Energy Plugins for the complete workflow, including query selection, fixed attributes, row order, and zero-copy input.

Exchange data with Python

Attributes are attached to vertices, edges, or faces. They use SoA layout by default and may have host storage, device storage, or both.

coords = mesh.input_vertex_coordinates()

host_view = coords.to_numpy("host") #Zero-copy numpy view
device_tensor = coords.to_torch("device") #Zero-copy pytorch view 
owned_array = coords.to_numpy_copy(source="host") #deep copy 

Unsuffixed to_* methods return a zero-copy view when supported. Methods ending in _copy return independent storage. Host and device allocations are separate; use attribute.move(source, target) when one side must receive changes from the other.

Mesh ordering maps, face arrays, and the Polyscope edge permutation are available directly from RXMeshStatic. See tests/test_core_mesh.py and tests/test_attributes.py for the supported operations.

Add custom CUDA operations

When an operation cannot be expressed efficiently from Python, generate a small plugin and write only the RXMesh device lambda:

python -m pyrxmesh.plugin my_kernels

The generated package builds against the PyRXMesh installation in the active environment. See Writing Custom CUDA Plugins and examples/custom_kernel_plugin.

Matrices and solvers

PyRXMesh exposes dense matrices, CSR sparse matrices, mesh-derived sparsity patterns, iterative solvers, and optional direct solvers. Dtypes, storage locations, matrix order, and mesh query patterns use short string arguments where they apply.

Documentation

Metadata

Release files for PyRXMesh 0.3.1

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

Source distribution (sdist)

Source distribution for PyRXMesh 0.3.1
File Size Uploaded Provenance Actions
pyrxmesh-0.3.1.tar.gz 138.6 kB With provenance Details for pyrxmesh-0.3.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for PyRXMesh 0.3.1
File Actions
pyrxmesh-0.3.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pyrxmesh-0.3.1-cp312-cp312-win_amd64.whl
pyrxmesh-0.3.1-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for pyrxmesh-0.3.1-cp312-cp312-manylinux_2_28_x86_64.whl
pyrxmesh-0.3.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pyrxmesh-0.3.1-cp311-cp311-win_amd64.whl
pyrxmesh-0.3.1-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for pyrxmesh-0.3.1-cp311-cp311-manylinux_2_28_x86_64.whl
pyrxmesh-0.3.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for pyrxmesh-0.3.1-cp310-cp310-win_amd64.whl
pyrxmesh-0.3.1-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for pyrxmesh-0.3.1-cp310-cp310-manylinux_2_28_x86_64.whl

Total release size: 706.2 MB

Release files / pyrxmesh-0.3.1.tar.gz

Download URL pyrxmesh-0.3.1.tar.gz
Size 138.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aec8ff6b6406c20d81d57feeee0cfa44a3757b9e3cc8c69142acc128443b1f38
BLAKE2b-256 checksum
How to use checksums
f509783a21884e60c03414dd850404ac248635d6ee82350d6f9e7ba37905031c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / pyrxmesh-0.3.1-cp312-cp312-win_amd64.whl

Download URL pyrxmesh-0.3.1-cp312-cp312-win_amd64.whl
Size 135.0 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
9d6040333125e6ed48111834ff9c3e00ce0061a035dee1e717e590a643b90437
BLAKE2b-256 checksum
How to use checksums
f6f21ba0202b3298eb8f446a433e46ff38de8732b2831b0a3cf3d63bd04e2709
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / pyrxmesh-0.3.1-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL pyrxmesh-0.3.1-cp312-cp312-manylinux_2_28_x86_64.whl
Size 100.4 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
20b335151908be0abc5d70fc8d80c8dce09152197c5409d1c7b1e045de2463f8
BLAKE2b-256 checksum
How to use checksums
7eb9ace24dd8201ecc735df069d2088f552432a49282453c6c6176f376063300
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / pyrxmesh-0.3.1-cp311-cp311-win_amd64.whl

Download URL pyrxmesh-0.3.1-cp311-cp311-win_amd64.whl
Size 134.9 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
9ed038e541b2276d3b1d4de02d38e390c3d0f83fa79bf4f9ef42a83c93f148b0
BLAKE2b-256 checksum
How to use checksums
2aec383c32b20e767a487be91408cb9a48827a230884f3065d7e4cd1cb0ac1e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / pyrxmesh-0.3.1-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL pyrxmesh-0.3.1-cp311-cp311-manylinux_2_28_x86_64.whl
Size 100.4 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
eb226eea17e4dffa7702927dafb0ad0e8655fc89df7a75dbdeec81965fdc3699
BLAKE2b-256 checksum
How to use checksums
cc779d2a4c0fa08f221954c2df7589ba4a375d2a45e3edd58849a874653c7be6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / pyrxmesh-0.3.1-cp310-cp310-win_amd64.whl

Download URL pyrxmesh-0.3.1-cp310-cp310-win_amd64.whl
Size 135.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
80b4433ade99a73578fcbfb8c537abb4df90e9a581bcbd222f9026271dc5b26f
BLAKE2b-256 checksum
How to use checksums
d65bb242523ac5c7528ba68e86a2a481a9fefe9b2d1ef5ad1d245278d12dc038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / pyrxmesh-0.3.1-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL pyrxmesh-0.3.1-cp310-cp310-manylinux_2_28_x86_64.whl
Size 100.4 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
aaf34908a0595445b50576745ea87d361ac55cda54dee7813b1370a9212af3d7
BLAKE2b-256 checksum
How to use checksums
c2dd42ac2c53284b09a984b3aed262f89796cba5a5bc908b0bab6b86930cef39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for PyRXMesh 0.3.1

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.

Full provenance

All 7 files in this release have been uploaded with provenance metadata.

Select from 7 files

Attestation for pyrxmesh-0.3.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

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