Weighted cylinder surface helpers
Source:R/export_examples.R, R/graph_helpers.R
cylinder_surface_helpers.RdConvenience helpers that embed a cylindrical grid graph into \(\mathbb{R}^3\) and use the induced Euclidean edge lengths as positive graph weights. These helpers are intended for benchmark families where the graph topology is cylindrical but the intended metric comes from a curved or spatially varying 3D realization.
Arguments
- h
Number of rows.
- w
Number of columns. Defaults to
h.- surface
Cylinder surface family. One of
"barrel","hourglass", or"wavy".- radius
Positive baseline cylinder radius.
- height
Positive cylinder height.
- amplitude
Finite numeric deformation amplitude. The resulting radius profile must stay positive everywhere.
- freq_theta
Positive angular frequency used only when
surface = "wavy".- freq_z
Positive vertical frequency used only when
surface = "wavy".- twist
Finite angular twist applied linearly with height.
- 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.
cylinder.surface.graph() returns a list with components:
edges: the undirected cylindrical-grid edges,n: number of vertices,edge_weights: induced positive edge lengths,coords_surface: the 3D surface embedding,coords_param: the 2D unwrapped parameter coordinates,weight_scale: the normalization constant applied to the raw edge lengths,family: always"cylinder",surface: the chosen surface name,label: a human-readable family label.