Exemple #1
0
        /// <summary>
        /// Overrides <see cref="CADability.GeoObject.ISurfaceImpl.Clone ()"/>
        /// </summary>
        /// <returns></returns>
        public override ISurface Clone()
        {
            HelicalSurface res = new HelicalSurface(basisCurve2D.Clone(), pitch, toSurface, curveStartParameter, curveEndParameter, curveParameterOffset);

            res.usedArea = usedArea;
            return(res);
        }
Exemple #2
0
        /// <summary>
        /// Overrides <see cref="CADability.GeoObject.ISurfaceImpl.CopyData (ISurface)"/>
        /// </summary>
        /// <param name="CopyFrom"></param>
        public override void CopyData(ISurface CopyFrom)
        {
            HelicalSurface cc = CopyFrom as HelicalSurface;

            if (cc != null)
            {
                this.basisCurve2D        = cc.basisCurve2D.Clone();
                this.pitch               = cc.pitch;
                this.toSurface           = cc.toSurface;
                this.fromSurface         = cc.fromSurface;
                this.curveStartParameter = cc.curveStartParameter;
                this.curveEndParameter   = cc.curveEndParameter;
            }
        }
Exemple #3
0
 /// <summary>
 /// Overrides <see cref="CADability.GeoObject.ISurfaceImpl.SameGeometry (BoundingRect, ISurface, BoundingRect, double, out ModOp2D)"/>
 /// </summary>
 /// <param name="thisBounds"></param>
 /// <param name="other"></param>
 /// <param name="otherBounds"></param>
 /// <param name="precision"></param>
 /// <param name="firstToSecond"></param>
 /// <returns></returns>
 public override bool SameGeometry(BoundingRect thisBounds, ISurface other, BoundingRect otherBounds, double precision, out ModOp2D firstToSecond)
 {
     if (other is HelicalSurface)
     {
         firstToSecond = ModOp2D.Null;
         HelicalSurface srother = other as HelicalSurface;
         bool           reverse;
         if (!Curves.SameGeometry(BasisCurve, srother.BasisCurve, precision, out reverse))
         {
             return(false);
         }
         if ((Location | srother.Location) > precision)
         {
             return(false);
         }
         if (Math.Abs(pitch - srother.pitch) > precision)
         {
             return(false);
         }
         GeoPoint2D uv1 = new GeoPoint2D(curveStartParameter, 0.0);
         GeoPoint   p1  = PointAt(uv1);
         GeoPoint2D uv2 = srother.PositionOf(p1);
         GeoPoint   p2  = srother.PointAt(uv2);
         if ((p1 | p2) > precision)
         {
             return(false);
         }
         uv1 = new GeoPoint2D(curveEndParameter, 0.0);
         p1  = PointAt(uv1);
         uv2 = srother.PositionOf(p1);
         p2  = srother.PointAt(uv2);
         if ((p1 | p2) > precision)
         {
             return(false);
         }
         firstToSecond = ModOp2D.Translate(uv2 - uv1);
         return(true);
     }
     return(base.SameGeometry(thisBounds, other, otherBounds, precision, out firstToSecond));
 }