tests/testthat/test-point-triangulation.R

context("point-triangulation")
x <- c(0, 0, 1, 1)
y <- c(0, 1, 1, 0)

## triplet index triangulation of x,y
prim3_index <-
  c(4, 3, 2,
    4, 2, 1)
## native vertex order (not much use out here)
vert_index <- c(2, 3, 1, 4, 1, 1)

test_that("simple triangulation works", {
  expect_equal(tri_xy(x, y), prim3_index)
  expect_equal(tri_xy2(x, y), prim3_index)

  expect_equal(tri_xy1(x, y), vert_index)

})
r-gris/cgalgris documentation built on Nov. 5, 2022, 8:02 p.m.