Analytical Ground Truth¶
Closed-form solutions for validation and benchmarking.
brepax.analytical
¶
Closed-form analytical solutions for ground-truth validation.
disk_disk
¶
Closed-form solutions for two-disk Boolean operations.
Provides analytically differentiable union area, stratum classification, and boundary distance for pairs of 2D disks. Used as ground truth for validating numerical gradient methods.
disk_disk_boundary_distance(c1, r1, c2, r2)
¶
Distance from current configuration to the nearest stratum boundary.
Measures the minimum of distance to external tangency (d = r1 + r2) and internal tangency (d = |r1 - r2|).
Source code in src/brepax/analytical/disk_disk.py
disk_disk_stratum_label(c1, r1, c2, r2)
¶
Classify the topological stratum of a two-disk configuration.
Returns:
| Type | Description |
|---|---|
Integer[Array, '']
|
Integer-valued scalar: 0 = disjoint, 1 = intersecting, 2 = contained. |
Source code in src/brepax/analytical/disk_disk.py
disk_disk_union_area(c1, r1, c2, r2)
¶
Compute the union area of two disks analytically.
Uses the standard two-circle intersection area formula: A_union = A_1 + A_2 - A_intersection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c1
|
Float[Array, 2]
|
Center of disk 1. |
required |
r1
|
Float[Array, '']
|
Radius of disk 1. |
required |
c2
|
Float[Array, 2]
|
Center of disk 2. |
required |
r2
|
Float[Array, '']
|
Radius of disk 2. |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, '']
|
Union area as a scalar. |
Source code in src/brepax/analytical/disk_disk.py
sphere_sphere
¶
Closed-form solutions for two-sphere Boolean operations.
Provides analytically differentiable union volume, stratum classification, and boundary distance for pairs of 3D spheres. Extends the two-disk pattern to three dimensions.
sphere_sphere_boundary_distance(c1, r1, c2, r2)
¶
Distance from current configuration to the nearest stratum boundary.
Measures the minimum of distance to external tangency (d = r1 + r2) and internal tangency (d = |r1 - r2|).
Source code in src/brepax/analytical/sphere_sphere.py
sphere_sphere_stratum_label(c1, r1, c2, r2)
¶
Classify the topological stratum of a two-sphere configuration.
Returns:
| Type | Description |
|---|---|
Integer[Array, '']
|
Integer-valued scalar: 0 = disjoint, 1 = intersecting, 2 = contained. |
Source code in src/brepax/analytical/sphere_sphere.py
sphere_sphere_union_volume(c1, r1, c2, r2)
¶
Compute the union volume of two spheres analytically.
Uses the spherical cap intersection formula: V_union = V_1 + V_2 - V_intersection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
c1
|
Float[Array, 3]
|
Center of sphere 1. |
required |
r1
|
Float[Array, '']
|
Radius of sphere 1. |
required |
c2
|
Float[Array, 3]
|
Center of sphere 2. |
required |
r2
|
Float[Array, '']
|
Radius of sphere 2. |
required |
Returns:
| Type | Description |
|---|---|
Float[Array, '']
|
Union volume as a scalar. |