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:

git clone https://github.com/yourusername/RBFMeshGen.git
cd RBFMeshGen
pip install .

Usage

import numpy as np
from RBFMeshGen import RandomMesh, plot_points, 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 = RandomMesh(border_outer1(100),border_outer2(200), border_inner1(-100))

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

# Plot the points
plot_points(points)

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.0.tar.gz (8.7 kB view hashes)

Uploaded Source

Built Distribution

RBFMeshGen-1.0.0-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page