Commit f2230bbf authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[test][constraints][disk] test constraints with quad also

parent 11f97873
......@@ -3,6 +3,7 @@
#include <stdexcept>
#include <frackit/geometry/disk.hh>
#include <frackit/geometry/quadrilateral.hh>
#include <frackit/geometry/cylinder.hh>
#include <frackit/entitynetwork/constraints.hh>
......@@ -12,6 +13,7 @@ int main()
using ctype = double;
using Disk = Frackit::Disk<ctype>;
using Quad = Frackit::Quadrilateral<ctype, 3>;
using Point = typename Disk::Point;
using Direction = typename Disk::Direction;
using Vector = typename Direction::Vector;
......@@ -87,6 +89,27 @@ int main()
throw std::runtime_error("Did not detect intersection angle violation");
std::cout << "Test 9 passed" << std::endl;
// test both intersection angles also with quadrilaterals
{
// intersection angle just ok
Quad quad1(Point(-1.0, -1.0, -1.0 - 0.5e-3),
Point( 1.0, -1.0, -1.0 - 0.5e-3),
Point(-1.0, 1.0, 1.0 + 0.5e-3),
Point( 1.0, 1.0, 1.0 + 0.5e-3));
if (!constraints.evaluate(mainDisk, quad1))
throw std::runtime_error("False positive intersection angle violation");
std::cout << "Test 8 with quad passed" << std::endl;
// intersection angle too small
Quad quad2(Point(-1.0, -1.0, -1.0 + 0.5e-3),
Point( 1.0, -1.0, -1.0 + 0.5e-3),
Point(-1.0, 1.0, 1.0 - 0.5e-3),
Point( 1.0, 1.0, 1.0 - 0.5e-3));
if (constraints.evaluate(mainDisk, quad2))
throw std::runtime_error("Did not detect intersection angle violation");
std::cout << "Test 9 with quad passed" << std::endl;
}
// Test constraints w.r.t. cylinder
Frackit::Cylinder<ctype> cylinder(0.5, 1.0);
Disk disk10(Point(0.0, 0.0, 0.5), e1, e2, 2.0, 2.0);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment