diff --git a/frontal_delaunay_2d_01.png b/frontal_delaunay_2d_01.png index c5b4d004..5077e48b 100644 Binary files a/frontal_delaunay_2d_01.png and b/frontal_delaunay_2d_01.png differ diff --git a/release.yml b/release.yml new file mode 100644 index 00000000..27208719 --- /dev/null +++ b/release.yml @@ -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 diff --git a/src/pvgmsh/__init__.py b/src/pvgmsh/__init__.py index 12f984aa..4eb1f3f1 100644 --- a/src/pvgmsh/__init__.py +++ b/src/pvgmsh/__init__.py @@ -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 @@ -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. @@ -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 @@ -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