Exemple #1
0
        /////////////////////////////////////////////////////////////
        // Use: Returns Normal as UnitVector for input Face.
        //
        /////////////////////////////////////////////////////////////
        public static UnitVector GetFaceNormal(
            Face face,
            Point point)
        {
            SurfaceEvaluator oEvaluator = face.Evaluator;

            Double[] Points = { point.X, point.Y, point.Z };

            Double[]             GuessParams = new Double[2];
            Double[]             MaxDev      = new Double[2];
            Double[]             Params      = new Double[2];
            SolutionNatureEnum[] sol         = new SolutionNatureEnum[2];

            oEvaluator.GetParamAtPoint(
                ref Points,
                ref GuessParams,
                ref MaxDev,
                ref Params,
                ref sol);

            Double[] normal = new Double[3];

            oEvaluator.GetNormal(ref Params, ref normal);

            return(_Tg.CreateUnitVector(
                       normal[0],
                       normal[1],
                       normal[2]));
        }
Exemple #2
0
        private Inventor.UnitVector GetMidPointAtFaceNormal(ref Inventor.Face Face)
        {
            Inventor.SurfaceEvaluator SurfaceEvaluator;
            SurfaceEvaluator = Face.Evaluator;
            double[] CenterPoint = new double[2];
            CenterPoint[0] = (SurfaceEvaluator.ParamRangeRect.MinPoint.X + SurfaceEvaluator.ParamRangeRect.MaxPoint.X) / 2;
            CenterPoint[1] = (SurfaceEvaluator.ParamRangeRect.MinPoint.Y + SurfaceEvaluator.ParamRangeRect.MaxPoint.Y) / 2;

            double[] normal = new double[2];
            SurfaceEvaluator.GetNormal(ref CenterPoint, ref normal);

            return(mInvApplication.TransientGeometry.CreateUnitVector(normal[0], normal[1], normal[2]));
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //Use: Returns Normal as UnitVector for input Face.
        //
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public static UnitVector GetFaceNormal(Face face)
        {
            SurfaceEvaluator evaluator = face.Evaluator;

            double[] points = { face.PointOnFace.X, face.PointOnFace.Y, face.PointOnFace.Z };

            double[]             guessParams = new double[2];
            double[]             maxDev      = new double[2];
            double[]             Params      = new double[2];
            SolutionNatureEnum[] sol         = new SolutionNatureEnum[2];

            evaluator.GetParamAtPoint(ref points, ref guessParams, ref maxDev, ref Params, ref sol);

            double[] normal = new double[3];

            evaluator.GetNormal(ref Params, ref normal);

            return(InvApplication.TransientGeometry.CreateUnitVector(
                       normal[0], normal[1], normal[2]));
        }
Exemple #4
0
        /////////////////////////////////////////////////////////////
        // Use: Returns Normal as UnitVector for input Face.
        //
        /////////////////////////////////////////////////////////////
        public static UnitVector GetFaceNormal(Face face)
        {
            SurfaceEvaluator oEvaluator = face.Evaluator;

            double[] point = new double[3]
            {
                face.PointOnFace.X,
                face.PointOnFace.Y,
                face.PointOnFace.Z
            };

            double[] guessParams = new double[2] {
                0.0, 0.0
            };
            double[] maxDev = new double[2] {
                0.0, 0.0
            };
            double[] Params = new double[2] {
                0.0, 0.0
            };

            SolutionNatureEnum[] sol = new SolutionNatureEnum[1]
            {
                SolutionNatureEnum.kUnknownSolutionNature
            };

            oEvaluator.GetParamAtPoint(ref point,
                                       ref guessParams,
                                       ref maxDev,
                                       ref Params,
                                       ref sol);

            double[] normal = new double[3];

            oEvaluator.GetNormal(ref Params, ref normal);

            return(_Tg.CreateUnitVector(
                       normal[0],
                       normal[1],
                       normal[2]));
        }
Exemple #5
0
        private Inventor.UnitVector GetFaceNormalPoint(Inventor.Face ViewFace, Inventor.Point Point)
        {
            Inventor.SurfaceEvaluator SurfaceEvaluator;
            SurfaceEvaluator = ViewFace.Evaluator;
            Inventor.UnitVector UnitVector    = null;
            double[]            Points        = new double[3];
            double[]            GuessParam    = new double[2];
            double[]            maxDeviations = new double[2];
            double[]            Params        = new double[2];

            Inventor.SolutionNatureEnum[] NatureEnum = new Inventor.SolutionNatureEnum[1];

            Points[0] = Point.X;
            Points[1] = Point.Y;
            Points[2] = Point.Z;

            SurfaceEvaluator.GetParamAtPoint(Points, GuessParam, maxDeviations, Params, NatureEnum);

            double[] normal = new double[3];
            SurfaceEvaluator.GetNormal(ref Params, ref normal);
            UnitVector = mInvApplication.TransientGeometry.CreateUnitVector(normal[0], normal[1], normal[2]);
            return(UnitVector);
        }
Exemple #6
0
        private Inventor.UnitVector GetXDir(ref Inventor.Face Face, ref Inventor.Point Point)
        {
            Inventor.SurfaceEvaluator SurfaceEvaluator;
            SurfaceEvaluator = Face.Evaluator;
            Inventor.UnitVector UnitVector    = null;
            double[]            Points        = new double[3];
            double[]            GuessParam    = new double[2];
            double[]            maxDeviations = new double[2];
            double[]            Params        = new double[2];
            double[]            uTangents     = new double[3];
            double[]            vTangents     = new double[3];

            Inventor.SolutionNatureEnum[] NatureEnum = new Inventor.SolutionNatureEnum[5];

            Points[0] = Point.X;
            Points[1] = Point.Y;
            Points[2] = Point.Z;

            SurfaceEvaluator.GetParamAtPoint(ref Points, ref GuessParam, ref maxDeviations, ref Params, ref NatureEnum);

            SurfaceEvaluator.GetTangents(ref Params, ref uTangents, ref vTangents);
            UnitVector = mInvApplication.TransientGeometry.CreateUnitVector(uTangents[0], uTangents[1], uTangents[2]);
            return(UnitVector);
        }