Esempio n. 1
0
        /// <summary>
        ///   Builds the solver info (magic points and planes) receiving as parameter a shape.
        /// </summary>
        /// <param name = "solverObject"></param>
        /// <param name = "shape"></param>
        /// <param name = "parallelPrecision"></param>
        /// <param name = "computeParallelism"></param>
        public static void BuildSolverInfo(SolverGeometricObject solverObject, Node shape,
                                           double parallelPrecision, bool computeParallelism)
        {
            var solidShape = ShapeUtils.ExtractShape(solverObject.Parent);

            // Build a list with the magic points made by the vertexes
            BuildPointList(shape, solverObject);
            var functionName = shape.Get <ShapeFunctionsInterface.Functions.FunctionInterpreter>().Name;

            if (functionName == FunctionNames.LineTwoPoints || functionName == FunctionNames.Arc ||
                functionName == FunctionNames.Arc3P || functionName == FunctionNames.Circle ||
                functionName == FunctionNames.Ellipse)
            {
                // Build a list with the edges
                BuildEdgeList(solidShape, solverObject);
            }
            // Build a list with the magic points made by the faces/surfaces
            BuildFaceList(solidShape, solverObject);

            // Build a list with parallel axis
            if (!computeParallelism)
            {
                return;
            }
            if (NodeBuilderUtils.NodeIsOnSketch(new NodeBuilder(shape)))
            {
                BuildParallelAxisList(solidShape, solverObject, parallelPrecision);
            }
        }