/// <summary>
        /// Creates a PCurve, a 2D curve parameterized in UV over
        /// the surface.
        /// </summary>
        /// <param name="surface"></param>
        /// <returns></returns>
        public ICurve ToPCurve(ISurface surface)
        {
            var propsDouble  = PropsDouble;
            var knots        = KnotVectorU;
            var ctrlPtCoords = ControlPoints.SelectMany(p => p.ToDoubles()).ToArray();

            #region debug
            var param = surface.Parameterization2();
            Debug.Assert(ControlPoints.All(c =>
                                           c.X <param.UMax && c.X> param.UMin &&
                                           c.Y <param.VMax && c.Y> param.VMin
                                           ));
            #endregion

            var pCurve = (ICurve)SwAddinBase.Active.Modeler.CreatePCurve(surface, propsDouble, knots, ctrlPtCoords);
            Debug.Assert(pCurve != null);
            return(pCurve);
        }