Skip to content

Commit

Permalink
Revert changes today
Browse files Browse the repository at this point in the history
  • Loading branch information
YuhangTom committed May 1, 2024
1 parent 97a1750 commit 56beece
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
19 changes: 4 additions & 15 deletions R/x3p_insidepoly_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#'
#' @param x3p An `x3p` object representing a topographic scan.
#' @param mask_col A string representing the color to be used for the polygon.
#' @param concavity A strictly positive number used in `concaveman::concaveman` to influence the shape of the polygon. If `NULL`, the shape is taken to be the whole scan.
#' @param concavity A strictly positive number used in `concaveman::concaveman` to influence the shape of the polygon.
#' @param b A positive integer representing the block size for `x3ptools::x3p_average`.
#' @param ifplot A Boolean flag indicating whether to save ggplot lists in the output attributes.
#' @return A data frame summarizing the inner polygon. The data frame includes the following columns:
Expand Down Expand Up @@ -39,16 +39,11 @@ x3p_insidepoly_df <- function(x3p, mask_col = "#FF0000", concavity = 1.5, b = 10
assert_that(
"x3p" %in% class(x3p),
is.string(mask_col),
is.number(concavity), concavity > 0,
is.count(b),
is.flag(ifplot)
)

if (!is.null(concavity)) {
assert_that(
is.number(concavity), concavity > 0
)
}

to <-
from <-
neighbor_val <-
Expand All @@ -61,14 +56,8 @@ x3p_insidepoly_df <- function(x3p, mask_col = "#FF0000", concavity = 1.5, b = 10
n_discrete <-
NULL

if (!is.null(concavity)) {
x3p <- x3p %>%
x3p_surface_polygon(colour = mask_col, concavity = concavity)
} else {
x3p <- x3p %>%
x3p_add_mask()
x3p$mask <- mask_col
}
x3p <- x3p %>%
x3p_surface_polygon(colour = mask_col, concavity = concavity)

### Extract inner part as x3p based on mask
x3p_inner <- x3p_extract(x3p, mask_vals = mask_col)
Expand Down
2 changes: 1 addition & 1 deletion man/x3p_insidepoly_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 56beece

Please sign in to comment.