Skip to contents

The 3d topographic surface is split into multiple segments of width width (in pixels) using an overlap of 10% between segments. For each segment, a line is extracted (with x3p_extract_profile). Line segments are projected onto the mask of the initial x3p object and exported as a lines attribute.

Usage

x3p_extract_profile_segments(
  x3p,
  width,
  overlap = 10,
  col = "#FF0000",
  linewidth = 11,
  line_result = "equi-spaced",
  scale_to = NA,
  verbose = TRUE
)

Arguments

x3p

object

width

segment width

overlap

percentage of overlap between segments

col

color

linewidth

integer value specifying the width for the profile

line_result

enhance result by the line: NULL for no, "raw" for a list of data frames of original x and y (in the mask) and projected x onto the line, "equi-spaced" (default) returns a single data frame with equi-spaced x values after fitting a loess smooth to the raw values. Note that variable x indicates the direction from first click (x=0) to the second click (max x) in steps of scale_to.

scale_to

positive number indicating the resolution for the line returned.

verbose

logical

Value

x3p object with added lines attribute.

Examples

logo <- x3p_read(system.file("csafe-logo.x3p", package="x3ptools"))
logo <- x3p_m_to_mum(logo)
if(interactive())
  x3p_extract_profile_segments(logo, 850, col="#ffffff", linewidth=5)