/// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object can be used to retrieve data from input parameters and
        /// to store data in output parameters.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            IntPtr       topoData   = IntPtr.Zero;
            List <Curve> parts      = new List <Curve>();
            List <Curve> boundaries = new List <Curve>();

            if (!DA.GetData(0, ref topoData))
            {
                return;
            }
            if (!DA.GetDataList(1, parts))
            {
                return;
            }
            DA.GetDataList(2, boundaries);

            CPolyLines polyLines = new CPolyLines();

            TopoCreator.RhinoPolylinesToCPolyline(parts, boundaries, ref polyLines, true);
            if (boundaries.Count == 0)
            {
                TopoCreator.setCrossMesh(ref polyLines, topoData, false);
            }
            else
            {
                TopoCreator.setCrossMesh(ref polyLines, topoData, true);
            }

            Marshal.FreeHGlobal(polyLines.atBoundary);
            Marshal.FreeHGlobal(polyLines.points);
            Marshal.FreeHGlobal(polyLines.sta_ends);

            DA.SetData(0, topoData);
            return;
        }