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.
Quick start · Sampling · Examples · Development
Quick start
Install the published release from PyPI:
pip install "RBFMeshGen[qmc]"
Version 1.1.0 adds Halton and Sobol sampling alongside the geometry fixes. For an editable development installation, run from the cloned repository:
py -3.13 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[qmc]"
Use any installed Python ≥ 3.9. On Linux/macOS, use python3 -m venv .venv and .venv/bin/python. Omit [qmc] if you only need random sampling.
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 | SciPy via [qmc] |
"sobol" |
Scrambled Sobol sequence | SciPy via [qmc] |
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
seedand environment. Calls append by default;append=Falsereplaces 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
.\.venv\Scripts\python.exe .\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 after installing .[qmc]:
.\.venv\Scripts\python.exe -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. The workflow uses the repository
secrets PYPI_USERNAME and PYPI_PASSWORD.
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rbfmeshgen-1.1.0.tar.gz | 17.5 kB | Without provenance | Details for rbfmeshgen-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rbfmeshgen-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for rbfmeshgen-1.1.0-py3-none-any.whl |
Total release size: 30.7 kB
Release files / rbfmeshgen-1.1.0.tar.gz
| Download URL | rbfmeshgen-1.1.0.tar.gz |
|---|---|
| Size | 17.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6aa400948d3bcf031d949eb0935b19dc50a2dac038e7e9a08b4f5ad5051dd3e1
|
|
BLAKE2b-256 checksum How to use checksums |
ad93c9d0e22c299adbd0a4add9911ea3c748448a0e0601073f0627ecfed56580
|
| 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.0-py3-none-any.whl
| Download URL | rbfmeshgen-1.1.0-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1072a4a60c2d123252e9bac66652463db05096c07239486d028c1fc2964af096
|
|
BLAKE2b-256 checksum How to use checksums |
0c370290b9c73e8276dd90a134df1a384f0aaeae73f710ff1cdc2c79df985821
|
| 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.0
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.