Intersection of 2 polyhedra using intersectn() R

一世执手 提交于 2020-01-05 04:21:10

问题


I have 2 polyhedra generated by the following extreme points:

df1 = structure(c(3, 5, 8, 6), .Dim = c(2L, 2L))
df2 = structure(c(2, 4, 9, 7), .Dim = c(2L, 2L))

Those points, taken as constraint inequalities, create a space. I would like to select the hull formed by the intersection of those 2 polyhedra.

The use of the function intersectn() from the geometry package, but I get the following error.

Error in convhulln(ps1, "n FA") : 
  Received error code 1 from qhull. Qhull error:
QH6214 qhull input error: not enough points(2) to construct initial simplex (need 3)

While executing:  | qhull n FA  Qt
Options selected for Qhull 2015.2.r 2016/01/18:
  run-id 2112210196  normals  FArea-total  Qtriangulate  _pre-merge
  _zero-centrum

Any idea why I am getting this error? The following example works.

ps1 <- rbox(0, C=0.5)
ps2 <- rbox(0, C=0.5) + 0.5
out <- intersectn(ps1, ps2)

来源:https://stackoverflow.com/questions/59336288/intersection-of-2-polyhedra-using-intersectn-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!