示例#1
0
        /// <summary>
        /// Is only implemented, if the paramcurve is a 2D - Line. In case that this line
        /// is parallel to the x-axis a Circle3d will be returned, which belongs to the paramcurve.
        /// If it is parallel to y-axis a Line3d on the Cone, which belongs to the paramcurve will be returned
        /// </summary>
        /// <param name="ParamCurve">Specifies the 2d-paramcurve, which will be lifted to a 3d-Curve </param>
        /// <returns>Returns a 3d-Curve.</returns>
        public override Curve3D To3dCurve(Curve ParamCurve)
        {
            if (ParamCurve is Line)
            {
                if (System.Math.Abs(ParamCurve.Atang.y) < 0.0001)
                {
                    Circle3D C = new Circle3D();

                    {
                        C.Radius = (Value(0, ParamCurve.A.y) - Value(0.5, ParamCurve.A.y)).length() / 2;
                        Base B = Base;
                        xyz  T = B.BaseZ * (B.BaseZ * (Value(ParamCurve.A.x, ParamCurve.A.y) - Base.BaseO));
                        B.BaseO = B.BaseO + T;
                        C.Base  = B;
                        return(C);
                    }
                }
                if (System.Math.Abs(ParamCurve.Atang.x) < 0.0001)
                {
                    Line3D L = new Line3D();
                    L.A = Value(ParamCurve.A.x, ParamCurve.A.y);
                    L.B = Value(ParamCurve.B.x, ParamCurve.B.y);
                    return(L);
                }
            }
            MappedCurve C1 = new MappedCurve();

            C1.Curve2d = ParamCurve;
            C1.Mapper  = this;

            return(C1);
        }
示例#2
0
        /// <summary>
        /// Overrides the <see cref="Surface.To3dCurve"/> method and converts paramcurves to Curve3D.
        /// For instead only Arc and Line is implemented.
        /// </summary>
        /// <param name="ParamCurve">Specifies the curve in the parameter room</param>
        /// <returns>Returns a 3D-Curve.</returns>
        public override Curve3D To3dCurve(Curve ParamCurve)
        {
            if (ParamCurve is Arc)
            {
                Arc      Arc = (ParamCurve as Arc);
                Circle3D C   = new Circle3D();
                C.Base = Base;

                if (Arc.ClockWise)
                {
                    C.Alfa = Arc.Alfa;
                    C.Beta = Arc.Beta;
                }
                else
                {
                    C.Alfa = Arc.Beta;
                    C.Beta = Arc.Alfa;
                }
                return(C);
            }
            if (ParamCurve is Line)
            {
                Line3D L = new Line3D(Value(ParamCurve.A.x, ParamCurve.A.y), Value(ParamCurve.B.x, ParamCurve.B.y));
                return(L);
            }
            return(null);
        }