Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

selfcut.psp

Cut Line Segments Where They Intersect


Description

Finds any crossing points between the line segments in a line segment pattern, and cuts the segments into pieces at these crossing-points.

Usage

selfcut.psp(A, ..., eps)

Arguments

A

Line segment pattern (object of class "psp").

eps

Optional. Smallest permissible length of the resulting line segments. There is a sensible default.

...

Ignored.

Details

This function finds any crossing points between different line segments in the line segment pattern A, and cuts the line segments into pieces at these intersection points.

A crossing point occurs whenever one of the line segments in A intersects another line segment in A, at a nonzero angle of intersection.

Value

Another line segment pattern (object of class "psp") in the same window as A with the same kind of marks as A.

The result also has an attribute "camefrom" indicating the provenance of each segment in the result. For example camefrom[3]=2 means that the third segment in the result is a piece of the second segment of A.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

X <- psp(runif(10), runif(10), runif(10), runif(10), window=owin())
  Y <- selfcut.psp(X)
  n <- nsegments(Y)
  plot(Y %mark% factor(sample(seq_len(n), n, replace=TRUE)))

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.