Skip to main content

No project description provided

Project description

🚧 scikit-gmsh is in the pre-alpha stage. The interface could be subject to significant changes soon.

scikit-gmsh

Scikit for Gmsh to generate 3D finite element mesh.

Contributing

Contributions are very welcome . This project is released with a Contributor Code of Conduct. By participating in this project, We want you to know that you agree to follow its terms.


GitHub Repo stars

Enjoying scikit-gmsh? Show your support with a GitHub star — it’s a simple click that means the world to us and helps others discover it, too! ⭐️


Table of Contents

Documentation Status

Installation

Developer

If you can't wait for the next release to play with the latest hot features, then you can easily install the main development branch from GitHub:

pip install git+https://github.com/pyvista/scikit-gmsh@main

Usage

import skgmsh as sg

We can define the surface using PyVista.

edge_source = sg.Polygon(n_sides=4, radius=8, fill=False)

We can then generate a 2D mesh.

mesh = sg.frontal_delaunay_2d(edge_source, target_sizes=2.0)

To visualize the model, we can use PyVista.

plotter = sg.Plotter()
_ = plotter.add_mesh(
    mesh,
    show_edges=True,
    line_width=1,
    color="aliceblue",
    lighting=False,
    edge_color="gray",
)
_ = plotter.add_mesh(edge_source, show_edges=True, line_width=4, color="gray")
plotter.show(cpos="xy")

We can also generate a 3D mesh.

edge_source = sg.Cube()
mesh = sg.delaunay_3d(edge_source, target_sizes=0.2)
plotter = sg.Plotter()
_ = plotter.add_mesh(
    mesh,
    show_edges=True,
    line_width=1,
    color="aliceblue",
    lighting=False,
    edge_color="gray",
)
_ = plotter.add_mesh(edge_source.extract_all_edges(), line_width=4, color="gray")
_ = plotter.add_box_axes()
plotter.show()

We can clip a mesh by a plane by specifying the origin and normal. See clip_with_surface_example for more examples using this filter.

clipped = mesh.clip(origin=(0.0, 0.0, 0.0), normal=(0.0, 0.0, 1.0), crinkle=True)

License

License: GPL v3

This software is published under the GPLv3 license.

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

scikit-gmsh-0.1.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

scikit_gmsh-0.1.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file scikit-gmsh-0.1.0.tar.gz.

File metadata

  • Download URL: scikit-gmsh-0.1.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for scikit-gmsh-0.1.0.tar.gz
Algorithm Hash digest
SHA256 25b2a5f107da09ece78780f070f8c03903aa0be30a5196cbf78502a4c7f75056
MD5 6c67eb483646757f1990a62082686431
BLAKE2b-256 925dc14aeb59db9ed9201d5c83b34c7c34909276c444bfea12ab148f4852c6ff

See more details on using hashes here.

File details

Details for the file scikit_gmsh-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: scikit_gmsh-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for scikit_gmsh-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e669eb38607e8f466acfb3eeb481eac1406b721a3bfa66deb2bc2dc0b82d96a
MD5 44cfeecaeb6baedc437c4cf3e2baf883
BLAKE2b-256 11ec9493e1c9d1b3cb8b51391cfc8392ccea2434a0adb6dde8c6e2e7a9ecdc51

See more details on using hashes here.

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