From 15d0f93f8bf1d50331f30d44412ddec8b82f1bfd Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Mon, 3 Apr 2023 14:16:31 +0100 Subject: [PATCH] refactor: remove Polyhedron.IsConvex --- X10D/src/Drawing/Polyhedron.cs | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/X10D/src/Drawing/Polyhedron.cs b/X10D/src/Drawing/Polyhedron.cs index 15538fb..2f46ca0 100644 --- a/X10D/src/Drawing/Polyhedron.cs +++ b/X10D/src/Drawing/Polyhedron.cs @@ -55,37 +55,6 @@ public class Polyhedron : IEquatable get => new(); } - /// - /// Returns a value indicating whether this polyhedron is convex. - /// - /// if this polyhedron is convex; otherwise, . - public bool IsConvex - { - get - { - if (_vertices.Count < 4) - { - return false; - } - - Vector3[] vertices = _vertices.ToArray(); - int n = vertices.Length; - - for (var i = 0; i < n; i++) - { - int j = (i + 1) % n; - int k = (i + 2) % n; - - if (Vector3.Cross(vertices[j] - vertices[i], vertices[k] - vertices[j]).LengthSquared() < 1e-6f) - { - return false; - } - } - - return true; - } - } - /// /// Gets the number of vertices in this polyhedron. ///