Skip to contents

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.

Usage

mesh.surface.embedding(
  h,
  w = h,
  surface = c("saddle", "paraboloid", "ripple"),
  amplitude = 0.75,
  freq_u = 1,
  freq_v = 1,
  x_scale = 1,
  y_scale = 1
)

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")
)

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

Occupied-mesh neighborhood rule passed to edges.occupied.mesh().

normalize

Normalization applied to the induced edge lengths. One of "median", "mean", or "none".

Value

mesh.surface.embedding() returns 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.

Details

`mesh.surface.embedding()` returns 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.