Test if a polyhedron touches another polyhedron along a given facet.
ts = P.isNeighbor(Q)
ts = isNeighbor(P,Q)
[ts, iP, iQ] = isNeighbor(P,Q,fP,fQ)
P |
Polyhedron in H-representation Class: Polyhedron |
Q |
Polyhedron in H-representation Class: Polyhedron |
fP |
Index of a facet to test from polyhedron ![]() Class: double |
fQ |
Index of a facet to test from polyhedron ![]() Class: double |
ts |
Logical statement if the polyhedron ![]() ![]() Class: logical Allowed values:
|
iP |
Index of a facet from polyhedron ![]() ![]() Class: double |
iQ |
Index of a facet from polyhedron ![]() ![]() Class: double |
R1 = Polyhedron([0 0; 2 0; 0 1; 2 1]);
R2 = Polyhedron([1 0; 2 0; 1 -1; 2 -1]);
R3 = Polyhedron([2 0; 3 0; 2 -1; 3 -1]);Plot the polyhedrons to see that they are touching themself.
plot([R1 R2 R3], 'showindex', true)
R1.isNeighbor(R2)
ans = 1Check that the fourth facet of the polyhedron R2 touches the second facet of polyhedron R3.
[ts, iR2, iR3] = R2.isNeighbor(R3)
ts = 1 iR2 = 2 iR3 = 4Actually, the facets of R2 and R3 are the same, so these polyhedra have face to face property that can be checked using isAdjacent method.
R2.isAdjacent(R3)
ans = 1
◀ | minhrep | contains | ▶ |
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch