Пример #1
0
        /// <summary>
        /// implements the <see cref="INurbs3d.getUKnots"/> method.
        /// </summary>
        /// <returns></returns>

        public override xyz[,] getCtrlPoints()
        {
            double Factor = 0.0000;

            xyz[,] ControlPoints = new xyz[, ]  {
                { new xyz(0, Factor, -Radius), new xyz(0, Radius, -Radius), new xyz(0, Radius, 0), new xyz(0, Radius, Radius), new xyz(0, Factor, Radius) },
                { new xyz(-Factor, Factor, -Radius), new xyz(-Radius, Radius, -Radius), new xyz(-Radius, Radius, 0), new xyz(-Radius, Radius, Radius), new xyz(-Factor, Factor, Radius) },
                { new xyz(-Factor, 0, -Radius), new xyz(-Radius, 0, -Radius), new xyz(-Radius, 0, 0), new xyz(-Radius, 0, Radius), new xyz(-Factor, 0, Radius) },
                { new xyz(-Factor, -Factor, -Radius), new xyz(-Radius, -Radius, -Radius), new xyz(-Radius, -Radius, 0), new xyz(-Radius, -Radius, Radius), new xyz(-Factor, -Factor, Radius) },
                { new xyz(0, -Factor, -Radius), new xyz(0, -Radius, -Radius), new xyz(0, -Radius, 0), new xyz(0, -Radius, Radius), new xyz(0, -Factor, Radius) },
                { new xyz(Factor, -Factor, -Radius), new xyz(Radius, -Radius, -Radius), new xyz(Radius, -Radius, 0), new xyz(Radius, -Radius, Radius), new xyz(Factor, -Factor, Radius) },
                { new xyz(Factor, 0, -Radius), new xyz(Radius, 0, -Radius), new xyz(Radius, 0, 0), new xyz(Radius, 0, Radius), new xyz(Factor, 0, Radius) },
                { new xyz(Factor, Factor, -Radius), new xyz(Radius, Radius, -Radius), new xyz(Radius, Radius, 0), new xyz(Radius, Radius, Radius), new xyz(Factor, Factor, Radius) },
                { new xyz(0, Factor, -Radius), new xyz(0, Radius, -Radius), new xyz(0, Radius, 0), new xyz(0, Radius, Radius), new xyz(0, Factor, Radius) }
            };
            for (int i = 0; i < ControlPoints.GetLength(0); i++)
            {
                for (int j = 0; j < ControlPoints.GetLength(1); j++)
                {
                    ControlPoints[i, j] = Base.Absolut(ControlPoints[i, j]);
                }
            }

            return(ControlPoints);
        }
Пример #2
0
        /// <summary>
        /// implements the <see cref="INurbs3d.getUKnots"/> method.
        /// </summary>
        /// <returns></returns>
        public override xyz[,] getCtrlPoints()
        {
            RefreshEnvBox();
            double BaseRadius = Radius;
            double Max        = Env.Y + Env.Height;
            double Min        = Env.Y;

            xyz[,] CP = new xyz[, ]
            {
                { new xyz(BaseRadius, 0, 0), new xyz(BaseRadius, 0, Height) },
                { new xyz(BaseRadius, BaseRadius, 0), new xyz(BaseRadius, BaseRadius, Height) },
                { new xyz(0, BaseRadius, 0), new xyz(0, BaseRadius, Height) },
                { new xyz(-BaseRadius, BaseRadius, 0), new xyz(-BaseRadius, BaseRadius, Height) },
                { new xyz(-BaseRadius, 0, 0), new xyz(-BaseRadius, 0, Height) },
                { new xyz(-BaseRadius, -BaseRadius, 0), new xyz(-BaseRadius, -BaseRadius, Height) },
                { new xyz(0, -BaseRadius, 0), new xyz(0, -BaseRadius, Height) },
                { new xyz(BaseRadius, -BaseRadius, 0), new xyz(BaseRadius, -BaseRadius, Height) },
                { new xyz(BaseRadius, 0, 0), new xyz(BaseRadius, 0, Height) },
            };

            for (int i = 0; i < CP.GetLength(0); i++)
            {
                for (int j = 0; j < CP.GetLength(1); j++)
                {
                    CP[i, j] = Base.Absolut(CP[i, j]);
                }
            }
            return(CP);
        }
