API Reference#

This page provides an auto-generated summary of pandamesh’s API.

Preprocessing#

Preprocessor([geometry, values, grid_size])

Utilities to clean-up geometries before meshing.

Preprocessor.unify_polygons([first])

Resolve polygon overlaps and intersections.

Preprocessor.merge_polygons()

Merge polygons with the same value for indexer (the same value if values was provided at initialization).

Preprocessor.clip_lines([distance])

Remove line segments that are outside or that are near polygon segments.

Preprocessor.unify_lines()

Ensure intersections between lines are present.

Preprocessor.interpolate_lines_to_points([...])

Convert lines into points.

Preprocessor.snap_points(distance)

Snap points together that are within tolerance of each other.

Preprocessor.clip_points([distance])

Remove points that are outside of a polygon or near line or polygon segments.

Preprocessor.to_geodataframe()

Return the processed geometries as a geopandas.GeoDataFrame.

find_edge_intersections(geometry)

Find all unresolved intersections between polygon boundaries, linestring, and linearring edges.

find_proximate_perimeter_points(geometry[, ...])

Detect vertices in polygon perimeters (exteriors and interiors) that are very close to each other.

Triangle#

TriangleMesher(gdf[, shift_origin, ...])

Wrapper for the python bindings to Triangle.

TriangleMesher.generate()

Generate a mesh of triangles.

TriangleMesher.generate_geodataframe()

Generate a mesh and return it as a geopandas GeoDataFrame.

TriangleMesher.generate_ugrid()

Generate a mesh and return it as an xugrid Ugrid2d.

TriangleMesher.minimum_angle

Minimum allowed angle for any triangle in the mesh.

TriangleMesher.conforming_delaunay

use this switch if you want all triangles in the mesh to be Delaunay, and not just constrained Delaunay; or if you want to ensure that all Voronoi vertices lie within the triangulation.

TriangleMesher.suppress_exact_arithmetic

Suppresses exact arithmetic.

TriangleMesher.maximum_steiner_points

Specifies the maximum number of added Steiner points

TriangleMesher.delaunay_algorithm

Sets the Delaunay algorithm.

TriangleMesher.consistency_check

Check the consistency of the final mesh.

Triangle Enumerators#

DelaunayAlgorithm(value[, names, module, ...])

The type of Delaunay algorithm for Triangle.

Gmsh#

GmshMesher(*args, **kwargs)

Wrapper for the python bindings to Gmsh.

GmshMesher.generate([finalize])

Generate a mesh of triangles or quadrangles.

GmshMesher.generate_geodataframe([finalize])

Generate a mesh and return it as a geopandas GeoDataFrame.

GmshMesher.generate_ugrid([finalize])

Generate a mesh and return it as an xugrid Ugrid2d.

GmshMesher.mesh_algorithm

Can be set to one of pandamesh.MeshAlgorithm:

GmshMesher.recombine_all

Apply recombination algorithm to all surfaces, ignoring per-surface spec.

GmshMesher.mesh_size_extend_from_boundary

Forces the mesh size to be extended from the boundary, or not, per surface.

GmshMesher.mesh_size_from_points

Compute mesh element sizes from values given at geometry points.

GmshMesher.mesh_size_from_curvature

Automatically compute mesh element sizes from curvature, using the value as the target number of elements per 2 * Pi radians.

GmshMesher.field_combination

Controls how cell size fields are combined when they are found at the same location.

GmshMesher.subdivision_algorithm

All meshes can be subdivided to generate fully quadrangular cells.

GmshMesher.general_verbosity

Controls level of information printed.

GmshMesher.add_matheval_distance_field(gdf)

Add a matheval distance field to the mesher.

GmshMesher.add_threshold_distance_field(gdf)

Add a distance field to the mesher.

GmshMesher.add_structured_field(cellsize, ...)

Add an equidistant structured field specifying cell sizes for mesh generation.

GmshMesher.add_structured_field_from_dataarray(da)

Add an equidistant structured field as an xarray DataArray specifying cell sizes for mesh generation.

GmshMesher.fields

Read-only access to fields.

GmshMesher.clear_fields()

GmshMesher.write(path)

Write a gmsh .msh file

GmshMesher.finalize()

GmshMesher.finalize_gmsh()

Finalize Gmsh.

gmsh_env([read_config_files, interruptible])

Gmsh Enumerators#

FieldCombination(value[, names, module, ...])

Controls how cell size fields are combined in Gmsh when they are found at the same location.

GeneralVerbosity(value[, names, module, ...])

Gmsh level of information printed.

GmshMesher(*args, **kwargs)

Wrapper for the python bindings to Gmsh.

MeshAlgorithm(value[, names, module, ...])

Gmsh meshing algorithm.

SubdivisionAlgorithm(value[, names, module, ...])

Controls how Gmsh recombines triangles to form quads.