Research Article

Efficient Boundary Extraction from Orthogonal Pseudo-Polytopes: An Approach Based on the 𝑛 D-EVM

Algorithm 4

Extracting D boundary elements from an OPP expressed in the EVM.
Input:     An D-OPP
   The number k of dimensions
   A list boundaryElements containing lists.
   A list previousCoordinates for completing the coordinates of
  -coordinates points.
Procedure GetBoundaryElements(EVM ,int k,List boundaryElements,List previousCoordinates)
    if then
    EVM FDcurr, BDcurr
    List v = GetSetVX1
    List identifiedBoundaryElements = boundaryElements
    List vertices = boundaryElements(0)
    {FD, BD} = GetForwardBackwardDifferences
     for(int Size(FD), )  // Forward Differences are processed.
       EVM FDcurr = FD(i)
       List compsFDcurr = ConnectedComponentsLabeling(FDcurr, )
       CoordType commonCoord = v(i)
       for(int Size(compsFDcurr), )
         EVM currComp = compsFDcurr(j)
         List verticesCurrComp
         for each Extreme Vertex eV in currComp do
           List point = getNdPoint(eV, commonCoord, previousCoordinates)
           int index = IndexOf(vertices, point)
           if(index < 0) then // A new point has been discovered.
             Append(vertices, point)
             index = Size(vertices) βˆ’ 1
             end-of-if
             Append(verticesCurrComp, index)
           end-of-for
           int index = IndexOf(identifiedBoundaryElements, verticesCurrComp)
           if(index < 0) then // A new boundary element has been found.
             Append(identifiedBoundaryElements, verticesCurrComp)
           end-of-if
           Append(previousCoordinates, commonCoord)
           // Recursive call for identifying new boundary elements.
           GetBoundaryElements(currComp, , boundaryElements, previousCoordinates)
           Remove(previousCoordinates, Size(previousCoordinates) - 1)
         end-of-for
       end-of-for
       for(int Size(BD), )  // Backward differences are processed.
         EVM BDcurr = BD(i)
         List compsBDcurr = ConnectedComponentsLabeling(BDcurr, )
         CoordType commonCoord = v(i)
         for(int Size(compsBDcurr), )
           EVM currComp = compsBDcurr(j)
           List verticesCurrComp
           for each Extreme Vertex eV in currComp do
             List point = getNdPoint(eV, commonCoord, previousCoordinates)
             int index = IndexOf(vertices, point)
             if(index < 0) then // A new point has been discovered.
               Append(vertices, point)
               index = Size(vertices) βˆ’ 1
             end-of-if
             Append(verticesCurrComp, index)
           end-of-for
           int index = IndexOf(identifiedBoundaryElements, verticesCurrComp)
           if(index < 0) then // A new boundary element has been found.
             Append(identifiedBoundaryElements, verticesCurrComp)
           end-of-if
           Append(previousCoordinates, commonCoord)
           // Recursive call for identifying new boundary elements.
           GetBoundaryElements(currComp, , boundaryElements, previousCoordinates)
           Remove(previousCoordinates, Size(previousCoordinates) - 1)
         end-of-for
       end-of-for
     end-of-if
    end-of-procedure