Weighted mesh surface helpers
Source:R/export_examples.R, R/graph_helpers.R
mesh_surface_helpers.RdConvenience helpers that lift a rectangular mesh parameter grid into \(\mathbb{R}^3\) and use the induced Euclidean edge lengths as positive graph weights. These helpers are intended for benchmark families where the topology is a plain mesh but the intended metric comes from a curved ambient geometry.
Arguments
- h
Number of rows.
- w
Number of columns. Defaults to
h.- surface
Surface family used for the lift. One of
"saddle","paraboloid", or"ripple".- amplitude
Finite numeric amplitude controlling the non-flat displacement.
- freq_u
Positive ripple frequency in the horizontal parameter direction. Used only when
surface = "ripple".- freq_v
Positive ripple frequency in the vertical parameter direction. Used only when
surface = "ripple".- x_scale
Positive horizontal scaling of the parameter domain.
- y_scale
Positive vertical scaling of the parameter domain.
- connectivity
Mesh neighborhood rule.
"orthogonal"keeps the four-neighbor grid;"diagonal"also adds both diagonals of every unit square.- normalize
Normalization applied to the induced edge lengths. One of
"median","mean", or"none".
Value
The coords_surface component is an n x 3 numeric matrix with
columns x, y, and z.
mesh.surface.graph() returns a list with components:
edges: the undirected mesh edges,n: number of vertices,edge_weights: induced positive edge lengths,coords_surface: the 3D surface embedding,coords_param: the 2D parameter-grid coordinates,weight_scale: the normalization constant applied to the raw edge lengths,family: always"mesh",surface: the chosen surface name,connectivity: the chosen mesh connectivity rule,label: a human-readable family label.