Skip to main content

RBFMeshGen

2D point clouds from parametric boundaries.

Random · Halton · Sobol   |   Python ≥ 3.9   |   MIT License

Define a domain, choose a sampler, and generate points with labeled boundaries—including holes, overlapping regions, and internal interfaces.

Random, Halton, and Sobol sampling on the same domain

Quick start · Sampling · Examples · Development

Quick start

Install the published release from PyPI:

pip install RBFMeshGen

Random, Halton, and Sobol are included in the standard installation. For an editable development installation, clone the repository and run:

py -3.13 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e .

Use any installed Python ≥ 3.9. On Linux/macOS, activate the environment with source .venv/bin/activate.

Create a circular domain with a hole:

import numpy as np
from RBFMeshGen import Border, RBFMesh, plot_mesh

outer = Border(lambda t: (np.cos(t), np.sin(t)),
               label="outer", t_start=0, t_end=2 * np.pi)
hole = Border(lambda t: (0.35 * np.cos(t), 0.35 * np.sin(t)),
              label="hole", t_start=0, t_end=2 * np.pi)

mesh = RBFMesh(outer(160), hole(-80))
mesh.generate_points(10000, method="halton", seed=42)
plot_mesh(mesh)

160 outer + 80 hole boundary points, plus 10,000 interior points.

Sampling

method Sampler Dependency
"random" Pseudorandom; default Base install
"halton" Scrambled Halton sequence Standard install
"sobol" Scrambled Sobol sequence Standard install
mesh.generate_points(10000, method="sobol", seed=42, append=False)
  • Exact counts: interior points are allocated by region area; boundary points are counted separately.
  • Repeatable results: use the same seed and environment. Calls append by default; append=False replaces interior points and avoids duplicates when reusing a seed.
  • Preserved boundaries: switching samplers keeps border counts and labels, including internal interfaces. Samples removed by holes are excluded.

These methods generate point clouds without enforcing minimum spacing. Clipping Sobol to a domain does not preserve its full power-of-two balance properties. See the SciPy docs for Halton and Sobol.

Boundaries & data

border(n) sets abs(n) segments; a negative count reverses traversal. Counterclockwise contours add regions; clockwise contours define holes. Contours must close within abs_tol (default 1e-4). Invalid or undersampled contours raise ValueError.

Attribute Contents
mesh.Points Interior points
mesh.Boundary_Points External and internal boundary points
mesh.region_polygons Disjoint Shapely regions

Each point exposes x, y, label, and is_border. Set Border(..., is_border=False) to exclude its samples from Boundary_Points.

Examples

python .\examples\example_6_sampling.py
Example Domain
01 · Annulus Circular boundary with a central hole
02 · Connected borders Straight edges and shared interfaces
03 · Airfoil Circular domain around an airfoil
04 · Overlapping circles Intersecting regions
05 · Concentric circles Internal interface and central hole
06 · Sampling comparison Random, Halton, and Sobol side by side

Replace the filename to run another example. Close its Matplotlib window to finish.

Development

The package has three core modules: geometry, generation, and visualization.

Run the test suite from an activated development environment:

python -m unittest discover -s tests -v

Publishing: GitHub Actions builds and uploads to PyPI when a v* tag is pushed. Update the version in setup.py and .bumpversion.cfg before tagging a new release.

RBFMeshGen generates point clouds; it does not currently implement RBF interpolation or element connectivity. Contributions are welcome under the MIT License.

Metadata

Release files for RBFMeshGen 1.1.2

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

Source distribution (sdist)

Source distribution for RBFMeshGen 1.1.2
File Size Uploaded Provenance Actions
rbfmeshgen-1.1.2.tar.gz 17.2 kB Without provenance Details for rbfmeshgen-1.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for RBFMeshGen 1.1.2
File Interpreter ABI Platform Actions
rbfmeshgen-1.1.2-py3-none-any.whl Python 3 none any Details for rbfmeshgen-1.1.2-py3-none-any.whl

Total release size: 30.3 kB

Release files / rbfmeshgen-1.1.2.tar.gz

Download URL rbfmeshgen-1.1.2.tar.gz
Size 17.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4a5b60f7364a09eec59f6f605fa114b598dce523f4a03b8e7497621c3427fcf0
BLAKE2b-256 checksum
How to use checksums
7a7bf368880fc1c6b4db011fb1236f739027f89dec8d66cd0f550ad2bb3b6bb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / rbfmeshgen-1.1.2-py3-none-any.whl

Download URL rbfmeshgen-1.1.2-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
985499cc46a809e860356c2d49c9a9e6b154ca2dc72c96e92983a5ca46d6309e
BLAKE2b-256 checksum
How to use checksums
d3f9171269f5fa603d73b12cf7e5a872ce6a4f3a2a0c38b6aac097411854be7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for RBFMeshGen 1.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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