GithubHelp home page GithubHelp logo

pyvista / scikit-gmsh Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 1.0 3.06 MB

Scikit for Gmsh to generate 3D finite element mesh

Home Page: https://scikit-gmsh.readthedocs.io/en/latest

License: GNU General Public License v3.0

Python 99.28% Makefile 0.72%
3d engineering hacktoberfest mathematics mesh-generation mesh-processing meshing python scientific-research scientific-visualization

scikit-gmsh's Introduction

🚧 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

scikit-gmsh is available on PyPI.

Pip

scikit-gmsh is also available on PyPI:

pip install scikit-gmsh

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.

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

We can then generate a 2D mesh.

mesh = source.frontal_delaunay_2d(edge_source=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(source, show_edges=True, line_width=4, color="gray")
plotter.show(cpos="xy")

We can also generate a 3D mesh.

source = sg.Cube()
source = sg.delaunay_3d(edge_source=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.

scikit-gmsh's People

Contributors

dependabot[bot] avatar pre-commit-ci[bot] avatar tkoyama010 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zhang9song

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.