reduce

Purpose

Reduces the overlapping union to minimal number of sets.

Syntax

kept = U.reduce
kept = reduce(U)

Description

Simplifies the union of polyhedra by removing those regions who are completely covered by others. Note that this algorithm is valid only for overlapping unions.

Input Arguments

U

Union of polyhedra in the same dimension.

Class: PolyUnion

kept

Vector of logical indices indicating if the region is non-redundant.

Class: logical

Allowed values:

  • true
  • false

Example(s)

Example 1

Create a random H-polyhedron that contains the origin.
P = 5*ExamplePoly.randHrep;
 Create another polyhedron that is contained within P 
      
 Q = 0.8*P; 
 Create another random polyhedron.
 R = ExamplePoly.randVrep+[1;5]; 
Create the union of polyhedra without specifying any properties.
 U = PolyUnion([P,Q,R]) 
PolyUnion in the dimension 2 with 3 polyhedra.
Functions : none
Plot the union
 U.plot 

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

This union can be reduced to only regions P and R because Q is completely covered by P.
 U.reduce 
ans =

     1     0     1

We can see that the union has now only 2 polyhedra. Plot the reduced union
 U.plot 

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

See Also

merge, isoverlapping


© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk

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