Skip to main content

Differentiable rasterizer for CAD Boolean operations — JAX-native B-Rep kernel with stratum-aware gradients.

Project description

BRepAX

CI License Python 3.11+

Differentiable rasterizer for CAD Boolean operations.

BRepAX is a JAX-native library that enables gradient-based optimization through B-Rep (Boundary Representation) topology changes. It translates contact dynamics formulations from differentiable physics into the CAD domain, providing stratum-aware differentiation for Boolean operations on geometric primitives.

Installation

pip install brepax

With optional dependencies:

pip install "brepax[viz]"          # Visualization
pip install "brepax[persistence]"  # Persistent homology
pip install "brepax[all]"          # Everything

Quick Start

import jax
import jax.numpy as jnp
from brepax.primitives import Disk

# Create two disks
disk1 = Disk(center=jnp.array([0.0, 0.0]), radius=jnp.array(1.0))
disk2 = Disk(center=jnp.array([1.5, 0.0]), radius=jnp.array(1.0))

# Evaluate SDF -- fully differentiable
query = jnp.array([0.75, 0.0])
sdf_value = disk1.sdf(query)

# Gradients flow through everything
grad_fn = jax.grad(lambda q: disk1.sdf(q))
gradient = grad_fn(query)

Documentation

Full documentation: lv416e.github.io/brepax

License

Apache License 2.0. See LICENSE for details.

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

brepax-0.1.0.tar.gz (211.4 kB view details)

Uploaded Source

Built Distribution

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

brepax-0.1.0-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file brepax-0.1.0.tar.gz.

File metadata

  • Download URL: brepax-0.1.0.tar.gz
  • Upload date:
  • Size: 211.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for brepax-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f8f5f18672a5f30f7dec5af2d2cd4d33395cd3625070385b686ce3110626d376
MD5 7c29db0bf42f8987ffbecd2b856caaee
BLAKE2b-256 93c05e733bc67cc9514370c3c3347ef8ff9d4991f4f4e8b1305f47fd6b318e5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for brepax-0.1.0.tar.gz:

Publisher: publish.yaml on lv416e/brepax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brepax-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: brepax-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 36.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for brepax-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17a541324abc6c2f67fb4b47ebdfa23c5be53ff7e1970c9dbd96e308f9644883
MD5 0b8a3d8f65d6a68801c0ab1abddb0e19
BLAKE2b-256 dc74eba924daaa22017d7d6f00c6f7a7a2f054e9729c12d12dfaabfe07a5483e

See more details on using hashes here.

Provenance

The following attestation bundles were made for brepax-0.1.0-py3-none-any.whl:

Publisher: publish.yaml on lv416e/brepax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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