public ICurve PolylineToSpeckle(RH.Polyline poly, Interval domain, string units = null)
        {
            var u = units ?? ModelUnits;

            if (poly.Count == 2)
            {
                var l = LineToSpeckle(new RH.Line(poly[0], poly[1]), u);
                if (domain != null)
                {
                    l.domain = domain;
                }
                return(l);
            }

            var myPoly = new Polyline(PointsToFlatArray(poly), u);

            myPoly.closed = poly.IsClosed;

            if (myPoly.closed)
            {
                myPoly.value.RemoveRange(myPoly.value.Count - 3, 3);
            }

            myPoly.domain = domain;
            myPoly.bbox   = BoxToSpeckle(new RH.Box(poly.BoundingBox), u);
            myPoly.length = poly.Length;

            // TODO: Area of 3d polyline cannot be resolved...
            return(myPoly);
        }
        public ICurve PolylineToSpeckle(RH.Polyline poly, Interval domain)
        {
            if (poly.Count == 2)
            {
                var l = new Line(PointsToFlatArray(poly), ModelUnits);
                l.domain = domain;
                return(l);
            }

            var myPoly = new Polyline(PointsToFlatArray(poly), ModelUnits);

            myPoly.closed = poly.IsClosed;

            if (myPoly.closed)
            {
                myPoly.value.RemoveRange(myPoly.value.Count - 3, 3);
            }

            myPoly.domain = domain;
            return(myPoly);
        }
 public RH.Interval IntervalToNative(Interval interval)
 {
     return(new RH.Interval((double)interval.start, (double)interval.end));
 }
        // Interval
        public Interval IntervalToSpeckle(RH.Interval interval)
        {
            var speckleInterval = new Interval(interval.T0, interval.T1);

            return(speckleInterval);
        }