mesh_segment_by_path: Section mesh using a path

View source: R/mesh_splitbypath.R

mesh_segment_by_pathR Documentation

Section mesh using a path

Description

Cuts a mesh along a closed path defined on the basis of an ordered set of coordinates (ideally landmarks), and splits the mesh into multiple components. Note that you must provide a clean mesh, so please use vcgClean on the input.

Usage

mesh_segment_by_path(
  mesh,
  lms = NULL,
  path.choice = "ridges",
  mesh.path = NULL
)

Arguments

mesh

A (clean) mesh3d object

lms

(Deprecated) An ordered set of coordinates. Since this parameter is being deprecated, please use the output of sPathConnect to the mesh.path argument)

path.choice

(Deprecated) Described in sPathConnect.

mesh.path

A vector containing a list of connected vertices forming a closed path on the surface of the input mesh. This parameter should correspond to the output of sPathConnect

Value

A list of mesh objects containing a minimum of 3 faces each.

Note

Minimum output mesh segment size is 3 faces. Anything smaller gets discarded silently.

Note also that the deprecated parameters will stop working in version 1 of this package at the latest.

Author(s)

Cornel M. Pop

Examples

library(rgl)
mesh.path <- sPathConnect(demoFlake2$lms, demoFlake2$mesh,
                          path.choice="ridges", closed=TRUE)
mesh.segs <- mesh_segment_by_path(demoFlake2$mesh, mesh.path=mesh.path)
shade3d(mesh.segs[[1]], color="green")
shade3d(mesh.segs[[2]], color="blue")

cornelmpop/Lithics3D documentation built on Feb. 10, 2024, 11:54 p.m.