Пример #1
0
        // Token: 0x06000130 RID: 304 RVA: 0x0000658C File Offset: 0x0000478C
        public static double DistanceTo(this Ray3 ray3, Arc3 arc3)
        {
            Line3             line             = new Line3(ray3.Origin, ray3.Direction);
            DistanceLine3Arc3 distanceLine3Arc = new DistanceLine3Arc3(line, arc3);

            if (distanceLine3Arc.LineParameter < 0.0)
            {
                return(ray3.Origin.DistanceTo(arc3));
            }
            return(distanceLine3Arc.Distance);
        }
Пример #2
0
        // Token: 0x06000023 RID: 35 RVA: 0x0000265C File Offset: 0x0000085C
        public static Vector3 ClosestPointTo(this Arc3 arc3, Ray3 ray3)
        {
            Line3             line             = new Line3(ray3.Origin, ray3.Direction);
            DistanceLine3Arc3 distanceLine3Arc = new DistanceLine3Arc3(line, arc3);

            if (distanceLine3Arc.LineParameter < 0.0)
            {
                return(arc3.ClosestPointTo(ray3.Origin));
            }
            return(distanceLine3Arc.ClosestPointOnArc);
        }
Пример #3
0
        // Token: 0x06000024 RID: 36 RVA: 0x000026B0 File Offset: 0x000008B0
        public static Segment3 ShortestSegmentTo(this Arc3 arc3, Ray3 ray3)
        {
            Line3             line             = new Line3(ray3.Origin, ray3.Direction);
            DistanceLine3Arc3 distanceLine3Arc = new DistanceLine3Arc3(line, arc3);

            if (distanceLine3Arc.LineParameter < 0.0)
            {
                return(arc3.ShortestSegmentTo(ray3.Origin));
            }
            return(new Segment3(distanceLine3Arc.ClosestPointOnArc, distanceLine3Arc.ClosestPointOnLine));
        }
Пример #4
0
        // Token: 0x06000074 RID: 116 RVA: 0x0000356C File Offset: 0x0000176C
        public DistanceVector3Arc3(Vector3 vector, Arc3 arc)
        {
            this = default(DistanceVector3Arc3);
            DistanceVector3Circle3 distanceVector3Circle = new DistanceVector3Circle3(vector, arc.Circle);

            this.ClosestPointOnArc = distanceVector3Circle.ClosestPointOnCircle;
            if (!arc.Contains(arc.Circle.GetPointDirectionAngle(this.ClosestPointOnArc)))
            {
                double squaredLength  = (vector - arc.StartPoint).SquaredLength;
                double squaredLength2 = (vector - arc.EndPoint).SquaredLength;
                this.ClosestPointOnArc = ((squaredLength2 < squaredLength) ? arc.EndPoint : arc.StartPoint);
            }
            this.SquaredDistance      = (vector - this.ClosestPointOnArc).SquaredLength;
            this.ClosestPointOnVector = vector;
        }
Пример #5
0
        // Token: 0x06000026 RID: 38 RVA: 0x000027A8 File Offset: 0x000009A8
        public static Vector3 ClosestPointTo(this Arc3 arc3, Segment3 segment3)
        {
            Line3             line             = new Line3(segment3.NegativeEnd, segment3.Direction);
            DistanceLine3Arc3 distanceLine3Arc = new DistanceLine3Arc3(line, arc3);

            if (distanceLine3Arc.LineParameter < 0.0)
            {
                return(arc3.ClosestPointTo(segment3.NegativeEnd));
            }
            Line3             line2             = new Line3(segment3.PositiveEnd, -segment3.Direction);
            DistanceLine3Arc3 distanceLine3Arc2 = new DistanceLine3Arc3(line2, arc3);

            if (distanceLine3Arc2.LineParameter < 0.0)
            {
                return(arc3.ClosestPointTo(segment3.PositiveEnd));
            }
            return(distanceLine3Arc2.ClosestPointOnArc);
        }
