isConvex

Purpose

Test if the union of polyhedra is convex.

Syntax

ts = U.isConvex
ts = isConvex(U)

Description

Return true if the union U of polyhedra is convex and false otherwise. Once this method has been called, the information about the convexity can be retrieved from U.Internal.Convex property. Note that this function is very 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 convex and false otherwise.

Class: logical

Allowed values:

  • true
  • false

Example(s)

Example 1

Create a random polyhedron in V-representation.
P = 10*ExamplePoly.randVrep;
 Triangulate polyhedron to get a partition. 
 T = P.triangulate 
Array of 4 polyhedra.
Create union out of these polyhedra without specifying the properties
 U = PolyUnion(T) 
PolyUnion in the dimension 2 with 4 polyhedra.
Functions : none
Check if the union is convex
 U.isConvex 
ans =

     1

We can plot the union to see that it is truly convex.
 U.plot 

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

See Also

isconnected, isoverlapping, isfulldim, isbounded


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