Пример #1
0
        private void DebugPoint(Vector3d vector3d, DMeshAABBTree3.IntersectionsQueryResult intersections)
        {
            Debug.WriteLine($"=====  Search {vector3d.CommaDelimited}");
            int i = -1;

            foreach (var seg in intersections.Segments)
            {
                i++;
                if (
                    seg.point0.DistanceSquared(vector3d) > 0
                    &&
                    seg.point1.DistanceSquared(vector3d) > 0
                    )
                {
                    continue;
                }
                // found one
                Debug.WriteLine($"In intersection segments [{i}] {vector3d.CommaDelimited}");
                var hitPoint = (seg.point0.DistanceSquared(vector3d) > 0) ? "point1" : "point0"; // one of the two must be
                Debug.WriteLine($"  hit: {hitPoint}");
                Debug.WriteLine($"  tris: tri0={seg.t0}, tri1={seg.t1}");
                Debug.WriteLine($"  seg: {seg.point0.CommaDelimited} to {seg.point1.CommaDelimited}");
                Debug.WriteLine($"  delta: {(seg.point0 - seg.point1).CommaDelimited}");
            }
            i = -1;
            foreach (var seg in intersections.Points)
            {
                i++;
                if (
                    seg.point.DistanceSquared(vector3d) > 0
                    )
                {
                    continue;
                }
                // found one
                Debug.WriteLine($"In intersection points [{i}] {vector3d.CommaDelimited}");
                Debug.WriteLine($"  tri: tri0 {seg.t0}, tri1: {seg.t1}  ");
            }
            DebugInfo("Triangle", FaceVertices, vector3d);
            DebugInfo("Edge", EdgeVertices, vector3d);
            Debug.WriteLine($"=====  End Search {vector3d.CommaDelimited}");
        }
Пример #2
0
        internal static void DebugIntersectionsInfo(DMeshAABBTree3.IntersectionsQueryResult intersections, DMesh3 mesh0, DMesh3 mesh1)
        {
            // Debug.WriteLine("Points");
            foreach (var point in intersections.Points)
            {
                Debug.WriteLine("Point");
                Debug.WriteLine(point.point.CommaDelimited);
            }
            // Debug.WriteLine("Segments");
            int i = 0;

            foreach (var segment in intersections.Segments)
            {
                Debug.WriteLine($"-COLOR {(i++ % 7) + 1}");

                Debug.WriteLine("Line");
                Debug.WriteLine(segment.point0.CommaDelimited);
                Debug.WriteLine(segment.point1.CommaDelimited);
                Debug.WriteLine("");
            }
        }