calculateLinesAndArrow: Gets offsetted lines

View source: R/RcppExports.R

calculateLinesAndArrowR Documentation

Gets offsetted lines

Description

The function calculates new points according to the offset that lie to the left/right of the provided line.

Usage

calculateLinesAndArrow(
  x,
  y,
  offset,
  end_x = -1,
  end_y = -1,
  arrow_offset = -1,
  rm_intersect = 3L
)

Arguments

x

A numeric vector containing all the x-elements

y

A numeric vector containing all the y-elements

offset

The offset to add to the line, can be a vector if you want to use different offsets.

end_x

The x end of the line where the arrow occurrs (if < 0 arrow is skipped)

end_y

The y end of the line where the arrow occurrs (if < 0 arrow is skipped)

arrow_offset

The offset to add to the arrow section if any (if <= 0 arrow is skipped)

rm_intersect

Set to 0 if you want to skip intersection removal, 1 only to remove left or 2 to only remove right. See details for why.

@section Remove intersections:

When the line is wide and the arrow has a narrow curve there may appear an empty triangle due to polygon cancellation (two polygons within the same are cancel out). This behaviour may be ugly and the function therefor tries to remove these.

Note: it is expensive to check if there are the lineas may intersect at one point, remove those unexpected, and then adjust the line to the new situation so that the top and bottom lines match. It can also cause some unexpected behaviour why you may want to remove this feature if the arrow behaves erratically.

Value

list(list(x = ..., y = ...)) Returns a list with the right/left lines that in turn lists with x and y elements


Gmisc documentation built on Aug. 26, 2023, 1:07 a.m.