Example #1
0
        // Arc
        public Arc ArcToSpeckle(CircularArc3d arc)
        {
            var interval = arc.GetInterval();
            var _arc     = new Arc(PlaneToSpeckle(arc.GetPlane()), arc.Radius, arc.StartAngle, arc.EndAngle, Math.Abs(arc.EndAngle - arc.StartAngle), ModelUnits);

            _arc.startPoint = PointToSpeckle(arc.StartPoint);
            _arc.endPoint   = PointToSpeckle(arc.EndPoint);
            _arc.midPoint   = PointToSpeckle(arc.EvaluatePoint((interval.UpperBound - interval.LowerBound) / 2));
            _arc.domain     = IntervalToSpeckle(arc.GetInterval());
            _arc.length     = arc.GetLength(arc.GetParameterOf(arc.StartPoint), arc.GetParameterOf(arc.EndPoint), tolerance);
            _arc.bbox       = BoxToSpeckle(arc.OrthoBoundBlock);
            return(_arc);
        }
        Point3dCollection ArcToVectors(CircularArc3d arc, int numSegments)
        {
            Interval interval   = arc.GetInterval();
            double   increment  = interval.Length / (double)numSegments;
            double   controller = interval.LowerBound;

            Point3dCollection points = new Point3dCollection();

            for (int i = 0; i < numSegments; ++i)
            {
                points.Add(arc.EvaluatePoint(controller));
                controller += increment;
            }

            points.Add(arc.EvaluatePoint(controller));

            return(points);
        }