Convenience 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.
mesh.surface.graph(
h,
w = h,
surface = c("saddle", "paraboloid", "ripple"),
amplitude = 0.75,
freq.u = 1,
freq.v = 1,
x.scale = 1,
y.scale = 1,
connectivity = c("orthogonal", "diagonal"),
normalize = c("median", "mean", "none")
)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.
Number of rows.
Number of columns. Defaults to h.
Surface family used for the lift. One of "saddle",
"paraboloid", or "ripple".
Finite numeric amplitude controlling the non-flat displacement.
Positive ripple frequency in the horizontal parameter
direction. Used only when surface = "ripple".
Positive ripple frequency in the vertical parameter direction.
Used only when surface = "ripple".
Positive horizontal scaling of the parameter domain.
Positive vertical scaling of the parameter domain.
Mesh neighborhood rule. "orthogonal" keeps the
four-neighbor grid; "diagonal" also adds both diagonals of every unit
square.
Normalization applied to the induced edge lengths. One of
"median", "mean", or "none".
The coords.surface component contains the 3D coordinates of the lifted grid.
mesh.surface.graph() returns a reusable weighted-graph bundle containing the
mesh edges, induced edge weights, the 3D surface coordinates, and the 2D
parameter coordinates.
mesh <- mesh.surface.graph(4, 5, surface = "saddle")
Run the code above in your browser using DataLab