bff_flatten: Automatically flatten a 3d mesh using boundary first...

Description Usage Arguments Value Examples

View source: R/flatten.R

Description

Flattening will only work with closed objects if cones are inserted (cuts or seams). Closed objects can instead be mapped to a sphere however. If both to_disk and to_sphere are FALSE, a target boundary shape will be determined automatically that minimized area and angle distortion. If you want to flatten to a particular target boundary shape, use bff_flatten_to_shape()

Usage

1
2
3
4
5
6
7
bff_flatten(
  mesh,
  n_cones = 0,
  to_disk = FALSE,
  to_sphere = FALSE,
  normalise = TRUE
)

Arguments

mesh

mesh3d object to flatten

n_cones

Number of cone singularities to insert into mesh to reduce distortion. Ignored if to_disk = TRUE

to_disk

Should the mesh be flattened to a disk?

to_sphere

Should the mesh be mapped to a sphere instead (only works with closed objects).

normalise

Should the 2d mapping be normalised between 0 and 1 on the x and y axes?

Value

A bff_flattened object containing the original mesh and its flattened version with corresponding vertices unless to_sphere = TRUE, in which case a bff_sphered object is returned.

Examples

1
2
3
data(face)
options(rgl.useNULL = TRUE)
flat_face <- bff_flatten(face)

rdinnager/rbff documentation built on Jan. 21, 2022, 2:08 p.m.