API reference
Smesh.build_delaunay_triangulation
— Methodbuild_delaunay_triangulation(data_points; shuffle = false, verbose = false)
Smesh.build_polygon_mesh
— Methodbuild_polygon_mesh(data_points, triangulation_vertices; mesh_type=:centroids, orthogonal_boundary_edges=true)
There are three different mesh types:
:standard_voronoi
=> standard voronoi, but use centroid if the circumcenter lies outside the triangle:centroids
=> not an actual voronoi, always use centroids and not circumcenters as vertices for the mesh:incenters
=> not an actual voronoi, always use incenters and not circumcenters as vertices for the mesh:pure_voronoi
=> pure Voronoi mesh (just for experiments, should not be used for computation)
Smesh.delaunay_compute_neighbors
— Methoddelaunay_compute_neighbors(data_points, vertices; periodicity = (false, false))
Calculates the neighbor connectivity for a delaunay triangulation created with build_delaunay_triangulation
.
data_points
is an array of size 2 × (number of points) with[coordinate, point]
.vertices
of size 3 × (number of triangles) describes the triangulation with the
structure [point_index, triangle_index]
periodicity
indicates whether the mesh is periodic in x or y direction.
Note: The feature of periodic meshes is experimental. Right now, it only supports straight boundaries which are parallel to the specific axis.
Smesh.mesh_basic
— Methodmesh_basic(coordinates_min, coordinates_max, n_points_x, n_points_y)
Creates points for a regular grid. Shifting every second column of points to avoid a simple mesh with bisected rectangles. This results in a unique triangulation.
Smesh.mesh_bisected_rectangle
— Methodmesh_bisected_rectangle(coordinates_min, coordinates_max, n_points_x, n_points_y;
symmetric_shift = false)
Creates points in a regular manner. The resulting non-unique triangulation consists of bisected rectangles. To allow periodic boundaries for the resulting polygon mesh, it is possible to enable a symmetric shift.
Smesh.voronoi_compute_neighbors
— Methodvoronoi_compute_periodic_neighbors!(vertices, voronoi_vertices_coordinates, voronoi_vertices,
voronoi_vertices_interval, delaunay_neighbors;
periodicity = (false, false))
Calculates the neighbor connectivity for a polygon mesh created with build_polygon_mesh
.
vertices
defines the structure of the triangulation. An array of size 3 × (number of triangles) with[point_index, triangle_index]
.voronoi_vertices_coordinates
contains the coordinates of Voronoi vertices invoronoi_vertices
.voronoi_vertices
: All points within the polygon mesh are sorted counterclockwise for each element.voronoi_vertices_interval
is an array of size 2 × (number of elements) and contains the starting and ending point index for every element invoronoi_vertices
.delaunay_neighbors
is the connectivity data structure created bydelaunay_compute_neighbors
.periodicity
indicates whether the mesh is periodic in x or y direction.
Note: The feature of periodic meshes is experimental. Right now, it only supports straight boundaries which are parallel to the specific axis.
Smesh.voronoi_compute_periodic_neighbors!
— Methodvoronoi_compute_periodic_neighbors!(voronoi_neighbors, periodicity,
voronoi_vertices_coordinates, voronoi_vertices,
voronoi_vertices_interval)