Exemplo n.º 1
0
        public static bool GetDistance(this IBody2 body0, IBody2 body1, out double[] p0, out double [] p1)
        {
            var faces0    = body0.GetFaces().CastArray <IFace2>();
            var faces1    = body1.GetFaces().CastArray <IFace2>();
            var distances = GetDistances(faces0, faces1);

            p0 = null;
            p1 = null;


            var shortest = distances.MinBy(t => MathPointExtensions.Distance(t.Item1, t.Item2));

            if (shortest.Count == 0)
            {
                return(false);
            }

            p0 = shortest[0].Item1;
            p1 = shortest[0].Item2;

            return(true);
        }
Exemplo n.º 2
0
 public static bool PlaneNormalEquals(this IRefPlane p, IMathUtility mathUtility, double[] normal, double tol)
 {
     return(MathPointExtensions.Equals(mathUtility.Vector(p.Normal(mathUtility)), mathUtility.Vector(normal), tol));
 }
Exemplo n.º 3
0
 public static bool PlaneOriginEquals(this IRefPlane p, IMathUtility mathUtility, double[] origin, double tol)
 {
     return(MathPointExtensions.Equals(mathUtility.Point(p.Origin(mathUtility)), mathUtility.Point(origin), tol));
 }