Beispiel #1
0
        public void AllCoplanarTest()
        {
            Vector3 pointA = new Vector3(1, 1, 0);
            Vector3 pointB = new Vector3(2, 1, 0);
            Vector3 pointC = new Vector3(1, 2, 0);
            Vector3 pointD = new Vector3(2, 2, 0);
            Vector3 pointE = new Vector3(3, 2, 0);
            Vector3 pointF = new Vector3(3, 3, 0);

            Vector3 normal = StereoTool.GetNormal(pointA, pointB, pointC);

            Assert.IsTrue(StereoTool.AllCoplanar(normal, pointA, pointB, pointC, pointD, pointE, pointF));
        }
Beispiel #2
0
        private static bool IsSquarePlanar(Vector3 pointA, Vector3 pointB, Vector3 pointC, Vector3 pointD, out Vector3 normal)
        {
            // define a plane using ABC, also checking that the are not colinear
            Vector3 vectorAB = new Vector3();
            Vector3 vectorAC = new Vector3();

            GetRawNormal(pointA, pointB, pointC, out normal, out vectorAB, out vectorAC);
            if (StereoTool.IsColinear(normal))
            {
                return(false);
            }

            // check that F is in the same plane as CDE
            return(StereoTool.AllCoplanar(normal, pointC, pointD));
        }