   quickhull quick question
  hihi!I am wondering how does the author of the code for ConvexHull3 in Geometric Tools determine the ordering of extremal vertex indices when assigning them to HullTriangles to build up their adjacency information. Code LinkThe snippet I am looking at is:if (kMapper.GetExtremeCCW()){   pkT0 = WM3_NEW HullTriangle3<Real>(i0,i1,i3);   pkT1 = WM3_NEW HullTriangle3<Real>(i0,i2,i1);   pkT2 = WM3_NEW HullTriangle3<Real>(i0,i3,i2);   pkT3 = WM3_NEW HullTriangle3<Real>(i1,i2,i3);   pkT0->AttachTo(pkT1,pkT3,pkT2);   pkT1->AttachTo(pkT2,pkT3,pkT0);   pkT2->AttachTo(pkT0,pkT3,pkT1);   pkT3->AttachTo(pkT1,pkT2,pkT0);    }    else    {   pkT0 = WM3_NEW HullTriangle3<Real>(i0,i3,i1);   pkT1 = WM3_NEW HullTriangle3<Real>(i0,i1,i2);   pkT2 = WM3_NEW HullTriangle3<Real>(i0,i2,i3);   pkT3 = WM3_NEW HullTriangle3<Real>(i1,i3,i2);   pkT0->AttachTo(pkT2,pkT3,pkT1);   pkT1->AttachTo(pkT0,pkT3,pkT2);   pkT2->AttachTo(pkT1,pkT3,pkT0);   pkT3->AttachTo(pkT0,pkT2,pkT1);    }thx!Edwin   
Quote:Original post by edwinnieI am wondering how does the author of the code for ConvexHull3 in Geometric Tools determine the ordering of extremal vertex indices when assigning them to HullTriangles to build up their adjacency information.That code is not "quickhull"; rather, it builds the hull incrementally.  In the code segment you posted, there is a Mapper3 object.  When you look at the source code for Mapper3, its job is to determine if the point set is (nearly) degenerate (point, linear, planar).  The point set is not degenerate when Mapper3 has located four non-coplanar points.  These are the vertices of a tetrahedron.Just as the vertices of a planar triangle can have two possible orderings (clockwise or counterclockwise), the vertices of a tetrahedron can have two possible orderings (clockwise or counterclockwise).  The ordering is based on how the triangle faces appear to an observer outside the tetrahedron.  Mapper3 determines this information, which you obtain by calling GetExtremeCCW().;  ah i seethx alot!   