isConnected

Purpose

Test if the union of polyhedra form a connected union.

Syntax

ts = U.isConnected
ts = isConnected(U)

Description

Return true if the union U of polyhedra is connected and false otherwise. Once this method has been called, the information about the connectivity can be retrieved from U.Internal.Connected property. Note tha if the union U is convex, it implies that the union is connected. Note that this function is computationally demanding and is suitable for unions with small number of polyhedra.

Input Arguments

U

Union of polyhedra in the same dimension.

Class: PolyUnion

Output Arguments

ts

True if union of polyhedra is connected and false otherwise.

Class: logical

Allowed values:

  • true
  • false

Example(s)

Example 1

Create three polyhedra that are not connected.
P(1) = Polyhedron('lb',[-1;0],'ub',[-1;1]);
 Shift the polyhedron P(1) 
      
P(2) = P(1) + [1;0];

P(3) = P(1) + [2;0];
 Plot the polyhedra to see that they are not connected. 
 P.plot('LineWidth',3); axis([-2 2 -1 2]); 

../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/isconnected_img_1.png

Create union out of these polyhedra without specifying the properties
 U = PolyUnion(P) 
PolyUnion in the dimension 2 with 3 polyhedra.
Functions : none
Check if the union is connected
 U.isConnected 
ans =

     0

The information about the connectivity can be accessed in
 U.Internal.Connected 
ans =

     0

See Also

isconvex, isoverlapping, isfulldim, isbounded


© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch