Skip to contents

Convenience helpers that build a torus from deterministically irregular major-cycle rings with varying sample counts, stitch adjacent rings into a locally triangulated toroidal graph, and then realize that graph in \(\mathbb{R}^3\) using either a standard, pinched, or wavy tube geometry.

Usage

irregular.torus.surface.graph(
  major.rings = 8,
  tube.count = 16,
  count.irregularity = 0.2,
  major.irregularity = 0.25,
  phase.twist = 0.35,
  surface = c("standard", "pinched", "wavy"),
  major.radius = 2,
  minor.radius = 0.75,
  amplitude = 0.2,
  freq.major = 2,
  freq.minor = 1,
  twist = 0.25,
  normalize = c("median", "mean", "none")
)

Arguments

major.rings

Number of cyclic major rings around the torus.

tube.count

Approximate number of vertices around each minor cycle.

count.irregularity

Irregularity level for the per-ring sample counts. Must lie in [0, 1).

major.irregularity

Irregularity level for the major-angle ring spacing. Must lie in [0, 1].

phase.twist

Finite phase offset used to desynchronize neighboring minor cycles.

surface

Torus geometry family. One of "standard", "pinched", or "wavy".

major.radius

Positive distance from the torus center to the center of the tube.

minor.radius

Positive baseline radius of the torus tube.

amplitude

Finite deformation amplitude.

freq.major

Positive angular frequency around the major cycle, used by "wavy" and the periodic twist.

freq.minor

Positive angular frequency around the minor cycle, used by "wavy".

twist

Finite phase twist applied periodically to the minor angle as a function of the major angle.

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.

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

  • edges: the irregular torus edges,

  • n: number of vertices,

  • edge_weights: induced positive edge lengths,

  • coords_surface: the 3D embedding,

  • coords_param: the irregular angular parameter coordinates,

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

  • family: always "irregular.torus",

  • surface: the chosen surface name,

  • major_rings: number of major-cycle rings,

  • ring_sizes: sample counts around each ring,

  • label: a human-readable family label.

Examples

torus <- irregular.torus.surface.graph(major.rings = 4, tube.count = 8)