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)

Roadmap

BRepAX is under active development. Current capabilities:

  • Primitives: 8 geometric types with differentiable SDF interface
  • Boolean operations: Union, subtract, intersect with stratum-dispatched gradients
  • STEP I/O: Read STEP files, extract metadata, convert faces to primitives
  • Visualization: 3D tessellated shape rendering
  • Applications: Mold direction optimization demonstrator

Planned modules (not yet implemented):

  • persistence/ — Persistent homology integration
  • topology/ — Half-edge mesh representation

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.2.0.tar.gz (249.8 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.2.0-py3-none-any.whl (45.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for brepax-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e7977aefbbfe40849fb4cb93be4e12dcf66f00a813822edf70e2ed9c5040a5fe
MD5 7b749446a66f8387f185718931b23749
BLAKE2b-256 38f84132fb0cb85bdf7fbb82860a0b3dee571d7259f09d271d63f7710fd8b286

See more details on using hashes here.

Provenance

The following attestation bundles were made for brepax-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: brepax-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 45.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5cfb0c0ae43363a462ace43ab577db59eb8af24057cff089dc001b92a3c50f7
MD5 84748902bba7b4d27a1551017137d917
BLAKE2b-256 fcbe1c085d0b3e89623917319732ca56f9986aa29a089493b1a085fa72efb607

See more details on using hashes here.

Provenance

The following attestation bundles were made for brepax-0.2.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