tomilov / quickhull

Header-only single-class implementation of Quickhull algorithm for convex hulls finding in arbitrary dimension (>1) space.
https://habr.com/ru/articles/245221/
70 stars 8 forks source link

In 3D cases, are facets triangular facets? #12

Closed wangxi0706 closed 1 year ago

wangxi0706 commented 1 year ago

Elegant codes!

In 3D cases, are facets triangular facets?

tomilov commented 1 year ago

Hi, thanks. In 3D they are triangular

wangxi0706 commented 1 year ago

Hi, thanks. In 3D they are triangular

Thanks! It helps a lot.

wangxi0706 commented 1 year ago

Another two questions: 1 Does the unit normal of facet point outward of the hull? 2 Is vertex order always anti-clock wise when seeing from outside the hull?

tomilov commented 1 year ago
  1. You can find distance function. SIgned distances compared by value and there is sign checks, so normal should be oriented outwards.
  2. Seems no, but really I don't remember. I pretty sure it should be possible to rewrite the algorithm in such a way, that this symmetry will be maintained at every intermediate step for free (in natural way). As I already mainained to do for vertices_ and neighbours_. Such a symmetries come from Platonic world of Forms: (I believe) there is ideal way to implement the algorithm with many useful invariants right from the box.
wangxi0706 commented 1 year ago

Thanks for your explanation!