Learn R Programming

grip (version 0.3.0)

irregular_rectangle_surface_helpers: Irregular rectangle surface helpers

Description

Convenience helpers that keep ordinary rectangular-mesh adjacency but replace the regular parameter grid by a deterministic irregular rectangle. The resulting family stays simply connected and rectangular in topology while breaking the strongest row/column symmetries of the lattice.

Usage

irregular.rectangle.surface.graph(
  h,
  w = h,
  surface = c("flat", "saddle", "paraboloid", "ripple"),
  amplitude = 0.75,
  freq.u = 1,
  freq.v = 1,
  x.scale = 1,
  y.scale = 1,
  row.irregularity = 0.2,
  col.irregularity = 0.2,
  row.phase = 0.35,
  col.phase = 0.65,
  interior.warp = 0.08,
  shear = 0,
  min.step.ratio = 0.3,
  connectivity = c("orthogonal", "diagonal"),
  normalize = c("median", "mean", "none")
)

Value

The coords_param component is an n x 2 numeric matrix with columns u and v.

The coords_surface component is an n x 3

numeric matrix with columns x, y, and z.

irregular.rectangle.surface.graph() returns a list with components:

  • edges: the undirected rectangular-mesh edges,

  • n: number of vertices,

  • edge_weights: induced positive edge lengths,

  • coords_surface: the 3D surface embedding,

  • coords_param: the irregular 2D parameter coordinates,

  • coords_regular_param: the underlying regular 2D parameter coordinates used to define the boundary-vanishing warp,

  • row_breaks: per-row parameter coordinates in row order,

  • col_breaks: per-column parameter coordinates in column order,

  • weight_scale: the normalization constant applied to the raw edge lengths,

  • family: always "irregular.rectangle",

  • surface: the chosen surface name,

  • connectivity: the chosen mesh connectivity rule,

  • label: a human-readable family label.

Arguments

h

Number of rows.

w

Number of columns. Defaults to h.

surface

Surface family used for the lift. One of "flat", "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.

row.irregularity

Irregularity level for the row spacing. Must lie in [0, 1].

col.irregularity

Irregularity level for the column spacing. Must lie in [0, 1].

row.phase

Finite phase shift for the deterministic row-spacing perturbation.

col.phase

Finite phase shift for the deterministic column-spacing perturbation.

interior.warp

Non-negative interior warp strength. Must lie in [0, 1]. The warp vanishes on the boundary.

shear

Finite affine shear applied after the boundary-vanishing warp. Larger values can force a validation error if the mesh cells invert.

min.step.ratio

Positive lower bound for the perturbed row and column interval lengths, expressed relative to the unperturbed interval scale. Must lie in (0, 1].

connectivity

Mesh neighborhood rule passed to edges.mesh().

normalize

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

Details

The coords.param component contains the irregular planar parameter coordinates. The coords.surface component lifts those coordinates into \(\mathbb{R}^3\). irregular.rectangle.surface.graph() returns a reusable weighted-graph bundle with the induced Euclidean edge lengths.

Examples

Run this code
rectangle <- irregular.rectangle.surface.graph(4, 5, surface = "ripple")

Run the code above in your browser using DataLab