shortcut to is_planar check

This commit is contained in:
David Rose 2004-11-24 22:20:42 +00:00
parent 1ed3266d9e
commit ac4d4d1c1c
1 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,12 @@ calculate_normal(Normald &result, CoordinateSystem cs) const {
////////////////////////////////////////////////////////////////////
bool EggPolygon::
is_planar() const {
if (size() <= 3) {
// If we don't have more than three vertices, we can't be
// non-planar.
return true;
}
Normald normal;
if (!calculate_normal(normal)) {
// A degenerate polygon--all of the vertices are within one line,