Пример #6
0
        // Token: 0x06000044 RID: 68 RVA: 0x00002C9C File Offset: 0x00000E9C
        public DistancePlane3Arc3(Plane3 plane, Arc3 arc)
        {
            this = default(DistancePlane3Arc3);
            double num  = arc.StartPoint.SignedDistanceTo(plane);
            double num2 = arc.EndPoint.SignedDistanceTo(plane);

            if (Math.Sign(num) != Math.Sign(num2))
            {
                this.SignedDistance = 0.0;
                return;
            }
            DistancePlane3Circle3 distancePlane3Circle = new DistancePlane3Circle3(plane, arc.Circle);
            double  signedDistance       = distancePlane3Circle.SignedDistance;
            Vector3 closestPointOnCircle = distancePlane3Circle.ClosestPointOnCircle;
            bool    flag = arc.Contains(arc.Circle.GetPointDirectionAngle(closestPointOnCircle));

            if (signedDistance != 0.0)
            {
                if (flag)
                {
                    this.SignedDistance = signedDistance;
                    return;
                }
                this.SignedDistance = ((num > 0.0) ? Math.Min(num, num2) : Math.Max(num, num2));
                return;
            }
            else
            {
                if (Math.Sign(arc.Circle.Center.SignedDistanceTo(plane)) != Math.Sign(num))
                {
                    this.SignedDistance = ((num > 0.0) ? Math.Min(num, num2) : Math.Max(num, num2));
                    return;
                }
                if (flag)
                {
                    this.SignedDistance = 0.0;
                    return;
                }
                this.SignedDistance = ((num > 0.0) ? Math.Min(num, num2) : Math.Max(num, num2));
                return;
            }
        }
Пример #7
0
        // Token: 0x0600007C RID: 124 RVA: 0x00003660 File Offset: 0x00001860
        public DistanceLine3Arc3(Line3 line, Arc3 arc)
        {
            this = default(DistanceLine3Arc3);
            Circle3 circle = arc.Circle;
            IEnumerable <double> polynomialRoots = DistanceLine3Circle3.GetPolynomialRoots(line, circle);
            double num = double.MaxValue;

            foreach (double num2 in polynomialRoots)
            {
                Vector3             vector             = line.Origin + num2 * line.Direction;
                DistanceVector3Arc3 distanceVector3Arc = new DistanceVector3Arc3(vector, arc);
                double squaredDistance = distanceVector3Arc.SquaredDistance;
                if (squaredDistance < num)
                {
                    num = squaredDistance;
                    this.ClosestPointOnLine = distanceVector3Arc.ClosestPointOnVector;
                    this.ClosestPointOnArc  = distanceVector3Arc.ClosestPointOnArc;
                    this.LineParameter      = num2;
                }
            }
            this.SquaredDistance = num;
        }
Пример #8
0
        // Token: 0x0600002C RID: 44 RVA: 0x00002958 File Offset: 0x00000B58
        public static double SignedDistanceTo(this Arc3 arc3, Plane3 plane3)
        {
            DistancePlane3Arc3 distancePlane3Arc = new DistancePlane3Arc3(plane3, arc3);

            return(distancePlane3Arc.SignedDistance);
        }
Пример #9
0
        // Token: 0x06000020 RID: 32 RVA: 0x00002608 File Offset: 0x00000808
        public static Vector3 ClosestPointTo(this Arc3 arc3, Line3 line3)
        {
            DistanceLine3Arc3 distanceLine3Arc = new DistanceLine3Arc3(line3, arc3);

            return(distanceLine3Arc.ClosestPointOnArc);
        }
Пример #10
0
        // Token: 0x06000029 RID: 41 RVA: 0x000028EC File Offset: 0x00000AEC
        public static Vector3 ClosestPointTo(this Arc3 arc3, Vector3 vector3)
        {
            DistanceVector3Arc3 distanceVector3Arc = new DistanceVector3Arc3(vector3, arc3);

            return(distanceVector3Arc.ClosestPointOnArc);
        }
Пример #11
0
 // Token: 0x06000028 RID: 40 RVA: 0x000028E1 File Offset: 0x00000AE1
 public static double DistanceTo(this Arc3 arc3, Vector3 vector3)
 {
     return(vector3.DistanceTo(arc3));
 }
Пример #12
0
        // Token: 0x060000A1 RID: 161 RVA: 0x00003C00 File Offset: 0x00001E00
        public static double DistanceTo(this Line3 line3, Arc3 arc3)
        {
            DistanceLine3Arc3 distanceLine3Arc = new DistanceLine3Arc3(line3, arc3);

            return(distanceLine3Arc.Distance);
        }
