Weighted recursive triangle-mask surface helpers
Source:R/graph_helpers.R
recursive_triangle_mask_surface_helpers.RdConvenience helpers that recursively subdivide an equilateral triangle into three corner subtriangles plus one central inverted subtriangle according to a four-slot keep-mask, retain the selected subtriangles at each recursion step, and lift the resulting vertex graph into \(\mathbb{R}^3\). This provides a generic gasket-style triangular family that includes the classic Sierpinski triangle together with bridge and asymmetric variants.
Usage
recursive.triangle.mask.surface.embedding(
mask = mask.triangle.classic(),
level = 2,
surface = c("flat", "saddle", "paraboloid", "ripple", "folded"),
amplitude = 0.75,
freq_u = 1,
freq_v = 1,
x_scale = 1,
y_scale = 1
)
recursive.triangle.mask.surface.graph(
mask = mask.triangle.classic(),
level = 2,
surface = c("flat", "saddle", "paraboloid", "ripple", "folded"),
amplitude = 0.75,
freq_u = 1,
freq_v = 1,
x_scale = 1,
y_scale = 1,
normalize = c("median", "mean", "none")
)Arguments
- mask
Four-entry logical or numeric keep-mask. Non-zero entries are retained at each recursive step.
- level
Recursion depth. May be
0or larger.- surface
Triangle surface family. One of
"flat","saddle","paraboloid","ripple", or"folded".- amplitude
Finite deformation amplitude.
- freq_u
Positive ripple frequency in the first canonical triangle coordinate. Used only when
surface = "ripple".- freq_v
Positive ripple frequency in the second canonical triangle coordinate. Used only when
surface = "ripple".- x_scale
Positive horizontal scaling applied to the canonical triangle coordinates.
- y_scale
Positive vertical scaling applied to the canonical triangle coordinates.
- normalize
Normalization applied to the induced edge lengths. One of
"median","mean", or"none".
Value
recursive.triangle.mask.surface.embedding() returns an n x 3
numeric matrix with columns x, y, and z.
recursive.triangle.mask.surface.graph() returns a list with
components:
edges: the retained recursive triangle-mask edges,n: number of vertices,edge_weights: induced positive edge lengths,coords_surface: the 3D surface embedding,coords_param: the canonical 2D triangle coordinates,weight_scale: the normalization constant applied to the raw edge lengths,family: always"recursive.triangle.mask",surface: the chosen surface name,level: the recursion depth,mask: the logical keep-mask,label: a human-readable family label.