示例#1
0
        private static bool IsReverseDirection(NXOpen.Features.OffsetCurveBuilder builder, Snap.NX.ICurve[] icurves, Position pos, Vector helpVector)
        {
            Position position;
            Point3d  pointd;
            Vector3d vectord;
            int      index = -1;
            double   num2  = -1.0;

            for (int i = 0; i < icurves.Length; i++)
            {
                double num4 = -1.0;
                num4 = Compute.Distance(pos, (Snap.NX.NXObject)icurves[i]);
                if (num4 > num2)
                {
                    num2  = num4;
                    index = i;
                }
            }
            if (icurves[index].ObjectType == ObjectTypes.Type.Edge)
            {
                position = Compute.ClosestPoints(pos, (Snap.NX.Edge)icurves[index]).Point2;
            }
            else
            {
                position = Compute.ClosestPoints(pos, (Snap.NX.Curve)icurves[index]).Point2;
            }
            builder.ComputeOffsetDirection(icurves[index].NXOpenICurve, (Point3d)position, out vectord, out pointd);
            return((vectord * helpVector) < 0.0);
        }