Пример #13
0
 // Token: 0x060001A3 RID: 419 RVA: 0x00007A9D File Offset: 0x00005C9D
 public static double DistanceTo(this Segment3 segment3, Arc3 arc3)
 {
     return(arc3.DistanceTo(segment3));
 }
Пример #14
0
 // Token: 0x0600001F RID: 31 RVA: 0x000025FD File Offset: 0x000007FD
 public static double DistanceTo(this Arc3 arc3, Line3 line3)
 {
     return(line3.DistanceTo(arc3));
 }
Пример #15
0
        // Token: 0x060001A5 RID: 421 RVA: 0x00007B34 File Offset: 0x00005D34
        public static Segment3 ShortestSegmentTo(this Segment3 segment3, Arc3 arc3)
        {
            Segment3 segment4 = arc3.ShortestSegmentTo(segment3);

            return(new Segment3(segment4.PositiveEnd, segment4.NegativeEnd));
        }
Пример #16
0
 // Token: 0x0600027A RID: 634 RVA: 0x0000A64E File Offset: 0x0000884E
 public IntersectionPlane3Arc3(Plane3 plane, Arc3 arc)
 {
     this       = default(IntersectionPlane3Arc3);
     this.plane = plane;
     this.arc   = arc;
 }
Пример #17
0
        // Token: 0x06000483 RID: 1155 RVA: 0x00016320 File Offset: 0x00014520
        public static AxisAlignedBox3 ComputeAxisAlignedBoundingBox(this Arc3 arc)
        {
            AxisAlignedBox3 axisAlignedBox = arc.Circle.ComputeAxisAlignedBoundingBox();
            double          minX           = axisAlignedBox.MinX;
            double          maxX           = axisAlignedBox.MaxX;
            double          minY           = axisAlignedBox.MinY;
            double          maxY           = axisAlignedBox.MaxY;
            double          minZ           = axisAlignedBox.MinZ;
            double          maxZ           = axisAlignedBox.MaxZ;
            Vector3         startPoint     = arc.StartPoint;
            Vector3         endPoint       = arc.EndPoint;
            UnitVector3     unitVector;

            if (arc.Circle.Normal.TryGetUnitCross(UnitVector3.UnitX, out unitVector))
            {
                UnitVector3 vector = unitVector.UnitCross(arc.Circle.Normal);
                double      num    = Math.Acos(arc.Circle.UnitU.Dot(vector));
                if (arc.Circle.UnitV.Dot(UnitVector3.UnitX) < 0.0)
                {
                    num = 6.2831853071795862 - num;
                }
                if (!arc.Contains(Angle.FromRadians(num)))
                {
                    maxX = Math.Max(startPoint.X, endPoint.X);
                }
                if (!arc.Contains(Angle.FromRadians((num + 3.1415926535897931) % 6.2831853071795862)))
                {
                    minX = Math.Min(startPoint.X, endPoint.X);
                }
            }
            UnitVector3 unitVector2;

            if (arc.Circle.Normal.TryGetUnitCross(UnitVector3.UnitY, out unitVector2))
            {
                UnitVector3 vector2 = unitVector2.UnitCross(arc.Circle.Normal);
                double      num2    = Math.Acos(arc.Circle.UnitU.Dot(vector2));
                if (arc.Circle.UnitV.Dot(UnitVector3.UnitY) < 0.0)
                {
                    num2 = 6.2831853071795862 - num2;
                }
                if (!arc.Contains(Angle.FromRadians(num2)))
                {
                    maxY = Math.Max(startPoint.Y, endPoint.Y);
                }
                if (!arc.Contains(Angle.FromRadians((num2 + 3.1415926535897931) % 6.2831853071795862)))
                {
                    minY = Math.Min(startPoint.Y, endPoint.Y);
                }
            }
            UnitVector3 unitVector3;

            if (arc.Circle.Normal.TryGetUnitCross(UnitVector3.UnitZ, out unitVector3))
            {
                UnitVector3 vector3 = unitVector3.UnitCross(arc.Circle.Normal);
                double      num3    = Math.Acos(arc.Circle.UnitU.Dot(vector3));
                if (arc.Circle.UnitV.Dot(UnitVector3.UnitZ) < 0.0)
                {
                    num3 = 6.2831853071795862 - num3;
                }
                if (!arc.Contains(Angle.FromRadians(num3)))
                {
                    maxZ = Math.Max(startPoint.Z, endPoint.Z);
                }
                if (!arc.Contains(Angle.FromRadians((num3 + 3.1415926535897931) % 6.2831853071795862)))
                {
                    minZ = Math.Min(startPoint.Z, endPoint.Z);
                }
            }
            return(new AxisAlignedBox3(minX, maxX, minY, maxY, minZ, maxZ));
        }
