Skip to main content

A Python package for generating random meshes based on radial basis functions.

Project description

RBFMeshGen

RBFMeshGen is a Python package designed for the generation and visualization of random mesh points within specified geometric boundaries using Radial Basis Functions (RBF) and other mesh generation techniques. The package provides tools to create, manipulate, and visualize complex mesh structures effectively in Python.

Features

  • Geometric Boundary Definitions: Define complex boundaries using parametric functions.
  • Mesh Generation: Generate meshes based on defined geometric borders, ensuring points adhere to specified orientations and distributions.
  • Visualization Tools: Visualize meshes and geometric borders, supporting both individual and collective plot displays.
  • Utility Functions: Includes utility functions to calculate mesh orientations and handle geometric calculations.

Installation

To install RBFMeshGen, simply clone this repository and use the setup file to install the package:

pip install RBFMeshGen

Usage

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


# Define a parametric function for a circle
def circle_parametric_function(radius, t):
    return radius * np.cos(t), radius * np.sin(t)


# Define the borders of the mesh
outer_radius = 1.0
inner_radius = 0.5

border_outer1 = Border(parametric_function=lambda t: circle_parametric_function(outer_radius, t), label=1, t_start=0,
                       t_end=np.pi)
border_outer2 = Border(parametric_function=lambda t: circle_parametric_function(outer_radius, t), label=1,
                       t_start=np.pi, t_end=2 * np.pi)
border_inner1 = Border(parametric_function=lambda t: circle_parametric_function(inner_radius, t), label=1, t_start=0,
                       t_end=2 * np.pi)

# Generate a random mesh
random_mesh = RBFMesh(border_outer1(100), border_outer2(200), border_inner1(-100))

# Generate points
num_points = 10000
random_mesh.generate_points(num_points)

# Plot the points
plot_mesh(random_mesh)

Output Mesh Visualization

Contributing

Contributions to RBFMeshGen are welcome! Please feel free to fork the repository, make changes, and submit pull requests. You can also open issues to discuss potential changes or report bugs.

License

RBFMeshGen is released under the MIT License. See the LICENSE file in the repository for full 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

rbfmeshgen-1.0.5.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

RBFMeshGen-1.0.5-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file rbfmeshgen-1.0.5.tar.gz.

File metadata

  • Download URL: rbfmeshgen-1.0.5.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for rbfmeshgen-1.0.5.tar.gz
Algorithm Hash digest
SHA256 cfa582a22571af43fbada6cbddd8b21910534a6b1782be05fe0319681174cede
MD5 249b0297d1ffeadad3afca020e6c9ff1
BLAKE2b-256 3362bb185ef626bcc2609b65f499b7f4824ad1531c65052e00a106bf565be9e5

See more details on using hashes here.

File details

Details for the file RBFMeshGen-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: RBFMeshGen-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for RBFMeshGen-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 03b6f65ba584b54b560a1def84bfc25daca1e3c25c57f3d75f71c268a7aeaa5e
MD5 b2e4a879040ef65559f6b6e50ce3b136
BLAKE2b-256 d83fde544a07cd4564387e475c9266ad31a39720ceeb23d9efb095358df69c7d

See more details on using hashes here.

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