Example #1
0
        /// <summary>
        /// Converts the spline in a Polyline3D.
        /// </summary>
        /// <param name="precision">Number of vertexes generated.</param>
        /// <returns>A new instance of <see cref="Polyline3D">Polyline3D</see> that represents the spline.</returns>
        public Polyline3D ToPolyline3D(int precision)
        {
            IEnumerable <Vector3> vertexes = this.PolygonalVertexes(precision);
            bool       closed = this.IsClosed || this.IsClosedPeriodic;
            Polyline3D poly   = new Polyline3D(vertexes)
            {
                Layer         = (Layer)this.Layer.Clone(),
                Linetype      = (Linetype)this.Linetype.Clone(),
                Color         = (AciColor)this.Color.Clone(),
                Lineweight    = this.Lineweight,
                Transparency  = (Transparency)this.Transparency.Clone(),
                LinetypeScale = this.LinetypeScale,
                Normal        = this.Normal,
                IsClosed      = closed
            };

            return(poly);
        }
Example #2
0
        /// <summary>
        /// Creates a new Polyline3D that is a copy of the current instance.
        /// </summary>
        /// <returns>A new Polyline3D that is a copy of this instance.</returns>
        public override object Clone()
        {
            Polyline3D entity = new Polyline3D(this.vertexes)
            {
                //EntityObject properties
                Layer         = (Layer)this.Layer.Clone(),
                Linetype      = (Linetype)this.Linetype.Clone(),
                Color         = (AciColor)this.Color.Clone(),
                Lineweight    = this.Lineweight,
                Transparency  = (Transparency)this.Transparency.Clone(),
                LinetypeScale = this.LinetypeScale,
                Normal        = this.Normal,
                IsVisible     = this.IsVisible,
                //Polyline3D properties
                Flags = this.flags
            };

            foreach (XData data in this.XData.Values)
            {
                entity.XData.Add((XData)data.Clone());
            }

            return(entity);
        }