| vcg_mesh_patch | R Documentation |
Connects a set of surface waypoints with geodesic paths to form a
closed boundary loop, then splits the mesh into the two regions created by
that loop.
Consecutive waypoints are joined by the geodesic (Dijkstra) shortest
path along the mesh surface; the last waypoint connects back to the
first.
vcg_mesh_patch(mesh, waypoints, seed_vertex = NULL, max_edge_length = NA)
mesh |
triangular mesh of class |
waypoints |
numeric matrix with exactly 3 columns ( |
seed_vertex |
integer (optional, 1-based). A vertex known to be inside
the desired first patch. When |
max_edge_length |
numeric (optional). When positive and finite, the mesh
is refined before patching so that no edge exceeds this length. Global
edge subdivision ( |
A length-2 list of mesh3d objects. Each contains:
$orig_vertex1-based integer vector: new vertex index i
corresponds to column orig_vertex[i] of the original mesh$vb.
The first element is the patch whose centroid is closest to the mean
waypoint position; the second is the complementary connected patch.
On a multi-manifold mesh, disconnected components not adjacent to the
boundary loop appear in neither patch. When the boundary loop does not
divide the mesh (degenerate waypoints), the second element is
NULL.
All waypoints must lie on the same connected component of the mesh.
The mesh should be manifold; run vcg_fix_defects first
if needed.
dijkstras_surface_distance, surface_path,
vcg_fix_defects
mesh <- vcg_sphere()
mesh <- vcg_uniform_remesh(mesh)
waypoints <- diag(1, 3)
patches <- vcg_mesh_patch(mesh, waypoints)
plot_mesh_polygon(
patches,
col = list("red", 'gray'),
alpha = list(1, 0.5),
eye = c(10, 10, 10)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.