Generators¶
The voids.generators sub-package provides functions to create synthetic and
mesh-based pore networks for controlled experiments and validation.
Network Generators¶
voids.generators.network
¶
sample_depth
¶
Infer slab thickness for quasi-2D network models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
Network whose sample geometry is inspected. |
required |
Returns:
| Type | Description |
|---|---|
float
|
Effective depth (thickness) used to convert 2D areas to volumes. |
Notes
If sample.lengths['z'] exists, it is used directly. Otherwise depth is
inferred from
depth = bulk_volume / (Lx * Ly).
This inference assumes orthogonal sample axes and consistent sample metadata.
Source code in src/voids/generators/network.py
update_network_geometry_from_radii
¶
update_network_geometry_from_radii(
net,
*,
pore_radius,
throat_radius,
shape_factor=DEFAULT_G_REF,
pore_length_fraction=0.45,
min_core_fraction=0.05,
)
Recompute 3D pore/throat geometric fields from prescribed radii.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
Target network to update in place. |
required |
pore_radius
|
ndarray
|
Pore inscribed radii, shape |
required |
throat_radius
|
ndarray
|
Throat inscribed radii, shape |
required |
shape_factor
|
float
|
Shape factor assigned uniformly to pores and throats. For circular
conduits, the common value is |
DEFAULT_G_REF
|
pore_length_fraction
|
float
|
Fraction of center-to-center throat length used as an upper bound for each pore-body contribution. |
0.45
|
min_core_fraction
|
float
|
Lower bound for throat core length as fraction of direct length. |
0.05
|
Returns:
| Type | Description |
|---|---|
None
|
The network is modified in place. |
Notes
Geometry model:
- A = pi r^2
- P = 2 pi r
- pore volume V_p = (4/3) pi r^3
- throat core volume V_t = A_t * L_core
Here L_core is computed from center distance minus pore-body lengths and
clipped by min_core_fraction.
Scientific caveat
This is a synthetic geometric closure used for controlled studies; it is not a direct pore-space reconstruction from imaging.
Source code in src/voids/generators/network.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | |
update_network_geometry_2d
¶
update_network_geometry_2d(
net,
*,
pore_radius,
throat_radius,
depth=None,
shape_factor=DEFAULT_G_REF,
pore_length_fraction=0.45,
min_core_fraction=0.05,
)
Recompute geometry fields for 2D slab-like network models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
Target network modified in place. |
required |
pore_radius
|
ndarray
|
Pore radii, shape |
required |
throat_radius
|
ndarray
|
Throat radii, shape |
required |
depth
|
float | None
|
Slab thickness. If omitted, inferred via :func: |
None
|
shape_factor
|
float
|
Same geometric controls as :func: |
DEFAULT_G_REF
|
pore_length_fraction
|
float
|
Same geometric controls as :func: |
DEFAULT_G_REF
|
min_core_fraction
|
float
|
Same geometric controls as :func: |
DEFAULT_G_REF
|
Returns:
| Type | Description |
|---|---|
None
|
The network is updated in place. |
Notes
In quasi-2D mode, pore volume is approximated as V_p = A_p * depth with
A_p = pi r^2. Throat volume uses the same A_t * L_core model used in
the 3D helper.
Source code in src/voids/generators/network.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |
insert_vug_superpore
¶
insert_vug_superpore(
net,
*,
radii_xyz,
center=None,
shape_factor=DEFAULT_G_REF,
connector_neighbor_weight=0.35,
connector_vug_weight=0.1,
connector_min_scale=1.1,
connector_max_scale=2.8,
pore_length_fraction=0.4,
pore_length_radius_scale=0.8,
min_core_fraction=0.02,
)
Insert one 3D vug as a super-pore replacing an ellipsoidal region.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
Source network. |
required |
radii_xyz
|
tuple[float, float, float]
|
Semi-axes of the ellipsoidal replacement region. |
required |
center
|
ndarray | tuple[float, float, float] | None
|
Optional vug center coordinate. Defaults to bounding-box center. |
None
|
shape_factor
|
float
|
Shape factor assigned to inserted pore/throats. |
DEFAULT_G_REF
|
connector_neighbor_weight
|
float
|
Linear weights used to estimate connector throat radii from neighboring pore radii and vug inscribed radius. |
0.35
|
connector_vug_weight
|
float
|
Linear weights used to estimate connector throat radii from neighboring pore radii and vug inscribed radius. |
0.35
|
connector_min_scale
|
float
|
Lower/upper clipping multipliers against median existing throat radius. |
1.1
|
connector_max_scale
|
float
|
Lower/upper clipping multipliers against median existing throat radius. |
1.1
|
pore_length_fraction
|
float
|
Controls for partitioning connector throat length into pore-side and core contributions. |
0.4
|
pore_length_radius_scale
|
float
|
Controls for partitioning connector throat length into pore-side and core contributions. |
0.4
|
min_core_fraction
|
float
|
Controls for partitioning connector throat length into pore-side and core contributions. |
0.4
|
Returns:
| Type | Description |
|---|---|
tuple[Network, dict[str, object]]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If radii or controls are invalid. |
RuntimeError
|
If the selected region yields no usable interface connections. |
KeyError
|
If required pore radius fields are absent. |
Algorithm summary
- Identify pores inside an ellipsoid.
- Build induced subnetwork excluding those pores.
- Add one new vug pore at
center. - Connect vug pore to boundary neighbors of removed region.
- Rebuild/extend geometry fields and labels.
Scientific caveat
The connector geometry is a heuristic closure model. It preserves topological continuity and plausible scale relations, but is not a unique physical derivation from first principles or direct imaging.
Source code in src/voids/generators/network.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 | |
insert_vug_superpore_2d
¶
insert_vug_superpore_2d(
net,
*,
radii_xy,
center_xy=None,
depth=None,
shape_factor=DEFAULT_G_REF,
connector_neighbor_weight=0.4,
connector_vug_weight=0.12,
connector_min_scale=1.05,
connector_max_scale=3.0,
pore_length_fraction=0.42,
pore_length_radius_scale=0.85,
min_core_fraction=0.02,
)
Insert one 2D vug as a super-pore replacing an elliptical region.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
Source network (typically quasi-2D mesh network). |
required |
radii_xy
|
tuple[float, float]
|
Semi-axes of the elliptical replacement region in the XY plane. |
required |
center_xy
|
tuple[float, float] | None
|
Optional XY center. Defaults to XY bounding-box center. |
None
|
depth
|
float | None
|
Optional slab thickness; inferred from sample metadata when omitted. |
None
|
shape_factor
|
float
|
Shape factor assigned to inserted pore/throats. |
DEFAULT_G_REF
|
connector_neighbor_weight
|
float
|
Weights used to estimate connector throat radii. |
0.4
|
connector_vug_weight
|
float
|
Weights used to estimate connector throat radii. |
0.4
|
connector_min_scale
|
float
|
Connector radius clipping multipliers against median throat radius. |
1.05
|
connector_max_scale
|
float
|
Connector radius clipping multipliers against median throat radius. |
1.05
|
pore_length_fraction
|
float
|
Controls for connector throat length partitioning. |
0.42
|
pore_length_radius_scale
|
float
|
Controls for connector throat length partitioning. |
0.42
|
min_core_fraction
|
float
|
Controls for connector throat length partitioning. |
0.42
|
Returns:
| Type | Description |
|---|---|
tuple[Network, dict[str, object]]
|
Updated network and diagnostic metadata. |
Notes
The inserted 2D vug pore uses:
- equivalent radius from area matching,
- pore volume pi * rx * ry * depth,
- connector geometry from the same heuristic strategy used in 3D.
Source code in src/voids/generators/network.py
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 | |
Porous Image Generators¶
voids.generators.porous_image
¶
generate_spanning_blobs_matrix
¶
Generate a percolating porous matrix using PoreSpy's blobs model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
Sequence[int]
|
Image shape in voxels. Supports 2D and 3D. |
required |
porosity
|
float
|
Target void fraction passed to |
required |
blobiness
|
float
|
Correlation-length control used by PoreSpy; larger values generally produce smoother/larger features. |
required |
axis_index
|
int
|
Axis used for percolation (spanning) acceptance. |
required |
seed_start
|
int
|
Initial random seed. Subsequent attempts use |
required |
max_tries
|
int
|
Maximum number of seeds to test. |
required |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, int]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If input controls are outside valid ranges. |
RuntimeError
|
If no percolating realization is found in |
Scientific interpretation
The acceptance criterion is topological percolation only. It ensures a connected pathway exists, but does not guarantee a target hydraulic conductance or morphological realism for specific rock classes.
Source code in src/voids/generators/porous_image.py
generate_connected_matrix
¶
generate_connected_matrix(
*,
shape,
porosity,
blobiness,
axis_index,
seed_start,
max_tries,
show_progress=False,
progress_desc=None,
)
Backward-compatible wrapper for notebook 08 API signatures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
tuple[int, int, int]
|
Same physical meaning as :func: |
required |
porosity
|
tuple[int, int, int]
|
Same physical meaning as :func: |
required |
blobiness
|
tuple[int, int, int]
|
Same physical meaning as :func: |
required |
axis_index
|
tuple[int, int, int]
|
Same physical meaning as :func: |
required |
seed_start
|
tuple[int, int, int]
|
Same physical meaning as :func: |
required |
max_tries
|
tuple[int, int, int]
|
Same physical meaning as :func: |
required |
show_progress
|
bool
|
Retained for compatibility with notebook code. Currently ignored by the packaged implementation. |
False
|
progress_desc
|
bool
|
Retained for compatibility with notebook code. Currently ignored by the packaged implementation. |
False
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, int]
|
Same as :func: |
Notes
This wrapper exists to reduce migration cost for notebook scripts while preserving deterministic behavior in the core implementation.
Source code in src/voids/generators/porous_image.py
estimate_voronoi_ncells_for_porosity_2d
¶
estimate_voronoi_ncells_for_porosity_2d(
shape,
porosity,
*,
intercept=0.08,
slope=0.000322,
reference_shape=(180, 180),
min_ncells=40,
)
Estimate Voronoi-cell count needed for a target 2D void fraction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
tuple[int, int]
|
Output image shape |
required |
porosity
|
float
|
Target void porosity in |
required |
intercept
|
float
|
Empirical linear model coefficients for
|
0.08
|
slope
|
float
|
Empirical linear model coefficients for
|
0.08
|
reference_shape
|
tuple[int, int]
|
Calibration image shape for the linear model. |
(180, 180)
|
min_ncells
|
int
|
Lower bound applied to the returned estimate. |
40
|
Returns:
| Type | Description |
|---|---|
int
|
Estimated |
Notes
The default calibration was measured in notebook 09 for
reference_shape=(180, 180) and r=0 with void = ~voronoi_edges.
Assumptions and caveats
The relation is empirical, not universal. Different resolutions, filtering, or post-processing can shift the mapping significantly.
Source code in src/voids/generators/porous_image.py
generate_spanning_voronoi_matrix_2d
¶
generate_spanning_voronoi_matrix_2d(
*,
shape,
porosity,
axis_index,
seed_start,
max_tries,
edge_radius_vox=0,
target_tol=0.003,
ncells_step=10,
search_half_window=70,
min_ncells=40,
)
Generate a percolating 2D matrix from Voronoi-edge microstructures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
tuple[int, int]
|
Output image shape |
required |
porosity
|
float
|
Target void porosity. |
required |
axis_index
|
int
|
Axis used for percolation acceptance. |
required |
seed_start
|
int
|
Seed-search controls. |
required |
max_tries
|
int
|
Seed-search controls. |
required |
edge_radius_vox
|
int
|
Edge thickening radius passed to |
0
|
target_tol
|
float
|
Relative acceptance tolerance on porosity mismatch. |
0.003
|
ncells_step
|
int
|
Search controls around the estimated |
10
|
search_half_window
|
int
|
Search controls around the estimated |
10
|
min_ncells
|
int
|
Lower bound for candidate |
40
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, int]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If controls are invalid. |
RuntimeError
|
If no spanning realization is found. |
Scientific interpretation
The generator targets low-porosity, edge-dominated connectivity. This is useful for sensitivity studies but remains a synthetic morphology model, not a physically faithful reconstruction of any specific rock sample.
Source code in src/voids/generators/porous_image.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | |
generate_spanning_matrix_2d
¶
generate_spanning_matrix_2d(
*,
shape,
porosity,
axis_index,
generator_name,
seed_start,
max_tries,
blobs_blobiness=1.8,
blobs_fallback_porosity_levels=(),
voronoi_edge_radius_vox=0,
voronoi_target_tol=0.003,
voronoi_ncells_step=10,
voronoi_search_half_window=70,
voronoi_min_ncells=40,
)
Dispatch 2D matrix generation across supported synthetic families.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
tuple[int, int]
|
Base generation/percolation controls. |
required |
porosity
|
tuple[int, int]
|
Base generation/percolation controls. |
required |
axis_index
|
tuple[int, int]
|
Base generation/percolation controls. |
required |
seed_start
|
tuple[int, int]
|
Base generation/percolation controls. |
required |
max_tries
|
tuple[int, int]
|
Base generation/percolation controls. |
required |
generator_name
|
str
|
Generator family selector: |
required |
blobs_blobiness
|
float
|
Controls for |
1.8
|
blobs_fallback_porosity_levels
|
float
|
Controls for |
1.8
|
voronoi_edge_radius_vox
|
int
|
Edge-thickening radius for Voronoi mode. |
0
|
voronoi_target_tol
|
float
|
Porosity mismatch tolerance for Voronoi mode. |
0.003
|
voronoi_ncells_step
|
int
|
Candidate-search controls for Voronoi mode. |
10
|
voronoi_search_half_window
|
int
|
Candidate-search controls for Voronoi mode. |
10
|
voronoi_min_ncells
|
int
|
Candidate-search controls for Voronoi mode. |
10
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, int, float]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
RuntimeError
|
If a spanning realization cannot be found. |
Source code in src/voids/generators/porous_image.py
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
generate_connected_matrix_2d
¶
generate_connected_matrix_2d(
*,
shape,
porosity,
axis_index,
generator_name,
seed_start,
max_tries,
show_progress=False,
progress_desc=None,
)
Backward-compatible wrapper for notebook 09 matrix API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
tuple[int, int]
|
Same as :func: |
required |
porosity
|
tuple[int, int]
|
Same as :func: |
required |
axis_index
|
tuple[int, int]
|
Same as :func: |
required |
generator_name
|
tuple[int, int]
|
Same as :func: |
required |
seed_start
|
tuple[int, int]
|
Same as :func: |
required |
max_tries
|
tuple[int, int]
|
Same as :func: |
required |
show_progress
|
bool
|
Retained for compatibility. Currently ignored. |
False
|
progress_desc
|
bool
|
Retained for compatibility. Currently ignored. |
False
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, int, float]
|
Same as :func: |
Source code in src/voids/generators/porous_image.py
insert_ellipsoidal_vug
¶
Insert an axis-aligned ellipsoidal vug into a 3D binary void image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matrix_void
|
ndarray
|
Input 3D boolean array where |
required |
radii_vox
|
tuple[int, int, int]
|
Ellipsoid semi-axes |
required |
center
|
tuple[int, int, int] | None
|
Ellipsoid center index. Defaults to the image center. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If dimensionality or radii are invalid. |
Notes
The operation is a boolean union: pre-existing void voxels remain void.
Source code in src/voids/generators/porous_image.py
insert_spherical_vug
¶
Insert a spherical vug into a 3D void image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matrix_void
|
ndarray
|
Input 3D binary void mask. |
required |
radius_vox
|
int
|
Sphere radius in voxels. |
required |
center
|
tuple[int, int, int] | None
|
Optional center index. Defaults to image center. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
Updated void image and spherical support mask. |
Source code in src/voids/generators/porous_image.py
insert_elliptical_vug_2d
¶
Insert an axis-aligned elliptical vug into a 2D binary void image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matrix_void
|
ndarray
|
Input 2D boolean array where |
required |
radii_vox
|
tuple[int, int]
|
Ellipse semi-axes |
required |
center
|
tuple[int, int] | None
|
Optional center index. Defaults to image center. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
Updated void image and ellipse mask. |
Source code in src/voids/generators/porous_image.py
insert_circular_vug_2d
¶
Insert a circular vug into a 2D binary void image.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
matrix_void
|
ndarray
|
Input 2D void mask. |
required |
radius_vox
|
int
|
Circle radius in voxels. |
required |
center
|
tuple[int, int] | None
|
Optional center index. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
Updated image and inserted circular mask. |
Source code in src/voids/generators/porous_image.py
make_synthetic_grayscale
¶
make_synthetic_grayscale(
binary_void,
*,
seed,
void_mean=65.0,
solid_mean=185.0,
noise_std=8.0,
clip_min=0.0,
clip_max=255.0,
)
Generate synthetic grayscale contrast from binary void/solid phases.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
binary_void
|
ndarray
|
2D or 3D binary mask where |
required |
seed
|
int
|
Seed for reproducible random noise. |
required |
void_mean
|
float
|
Mean gray levels assigned to void and solid phases before noise. |
65.0
|
solid_mean
|
float
|
Mean gray levels assigned to void and solid phases before noise. |
65.0
|
noise_std
|
float
|
Standard deviation of additive Gaussian noise. |
8.0
|
clip_min
|
float
|
Output clipping range. |
0.0
|
clip_max
|
float
|
Output clipping range. |
0.0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Floating-point grayscale image with same shape as |
Scientific interpretation
This is a synthetic observation model useful for controlled algorithm benchmarking. It does not represent scanner-specific physics (beam hardening, ring artifacts, partial-volume effects, etc.).
Source code in src/voids/generators/porous_image.py
make_synthetic_grayscale_2d
¶
make_synthetic_grayscale_2d(
binary_void,
seed,
*,
void_mean=70.0,
solid_mean=185.0,
noise_std=8.0,
clip_min=0.0,
clip_max=255.0,
)
Backward-compatible 2D wrapper around :func:make_synthetic_grayscale.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
binary_void
|
ndarray
|
2D binary void mask. |
required |
seed
|
int
|
Random seed for noise realization. |
required |
void_mean
|
float
|
Same meaning as in :func: |
70.0
|
solid_mean
|
float
|
Same meaning as in :func: |
70.0
|
noise_std
|
float
|
Same meaning as in :func: |
70.0
|
clip_min
|
float
|
Same meaning as in :func: |
70.0
|
clip_max
|
float
|
Same meaning as in :func: |
70.0
|
Returns:
| Type | Description |
|---|---|
ndarray
|
2D floating-point grayscale image. |
Source code in src/voids/generators/porous_image.py
Vug Templates¶
voids.generators.vug_templates
¶
format_radius_token
¶
equivalent_radius_2d
¶
Return the area-equivalent circular radius for an ellipse.
Source code in src/voids/generators/vug_templates.py
equivalent_radius_3d
¶
Return the volume-equivalent spherical radius for an ellipsoid.
Source code in src/voids/generators/vug_templates.py
match_ellipse_to_circle
¶
Match integer ellipse radii (a, b) to circular area r^2.
The optimization prioritizes area error and then aspect-ratio error.
Source code in src/voids/generators/vug_templates.py
match_ellipsoid_to_sphere
¶
Match integer ellipsoid radii (a, b, b) to spherical volume r^3.
The optimization prioritizes volume error and then aspect-ratio error.
Source code in src/voids/generators/vug_templates.py
build_image_vug_radii_2d
¶
Build area-matched 2D anisotropic radii from circular base radii.
Returns:
| Type | Description |
|---|---|
tuple
|
|
Source code in src/voids/generators/vug_templates.py
build_image_vug_radii_3d
¶
Build volume-matched 3D anisotropic radii from spherical base radii.
Returns:
| Type | Description |
|---|---|
tuple
|
|
Source code in src/voids/generators/vug_templates.py
build_lattice_vug_templates_2d
¶
Build 2D lattice vug templates with matched equivalent radius per config.
Returns:
| Type | Description |
|---|---|
tuple
|
|
Source code in src/voids/generators/vug_templates.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | |
build_lattice_vug_templates_3d
¶
Build 3D lattice vug templates with matched equivalent radius per config.
Returns:
| Type | Description |
|---|---|
tuple
|
|
Source code in src/voids/generators/vug_templates.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |