Occupied-mesh and perforated-grid helpers
Source:R/export_examples.R, R/graph_helpers.R
occupied_mesh_surface_helpers.Rdoccupied.mesh.surface.graph() builds a finite occupied-grid graph on the
retained cells of a rectangular occupancy matrix and lifts those cells into
\(\mathbb{R}^3\) using the same
"saddle", "paraboloid", and "ripple" families used
for regular meshes.
Arguments
- keep
Logical or numeric occupancy matrix. Non-zero entries are kept.
- 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
Mesh neighborhood rule passed to
edges.mesh().- 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.
occupied.mesh.surface.graph() returns a list with components:
edges: the occupied-cell mesh edges,n: number of vertices,edge_weights: induced positive edge lengths,coords_surface: the 3D surface embedding,coords_param: the 2D parameter coordinates,weight_scale: the normalization constant applied to the raw edge lengths,family: always"occupied.mesh",surface: the chosen surface name,connectivity: the chosen occupied-mesh connectivity rule,keep: the logical occupancy matrix,label: a human-readable family label.
Examples
keep <- matrix(TRUE, nrow = 4, ncol = 5)
keep[2, 3] <- FALSE
occupied <- occupied.mesh.surface.graph(keep, surface = "paraboloid")