classdef testPolytopeBugList < TestCase
    methods
        %% Setup functions
        function self = testPolytopeBugList(name)
            self = self@TestCase(name);
        end
        
        %% Vertices too close
        % Whenever vertices are almost equal, this causes cddlib to crash.
        % Scaling cannot solve the problem. Afterwards, the dual polytope
        % is calculated. Close vertices are converted to planes
        function testAlmostEqualVertices(self)
            vrepLarge = obtainVrep('cube');
            vrepSmall = 1e-5*obtainVrep('bipyramid', 3);
            vrep = addMinkowskiVrep(vrepLarge, vrepSmall);
            
            hrep = convertVrepToHrep(vrep);
            %hrep{1}
            %hrep{2}
        end
    
        function testAlmostEqualVertices2(self)
            vrepLarge = obtainVrep('cube');
            vrepSmall = 1e-5*obtainVrep('bipyramid', 3);
            vrep = addMinkowskiVrep(vrepLarge, vrepSmall);
            vrep = 1e3*reduceVrep(1e-3*vrep);
            
            hrep = convertVrepToHrep(vrep);
            %hrep{1}
            %hrep{2}
        end
        
        function testTwoAlmostEqualVertices(self)
            vrepLarge = obtainVrep('cube');
            vrepSmall = 1e-6*obtainVrep('line', 3);
            vrepSmall = rotateVrep3d(vrepSmall, 'y', pi/4);
            
            
            vrep = addMinkowskiVrep(vrepLarge, vrepSmall);
            
            hrep = convertVrepToHrep(vrep);
            %hrep{1}
            %hrep{2}
        end
     
        
    end
end