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.3.tar.gz (8.7 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.3-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rbfmeshgen-1.0.3.tar.gz
  • Upload date:
  • Size: 8.7 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.3.tar.gz
Algorithm Hash digest
SHA256 3feca254288dc741db59bf4a35083cc32d6e4fb8480d328519951132e8b7895e
MD5 6b74c323077238b75cdfe0294c71de31
BLAKE2b-256 c2b056eb00998e64eaa786ca89ecd8ca43c8e756e7b75171cdcf3293b237552b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: RBFMeshGen-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ed9092826105438016e22bb0e272f00bc038382cb6cd1f4b49bf1f4a0581d1cf
MD5 14deb8ac0acfbb61028002faefead6e6
BLAKE2b-256 e3cf1227fafa4f30ece46cc54205e492008093def32ce3b81dc5654059498964

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