# quickhull quick question

This topic is 4492 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 Link The 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

##### Share on other sites
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 see
thx alot!

1. 1
2. 2
Rutin
15
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633270
• Total Posts
3011155
• ### Who's Online (See full list)

There are no registered users currently online

×