isotropicRemesh: Isotropic remeshing

View source: R/remeshing.R

isotropicRemeshR Documentation

Isotropic remeshing

Description

Isotropically remesh a mesh.

Usage

isotropicRemesh(
  vertices,
  faces,
  mesh = NULL,
  targetEdgeLength,
  iterations = 1,
  relaxSteps = 1,
  normals = FALSE
)

Arguments

vertices

a numeric matrix with three columns

faces

either an integer matrix (each row provides the vertex indices of the corresponding face) or a list of integer vectors, each one providing the vertex indices of the corresponding face

mesh

if not NULL, this argument takes precedence over vertices and faces, and must be either a list containing the fields vertices and faces (objects as described above), otherwise a rgl mesh (i.e. a mesh3d object)

targetEdgeLength

positive number, the target edge length of the remeshed mesh

iterations

number of iterations, a positive integer

relaxSteps

number of relaxation steps, a positive integer

normals

Boolean, whether to compute the vertex normals of the output mesh

Value

A triangle mesh represented as the output of the Mesh function.

Examples

library(MeshesOperations)
library(rgl)

theta <- seq(0, 2*pi, length.out = 16)
torus <- cylinder3d(
  cbind(cos(theta), sin(theta), 0),
  radius = 0.4, closed = TRUE
)

mesh <- isotropicRemesh(
  mesh = torus,
  targetEdgeLength = 0.3,
  iterations = 3
)
rglmesh <- toRGL(mesh)

open3d(windowRect = c(50, 50, 950, 500))
mfrow3d(1, 2)
view3d(0, 0, zoom = 0.8)
wire3d(torus)
next3d()
view3d(0, 0, zoom = 0.8)
wire3d(rglmesh)

stla/MeshesOperations documentation built on Oct. 23, 2022, 8:23 a.m.