Пример #3
0
        /// <summary>
        /// implements the <see cref="INurbs3d.getCtrlPoints"/> method.
        /// </summary>
        /// <returns></returns>
        public override xyz[,] getCtrlPoints()
        {
            if (BoundedCurves != null)
            {
                Env = BoundedCurves[0].MaxRect;
            }
            else
            {
                Env = new RectangleF(new PointF(0, 0), new SizeF((float)Radius, (float)Height));
            }
            double Max        = Env.Y + Env.Height;
            double Min        = Env.Y;
            double BaseRadius = Radius;
            double TopR       = Radius - Height * System.Math.Tan(HalfAngle);

            TopR       = Radius - (VFactor * (System.Math.Tan(HalfAngle)));
            BaseRadius = Radius - (VFactor * (System.Math.Tan(HalfAngle) * (Min)));
            xyz[,] CP  = new xyz[, ]
            {
                { new xyz(BaseRadius, 0, Min), new xyz(TopR, 0, Max) },
                { new xyz(BaseRadius, BaseRadius, Min), new xyz(TopR, TopR, Max) },
                { new xyz(0, BaseRadius, Min), new xyz(0, TopR, Max) },
                { new xyz(-BaseRadius, BaseRadius, Min), new xyz(-TopR, TopR, Max) },
                { new xyz(-BaseRadius, 0, Min), new xyz(-TopR, 0, Max) },
                { new xyz(-BaseRadius, -BaseRadius, Min), new xyz(-TopR, -TopR, Max) },
                { new xyz(0, -BaseRadius, Min), new xyz(0, -TopR, Max) },
                { new xyz(BaseRadius, -BaseRadius, Min), new xyz(TopR, -TopR, Max) },
                { new xyz(BaseRadius, 0, Min), new xyz(TopR, 0, Max) },
            };

            for (int i = 0; i < CP.GetLength(0); i++)
            {
                for (int j = 0; j < CP.GetLength(1); j++)
                {
                    CP[i, j] = Base.Absolut(CP[i, j]);
                }
            }
            return(CP);
        }