Пример #18
0
 // Token: 0x06000484 RID: 1156 RVA: 0x00016663 File Offset: 0x00014863
 internal static bool Contains(this Arc3 arc, Angle angle)
 {
     return(ArcExtensionMethods.Contains(arc.StartAngle, arc.DeltaAngle, angle));
 }
Пример #19
0
        // Token: 0x06000113 RID: 275 RVA: 0x00005FA4 File Offset: 0x000041A4
        public static double DistanceTo(this Plane3 plane3, Arc3 arc3)
        {
            DistancePlane3Arc3 distancePlane3Arc = new DistancePlane3Arc3(plane3, arc3);

            return(distancePlane3Arc.Distance);
        }
Пример #20
0
        // Token: 0x06000021 RID: 33 RVA: 0x00002628 File Offset: 0x00000828
        public static Segment3 ShortestSegmentTo(this Arc3 arc3, Line3 line3)
        {
            DistanceLine3Arc3 distanceLine3Arc = new DistanceLine3Arc3(line3, arc3);

            return(new Segment3(distanceLine3Arc.ClosestPointOnArc, distanceLine3Arc.ClosestPointOnLine));
        }
Пример #21
0
 // Token: 0x06000022 RID: 34 RVA: 0x00002651 File Offset: 0x00000851
 public static double DistanceTo(this Arc3 arc3, Ray3 ray3)
 {
     return(ray3.DistanceTo(arc3));
 }
Пример #22
0
        // Token: 0x06000213 RID: 531 RVA: 0x00009450 File Offset: 0x00007650
        public static double DistanceTo(this Vector3 vector3, Arc3 arc3)
        {
            DistanceVector3Arc3 distanceVector3Arc = new DistanceVector3Arc3(vector3, arc3);

            return(distanceVector3Arc.Distance);
        }
 // Token: 0x060004C4 RID: 1220 RVA: 0x00018983 File Offset: 0x00016B83
 public static Arc3 Transform(this AffineTransform3 transformer, Arc3 arc)
 {
     return(new Arc3(transformer.Transform(arc.Circle), arc.StartAngle, arc.DeltaAngle));
 }
Пример #24
0
 // Token: 0x06000253 RID: 595 RVA: 0x0000A245 File Offset: 0x00008445
 public static bool Intersects(this Arc3 arc, Plane3 plane)
 {
     return(plane.Intersects(arc));
 }
Пример #25
0
        // Token: 0x06000391 RID: 913 RVA: 0x0000FA8C File Offset: 0x0000DC8C
        public static bool Intersects(this Plane3 plane, Arc3 arc)
        {
            IntersectionPlane3Arc3 intersectionPlane3Arc = new IntersectionPlane3Arc3(plane, arc);

            return(intersectionPlane3Arc.Test());
        }
Пример #26
0
        // Token: 0x06000392 RID: 914 RVA: 0x0000FAAC File Offset: 0x0000DCAC
        public static ICollection <Vector3> IntersectionPointsWith(this Plane3 plane, Arc3 arc)
        {
            IntersectionPlane3Arc3 intersectionPlane3Arc = new IntersectionPlane3Arc3(plane, arc);

            return(intersectionPlane3Arc.Find());
        }
Пример #27
0
        // Token: 0x06000214 RID: 532 RVA: 0x00009470 File Offset: 0x00007670
        public static Segment3 ShortestSegmentTo(this Vector3 vector3, Arc3 arc3)
        {
            DistanceVector3Arc3 distanceVector3Arc = new DistanceVector3Arc3(vector3, arc3);

            return(new Segment3(distanceVector3Arc.ClosestPointOnVector, distanceVector3Arc.ClosestPointOnArc));
        }
Пример #28
0
 // Token: 0x06000254 RID: 596 RVA: 0x0000A24E File Offset: 0x0000844E
 public static ICollection <Vector3> IntersectionPointsWith(this Arc3 arc, Plane3 plane)
 {
     return(plane.IntersectionPointsWith(arc));
 }