Ignore:
Timestamp:
Jan 8, 2010, 2:04:22 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
22b47e
Parents:
eda56a
Message:

Attempt to fix the tesselation::IsInnerPoint().

We try the IsInnerPoint() as follows:

  1. Find nearest BoundaryPoints - working
  2. Find Closest BoundaryLine's - working
  3. Find closest Triangle that is well aligned (wrt to NormalVector and Distance) - unsure whether correctly working
  4. Check whether alignment is on boundary or inside/outside - working
  5. If on boundary, we check whether it's inside of triangle by intersecting with boundary lines - not working

Hence, we code a wrapper for GSL routines, to - finally - allow for solution of linear system of equations.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/unittests/tesselation_insideoutsideunittest.cpp

    reda56a ra1acc5  
    2626void TesselationInOutsideTest::setUp()
    2727{
    28   setVerbosity(3);
     28  setVerbosity(5);
    2929
    3030  // create corners
     
    3232  Walker = new TesselPoint;
    3333  Walker->node = new Vector(0., 0., 0.);
    34   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     34  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    3535  strcpy(Walker->Name, "1");
    3636  Walker->nr = 1;
     
    3838  Walker = new TesselPoint;
    3939  Walker->node = new Vector(0., 1., 0.);
    40   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     40  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    4141  strcpy(Walker->Name, "2");
    4242  Walker->nr = 2;
     
    4444  Walker = new TesselPoint;
    4545  Walker->node = new Vector(1., 0., 0.);
    46   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     46  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    4747  strcpy(Walker->Name, "3");
    4848  Walker->nr = 3;
     
    5050  Walker = new TesselPoint;
    5151  Walker->node = new Vector(1., 1., 0.);
    52   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     52  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    5353  strcpy(Walker->Name, "4");
    5454  Walker->nr = 4;
     
    5656  Walker = new TesselPoint;
    5757  Walker->node = new Vector(0., 0., 1.);
    58   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     58  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    5959  strcpy(Walker->Name, "5");
    6060  Walker->nr = 5;
     
    6262  Walker = new TesselPoint;
    6363  Walker->node = new Vector(0., 1., 1.);
    64   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     64  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    6565  strcpy(Walker->Name, "6");
    6666  Walker->nr = 6;
     
    6868  Walker = new TesselPoint;
    6969  Walker->node = new Vector(1., 0., 1.);
    70   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     70  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    7171  strcpy(Walker->Name, "7");
    7272  Walker->nr = 7;
     
    7474  Walker = new TesselPoint;
    7575  Walker->node = new Vector(1., 1., 1.);
    76   Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp");
     76  Walker->Name = Malloc<char>(3, "TesselationInOutsideTest::setUp - *Name");
    7777  strcpy(Walker->Name, "8");
    7878  Walker->nr = 8;
     
    146146{
    147147  double n[3];
    148   const double boundary = 5.;
     148  const double boundary = 2.;
    149149  const double step = 1.;
    150150
     
    153153    for (n[1] = -boundary; n[1] <= boundary; n[1]+=step)
    154154      for (n[2] = -boundary; n[2] <= boundary; n[2]+=step) {
    155         if ( ((n[0] > 0) && (n[0] > 0) && (n[0] > 0)) && (n[0]+n[1]+n[2] <= 1.))
     155        if ( ((n[0] >= 0.) && (n[1] >= 0.) && (n[2] >= 0.)) && (fabs(n[0])+fabs(n[1])+fabs(n[2]) <= 1.))
    156156          CPPUNIT_ASSERT_EQUAL( true , TesselStruct->IsInnerPoint(Vector(n[0], n[1], n[2]), LinkedList) );
    157157        else
Note: See TracChangeset for help on using the changeset viewer.