Skip to content

Commit

Permalink
Merge branch 'main' into doc/paper-draft
Browse files Browse the repository at this point in the history
  • Loading branch information
tkoyama010 authored Dec 30, 2023
2 parents 9015af5 + e271a7f commit 5d4facf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
Binary file modified frontal_delaunay_2d_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: Breaking Changes
labels:
- breaking-change
- title: New Features
labels:
- enhancement
- title: Bug fixes or behavior changes
labels:
- bug
- title: Documentation
labels:
- documentation
- title: Maintenance
labels:
- maintenance
22 changes: 11 additions & 11 deletions src/pvgmsh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@

from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING:
import pyvista as pv

import gmsh
import numpy as np
import pyvista as pv
from pygmsh.helpers import extract_to_meshio
from pyvista.core.utilities import fileio

from pvgmsh._version import __version__ # noqa: F401

Expand All @@ -20,7 +15,7 @@
def frontal_delaunay_2d(
edge_source: pv.PolyData,
target_size: float | None,
) -> pv.UnstructuredGrid:
) -> pv.PolyData | None:
"""
Frontal-Delaunay 2D mesh algorithm.
Expand Down Expand Up @@ -57,9 +52,10 @@ def frontal_delaunay_2d(
>>> mesh = pm.frontal_delaunay_2d(edge_source, target_size=1.0)
>>> mesh
UnstructuredGrid (...)
N Cells: 398
PolyData (...)
N Cells: 346
N Points: 198
N Strips: 0
X Bounds: -5.657e+00, 5.657e+00
Y Bounds: -5.657e+00, 5.657e+00
Z Bounds: 0.000e+00, 0.000e+00
Expand Down Expand Up @@ -92,7 +88,11 @@ def frontal_delaunay_2d(
gmsh.model.geo.add_plane_surface([1], 1)
gmsh.model.geo.synchronize()
gmsh.model.mesh.generate(2)
mesh = fileio.from_meshio(extract_to_meshio())
mesh = extract_to_meshio()
gmsh.clear()
gmsh.finalize()
return mesh

for cell in mesh.cells:
if cell.type == "triangle":
return pv.PolyData.from_regular_faces(mesh.points, cell.data)
return None

0 comments on commit 5d4facf

Please sign in to comment.