Пример #4
0
        /// <summary>
        /// implements the <see cref="INurbs3d.getUKnots"/> method.
        /// </summary>
        /// <returns></returns>
        public override xyz[,] getCtrlPoints()
        {
            double IRSqrt = InnerRadius;// / System.Math.Sqrt(2);

            xyz[,] CP = new xyz[, ]
            {
                {
                    new xyz(OuterRadius + InnerRadius, 0, 0),
                    new xyz(OuterRadius + InnerRadius, 0, InnerRadius),
                    new xyz(OuterRadius, 0, InnerRadius),
                    new xyz(OuterRadius - InnerRadius, 0, InnerRadius),
                    new xyz(OuterRadius - InnerRadius, 0, 0),
                    new xyz(OuterRadius - InnerRadius, 0, -InnerRadius),
                    new xyz(OuterRadius, 0, -InnerRadius),
                    new xyz(OuterRadius + InnerRadius, 0, -InnerRadius),
                    new xyz(OuterRadius + InnerRadius, 0, 0),
                },

                {
                    new xyz(OuterRadius + InnerRadius, OuterRadius + InnerRadius, 0),
                    new xyz(OuterRadius + InnerRadius, OuterRadius + InnerRadius, InnerRadius),
                    new xyz(OuterRadius, OuterRadius, InnerRadius),
                    new xyz(OuterRadius - InnerRadius, OuterRadius - InnerRadius, InnerRadius),
                    new xyz(OuterRadius - InnerRadius, OuterRadius - InnerRadius, 0),
                    new xyz(OuterRadius - InnerRadius, OuterRadius - InnerRadius, -InnerRadius),
                    new xyz(OuterRadius, OuterRadius, -InnerRadius),
                    new xyz(OuterRadius + InnerRadius, OuterRadius + InnerRadius, -InnerRadius),
                    new xyz(OuterRadius + InnerRadius, OuterRadius + InnerRadius, 0),
                },

                {
                    new xyz(0, OuterRadius + InnerRadius, 0),
                    new xyz(0, OuterRadius + InnerRadius, InnerRadius),
                    new xyz(0, OuterRadius, InnerRadius),
                    new xyz(0, OuterRadius - InnerRadius, InnerRadius),
                    new xyz(0, OuterRadius - InnerRadius, 0),
                    new xyz(0, OuterRadius - InnerRadius, -InnerRadius),
                    new xyz(0, OuterRadius, -InnerRadius),
                    new xyz(0, OuterRadius + InnerRadius, -InnerRadius),
                    new xyz(0, OuterRadius + InnerRadius, 0),
                },

                {
                    new xyz(-(OuterRadius + InnerRadius), OuterRadius + InnerRadius, 0),
                    new xyz(-(OuterRadius + InnerRadius), OuterRadius + InnerRadius, InnerRadius),
                    new xyz(-OuterRadius, OuterRadius, InnerRadius),
                    new xyz(-(OuterRadius - InnerRadius), OuterRadius - InnerRadius, InnerRadius),
                    new xyz(-(OuterRadius - InnerRadius), OuterRadius - InnerRadius, 0),
                    new xyz(-(OuterRadius - InnerRadius), OuterRadius - InnerRadius, -InnerRadius),
                    new xyz(-OuterRadius, OuterRadius, -InnerRadius),
                    new xyz(-(OuterRadius + InnerRadius), OuterRadius + InnerRadius, -InnerRadius),
                    new xyz(-(OuterRadius + InnerRadius), OuterRadius + InnerRadius, 0),
                },

                {
                    new xyz(-(OuterRadius + InnerRadius), 0, 0),
                    new xyz(-(OuterRadius + InnerRadius), 0, InnerRadius),
                    new xyz(-OuterRadius, 0, InnerRadius),
                    new xyz(-(OuterRadius - InnerRadius), 0, InnerRadius),
                    new xyz(-(OuterRadius - InnerRadius), 0, 0),
                    new xyz(-(OuterRadius - InnerRadius), 0, -InnerRadius),
                    new xyz(-OuterRadius, 0, -InnerRadius),
                    new xyz(-(OuterRadius + InnerRadius), 0, -InnerRadius),
                    new xyz(-(OuterRadius + InnerRadius), 0, 0),
                },

                {
                    new xyz(-(OuterRadius + InnerRadius), -(OuterRadius + InnerRadius), 0),
                    new xyz(-(OuterRadius + InnerRadius), -(OuterRadius + InnerRadius), InnerRadius),
                    new xyz(-OuterRadius, -(OuterRadius), InnerRadius),
                    new xyz(-(OuterRadius - InnerRadius), -(OuterRadius - InnerRadius), InnerRadius),
                    new xyz(-(OuterRadius - InnerRadius), -(OuterRadius - InnerRadius), 0),
                    new xyz(-(OuterRadius - InnerRadius), -(OuterRadius - InnerRadius), -InnerRadius),
                    new xyz(-OuterRadius, -OuterRadius, -InnerRadius),
                    new xyz(-(OuterRadius + InnerRadius), -(OuterRadius + InnerRadius), -InnerRadius),
                    new xyz(-(OuterRadius + InnerRadius), -(OuterRadius + InnerRadius), 0),
                },

                {
                    new xyz(0, -(OuterRadius + InnerRadius), 0),
                    new xyz(0, -(OuterRadius + InnerRadius), InnerRadius),
                    new xyz(0, -OuterRadius, InnerRadius),
                    new xyz(0, -(OuterRadius - InnerRadius), InnerRadius),
                    new xyz(0, -(OuterRadius - InnerRadius), 0), new xyz(0, -(OuterRadius - InnerRadius), -InnerRadius),
                    new xyz(0, -OuterRadius, -InnerRadius),
                    new xyz(0, -(OuterRadius + InnerRadius), -InnerRadius),
                    new xyz(0, -(OuterRadius + InnerRadius), 0),
                },

                {
                    new xyz(OuterRadius + InnerRadius, -(OuterRadius + InnerRadius), 0),
                    new xyz(OuterRadius + InnerRadius, -(OuterRadius + InnerRadius), InnerRadius),
                    new xyz(OuterRadius, -OuterRadius, InnerRadius),
                    new xyz(OuterRadius - InnerRadius, -(OuterRadius - InnerRadius), InnerRadius),
                    new xyz(OuterRadius - InnerRadius, -(OuterRadius - InnerRadius), 0),
                    new xyz(OuterRadius - InnerRadius, -(OuterRadius - InnerRadius), -InnerRadius),
                    new xyz(OuterRadius, -OuterRadius, -InnerRadius),
                    new xyz(OuterRadius + InnerRadius, -(OuterRadius + InnerRadius), -InnerRadius),
                    new xyz(OuterRadius + InnerRadius, -(OuterRadius + InnerRadius), 0),
                },

                {
                    new xyz(OuterRadius + InnerRadius, 0, 0),
                    new xyz(OuterRadius + InnerRadius, 0, InnerRadius),
                    new xyz(OuterRadius, 0, InnerRadius),
                    new xyz(OuterRadius - InnerRadius, 0, InnerRadius),
                    new xyz(OuterRadius - InnerRadius, 0, 0),
                    new xyz(OuterRadius - InnerRadius, 0, -InnerRadius),
                    new xyz(OuterRadius, 0, -InnerRadius),
                    new xyz(OuterRadius + InnerRadius, 0, -InnerRadius),
                    new xyz(OuterRadius + InnerRadius, 0, 0),
                },
            };


            for (int i = 0; i < CP.GetLength(0); i++)
            {
                for (int j = 0; j < CP.GetLength(1); j++)
                {
                    CP[i, j] = Base.Absolut(CP[i, j]);
                }
            }


            return(CP);
        }