find_edges_3D: Find edges in an evenly spaced 3D grid.

View source: R/RcppExports.R

find_edges_3DR Documentation

Find edges in an evenly spaced 3D grid.

Description

Checks all neighbour indices in a vector c_search for TRUE. If all neighbours are TRUE it is not an edge, else it is.

Arguments

c_search

Logical vector

n

dimensions of 3D array c(nx, ny, nz)

Value

logical vector if edge was found

Examples

n <- c(6L,5L,4L)
df_input <- expand.grid(
  x = 1:n[1],
  y = 1:n[2],
  z = 1:n[3])
df_input$search <- TRUE
df_input$edge <- find_edges_3D(df_input$search, n)
df_input$color <- ifelse(df_input$edge, "blue", "black")

df_input
df_input|>
  rgl::plot3d(col = df_input$color, size = 15,aspect = "iso")


wagnius-GmbH/slvwagner documentation built on Jan. 19, 2025, 7:10 a.m.