问题描述
我正在使用X=rpoisline(4)
生成线并用plot(X)
绘制它们.在X$ends
中,我的坐标和交点与selfcrossing.psp(X)
(在R中,带有spatstat的library(spatstat)
).
I'm using X=rpoisline(4)
to generate lines and plot them with plot(X)
.With X$ends
I have their coordinates and their intersection points with selfcrossing.psp(X)
(In R with spatstat : library(spatstat)
).
我需要获取线段及其坐标的列表,并能够对其进行操作(更改其方向,位置,交点...).这些线段必须由一条线与另一条线和窗口的交点定义.
I need to get a list of segments and their coordinates and be able to manipulate them (change their orientation, position, intersection...). Those segments have to be defined by the intersection of a line with an other line and with the window.
那么,我是否缺少一种简单的方法来将不相交段的 psp 中的几个相交线的 psp 转换(我希望这很清楚)?
So, am I missing a simple way to convert a psp of few intersecting lines in a psp of non intersecting segments (I hope it's clear) ?
如果您使用的是非简单方式,我很感兴趣!
If you have a non-simple way, I'm interested to !
感谢您的时间!
这是我的台词:
这是我认为如果设法处理每个段(一个接一个地)的话,我可以产生的那种随机的东西.因此,我需要从随机行列表中获取细分列表.
And here are the kind of random stuff I think I can produce if I manage to handle each segments (one by one). So I need to get a list of segments from my list of random lines.
推荐答案
spatstat
函数selfcut.psp
正是为此目的而设计的.
The spatstat
function selfcut.psp
is designed for exactly this purpose.
Y <- selfcut.psp(X)
有关操纵线段模式的更多信息,请参见 spatstat书籍中的4.4节.
For further information about manipulating line segment patterns, see section 4.4 in the spatstat book.
这篇关于如何从随机自拦截线(R中的psp)列表中生成分段列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!